From 45e1fa306e886685c1910e2e09e2615053ce60bd Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 23 Jul 2025 01:23:22 +0800 Subject: [PATCH] fix linker script for the simulation target no need to include fonts in the verilator target environment --- loader/Cargo.toml | 2 +- loader/build.rs | 2 +- loader/src/platform/cramium/link-fpga.x | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/loader/Cargo.toml b/loader/Cargo.toml index ece31a285..ab23348d7 100644 --- a/loader/Cargo.toml +++ b/loader/Cargo.toml @@ -101,7 +101,7 @@ board-baosec = [ ] board-baosor = ["cramium-hal/loader-baosor"] board-dabao = ["cramium-hal/loader-dabao"] -cramium-fpga = ["utralib/cramium-fpga", "debug-print"] +cramium-fpga = ["utralib/cramium-fpga", "debug-print", "linked_list_allocator"] atsama5d27 = ["utralib/atsama5d27", "armv7", "dep:atsama5d27"] # precursor flags diff --git a/loader/build.rs b/loader/build.rs index 19d75180d..f41eab36d 100644 --- a/loader/build.rs +++ b/loader/build.rs @@ -13,7 +13,7 @@ fn main() { #[cfg(feature = "cramium-soc")] let p = PathBuf::from("src/platform/cramium/link-soc.x"); #[cfg(feature = "cramium-fpga")] - let p = PathBuf::from("src/platform/cramium/link-soc.x"); // note deviation -- this is because we are still simulating the FPGA model and offsets are not yet settled for that + let p = PathBuf::from("src/platform/cramium/link-fpga.x"); #[cfg(not(any(feature = "cramium-soc", feature = "cramium-fpga")))] let p = PathBuf::from("src/platform/precursor/link.x"); diff --git a/loader/src/platform/cramium/link-fpga.x b/loader/src/platform/cramium/link-fpga.x index 8b0e921ca..12b341504 100644 --- a/loader/src/platform/cramium/link-fpga.x +++ b/loader/src/platform/cramium/link-fpga.x @@ -1,12 +1,11 @@ MEMORY { /* we are using an unsigned loader, so the offset is not 1k offset */ - FLASH : ORIGIN = 0x60500000, LENGTH = 32k - RAM : ORIGIN = 0x61000000, LENGTH = 16M + /* if the font location is adjusted, this needs to be updated in libs/blitstr2 codegen templates.go FONT_BASE value */ + FONTS : ORIGIN = 0x60040000, LENGTH = 128k + FLASH : ORIGIN = 0x60001000, LENGTH = 252k + RAM : ORIGIN = 0x61000000, LENGTH = 2M } -/* -Fonts go from 0x2053_0000 to 0x2097_0000 -*/ REGION_ALIAS("REGION_TEXT", FLASH); REGION_ALIAS("REGION_RODATA", FLASH); @@ -88,12 +87,12 @@ SECTIONS . = ALIGN(4); _edata = .; } > REGION_DATA AT > REGION_RODATA - - /* .fonts : ALIGN(65536) +/* + .fonts : ALIGN(65536) { KEEP(*(.fontdata)); - } > FONTS */ - + } > FONTS +*/ .bss (NOLOAD) : { _sbss = .;