summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-06-17 23:56:50 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-06-17 23:56:50 +0200
commit19ffdc8218284937b1ac4fc8ef9a19a536b4a887 (patch)
tree6226d6c04f169b5f54ab58034568aba7ed927c61
parentd48a66377317771bb22c7b5e97661a91535be97f (diff)
fix: see below.
fix: - match flash base address according to qemu `virt`. - make use of correct offsets in the firmware's entrypoint. refactor: - rename flash.c to flash-driver.c Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--lib/boot.h2
-rw-r--r--lib/pci-tree.h14
-rw-r--r--src/coreboot-start.c2
-rw-r--r--src/hal/coreboot-flash-driver.c (renamed from src/hal/coreboot-flash.c)0
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/boot.h b/lib/boot.h
index a792a82..cf90766 100644
--- a/lib/boot.h
+++ b/lib/boot.h
@@ -93,7 +93,7 @@ typedef ptrtype_t size_t;
#define CB_BOOT_ADDR 0x1030000
#define CB_BOOT_ADDR_STR "0x1030000"
#define CB_FRAMEBUFFER_ADDR 0x40000000L
-#define CB_FLASH_BASE_ADDR 0x08000000
+#define CB_FLASH_BASE_ADDR 0x60000000
static inline void __sync_synchronize(void) {
/// leave it as is.
diff --git a/lib/pci-tree.h b/lib/pci-tree.h
index 460b185..2c4ca1f 100644
--- a/lib/pci-tree.h
+++ b/lib/pci-tree.h
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
------------------------------------------- */
@@ -19,12 +19,6 @@
#define CB_BASE_ADDRESS (0x20008000) /* PCI base mapped in virtual memory. */
#define CB_PCI_TREE_BASE (0x802000) /* The PCI tree base address. */
-#define PCI_CONFIG_SPACE (4096U)
-
-#define PCI_BUS_MAX (256U)
-#define PCI_DEV_MAX (32U)
-#define PCI_FN_MAX (8U)
-
/* version 1.0 */
#define CB_PCI_VERSION (0x0100)
@@ -33,6 +27,12 @@
#define CB_PCI_NAME_LEN (255U)
+#define PCI_CONFIG_SPACE (4096U)
+
+#define PCI_BUS_MAX (256U)
+#define PCI_DEV_MAX (32U)
+#define PCI_FN_MAX (8U
+
typedef char cb_pci_char_t;
typedef uintptr_t cb_pci_num_t;
diff --git a/src/coreboot-start.c b/src/coreboot-start.c
index da6da23..7a93744 100644
--- a/src/coreboot-start.c
+++ b/src/coreboot-start.c
@@ -108,7 +108,7 @@ void cb_start_exec(void) {
cb_put_string("CB> Trying EPM partition...\r\n");
part_block_t* blk =
- cb_parse_partition_block_at((voidptr_t) CB_FLASH_BASE_ADDR, EPM_PART_BLK_SZ, 0);
+ cb_parse_partition_block_at((voidptr_t) CB_BOOT_ADDR, EPM_PART_BLK_SZ, 0);
if (blk) {
cb_pci_append_tree("@stage2-epm", (cb_pci_num_t) blk, sizeof(part_block_t) * blk->num_blocks);
diff --git a/src/hal/coreboot-flash.c b/src/hal/coreboot-flash-driver.c
index d1b0907..d1b0907 100644
--- a/src/hal/coreboot-flash.c
+++ b/src/hal/coreboot-flash-driver.c