[U-Boot-Users] questions booting Linux on a mpc8247

Jim Fridlund jim at code4fun.us
Thu May 11 05:17:29 CEST 2006

Hi all. I am trying to load Linux on a board with a mpc8247
processor using u-boot-1.1.4 and I'm running into a problems
booting a multi-boot image (Linux kernel + ram disk).

I can load the image via TFTP, but it hangs when I try to
run bootm. I searched in Google, but I couldn't find anything
related to what I'm seeing so I'm hoping I can get some help
from the u-boot community. What I see here is that u-boot gets
a 0x200 exception because it is trying to load the ram disk
image to memory out of range. My board has 128M of memory. Here
is a snippet:

U-Boot 1.1.4 (May 10 2006 - 11:38:41)

MPC8247 Reset Status: Check Stop, External Soft, External Hard

MPC8247 Clock Configuration
 - Bus-to-Core Mult 4x, VCO Div 2, 60x Bus Freq  25-75 , Core Freq 100-300
 - dfbrg 1, corecnf 0x1a, busdf 5, cpmdf 1, plldf 0, pllmf 5
 - vco_out  399999996, scc_clk   99999999, brg_clk   24999999
 - cpu_clk  266666664, cpm_clk  199999998, bus_clk   66666666
 - pci_clk   66666666

CPU:   MPC8247 (HiP7 Rev 14, Mask 1.0 1K50M) at 266.666 MHz
Board: MPC 8247
I2C:   ready
DRAM:  128 MB
FLASH: 512 kB
Using default environment

In:    serial
Out:   serial
Err:   serial
IDE:   Bus 0: OK
  Device 0: Model: TOSHIBA THNCF256MMA Firm: 3.10 Ser#: STCB52M6300ZC49843C5
            Type: Removable Hard Disk
            Capacity: 244.5 MB = 0.2 GB (500736 x 512)

Type "run flash_nfs" to mount root filesystem over NFS

=> tftp
Using FCC1 ETHERNET device
TFTP from server; our IP address is
Filename 'jim/uImage'.
Load address: 0x100000
Loading: #################################################################
Bytes transferred = 7326900 (6fccb4 hex)
=> bootm
## Booting image at 00100000 ...
   Image Name:   Linux with ramdisk
   Created:      2006-05-10  22:01:21 UTC
   Image Type:   PowerPC Linux Multi-File Image (uncompressed)
   Data Size:    7326836 Bytes =  7 MB
   Load Address: 00000000
   Entry Point:  00000000
   Image 0:  2559077 Bytes =  2.4 MB
   Image 1:  4767744 Bytes =  4.5 MB
   Verifying Checksum ... OK
   Loading Ramdisk to 84344000, end 07f74064 ...

It verifies the image correctly, but the board hangs with a
0x200 exception trying to load the ram disk at 0x84344000
which is out of range. I don't know how u-boot calculates
where it stores the kernel and ram disk at the moment (this
is all magic to me). If I create an image where I specify the
load address, say 16M (0x01000000), it is able to load the ram
disk ok but hangs shortly with exception 0x200.

I generate the multi-boot image by running the following mkimage

$ ./u-boot-1.1.4/tools/mkimage -A ppc -O Linux -T multi -C none -n
'Linux with ramdisk' -d vmlinux:rootfs.powerpc.ext2 uImage.img

Unfortunately, I haven't figured out how to debug u-boot after
it copies the code from rom to memory so progress has slowed.
I am using Vision Probe to debug. I can debug the code prior to
copying itself into memory, but I lose symbols once it relocates
to memory. Does anyone have any advice on how to tackle this? I
saw the GDB serial debug tutorial, but I don't have another serial
port unfortunately.

I also have a question regarding tool chain. I am using uClibC's
buildroot to build a compiler toolchain. At the moment, I am using
gcc 3.4.2 and Linux 2.4.31. I tried using gcc 4.0.2 initially, but
I had a problem with it trying to generate the proper code for
building u-boot. It appears that u-boot is using register r29 as
a global pointer and we had the following code in

void cpu_init_f (volatile immap_t * immr)

        /* Pointer is writable since we allocated a register for it */
        gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);

For the PPC, DECLARE_GLOBAL_DATA_PTR is defined as:

#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r29")

As far as I can tell, the above statement is trying to assign
r29 the value of CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET which
is basically an offset in the PPC's internal memory for storing
global data structure. However, gcc 4.0.2 would not generate code
that sets r29 correctly. I temporarily worked around it by adding
a couple of lines in start.S:

        /* Hack to initialize R29 since cpu_init_f code isn't working. */
        lis     r29,(CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET)@h
        ori     r29, r29, (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET)@l

Is anyone using gcc 4.x to build? I reverted to gcc 3.4.2 just to
be on the safe side. Also, I noticed that Linux 2.6.x kernel doesn't
have much support for embedded mpc82xx so I ended up using Linux 2.4.31
which is the most current version that works with uClibC's buildroot.
Is there anyone doing embedded PPC development based on 2.6 kernel and
gcc 4.x? I sure would like to hear your inputs.

Lastly, is there anyone working on a TIPC implementation in u-boot?
I read the white paper on TIPC and it would seem like a nice solution
to have on a distributed/embedded cluster environment such as a
chassis where there is a single control card with multiple dummy
line cards (flashless) on a custom backplane.

Any help or pointers would be greatly appreciated. Thanks in advance.

More information about the U-Boot mailing list