Skip to contentSkip to conversation

the question about the Flat Device Tree on MPC8360?

U-Boot-Users 郭劲 3 participants 4 messages Mar 3, 2008 – Mar 5, 2008 PowerPC

lore
Share & tools
lore

郭劲

author
#0 lore raw

HI, friends.

I want to update my linux version from 2.6.11 to 2.6.22 on MPC8360 board, I
always fail when the linux version is about 2.6.11. Someone told me that I need to build the Flat Device Tree. I see that the U-boot-1.2.0 has one FDT command, but I did not know how to use this command and how to use the Flat Device Tree.
I once see a document from freescale that the FDT file need tftp download to DDR
memory first then bootm the linux. What's that FDT file? how can i get it? which DDR address that I need to tftp download?
What is the FDT? Could someone teach me? Thanks.

#1 lore raw
Quoted 10 lines · ??

HI, friends.

I want to update my linux version from 2.6.11 to 2.6.22 on MPC8360 board, I
always fail when the linux version is about 2.6.11. Someone told me that I need to build the Flat Device Tree. I see that the U-boot-1.2.0 has one FDT command, but I did not know how to use this command and how to use the Flat Device Tree.
I once see a document from freescale that the FDT file need tftp download to DDR
memory first then bootm the linux. What's that FDT file? how can i get it? which DDR address that I need to tftp download?
What is the FDT? Could someone teach me? Thanks.

Hi ??,

u-boot 1.2.0's support of FDT is crude. Upgrade to the tip o' the tree (1.3.2rc3), or at least to 1.3.1.

The flattened device tree (FDT) is a method of passing hardware configuration information to the kernel. It is described in the kernel documentation directory/file:
./Documentation/powerpc/booting-without-of.txt

You need a recent kernel, 2.6.22 probably is OK. I'm running 2.6.25rc3 (tip 'o the tree as of a week or so ago).

I have a mpc8360emds eval board, so I configure the kernel:

   $ make mpc836x_mds_defconfig
and build it
   $ make

You can find example device tree source (.dts) files for the device trees in the kernel directory:
./arch/powerpc/boot/dts

You need to compile your .dts (source) file into a .dtb (binary) using the dtc (device tree compiler). After building the kernel, you will find dtc in:
./arch/powerpc/boot/dtc

Copy your kernel, *.dtb, and ramdisk (as appropriate). I'm using the ramdisk from ELDK
eldk/ppc_6xx/images/uRamdisk
...and boot away. Addresses are fairly arbitrary, just have to make sure you don't overwrite things.

Boot log:
---------
=> set serverip 192.168.47.8 ; set ipaddr 192.168.47.214

=> setenv fdtaddr 400000 ; setenv fdtfile mpc8360emds/mpc836x_mds.dtb ; setenv loadaddr 200000 ; setenv uboot mpc8360emds/u-boot.bin ; setenv bootfile mpc8360emds/uImage ; setenv ramdiskaddr 1000000 ; setenv ramdiskfile mpc8360emds/uRamdisk

=> tftp $ramdiskaddr $ramdiskfile ; tftp $fdtaddr $fdtfile ; tftp $loadaddr $bootfile

UEC: PHY is Marvell 88E11x1 (1410cc2)
FSL UEC0: Full Duplex
switching to rgmii 100
FSL UEC0: Speed 100BT
FSL UEC0: Link is up
Using FSL UEC0 device
TFTP from server 192.168.47.8; our IP address is 192.168.47.214 Filename 'mpc8360emds/uRamdisk'.
Load address: 0x1000000
Loading: T #################################################################

          #####################################################

done
Bytes transferred = 1731966 (1a6d7e hex)
Using FSL UEC0 device
TFTP from server 192.168.47.8; our IP address is 192.168.47.214 Filename 'mpc8360emds/mpc836x_mds.dtb'.
Load address: 0x400000
Loading: #
done
Bytes transferred = 12288 (3000 hex)
Using FSL UEC0 device
TFTP from server 192.168.47.8; our IP address is 192.168.47.214 Filename 'mpc8360emds/uImage'.
Load address: 0x200000
Loading: #################################################################

          ##########################

