From 8d25faf30af18435279942361b99c08b6bb0f511 Mon Sep 17 00:00:00 2001 From: Michael Bishop Date: Mon, 21 Aug 2023 17:47:10 -0300 Subject: [PATCH] raise kernel load addr and slip stack under kernel on both 32bit and 64bit --- ports/broadcom/Makefile | 9 +++++++++ ports/broadcom/config.txt | 1 + ports/broadcom/peripherals | 2 +- ports/broadcom/supervisor/port.c | 14 +------------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index 9af0503fbb..57d3aca029 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -171,6 +171,15 @@ $(BUILD)/firmware.disk.img.zip: $(BUILD)/kernel$(SUFFIX).img $(Q)zip $@ $(BUILD)/circuitpython-disk.img $(Q)rm $(BUILD)/circuitpython-disk.img +.PHONY: $(BUILD)/rpiboot rpiboot +rpiboot: $(BUILD)/rpiboot +$(BUILD)/rpiboot: $(BUILD)/kernel$(SUFFIX).img + mkdir -vp $@ + cp -vf $(BUILD)/kernel$(SUFFIX).img $@/ + cp -vfr config.txt firmware/bootcode.bin firmware/fixup* firmware/start* firmware/*.dtb $@/ + #sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" $@/bootcode.bin $@/bootcode.bin + echo uart_2ndstage=1 >> $@/config.txt + include $(TOP)/py/mkrules.mk diff --git a/ports/broadcom/config.txt b/ports/broadcom/config.txt index 36fd6308cf..1c12196b98 100644 --- a/ports/broadcom/config.txt +++ b/ports/broadcom/config.txt @@ -7,3 +7,4 @@ enable_jtag_gpio=1 # hdmi_group=1 # hdmi_mode=16 gpu_mem=16 +kernel_address=0x100000 diff --git a/ports/broadcom/peripherals b/ports/broadcom/peripherals index d3a6b50a21..ec1043800f 160000 --- a/ports/broadcom/peripherals +++ b/ports/broadcom/peripherals @@ -1 +1 @@ -Subproject commit d3a6b50a21e7dd49ba4bfa0374da3407594caa50 +Subproject commit ec1043800fc987f7067fc07615193439843695d6 diff --git a/ports/broadcom/supervisor/port.c b/ports/broadcom/supervisor/port.c index ec6feb8703..d12b96aa5e 100644 --- a/ports/broadcom/supervisor/port.c +++ b/ports/broadcom/supervisor/port.c @@ -124,30 +124,18 @@ void reset_cpu(void) { } bool port_has_fixed_stack(void) { - #ifdef __aarch64__ return true; - #else - return false; - #endif } // From the linker script extern uint32_t __bss_end; extern uint32_t _ld_ram_end; uint32_t *port_stack_get_limit(void) { - #ifdef __aarch64__ return (uint32_t *)0x4; - #else - return &__bss_end; - #endif } uint32_t *port_stack_get_top(void) { - #ifdef __aarch64__ - return (uint32_t *)0x80000; - #else - return &_ld_ram_end; - #endif + return (uint32_t *)0x100000; } uint32_t *port_heap_get_bottom(void) {