Device Tree for Android - Linaro Connect 11Q4

Registered by Zach Pfeffer

In this session we will talk about device tree on Android.

Description
------------------
Linaro has a goal of creating a single runtime image that can run across SoC hardware. The Android team is supporting this effort by using a common Linaro Android tree as a base for all our trees and working to unify all the SoC trees into one. Once unification is done, device tree will allow us to re-factor basic support that was once compile time configurable into runtime configurable options. Having this support on Android early will help us towards this goal and ensure that our kernels can boot as device tree becomes more widespread.

Linaro Kernel WG and OCTO have worked on getting Device Tree support accepted into the mainline kernel, and initial support for all recent member SoCs is available. Ubuntu images are already using Device Tree; the next logical step is to make Device Tree be used by default in Linaro's Android LEBs.

This feature requires improvements to the Linaro Android builds to enable production of binary flattened device trees as part of the platform build. Also required is updating installation tools and u-boot to ensure that the FDT is used during the boot process as needed. Additional fixes in Android-specific kernel and driver code may be required.

Acceptance Criteria
-------------------------------
1. LEB Android builds come with u-boot and kernel that have device tree support enabled
2. LEB Android builds include appropriate flattened device tree in the 'boot' artifact
3. Installing LEB images using linaro-android-media-create will yield an image with device tree being used by u-boot and kernel

Agenda
------------
1. A brief introduction for the device tree. - 5 minutes.
2. Describe the structure of the device tree, and show some examples. - 10 minutes.
3. Summarize the benefits if we use device tree. - 5 minutes.
4. Raise questions, collect answers and discuss actions. - 25 minutes.

Goal of this Session
-----------------------------
1. Let people and myself to know more about the device tree.
2. Discuss how to implement the device tree on Linaro Android images.
3. Create work items to the relevant people, then we will know what should be done and who will take the responsibilities for that.

Blueprint information

Status:
Complete
Approver:
Zach Pfeffer
Priority:
Essential
Drafter:
Botao
Direction:
Needs approval
Assignee:
Botao
Definition:
Approved
Series goal:
Proposed for 2011q2
Implementation:
Implemented
Milestone target:
None
Started by
Botao
Completed by
Botao

Related branches

Sprints

Whiteboard

[botao, 29th November 2011]: Because this blueprint is created for the Linaro Connect 11Q4, so I will mark it as implemented.

[botao, 10th November 2011]: The new blueprint for device tree in 11.11 release cycle has been created here: https://blueprints.launchpad.net/linaro-android/+spec/linaro-android-origen-device-tree

[botao, 10th November 2011]: This is the feedback which Tony Mansson got from landing teams:

Botao,

I'm not sure what you mean by kick-off. I asked the landing team for status immediately, and this is what I have received so far.

a) Device tree support in the LT kernels?
b) Completeness of .dts files for all Linaro supported boards?

2011-11-02 ARM Ryan Harkin
David Martin is working on this for ARM and we've not seen anything of
it. I'm going to talk to David this week, but haven't done so yet. So
we currently have nothing, but the work is in progress

2011-11-02 ST-Ericsson Lee Jones
As far as I know it doesn’t exist in Snowball.
Your best bet is to ask the Kernel WG, as they are the one implementing it.

2011-11-02 Samsung Angus Ainsley
Thomas Abraham has upstreamed the initial support for DT. As part of
our upleveling to 3.1 we will be bringing in some of those patches
into the ubuntu kernel first and then those patches will be puhsed out
to our android kernel. I haven't looked at it recently but I believe that Thomas has a
correct dts file for all of the components that he has upstreamed.

A comment to ST-Ericsson's reply is that Niklas Heareaus from ST-Ericsson who is working with this in the Kernel group is here. I don't think that he has any tangible result yet.

[pfefferz, 7th November 2011]: Botao, please create a new BP for 11.11 that tracks what part of DT you're going to finish in 11.11.

[botao, 2nd November 2011]: Presentation was launched at GRAND SIERRA G, and you can get the slides here:
https://docs.google.com/presentation/d/1VrLStAboq6L7xaVr2d-bKBBTMd5onbykiRQRENMJWno/edit

[botao, 31st October 2011]: Let me add some useful documents and links here, and I'm reading them now.

1. devicetree.org: http://devicetree.org/Main_Page

2. Power ePAPR v1.0: https://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf

3. Device Tree Usage on the devicetree.org: http://devicetree.org/Device_Tree_Usage

4. Device Tree description on eLinux.org: http://elinux.org/Device_Trees

5. ELCE: Grant Likely on device tree: http://lwn.net/Articles/414016/

[botao, 24th October 2011]: Can't access the content of this link without user name and password: https://linaro.papyrs.com/page/4112/ANDROID2011-FDT-LEB

Notes from session:
Integrate Device Tree on Android
Ubuntu is already using DT

AI: Botao: Post DT presentation

Questions:
1. Who writes the DT file?
Prefer LT to write file
AI: Tony: Talk to each LT

2. Where should we put it?
/boot/dts
/boot/dtb

Shachaen Kamut: Fastboot support for DT flashing
AI: Zach: Look at Fastboot

3. Final statement, binary or text file
Two ways
    Attach DT blob
    Attach to uImage
AI: botao: Android specific

Bero: Is DT in /sys or /proc?

AI: Tony: Ask each kernel team to turn this on

AI: Botao: Talk to Ricardo about Ubuntu DT

7. One image with many different dtbs?

AI: botao: talk to Grant about dtb switching at runtime
2 years out

8. How does the kernel know

The bootloader can do the switch

Compile the bootloader

AI: botao: Ask linaro-image-tools if can pass dtb into, hwpack
Can linaro-android-media-create
Use Ubuntu hwpacks with
start and stop machine

AI: Zach: Ubuntu running on "Android" kernel
AI: Zach: Spin up a session for Ubuntu on

(?)

Work Items