done
Bytes transferred = 1329289 (144889 hex)
=> bootm $loadaddr $ramdiskaddr $fdtaddr
## Booting image at 00200000 ...

    Image Name:   Linux-2.6.25-rc3-00001-g5fb74e4-
    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
    Data Size:    1329225 Bytes =  1.3 MB

Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at 01000000 ...

    Image Name:   Simple Embedded Linux Framework
    Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
    Data Size:    1731902 Bytes =  1.7 MB
    Load Address: 00000000
    Entry Point:  00000000
    Verifying Checksum ... OK
    Booting using the fdt at 0x400000
    Loading Ramdisk to 0fdfa000, end 0ffa0d3e ... OK

Using MPC836x MDS machine description
Linux version 2.6.25-rc3-00001-g5fb74e4-dirty (vanbaren at dellserver) (gcc version
4.0.0 (DENX ELDK 4.1 4.0.0)) #1 Mon Feb 25 20:38:46 EST 2008
Found initrd at 0xcfdfa000:0xcffa0d3e
console [udbg0] enabled
setup_arch: bootmem
mpc836x_mds_setup_arch()
Found MPC83xx PCI host bridge at 0x00000000e0008500. Firmware bus
number: 0->0
PCI host bridge /pci at e0008500 (primary) ranges:
MEM 0x00000000a0000000..0x00000000afffffff -> 0x00000000a0000000 MEM 0x0000000080000000..0x000000008fffffff -> 0x0000000080000000 Prefetch
IO 0x00000000e2000000..0x00000000e20fffff -> 0x0000000000000000
arch: exit
Zone PFN ranges:
DMA 0 -> 65536
Normal 65536 -> 65536
Movable zone start PFN for each node
early_node_map[1] active PFN ranges

     0:        0 ->    65536

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024 Kernel command line:
IPIC (128 IRQ sources) at fddf3700
PID hash table entries: 1024 (order: 10, 4096 bytes)
clocksource: timebase mult[3c9b26d] shift[22] registered Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 254968k/262144k available (2628k kernel code, 6832k reserved, 116k data,
92k bss, 148k init)
SLUB: Genslabs=12, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1 Mount-cache hash table entries: 512
net_namespace: 156 bytes
NET: Registered protocol family 16

PCI: Probing PCI hardware
SCSI subsystem initialized
NET: Registered protocol family 2
Time: timebase clocksource has been installed.
IP route cache hash table entries: 2048 (order: 1, 8192 bytes) TCP established hash table entries: 8192 (order: 4, 65536 bytes) TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 1691k freed
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Generic RTC Driver v1.07
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 18) is a 16550A
console
handover: b
oot [udbg0] -> real [ttyS0]
serial8250.0: ttyS1 at MMIO 0xe0004600 (irq = 19) is a 16550A
brd: module loaded
loop: module loaded
UCC Ethernet Controller MII Bus: probed
ucc_geth: QE UCC Gigabit Ethernet Controller
ucc_geth: UCC1 at 0xe0102000 (irq = 22)
ucc_geth: UCC2 at 0xe0103000 (irq = 23)
i2c /dev entries driver
proc_dir_entry 'rtc' already registered

Call Trace:

[snip a traceback]
rtc-ds1374 0-0068: rtc core: registered rtc-ds1374 as rtc0 WDT driver for MPC83xx initialized. mode:reset timeout=65535 (16 seconds) TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
rtc-ds1374 0-0068: setting system clock to 1971-09-14 13:42:23 UTC (53703743)
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 148k init
init started: BusyBox v1.7.1 (2008-02-21 07:55:43 CET) starting pid 732, tty '': '/etc/rc.sh'
/etc/rc.sh: line 5: cannot create /etc/mtab: Read-only file system starting pid 737, tty '': '/bin/application'
### Application running ...
starting pid 739, tty '': '/bin/sh'
~ #

HTH,
gvb

#2 lore raw
Quoted 22 lines · Jerry Van Baren
Quoted 10 lines · ??

HI, friends.

I want to update my linux version from 2.6.11 to 2.6.22 on MPC8360 board, I
always fail when the linux version is about 2.6.11. Someone told me that I need to build the Flat Device Tree. I see that the U-boot-1.2.0 has one FDT command, but I did not know how to use this command and how to use the Flat Device Tree.
I once see a document from freescale that the FDT file need tftp download to DDR
memory first then bootm the linux. What's that FDT file? how can i get it? which DDR address that I need to tftp download?
What is the FDT? Could someone teach me? Thanks.

Hi ??,

