# HG changeset patch # User Paul Boddie # Date 1453053048 -3600 # Node ID ef7486be5e213d2341386013eb4d7eb34792659d # Parent e75e6bb0021e132c0aa2012862219cbbc077254b Changed the stage 2 base address for usbboot compatibility. Added various options to the USB Boot script for demonstration purposes. diff -r e75e6bb0021e -r ef7486be5e21 boot_usb --- a/boot_usb Sun Jan 17 18:49:42 2016 +0100 +++ b/boot_usb Sun Jan 17 18:50:48 2016 +0100 @@ -1,3 +1,31 @@ #!/bin/sh -xbboot -u 0x80010000 stage2/stage2.bin +# To use the installed stage1 payload... + +if [ "$1" = '--default1' ]; then + if xbboot -u 0x81c00000 stage2/stage2.bin ; then + exit 0 + else + exit 1 + fi + +# To use usbboot, which is less elegant but sometimes more reliable... + +elif [ "$1" = '--usbboot' ]; then + if usbboot -c 'boot' -1 stage1/stage1.bin -2 stage2/stage2.bin ; then + exit 0 + else + exit 1 + fi +fi + +# Otherwise, use the generated payloads with xbboot. + +xbboot set_addr 0x80002000 +xbboot bulk_write stage1/stage1.bin +xbboot start1 0x80002000 +xbboot get_info +xbboot set_addr 0x81c00000 +xbboot bulk_write stage2/stage2.bin +xbboot flush_cache +xbboot start2 0x81c00000 diff -r e75e6bb0021e -r ef7486be5e21 stage2/Makefile --- a/stage2/Makefile Sun Jan 17 18:49:42 2016 +0100 +++ b/stage2/Makefile Sun Jan 17 18:50:48 2016 +0100 @@ -76,7 +76,7 @@ echo "Nothing else to clean." $(UIMAGE): $(PAYLOAD) - $(MKIMAGE) -A mips -O linux -T kernel -C none -a 0x80010000 -e 0x80010000 -n NanoPayload -d $(PAYLOAD) $(UIMAGE) + $(MKIMAGE) -A mips -O linux -T kernel -C none -a 0x81c00000 -e 0x81c00000 -n NanoPayload -d $(PAYLOAD) $(UIMAGE) $(PAYLOAD): $(TARGET) $(OBJCOPY) -O binary $(@:.bin=.elf) $@+ diff -r e75e6bb0021e -r ef7486be5e21 stage2/stage2.ld --- a/stage2/stage2.ld Sun Jan 17 18:49:42 2016 +0100 +++ b/stage2/stage2.ld Sun Jan 17 18:50:48 2016 +0100 @@ -5,7 +5,7 @@ { /* Program memory section. */ - . = 0x80010000; + . = 0x81c00000; .text2 : { *(.text*) } . = ALIGN(4);