summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2022-05-29 11:12:17 +0200
committerLinus Groh <mail@linusgroh.de>2022-06-02 13:14:12 +0100
commit63ee2781fb89f97e370ce56f5a6634c60c463dea (patch)
tree745193853340c57571c39e71fb8cb5c57c13712b /Kernel
parent77f24056e0fe8bf2dbca020d0d22941d621115cc (diff)
downloadserenity-63ee2781fb89f97e370ce56f5a6634c60c463dea.zip
Kernel: Put Raspberry Pi devices into RPi namespace
This makes it clear in the code that these drivers are specific for the Raspberry Pi devices.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Arch/aarch64/MMU.cpp2
-rw-r--r--Kernel/Arch/aarch64/RPi/Framebuffer.cpp2
-rw-r--r--Kernel/Arch/aarch64/RPi/Framebuffer.h2
-rw-r--r--Kernel/Arch/aarch64/RPi/FramebufferMailboxMessages.h2
-rw-r--r--Kernel/Arch/aarch64/RPi/GPIO.cpp2
-rw-r--r--Kernel/Arch/aarch64/RPi/GPIO.h2
-rw-r--r--Kernel/Arch/aarch64/RPi/MMIO.cpp2
-rw-r--r--Kernel/Arch/aarch64/RPi/MMIO.h2
-rw-r--r--Kernel/Arch/aarch64/RPi/Mailbox.cpp2
-rw-r--r--Kernel/Arch/aarch64/RPi/Mailbox.h2
-rw-r--r--Kernel/Arch/aarch64/RPi/Timer.cpp2
-rw-r--r--Kernel/Arch/aarch64/RPi/Timer.h2
-rw-r--r--Kernel/Arch/aarch64/RPi/UART.cpp2
-rw-r--r--Kernel/Arch/aarch64/RPi/UART.h2
-rw-r--r--Kernel/Arch/aarch64/init.cpp20
-rw-r--r--Kernel/Arch/aarch64/kprintf.cpp6
16 files changed, 27 insertions, 27 deletions
diff --git a/Kernel/Arch/aarch64/MMU.cpp b/Kernel/Arch/aarch64/MMU.cpp
index 43882a04bd..8095324850 100644
--- a/Kernel/Arch/aarch64/MMU.cpp
+++ b/Kernel/Arch/aarch64/MMU.cpp
@@ -142,7 +142,7 @@ static void build_identity_map(PageBumpAllocator& allocator)
u64 device_memory_flags = ACCESS_FLAG | PAGE_DESCRIPTOR | OUTER_SHAREABLE | DEVICE_MEMORY;
insert_identity_entries_for_physical_memory_range(allocator, level1_table, START_OF_NORMAL_MEMORY, END_OF_NORMAL_MEMORY, normal_memory_flags);
- insert_identity_entries_for_physical_memory_range(allocator, level1_table, MMIO::the().peripheral_base_address(), MMIO::the().peripheral_end_address(), device_memory_flags);
+ insert_identity_entries_for_physical_memory_range(allocator, level1_table, RPi::MMIO::the().peripheral_base_address(), RPi::MMIO::the().peripheral_end_address(), device_memory_flags);
}
static void switch_to_page_table(u8* page_table)
diff --git a/Kernel/Arch/aarch64/RPi/Framebuffer.cpp b/Kernel/Arch/aarch64/RPi/Framebuffer.cpp
index a7705e6d2a..679725fd22 100644
--- a/Kernel/Arch/aarch64/RPi/Framebuffer.cpp
+++ b/Kernel/Arch/aarch64/RPi/Framebuffer.cpp
@@ -8,7 +8,7 @@
#include <Kernel/Arch/aarch64/RPi/Framebuffer.h>
#include <Kernel/Arch/aarch64/RPi/FramebufferMailboxMessages.h>
-namespace Kernel {
+namespace Kernel::RPi {
Framebuffer::Framebuffer()
{
diff --git a/Kernel/Arch/aarch64/RPi/Framebuffer.h b/Kernel/Arch/aarch64/RPi/Framebuffer.h
index e5ab9e2fc3..e14ec3c4cb 100644
--- a/Kernel/Arch/aarch64/RPi/Framebuffer.h
+++ b/Kernel/Arch/aarch64/RPi/Framebuffer.h
@@ -8,7 +8,7 @@
#include <AK/Types.h>
-namespace Kernel {
+namespace Kernel::RPi {
class Framebuffer {
public:
diff --git a/Kernel/Arch/aarch64/RPi/FramebufferMailboxMessages.h b/Kernel/Arch/aarch64/RPi/FramebufferMailboxMessages.h
index 29f1a1de2a..bd68c58f80 100644
--- a/Kernel/Arch/aarch64/RPi/FramebufferMailboxMessages.h
+++ b/Kernel/Arch/aarch64/RPi/FramebufferMailboxMessages.h
@@ -8,7 +8,7 @@
#include <Kernel/Arch/aarch64/RPi/Mailbox.h>
-namespace Kernel {
+namespace Kernel::RPi {
class FramebufferSetPhysicalSizeMboxMessage : public Mailbox::Message {
public:
diff --git a/Kernel/Arch/aarch64/RPi/GPIO.cpp b/Kernel/Arch/aarch64/RPi/GPIO.cpp
index 0fea124f7f..7878729b06 100644
--- a/Kernel/Arch/aarch64/RPi/GPIO.cpp
+++ b/Kernel/Arch/aarch64/RPi/GPIO.cpp
@@ -8,7 +8,7 @@
#include <Kernel/Arch/aarch64/RPi/GPIO.h>
#include <Kernel/Arch/aarch64/RPi/MMIO.h>
-namespace Kernel {
+namespace Kernel::RPi {
// See BCM2835-ARM-Peripherals.pdf section "6 General Purpose I/O" or bcm2711-peripherals.pdf "Chapter 5. General Purpose I/O".
diff --git a/Kernel/Arch/aarch64/RPi/GPIO.h b/Kernel/Arch/aarch64/RPi/GPIO.h
index ee3e370826..a24a51dbdb 100644
--- a/Kernel/Arch/aarch64/RPi/GPIO.h
+++ b/Kernel/Arch/aarch64/RPi/GPIO.h
@@ -9,7 +9,7 @@
#include <AK/Array.h>
#include <AK/Types.h>
-namespace Kernel {
+namespace Kernel::RPi {
struct GPIOControlRegisters;
diff --git a/Kernel/Arch/aarch64/RPi/MMIO.cpp b/Kernel/Arch/aarch64/RPi/MMIO.cpp
index 5a63b72f37..d43514a520 100644
--- a/Kernel/Arch/aarch64/RPi/MMIO.cpp
+++ b/Kernel/Arch/aarch64/RPi/MMIO.cpp
@@ -7,7 +7,7 @@
#include <Kernel/Arch/aarch64/MainIdRegister.h>
#include <Kernel/Arch/aarch64/RPi/MMIO.h>
-namespace Kernel {
+namespace Kernel::RPi {
MMIO::MMIO()
: m_base_address(0xFE00'0000)
diff --git a/Kernel/Arch/aarch64/RPi/MMIO.h b/Kernel/Arch/aarch64/RPi/MMIO.h
index 1eafc3b4b6..d7c4dc8275 100644
--- a/Kernel/Arch/aarch64/RPi/MMIO.h
+++ b/Kernel/Arch/aarch64/RPi/MMIO.h
@@ -8,7 +8,7 @@
#include <AK/Types.h>
-namespace Kernel {
+namespace Kernel::RPi {
// Knows about memory-mapped IO addresses on the Broadcom family of SOCs used in Raspberry Pis.
// RPi3 is the first Raspberry Pi that supports aarch64.
diff --git a/Kernel/Arch/aarch64/RPi/Mailbox.cpp b/Kernel/Arch/aarch64/RPi/Mailbox.cpp
index e11723f245..31be70f571 100644
--- a/Kernel/Arch/aarch64/RPi/Mailbox.cpp
+++ b/Kernel/Arch/aarch64/RPi/Mailbox.cpp
@@ -7,7 +7,7 @@
#include <Kernel/Arch/aarch64/RPi/MMIO.h>
#include <Kernel/Arch/aarch64/RPi/Mailbox.h>
-namespace Kernel {
+namespace Kernel::RPi {
// There's one mailbox at MBOX_BASE_OFFSET for reading responses from VideoCore, and one at MBOX_BASE_OFFSET + 0x20 for sending requests.
// Each has its own status word.
diff --git a/Kernel/Arch/aarch64/RPi/Mailbox.h b/Kernel/Arch/aarch64/RPi/Mailbox.h
index 042283e306..fb9d12c770 100644
--- a/Kernel/Arch/aarch64/RPi/Mailbox.h
+++ b/Kernel/Arch/aarch64/RPi/Mailbox.h
@@ -8,7 +8,7 @@
#include <AK/Types.h>
-namespace Kernel {
+namespace Kernel::RPi {
// Can exchange mailbox messages with the Raspberry Pi's VideoCore chip.
// https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
diff --git a/Kernel/Arch/aarch64/RPi/Timer.cpp b/Kernel/Arch/aarch64/RPi/Timer.cpp
index 5b32f5d247..02b20b2b51 100644
--- a/Kernel/Arch/aarch64/RPi/Timer.cpp
+++ b/Kernel/Arch/aarch64/RPi/Timer.cpp
@@ -9,7 +9,7 @@
#include <Kernel/Arch/aarch64/RPi/Mailbox.h>
#include <Kernel/Arch/aarch64/RPi/Timer.h>
-namespace Kernel {
+namespace Kernel::RPi {
// "12.1 System Timer Registers" / "10.2 System Timer Registers"
struct TimerRegisters {
diff --git a/Kernel/Arch/aarch64/RPi/Timer.h b/Kernel/Arch/aarch64/RPi/Timer.h
index eddda13eaf..c00ecc01bb 100644
--- a/Kernel/Arch/aarch64/RPi/Timer.h
+++ b/Kernel/Arch/aarch64/RPi/Timer.h
@@ -8,7 +8,7 @@
#include <AK/Types.h>
-namespace Kernel {
+namespace Kernel::RPi {
struct TimerRegisters;
diff --git a/Kernel/Arch/aarch64/RPi/UART.cpp b/Kernel/Arch/aarch64/RPi/UART.cpp
index b1134fcfd9..506c96ef0b 100644
--- a/Kernel/Arch/aarch64/RPi/UART.cpp
+++ b/Kernel/Arch/aarch64/RPi/UART.cpp
@@ -9,7 +9,7 @@
#include <Kernel/Arch/aarch64/RPi/Timer.h>
#include <Kernel/Arch/aarch64/RPi/UART.h>
-namespace Kernel {
+namespace Kernel::RPi {
// "13.4 Register View" / "11.5 Register View"
struct UARTRegisters {
diff --git a/Kernel/Arch/aarch64/RPi/UART.h b/Kernel/Arch/aarch64/RPi/UART.h
index 753521205a..9479ca1f13 100644
--- a/Kernel/Arch/aarch64/RPi/UART.h
+++ b/Kernel/Arch/aarch64/RPi/UART.h
@@ -9,7 +9,7 @@
#include <AK/Types.h>
-namespace Kernel {
+namespace Kernel::RPi {
struct UARTRegisters;
diff --git a/Kernel/Arch/aarch64/init.cpp b/Kernel/Arch/aarch64/init.cpp
index 5013b4e3b9..8e57970d46 100644
--- a/Kernel/Arch/aarch64/init.cpp
+++ b/Kernel/Arch/aarch64/init.cpp
@@ -112,14 +112,14 @@ extern "C" [[noreturn]] void init()
dbgln("Initialize MMU");
init_prekernel_page_tables();
- auto& framebuffer = Framebuffer::the();
+ auto& framebuffer = RPi::Framebuffer::the();
if (framebuffer.initialized()) {
draw_logo();
}
dbgln("Enter loop");
- auto& timer = Timer::the();
+ auto& timer = RPi::Timer::the();
u64 start_musec = 0;
for (;;) {
u64 now_musec;
@@ -130,12 +130,12 @@ extern "C" [[noreturn]] void init()
}
}
-class QueryFirmwareVersionMboxMessage : Mailbox::Message {
+class QueryFirmwareVersionMboxMessage : RPi::Mailbox::Message {
public:
u32 version;
QueryFirmwareVersionMboxMessage()
- : Mailbox::Message(0x0000'0001, 4)
+ : RPi::Mailbox::Message(0x0000'0001, 4)
{
version = 0;
}
@@ -144,12 +144,12 @@ public:
static u32 query_firmware_version()
{
struct __attribute__((aligned(16))) {
- Mailbox::MessageHeader header;
+ RPi::Mailbox::MessageHeader header;
QueryFirmwareVersionMboxMessage query_firmware_version;
- Mailbox::MessageTail tail;
+ RPi::Mailbox::MessageTail tail;
} message_queue;
- if (!Mailbox::the().send_queue(&message_queue, sizeof(message_queue))) {
+ if (!RPi::Mailbox::the().send_queue(&message_queue, sizeof(message_queue))) {
return 0xffff'ffff;
}
@@ -169,7 +169,7 @@ static void draw_logo()
dbgln("Boot logo size: {} ({} x {})", serenity_boot_logo_size, logo_parser.image.width, logo_parser.image.height);
- auto& framebuffer = Framebuffer::the();
+ auto& framebuffer = RPi::Framebuffer::the();
auto fb_ptr = framebuffer.gpu_buffer();
auto image_left = (framebuffer.width() - logo_parser.image.width) / 2;
auto image_right = image_left + logo_parser.image.width;
@@ -181,12 +181,12 @@ static void draw_logo()
for (u32 x = 0; x < framebuffer.width(); x++) {
if (x >= image_left && x < image_right && y >= image_top && y < image_bottom) {
switch (framebuffer.pixel_order()) {
- case Framebuffer::PixelOrder::RGB:
+ case RPi::Framebuffer::PixelOrder::RGB:
fb_ptr[0] = logo_pixels[0];
fb_ptr[1] = logo_pixels[1];
fb_ptr[2] = logo_pixels[2];
break;
- case Framebuffer::PixelOrder::BGR:
+ case RPi::Framebuffer::PixelOrder::BGR:
fb_ptr[0] = logo_pixels[2];
fb_ptr[1] = logo_pixels[1];
fb_ptr[2] = logo_pixels[0];
diff --git a/Kernel/Arch/aarch64/kprintf.cpp b/Kernel/Arch/aarch64/kprintf.cpp
index 7a3361fd49..800b56ce67 100644
--- a/Kernel/Arch/aarch64/kprintf.cpp
+++ b/Kernel/Arch/aarch64/kprintf.cpp
@@ -14,7 +14,7 @@ void kernelputstr(char const* characters, size_t length)
if (!characters)
return;
- auto& uart = Kernel::UART::the();
+ auto& uart = Kernel::RPi::UART::the();
uart.print_str(characters, length);
}
@@ -23,7 +23,7 @@ void kernelcriticalputstr(char const* characters, size_t length)
if (!characters)
return;
- auto& uart = Kernel::UART::the();
+ auto& uart = Kernel::RPi::UART::the();
uart.print_str(characters, length);
}
@@ -32,6 +32,6 @@ void kernelearlyputstr(char const* characters, size_t length)
if (!characters)
return;
- auto& uart = Kernel::UART::the();
+ auto& uart = Kernel::RPi::UART::the();
uart.print_str(characters, length);
}