Skip to main content.
Navigation:
DENX
>
U-Boot
>
UBootFdtInfo
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
U-Boot
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
U-Boot Home
Documentation
Source Code
The Custodians
Custodian Repositories
Development Process
Release Cycle
Coding Style
Patches
Tasks
Contacts
Changes
Index
List of pages in U-Boot
Search
---+!! Flattened Device Tree The mandate of the Flattened Device Tree custodian repository is to improve fdt "blob" support in u-boot. It does this by adapting David Gibson's libfdt for use in u-boot and adds a =fdt= command to allow easy manipulation of "fdt blobs." --- %TOC% ---++ Branches / Patches Queued for the Next Window ---++ =libfdt= Checking for libfdt patches 1 Clone the dtc * =git clone git://git.jdl.com/software/dtc.git= 1 Find all changes in the libfdt/ subdirectory * =git log libfdt/= 1 Find all the =libfdt/= patchset hashes * =git log libfdt/ | awk '/^commit/ {print $2}'= ---+++ <nop>ToDo - =libfdt= Ongoing: Catch up with =dtc= (=libfdt/*= to be slightly more explicit). * Upstream libfdt patchsets applied to the v2011.09 release: * 0329-Support-ePAPR-compliant-phandle-properties.patch * DTC commit: d75b33af676d0beac8398651a7f09037555a550b * U-Boot commit 05a22ba096fb996bb69ab020a8d08aafac2c28ba * 0344-libfdt-Implement-property-iteration-functions.patch * DTC commit 73dca9ae0b9abe6924ba640164ecce9f8df69c5a * U-Boot commit d1c6314887c4d6712f7bd9ba7428b6517e7732e0 * =Fix-a-possible-overflow-case-detected-by-gcc-4.3.2.patch= - This upstream patch was applied to u-boot: <blockquote> <verbatim> commit 13d93f38e86818739317b0206d597265cf9e675e Author: Emil Medve <Emilian.Medve@Freescale.com> Date: Mon Feb 23 10:43:36 2009 -0600 </verbatim> </blockquote> ---++ Outstanding Patches ---++ <nop>ToDo 1 For =fdt addr=, enhance to implement "fdt addr X +Y", where "Y" is the number of additional bytes to _add_ to the blob. 1 Suggestion from Timur: <blockquote>\ If the device tree is wrapped in a uimage (a 'dtu'), then the hdr->ih_load field contains the location where the device tree should be copied. If that value is zero, bad things happen. So I have two suggestions: <ol>\ <li> If the value is zero, report an error and stop\ <li> If the value is zero, assume the user doesn't want the device tree to be copied, and the code should fill it in with the current location of the device tree.</ol> I like option #2 better, because then I don't have to hard-code an address into the dtu.</blockquote> 1 Save and load the blob to flash (likely after env space) * Add a CRC a'la env * Add a backup version a'la env 1 Proposed additional =fdt= commands * =merge= - merge two trees. Need a conflict resolution: source tree #1 has priority? * David Gibson has talked about creating a "[[http://article.gmane.org/gmane.linux.ports.ppc64.devel/35740][graft]]" function for libfdt. * =load= - load from flash * Not needed, see =fdt move= (but non-memory mapped storage such as NAND flash won't work with =fdt move=) * =save= - save to flash * =cp= should handle this already * =header= - print useful blob info like validity, version, total and used reserved slots, extra space, presence of <NOP> filling(?), etc. * Kumar submitted a patch to print the header info... some additional info showing extra space would be useful. NOTE: Grant Likely has adapted =libfdt= for the 5xxx family, his methodology is the recommended template. ---++ Background Information on Flattened Device Trees 1275 spec: * http://playground.sun.com/pub/1275/coredoc/1275-1994/1275.ps.gz Power.org™ Standard for Embedded Power Architecture™ Platform Requirements (ePAPR) * https://www.power.org/documentation/epapr-version-1-1/ %BR% (registration needed) !PowerPC processor binding: * http://playground.sun.com/1275/bindings/ppc/release/ppc-2_1.html booting-without-of.txt * In the kernel source tree under =Documentation/powerpc=) - Describes the flat device tree as it is used in the Linux kernel. Device Trees Everywhere-- paper by David Gibson and Ben Herrenschmidt-- an overview of the concept * http://ozlabs.org/~dgibson/home/papers/dtc-paper.pdf PCI Bus binding: * http://playground.sun.com/1275/bindings/pci/pci2_1.pdf USB Bus binding: * http://playground.sun.com/1275/bindings/usb/usb-1_0.ps CHRP Binding: * http://playground.sun.com/1275/bindings/chrp/chrp1_8a.ps * (I think some things we may use like interrupt controller device types came from here) 64-bit extension: * http://playground.sun.com/1275/bindings/64bitx/12756d5.ps Interrupt mappings ( very important ): * http://playground.sun.com/1275/practice/imap/imap0_9d.html Misc device types (network, RTC, sound, etc) * http://playground.sun.com/1275/practice/devicex/dse1_0a.html ---++ Notes ---+++ All Your Base are Belong to Us ...aka some more git usage... <pre><tt>\ # See what branch I'm on (it happens to be master) git branch # Switch to my "sync with Wolfgang" branch (use -b the first time) git checkout uboot # Pull the latest u-boot.git (supreme master) changes into my uboot branch git pull git://www.denx.de/git/u-boot.git # Switch back to my master branch (where my pending changes are/would be) git checkout master # Rebase against u-boot.git latest git rebase uboot # Want to see what Kumar Gala is cooking with libfdt - start a new branch git checkout -b galak # Pull Kumar's libfdt branch git pull git://git.kernel.org/pub/scm/boot/u-boot/galak/u-boot.git libfdt # See what the changes are git diff master # Visual version gitk # Rebase against the master (which was rebased against Wolfgang's supreme # master), our (Kumar's) changes are now against the master. git rebase master </pre></tt> ---+++ Testing (not fdt-specific) * See DENX Universal Test System ([[http://git.denx.de/?p=duts.git;a=summary][DUTS]]) * Debian python pexpect and pyserial packages: * python-pexpect - http://pexpect.sourceforge.net/pexpect.html * python-serial - http://pyserial.sourceforge.net/ <pre> >>> import serial >>> ser = serial.Serial(0, 115200, timeout=100, parity=serial.PARITY_NONE, rtscts=0) >>> ser.write("help\n") >>> ser.inWaiting() 2304L >>> s=ser.read(2304) >>> print s help ? - alias for 'help' askenv - get environment variables from stdin : : version - print monitor version => >>> ser.write("help\n") >>> s = ser.read(100) >>> print s help ? - alias for 'help' askenv - get environment variables from stdin autoscr - run scri >>> s = ser.readline() >>> print s pt from memory >>> s = ser.readline() >>> print s base - print or set address offset </pre>