summaryrefslogtreecommitdiffhomepage
path: root/src/arm64
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-28 09:09:27 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-28 09:09:27 +0100
commitf204ff88659e058d70213fc7224a2c95c6a48c9d (patch)
treeb4d62fa0dc6da921e25aa3fac400cab892a78e57 /src/arm64
parent08f96fce677d9cf4f8757cf064c07f80e30d378e (diff)
coreboot: rename from NeKernel firmware, refactor symbols to `cb_`, update docs
This patch completes a major renaming and cleanup of the firmware codebase: - Rename project from "NeKernel Firmware" to "CoreBoot" in README and comments. - Replace all `mp_`-prefixed symbols with `cb_` to reflect the new naming scheme. - Remove obsolete SPECIFICATION.TXT and replace with SPECIFICATION_FIRMWARE.md. - Update memory-mapped I/O helpers, TLB init, and platform-specific code to match `cb_*` naming. - Refactor low-level UART, panic, PCI-tree, partition map, and context setup to use unified `cb_` API. - Adjust linker scripts and boot vectors for ARM64, PPC64, and RV64 targets accordingly. - Add Doxygen documentation note to README. This change is part of an ongoing effort to rebrand and unify the firmware interface, improve naming clarity, and better align with platform-specific toolchains. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/arm64')
-rw-r--r--src/arm64/arm64-30pin.c2
-rw-r--r--src/arm64/arm64-boot.S8
-rw-r--r--src/arm64/arm64-err.c8
-rw-r--r--src/arm64/arm64-start-context.S10
-rw-r--r--src/arm64/arm64-uart.c20
-rw-r--r--src/arm64/script.lds6
6 files changed, 28 insertions, 26 deletions
diff --git a/src/arm64/arm64-30pin.c b/src/arm64/arm64-30pin.c
index 7f660d9..83692f9 100644
--- a/src/arm64/arm64-30pin.c
+++ b/src/arm64/arm64-30pin.c
@@ -7,4 +7,4 @@
#include <lib/partition-map.h>
#include <lib/30pin.h>
-extern size_t mp_send_read_30pin(voidptr_t blob, size_t* size, size_t* start_lba);
+extern size_t cb_send_read_30pin(voidptr_t blob, size_t* size, size_t* start_lba);
diff --git a/src/arm64/arm64-boot.S b/src/arm64/arm64-boot.S
index c62a227..bcbec0e 100644
--- a/src/arm64/arm64-boot.S
+++ b/src/arm64/arm64-boot.S
@@ -7,9 +7,9 @@
.text
.balign 4
-.global mp_reset_vector
+.global cb_reset_vector
-mp_reset_vector:
- ldr sp, =__mp_stack_end
+cb_reset_vector:
+ ldr sp, =__cb_stack_end
/* don't care about page_zero, it's gonna be a raw binary */
- b mp_start_exec
+ b cb_start_exec
diff --git a/src/arm64/arm64-err.c b/src/arm64/arm64-err.c
index 5877cca..5417bc1 100644
--- a/src/arm64/arm64-err.c
+++ b/src/arm64/arm64-err.c
@@ -10,11 +10,11 @@
/// @brief Goes into a panic state.
/// @param reason why?
-void mp_panic(const char* reason)
+void cb_panic(const char* reason)
{
- mp_put_string("Error: ");
- mp_put_string(reason);
- mp_put_char('\n');
+ cb_put_string("Error: ");
+ cb_put_string(reason);
+ cb_put_char('\n');
while (yes)
{
diff --git a/src/arm64/arm64-start-context.S b/src/arm64/arm64-start-context.S
index 389f958..5db92d0 100644
--- a/src/arm64/arm64-start-context.S
+++ b/src/arm64/arm64-start-context.S
@@ -6,12 +6,12 @@
.text
.balign 4
-.global mp_start_context
-.global mp_boot_processor_ready
+.global cb_start_context
+.global cb_boot_processor_ready
-mp_start_context:
- bl mp_start_context
+cb_start_context:
+ bl cb_start_context
ldr pc, [lr]
-mp_boot_processor_ready:
+cb_boot_processor_ready:
ldr pc, [lr]
diff --git a/src/arm64/arm64-uart.c b/src/arm64/arm64-uart.c
index fff3bbf..ce5edcf 100644
--- a/src/arm64/arm64-uart.c
+++ b/src/arm64/arm64-uart.c
@@ -9,36 +9,38 @@
/// BUGS: 0
-#define ARM64_MMIO_REG(addr) (*(volatile uint32_t*)(mp_uart_ptr + addr))
+#define ARM64_MMIO_REG(addr) (*(volatile uint32_t*)(cb_uart_ptr + addr))
/* this file handles the UART */
-static uint32_t* mp_uart_ptr = (uint32_t*)SYS_UART_BASE;
+static uint32_t* cb_uart_ptr = (uint32_t*)SYS_UART_BASE;
// we need that one, to avoid sending mutliple chars to UART.
-static boolean mp_locked_put_char = no;
+static boolean cb_locked_put_char = no;
-utf_char_t mp_get_char(void)
+/// @brief Retrieve character from cb_uart_ptr
+utf_char_t cb_get_char(void)
{
+ // check if ready.
while ((ARM64_MMIO_REG(0x018) & (1 << 4)))
{
}
- return (utf_char_t)*mp_uart_ptr;
+ return (utf_char_t)ARM64_MMIO_REG(0x0);
}
-void mp_put_char(utf_char_t ch)
+void cb_put_char(utf_char_t ch)
{
while ((ARM64_MMIO_REG(0x018) & (1 << 5)))
{
}
- *mp_uart_ptr = ch;
+ ARM64_MMIO_REG(0x0) = ch;
}
/// @brief UART put string
/// @param text the input text.
-size_t mp_put_string(const char* text)
+size_t cb_put_string(const char* text)
{
if (text == nil)
return 0;
@@ -47,7 +49,7 @@ size_t mp_put_string(const char* text)
for (; i < strlen(text); i++)
{
- mp_put_char(text[i]);
+ cb_put_char(text[i]);
}
return i;
diff --git a/src/arm64/script.lds b/src/arm64/script.lds
index 37bd647..b8a0d11 100644
--- a/src/arm64/script.lds
+++ b/src/arm64/script.lds
@@ -1,4 +1,4 @@
-ENTRY(mp_reset_vector)
+ENTRY(cb_reset_vector)
SECTIONS
{
. = 0x40100000;
@@ -8,7 +8,7 @@ SECTIONS
.bss : { *(.bss COMMON) }
. = ALIGN(8);
. = . + 0x1000; /* 4kB of stack memory */
- __mp_stack_end = .;
+ __cb_stack_end = .;
- PROVIDE(mp_memory_end = .);
+ PROVIDE(cb_memory_end = .);
}