diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-12-02 12:26:48 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-12-02 12:26:48 +0000 |
commit | c77ac1f27122da92e026f21446a2679695007e3d (patch) | |
tree | a52f90d777f940b0bc1479a7b9528a9d55028aef |
Initial version.
-rw-r--r-- | Makefile | 29 | ||||
-rw-r--r-- | boot-t2.S | 34 | ||||
-rw-r--r-- | boot.S | 33 | ||||
-rw-r--r-- | model.lds | 24 |
4 files changed, 120 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3e40b27 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +# Build an ELF linux+filesystem image + +BOOTLOADER = boot.bin +KERNEL = uImage +FILESYSTEM = base.cramfs + +IMAGE = linux-system.axf +LD_SCRIPT = model.lds + +CROSS_COMPILE = arm-none-linux-gnueabi- + +CC = $(CROSS_COMPILE)gcc +AS = $(CROSS_COMPILE)as +LD = $(CROSS_COMPILE)ld +OBJCOPY = $(CROSS_COMPILE)objcopy + +all: $(IMAGE) + +clean: + rm -f $(IMAGE) + +$(IMAGE): $(BOOTLOADER) $(KERNEL) $(FILESYSTEM) $(LD_SCRIPT) + $(LD) -o $@ --script=$(LD_SCRIPT) + +boot.bin: boot.o + $(OBJCOPY) -O binary -S $< $@ + +boot.o: boot.S + $(AS) -o $@ $< diff --git a/boot-t2.S b/boot-t2.S new file mode 100644 index 0000000..ed3d232 --- /dev/null +++ b/boot-t2.S @@ -0,0 +1,34 @@ +/* + * boot.S - simple register setup code for stand-alone Linux booting + * + * Copyright (C) 2006 ARM Limited + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + mov r0, #0x16000000 @ UART base (Integrator/CP) + mov r1, #0x10 @ ibrd + str r1, [r0, #0x24] + mov r1, #0xc300 + orr r1, #0x0001 @ cr + str r1, [r0, #0x30] + + mov r0, #0 + mov r1, #0x13 + orr r1, r1, #0x100 @ Integrator/CP + mov r2, #0 + mov r3, #0 + mov lr, #0x8000 + orr lr, lr, #1 @ Thumb mode + bx lr @ jump to the kernel @@ -0,0 +1,33 @@ +/* + * boot.S - simple register setup code for stand-alone Linux booting + * + * Copyright (C) 2006 ARM Limited + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + mov r0, #0x16000000 @ UART base (Integrator/CP) + mov r1, #0x10 @ ibrd + str r1, [r0, #0x24] + mov r1, #0xc300 + orr r1, #0x0001 @ cr + str r1, [r0, #0x30] + + mov r0, #0 + mov r1, #0x13 + orr r1, r1, #0x100 @ Integrator/CP + mov r2, #0 + mov r3, #0 + mov lr, #0x8000 + mov pc, lr @ jump to the kernel diff --git a/model.lds b/model.lds new file mode 100644 index 0000000..7b68d0b --- /dev/null +++ b/model.lds @@ -0,0 +1,24 @@ +start = 0x00400000; + +OUTPUT_FORMAT("elf32-littlearm") +OUTPUT_ARCH(arm) +TARGET(binary) + +INPUT(./uImage) +INPUT(./boot.bin) +INPUT(./base.cramfs) + +SECTIONS +{ + . = 0x00007fc0; + .text.kernel : { ./uImage *(.text) } + + . = 0x00400000; + .text.boot : { ./boot.bin *(.text) } + + . = 0x00800000; + .text.filesystem : { ./base.cramfs *(.text) } + + .data : { *(.data) } + .bss : { *(.bss) } +} |