Skip to content

Commit a3654ed

Browse files
committed
raise kernel load addr and slip stack under kernel on both 32bit and 64bit
1 parent 75ba17e commit a3654ed

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

ports/broadcom/Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ $(BUILD)/firmware.disk.img.zip: $(BUILD)/kernel$(SUFFIX).img
171171
$(Q)zip $@ $(BUILD)/circuitpython-disk.img
172172
$(Q)rm $(BUILD)/circuitpython-disk.img
173173

174+
.PHONY: $(BUILD)/rpiboot rpiboot
175+
rpiboot: $(BUILD)/rpiboot
176+
$(BUILD)/rpiboot: $(BUILD)/kernel$(SUFFIX).img
177+
mkdir -vp $@
178+
cp -vf $(BUILD)/kernel$(SUFFIX).img $@/
179+
cp -vfr config.txt firmware/bootcode.bin firmware/fixup* firmware/start* firmware/*.dtb $@/
180+
#sed -i -e "s/BOOT_UART=0/BOOT_UART=1/" $@/bootcode.bin $@/bootcode.bin
181+
echo uart_2ndstage=1 >> $@/config.txt
182+
174183
include $(TOP)/py/mkrules.mk
175184

176185

ports/broadcom/config.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ enable_jtag_gpio=1
77
# hdmi_group=1
88
# hdmi_mode=16
99
gpu_mem=16
10+
kernel_address=0x100000

ports/broadcom/supervisor/port.c

+1-13
Original file line numberDiff line numberDiff line change
@@ -124,30 +124,18 @@ void reset_cpu(void) {
124124
}
125125

126126
bool port_has_fixed_stack(void) {
127-
#ifdef __aarch64__
128127
return true;
129-
#else
130-
return false;
131-
#endif
132128
}
133129

134130
// From the linker script
135131
extern uint32_t __bss_end;
136132
extern uint32_t _ld_ram_end;
137133
uint32_t *port_stack_get_limit(void) {
138-
#ifdef __aarch64__
139134
return (uint32_t *)0x4;
140-
#else
141-
return &__bss_end;
142-
#endif
143135
}
144136

145137
uint32_t *port_stack_get_top(void) {
146-
#ifdef __aarch64__
147-
return (uint32_t *)0x80000;
148-
#else
149-
return &_ld_ram_end;
150-
#endif
138+
return (uint32_t *)0x100000;
151139
}
152140

153141
uint32_t *port_heap_get_bottom(void) {

0 commit comments

Comments
 (0)