u-boot 1.2.0's support of FDT is crude. Upgrade to the tip o' the tree (1.3.2rc3), or at least to 1.3.1.

The flattened device tree (FDT) is a method of passing hardware configuration information to the kernel. It is described in the kernel documentation directory/file:
./Documentation/powerpc/booting-without-of.txt

Quoted 7 lines

You need a recent kernel, 2.6.22 probably is OK. I'm running 2.6.25rc3 (tip 'o the tree as of a week or so ago).

I have a mpc8360emds eval board, so I configure the kernel:

   $ make mpc836x_mds_defconfig
and build it
   $ make

I forgot to mention, with the tip 'o the kernel tree and the ELDK 4.1 (4.2rc), the kernel compile breaks on an unrecognized register due to CONFIG_FSL_EMB_PERFMON. I have not succeeded in chasing down the cause yet, so I simply commented it out:

arch/powerpc/kernel/pmc.c +1 -1
index 0516e2d..e26e63a 100644
@@ -26,7 +26,7 @@
 
  static void dummy_perf(struct pt_regs *regs)
  {
-#if defined(CONFIG_FSL_EMB_PERFMON)
+#if 0 //gvb// defined(CONFIG_FSL_EMB_PERFMON)
         mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE);
  #elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
  	if (cur_cpu_spec->pmc_type == PPC_PMC_IBM)

Best regards,
gvb

#3 lore raw

Jerry,

everybody running an MPC83xx should habe this problem with the latest kernel.

"FSL_EMB_PERFMON" will be selected automatically as soon as you chose a mpc83xx platform. It's a "select FSL_EMB_PERFMON" in arch/powerpc/platforms/Kconfig ...

mtpmr is not a valid instruction on MPC834x.

http://www.freescale.com/files/32bit/doc/ref_manual/MPC8349EARMAD.pdf

7.3.2.2, 7-27Removed last bullet and sub-bullets concerning performance monitor instructions(mfmpr and mtmpr); these instructions are not supported on this device.

Maybe Kumar can fix the Kconfig along with pmc.c.

regards,
Andr? Schwarz

Quoted 52 lines · Jerry Van Baren
Quoted 21 lines · Jerry Van Baren
Quoted 10 lines · ??

HI, friends.

I want to update my linux version from 2.6.11 to 2.6.22 on MPC8360 board, I
always fail when the linux version is about 2.6.11. Someone told me that I need to build the Flat Device Tree. I see that the U-boot-1.2.0 has one FDT command, but I did not know how to use this command and how to use the Flat Device Tree.
I once see a document from freescale that the FDT file need tftp download to DDR
memory first then bootm the linux. What's that FDT file? how can i get it? which DDR address that I need to tftp download?
What is the FDT? Could someone teach me? Thanks.

Hi ??,

u-boot 1.2.0's support of FDT is crude. Upgrade to the tip o' the tree (1.3.2rc3), or at least to 1.3.1.

The flattened device tree (FDT) is a method of passing hardware configuration information to the kernel. It is described in the kernel documentation directory/file:
./Documentation/powerpc/booting-without-of.txt

Quoted 7 lines

You need a recent kernel, 2.6.22 probably is OK. I'm running 2.6.25rc3 (tip 'o the tree as of a week or so ago).

I have a mpc8360emds eval board, so I configure the kernel:

   $ make mpc836x_mds_defconfig
and build it
   $ make

I forgot to mention, with the tip 'o the kernel tree and the ELDK 4.1 (4.2rc), the kernel compile breaks on an unrecognized register due to CONFIG_FSL_EMB_PERFMON. I have not succeeded in chasing down the cause yet, so I simply commented it out:

arch/powerpc/kernel/pmc.c +1 -1
index 0516e2d..e26e63a 100644
@@ -26,7 +26,7 @@
 
  static void dummy_perf(struct pt_regs *regs)
  {
-#if defined(CONFIG_FSL_EMB_PERFMON)
+#if 0 //gvb// defined(CONFIG_FSL_EMB_PERFMON)
         mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE);
  #elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
  	if (cur_cpu_spec->pmc_type == PPC_PMC_IBM)

Best regards,
gvb

Quoted 8 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

MATRIX VISION GmbH, Talstra?e 16, DE-71570 Oppenweiler - Registergericht: Amtsgericht Stuttgart, HRB 271090 Gesch?ftsf?hrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner