Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101727
b: refs/heads/master
c: 9b09c6d
h: refs/heads/master
i:
  101725: 43bdc7c
  101723: 92f025a
  101719: bae5839
  101711: c6b9670
  101695: a88e8af
v: v3
  • Loading branch information
Tony Breeds authored and Paul Mackerras committed Jul 1, 2008
1 parent a7515ed commit 63464f0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c230328def963373ec474056f372e1918692c3c8
refs/heads/master: 9b09c6d909dfd8de96b99b9b9c808b94b0a71614
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/boot/addnote.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ char arch[] = "PowerPC";
#define N_DESCR 6
unsigned int descr[N_DESCR] = {
0xffffffff, /* real-mode = true */
0x00c00000, /* real-base, i.e. where we expect OF to be */
0x02000000, /* real-base, i.e. where we expect OF to be */
0xffffffff, /* real-size */
0xffffffff, /* virt-base */
0xffffffff, /* virt-size */
Expand Down
15 changes: 13 additions & 2 deletions trunk/arch/powerpc/boot/oflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,19 @@ void *of_claim(unsigned long virt, unsigned long size, unsigned long align)

void *of_vmlinux_alloc(unsigned long size)
{
void *p = malloc(size);

unsigned long start = (unsigned long)_start, end = (unsigned long)_end;
void *addr;
void *p;

/* With some older POWER4 firmware we need to claim the area the kernel
* will reside in. Newer firmwares don't need this so we just ignore
* the return value.
*/
addr = of_claim(start, end - start, 0);
printf("Trying to claim from 0x%lx to 0x%lx (0x%lx) got %p\r\n",
start, end, end - start, addr);

p = malloc(size);
if (!p)
fatal("Can't allocate memory for kernel image!\n\r");

Expand Down
14 changes: 12 additions & 2 deletions trunk/arch/powerpc/boot/wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,20 @@ objflags=-S
tmp=$tmpdir/zImage.$$.o
ksection=.kernel:vmlinux.strip
isection=.kernel:initrd
link_address='0x400000'

case "$platform" in
pmac|pseries|chrp)
pseries)
platformo=$object/of.o
link_address='0x4000000'
;;
pmac|chrp)
platformo=$object/of.o
;;
coff)
platformo=$object/of.o
lds=$object/zImage.coff.lds
link_address='0x500000'
;;
miboot|uboot)
# miboot and U-boot want just the bare bits, not an ELF binary
Expand Down Expand Up @@ -190,6 +196,7 @@ ps3)
objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
ksection=.kernel:vmlinux.bin
isection=.kernel:initrd
link_address=''
;;
ep88xc|ep405|ep8248e)
platformo="$object/fixed-head.o $object/$platform.o"
Expand Down Expand Up @@ -272,7 +279,10 @@ if [ -n "$dtb" ]; then
fi

if [ "$platform" != "miboot" ]; then
${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \
if [ -n "$link_address" ] ; then
text_start="-Ttext $link_address --defsym _start=$link_address"
fi
${CROSS}ld -m elf32ppc -T $lds $text_start -o "$ofile" \
$platformo $tmp $object/wrapper.a
rm $tmp
fi
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/powerpc/boot/zImage.coff.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ENTRY(_zimage_start_opd)
EXTERN(_zimage_start_opd)
SECTIONS
{
. = (5*1024*1024);
_start = .;
.text :
{
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/powerpc/boot/zImage.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ENTRY(_zimage_start)
EXTERN(_zimage_start)
SECTIONS
{
. = (4*1024*1024);
_start = .;
.text :
{
Expand Down

0 comments on commit 63464f0

Please sign in to comment.