Skip to contentSkip to conversation

Device Tree setup for 8272-based board

DISCUSSION Daniel Ng 3 participants 8 messages Dec 19, 2008 – Dec 23, 2008

lore
Share & tools
lore

Daniel Ng

author
#0 lore raw

Hi,

We are migrating our PowerPC 8272-based board from 2.6.14 to 2.6.27.

One of the big changes is the need for a Device Tree for bootup.

So far, my bootup looks like the below (using u-boot).

I am just using arch/powerpc/boot/cuboot-824x.c
and /arch/powerpc/boot/dts/mpc8272ads.dts for now. Therefore, all the settings as printed below are wrong ie. Memory, ENET0 mac, CPU clock freq, etc.

When I change the settings in mpc8272ads.dts and do a fresh recompile, the settings do not change. However, if I use another cuboot*.c file, I get a different set of printed settings eg. 2 ethernet ports instead of 1. This is fine, but I don't see where in the cuboot*.c file these settings are specified. Can someone suggest where these might be?

Cheers,
Daniel

## Booting image at 00200000 ...

   Image Name:   Linux-2.6.27-mybuild
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1477233 Bytes =  1.4 MB

Load Address: 00400000
Entry Point: 00400594
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Memory <- <0x0 0x4000000> (64MB)
ENET0: local-mac-address <- c0:a8:01:4b:7e:13
CPU clock-frequency <- 0xa175c100 (2709MHz)
CPU timebase-frequency <- 0x4ead9a0 (83MHz)
CPU bus-frequency <- 0x13ab6680 (330MHz)

zImage starting: loaded at 0x00400000 (sp: 0x03f7c9c8) Allocating 0x316e8c bytes for kernel ...
gunzipping (0x00000000 <- 0x0040c000:0x0071367c)...done 0x2f41a0 bytes

Linux/PowerPC load:
Finalizing device tree... flat tree at 0x40acd8

(there is no more output after this)

#1 lore raw

SGkgRGFuaWVsLA0KICAgIEkgdGhpbmsgeW91J2QgYmV0dGVyIHJlYWQgRG9jdW1lbnRhdGlvbi9w b3dlcnBjL2Jvb3R3cmFwcGVyLnR4dCwgYW5kIGNob29zZSB0aGUgYXBwcm9wcmlhdGUgaW1hZ2Ug dGFyZ2V0Lg0KDQotLS0tLS0tLS0tLS0tLS0t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9hZGVkIGF0IDB4MDA0MDAwMDAgKHNwOiAweDAz ZjdjOWM4KQ0KPiBBbGxvY2F0aW5nIDB4MzE2ZThjIGJ5dGVzIGZvciBrZXJuZWwgLi4uDQo+IGd1 bnppcHBpbmcgKDB4MDAwMDAwMDAgPC0gMHgwMDQwYzAwMDoweDAwNzEzNjdjKS4uLmRvbmUgMHgy ZjQxYTAgYnl0ZXMNCj4gDQo+IExpbnV4L1Bvd2VyUEMgbG9hZDoNCj4gRmluYWxpemluZyBkZXZp Y2UgdHJlZS4uLiBmbGF0IHRyZWUgYXQgMHg0MGFjZDgNCj4gDQo+ICh0aGVyZSBpcyBubyBtb3Jl IG91dHB1dCBhZnRlciB0aGlzKQ0KPiANCj4gDQo+IA0KPiBfX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fXw0KPiBMaW51eHBwYy1lbWJlZGRlZCBtYWlsaW5nIGxp c3QNCj4gTGludXhwcGMtZW1iZWRkZWRAb3psYWJzLm9yZw0KPiBodHRwczovL296bGFicy5vcmcv bWFpbG1hbi9saXN0aW5mby9saW51eHBwYy1lbWJlZGRlZA0KPiA=

#2 lore raw
In reply to Daniel Ng
Quoted 7 lines · Daniel Ng

We are migrating our PowerPC 8272-based board from 2.6.14 to 2.6.27.

One of the big changes is the need for a Device Tree for bootup.

So far, my bootup looks like the below (using u-boot).

I am just using arch/powerpc/boot/cuboot-824x.c

cuboot-824x is for 8240, 8245, and similar chips. You want cuboot-pq2.

Quoted 1 line

When I change the settings in mpc8272ads.dts and do a fresh recompile, the settings do not change. However, if I use another cuboot*.c file, I get a different set of printed settings eg. 2 ethernet ports instead of 1. This is fine, but I don't see where in the cuboot*.c file these settings are specified. Can someone suggest where these might be?

