ASFLAGS = $(arch) $(dbg) $(inc)
LDFLAGS = -nostdlib -T rpikern.ld -print-gc-sections
-QEMU_FLAGS = -m 256 -M raspi2 -serial stdio -d guest_errors
+QEMU_FLAGS = -m 1024 -M raspi2 -serial stdio -d guest_errors
$(bin): $(elf)
.PHONY: disasm
disasm: $(elf)
$(toolprefix)objdump -d $<
+
+.PHONY: install
+install: $(bin) $(elf)
+ cp $(bin) /srv/tftp/$(bin)
+ cp $(elf) /srv/tftp/$(elf)
--- /dev/null
+RPi Configuration
+-----------------
+In `config.txt`:
+ init_uart_clock=3000000
+ enable_uart=1
+ core_freq=250
+
+netboot with uboot
+------------------
+Put `rpikern.bin` in `/srv/tftp/` (`make install`)
+
+Once:
+ setenv serverip 192.168.0.4
+ setenv ipaddr 192.168.0.25
+ saveenv
+
+Then:
+ tftpboot 0x8000 rpikern.bin
+ go 0x8000
+
+TODO: make it automatic with a boot script
mount /media/usbmass && \
cp rpikern.bin /media/usbmass/kernel7.img && \
- umount /media/usbmass && sync
+ umount /media/usbmass
static char cmdbuf[256];
static int cmdend;
- dbgled(2);
-
init_serial(115200);
ser_printstr("starting rpikern\n");
void panic(void)
{
- dbgled(1);
+ ser_printstr("PANIC!\n");
exit(0);
}
.code 32
startup:
- ldr sp, =_stacktop
+ @ stop all but one of the cores
+ mrc p15, 0, r0, c0, c0, 5
+ ands r0, r0, #0xff
+ bne exit
- mov r0, #2
- bl dbgled
+ @ setup stack
+ ldr sp, =_stacktop
@ clear bss
ldr r0, =_bss_start
subs r1, #4
bne 0b
1:
- bl main
-
- mov r0, #0
- bl dbgled
+ blx main
.global exit
exit: wfe