commit 32db212acdd66595ace49ca529193691189fe681
parent 539c277fe0be8c9f7c04dff1d7f6808014aa975a
Author: oblique <psyberbits@gmail.com>
Date: Thu, 23 May 2013 19:56:09 +0300
Load the kernel at 0x82000000 instead of 0x80000000.
U-Boot loads at 0x80000000 so the kernel must load in a different
address to avoid conflicts. I choose 0x82000000 because omap4boot
loads the kernel image there, so we don't need usbboot/usbboot.S
anymore. omap4boot can now load kernel.bin in the PandaBoard without
any problems.
Diffstat:
6 files changed, 5 insertions(+), 62 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -8,5 +8,4 @@
/kernel.elf
/kernel.syms
/uImage
-/usbbootImage
/voron.tar.gz
diff --git a/Makefile b/Makefile
@@ -20,7 +20,7 @@ KERNEL_SRCS = $(KERNEL_SRCS_C) $(KERNEL_SRCS_S)
KERNEL_OBJS = $(KERNEL_SRCS_C:%.c=%.o) $(KERNEL_SRCS_S:%.S=%.o)
HDRS = $(wildcard include/*.h)
-all: uImage usbbootImage kernel.syms
+all: uImage kernel.syms
kernel.elf: $(KERNEL_OBJS) kernel/linker.ld
@echo -e " LD\t$@"
@@ -33,20 +33,7 @@ kernel.syms: kernel.elf
@$(NM) $< > $@
uImage: kernel.bin
- @mkimage -A arm -T kernel -C none -a 0x80000000 -e 0x80000000 -n Voron -d $< $@
-
-usbbootImage: usbboot/usbboot.o usbboot/usbboot.ld usbboot/kernel_image.o
- @echo "Creating $@"
- @echo "Entry Point: 0x82000000"
- @echo "Load Image: 0x80000000"
- @$(CC) -T usbboot/usbboot.ld -nostdlib -nostdinc -nodefaultlibs -nostartfiles \
- -fno-builtin -o __$@ $<
- @$(OBJCOPY) __$@ -O binary $@
- @rm -f __$@
- @echo "Done"
-
-usbboot/kernel_image.o: kernel.bin
- @$(LD) -r -b binary -o $@ $<
+ @mkimage -A arm -T kernel -C none -a 0x82000000 -e 0x82000000 -n Voron -d $< $@
%.o: %.c $(HDRS)
@echo -e " CC\t$<"
@@ -57,8 +44,7 @@ usbboot/kernel_image.o: kernel.bin
@$(CC) $(ASFLAGS) -c -o $@ $<
clean:
- @rm -f $(KERNEL_OBJS) kernel.elf kernel.bin kernel.syms uImage usbbootImage \
- usbboot/kernel_image.o usbboot/usbboot.o voron.tar.gz
+ @rm -f $(KERNEL_OBJS) kernel.elf kernel.bin kernel.syms uImage voron.tar.gz
targz:
@git archive --format=tar.gz --prefix=voron/ -o voron.tar.gz HEAD
diff --git a/kernel/linker.ld b/kernel/linker.ld
@@ -6,7 +6,7 @@ SECTIONS
_ram_start = 0x80000000;
_ram_end = 0xbfffffff;
- .text 0x80000000 :
+ .text 0x82000000 :
{
_kernel_bin_start = .;
kernel/start.o (.text)
@@ -52,6 +52,5 @@ SECTIONS
. = . + 0x2000;
_abort_stack_top = .;
-
_kernel_bin_end = .;
}
diff --git a/scripts/panda_usbboot.sh b/scripts/panda_usbboot.sh
@@ -7,7 +7,7 @@ fi
[ $(basename ${PWD}) = "scripts" ] && cd ..
if [ -z "$BIN" ]; then
- BIN="${PWD}/usbbootImage"
+ BIN="${PWD}/kernel.bin"
fi
if [ ! -f "$BIN" ]; then
diff --git a/usbboot/usbboot.S b/usbboot/usbboot.S
@@ -1,19 +0,0 @@
-.section .text
-.globl _start
-_start:
- ldr sp, =_usbboot_stack_top
- stmfd sp!, { r0 - r12 }
-
- /* copy kernel image at _image_load_addr */
- ldr r0, =_image_start
- ldr r1, =_image_end
- ldr r2, =_image_load_addr
-
-1:
- ldmia r0!, { r3 - r12 }
- stmia r2!, { r3 - r12 }
- cmp r0, r1
- blo 1b
-
- ldmfd sp!, { r0 - r12 }
- ldr pc, =_image_load_addr @ jump to _image_load_addr
diff --git a/usbboot/usbboot.ld b/usbboot/usbboot.ld
@@ -1,22 +0,0 @@
-OUTPUT_FORMAT("elf32-littlearm")
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
- _image_load_addr = 0x80000000;
-
- .text 0x82000000 :
- {
- usbboot/usbboot.o (.text)
- }
-
- .image : ALIGN(4)
- {
- _image_start = .;
- usbboot/kernel_image.o (.data)
- }
- . = ALIGN(4);
- _image_end = .;
-
- _usbboot_stack_top = . + 0x1000;
-}