The cuboot file defines things like TARGET_CPM2 or TARGET_824x, which influences the compilation of the bd_t struct. It's messy, which is why we use device trees now. :-)

-Scott

author
#3 lore raw
Quoted 4 lines · Scott Wood <scottwood <at> freescale.com> writes:

The cuboot file defines things like TARGET_CPM2 or TARGET_824x, which influences the compilation of the bd_t struct. It's messy, which is why we use device trees now.

Thanks for your helpful responses Scott and Ming Qian. Now, from reading the docco can you please verify my understanding is correct?-

First, I need a basic DTS file which will give me a basic Device Tree. The cuboot*.c file takes care of adding other parameters to the Device Tree passed from u-boot via the old bd_info struct.

Is this correct? If so, would it be possible to do away with the DTS file altogether? On the other hand, would it be possible to do away with the cuboot*.c file by providing a complete DTS file?

Cheers,
Daniel

#4 lore raw
Quoted 5 lines · Daniel Ng

Thanks for your helpful responses Scott and Ming Qian. Now, from reading the docco can you please verify my understanding is correct?-

First, I need a basic DTS file which will give me a basic Device Tree. The cuboot*.c file takes care of adding other parameters to the Device Tree passed from u-boot via the old bd_info struct.

Is this correct?

Yes.

Quoted 1 line

If so, would it be possible to do away with the DTS file altogether?

How, other than by encoding all the information about the board in code rather than data, which would be a step backwards?

Quoted 1 line

On the other hand, would it be possible to do away with the cuboot*.c file by providing a complete DTS file?

Yes, though that eliminates the ability to dynamically set certain parameters from the firmware. Better is to use an up-to-date u-boot, and have u-boot fill in the dynamic fields (MAC address, clocks, command line, etc) directly.

-Scott

author
#5 lore raw
In reply to Scott Wood
Quoted 1 line · Scott Wood <scottwood <at> freescale.com> writes:

cuboot-824x is for 8240, 8245, and similar chips. You want cuboot-pq2.

Hi Scott et al,

I seem to get further with the cuboot-824x file- with the cuboot-pq2 file the boot sequence doesn't even reach the 'zImage starting' stage. The machine reboots just before it should be printing out 'zImage starting'.

Is there a way I can get more detailed debug to see what's happening?

Do settings from bd_info struct override the settings from the DTS file?

Also, a lot of the settings passed from u-boot in our 2.6.14 environment are plain wrong eg. wrong memory, wrong processor speed. In this case, the correct settings are set elsewhere (for memory, it is a kernel parameter ie. mem=32M, and the processor speed is set in the 2.6.14 'make menuconfig'). Therefore, the machine still boots into Linux correctly. For 2.6.27, would these incorrect settings be causing my problems?

Daniel

#6 lore raw
Quoted 6 lines · Daniel Ng
Quoted 1 line · Scott Wood <scottwood <at> freescale.com> writes:

cuboot-824x is for 8240, 8245, and similar chips. You want cuboot-pq2.

Hi Scott et al,

I seem to get further with the cuboot-824x file- with the cuboot-pq2 file

Nonetheless, cuboot-pq2 is the correct one.

Quoted 1 line

the boot sequence doesn't even reach the 'zImage starting' stage. The machine reboots just before it should be printing out 'zImage starting'.

What does it print before it reboots? Try disabling the PCI and localbus setup.

Quoted 1 line

Is there a way I can get more detailed debug to see what's happening?

printf(). :-)

Quoted 1 line

Do settings from bd_info struct override the settings from the DTS file?

Yes.

Quoted 1 line

Also, a lot of the settings passed from u-boot in our 2.6.14 environment are plain wrong eg. wrong memory, wrong processor speed. In this case, the correct settings are set elsewhere (for memory, it is a kernel parameter ie. mem=32M, and the processor speed is set in the 2.6.14 'make menuconfig'). Therefore, the machine still boots into Linux correctly. For 2.6.27, would these incorrect settings be causing my problems?

Yes, if u-boot is providing junk, then you'll probably want to hack up the wrapper to ignore it. Or just upgrade u-boot to one that works. :-)

-Scott

author
#7 lore raw
Quoted 3 lines · Scott Wood <scottwood <at> freescale.com> writes:

Yes, if u-boot is providing junk, then you'll probably want to hack up the wrapper to ignore it. Or just upgrade u-boot to one that works.

Thanks for your advice Scott. Looks like upgrading u-boot will be the easiest way forward.