Commit 5e2076c4 authored by Russell King's avatar Russell King

[ARM] Make "bootp" Image generation know that the zImage is now PIC.

Since a bootp image contains a zImage and an initrd (or maybe later
an initramfs) image, and the zImage is now PIC, we don't have to
copy the zImage to a specific address before calling it.  We just
call it where it got loaded into memory and let it sort itself out.
parent 3e6157d0
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
ZSYSTEM =$(TOPDIR)/arch/arm/boot/zImage ZSYSTEM =$(TOPDIR)/arch/arm/boot/zImage
ZLDFLAGS =-p -X -T bootp.lds \ ZLDFLAGS =-p -X -T bootp.lds \
--defsym initrd_addr=$(INITRD_PHYS) \ --defsym initrd_addr=$(INITRD_PHYS) \
--defsym params=$(PARAMS_PHYS) \ --defsym params=$(PARAMS_PHYS)
--defsym kernel_addr=$(ZTEXTADDR)
all: bootp all: bootp
......
/* /*
* linux/arch/arm/boot/bootp/bootp.lds * linux/arch/arm/boot/bootp/bootp.lds
* *
* Copyright (C) 2000 Russell King * Copyright (C) 2000-2002 Russell King
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -15,13 +15,9 @@ SECTIONS ...@@ -15,13 +15,9 @@ SECTIONS
_text = .; _text = .;
.text : { .text : {
_stext = .; _stext = .;
_start = .; *(.start)
init.o(.start)
kernel_start = .;
kernel.o kernel.o
kernel_len = . - kernel_start;
. = ALIGN(32); . = ALIGN(32);
*(.text)
initrd_start = .; initrd_start = .;
initrd.o initrd.o
initrd_len = . - initrd_start; initrd_len = . - initrd_start;
......
/* /*
* linux/arch/arm/boot/bootp/init.S * linux/arch/arm/boot/bootp/init.S
* *
* Copyright (C) 2000 Russell King * Copyright (C) 2000-2002 Russell King
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
* r0 through to r3 straight through. * r0 through to r3 straight through.
*/ */
.section .start,#alloc,#execinstr .section .start,#alloc,#execinstr
.type _entry, #function .type _start, #function
_entry: adr r10, initdata .globl _start
_start: adr r10, initdata
ldr r11, initdata ldr r11, initdata
sub r11, r10, r11 @ work out exec offset sub r11, r10, r11 @ work out exec offset
b splitify b splitify
...@@ -22,17 +23,11 @@ _entry: adr r10, initdata ...@@ -22,17 +23,11 @@ _entry: adr r10, initdata
initdata: .word initdata @ compiled address of this initdata: .word initdata @ compiled address of this
.size initdata,. - initdata .size initdata,. - initdata
.text
splitify: adr r13, data splitify: adr r13, data
ldmia r13!, {r4-r6} @ move the initrd ldmia r13!, {r4-r6} @ move the initrd
add r4, r4, r11 @ correction add r4, r4, r11 @ correction
bl move bl move
ldmia r13!, {r4-r6} @ then the kernel
mov r12, r5
add r4, r4, r11 @ correction
bl move
/* /*
* Setup the initrd parameters to pass to the kernel. This can either be * Setup the initrd parameters to pass to the kernel. This can either be
* passed in via a param_struct or a tag list. We spot the param_struct * passed in via a param_struct or a tag list. We spot the param_struct
...@@ -76,6 +71,7 @@ taglist: ldr r9, [r8, #0] @ tag length ...@@ -76,6 +71,7 @@ taglist: ldr r9, [r8, #0] @ tag length
mov r4, #16 @ length of initrd tag mov r4, #16 @ length of initrd tag
mov r9, #0 @ end of tag list terminator mov r9, #0 @ end of tag list terminator
stmia r8, {r4, r5, r6, r7, r9} stmia r8, {r4, r5, r6, r7, r9}
adr r12, kernel_start
mov pc, r12 @ call kernel mov pc, r12 @ call kernel
/* /*
...@@ -97,15 +93,12 @@ data: .word initrd_start ...@@ -97,15 +93,12 @@ data: .word initrd_start
.word initrd_addr .word initrd_addr
.word initrd_len .word initrd_len
.word kernel_start
.word kernel_addr
.word kernel_len
.word 0x54410001 @ r4 = ATAG_CORE .word 0x54410001 @ r4 = ATAG_CORE
.word 0x54420005 @ r5 = ATAG_INITRD .word 0x54420005 @ r5 = ATAG_INITRD
.word initrd_addr @ r6 .word initrd_addr @ r6
.word initrd_len @ r7 .word initrd_len @ r7
.word params @ r8 .word params @ r8
.type kernel_start,#object
.type initrd_start,#object .type initrd_start,#object
kernel_start:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment