Difference between revisions of "Device-tree documentation project"

From eLinux.org
Jump to: navigation, search
(fix a few sentences)
Line 7: Line 7:
 
== Description ==
 
== Description ==
 
The [[Device Tree]] is a relatively new (for ARM Linux) framework
 
The [[Device Tree]] is a relatively new (for ARM Linux) framework
for specifying hardware that a Linux kernel should support for a
+
for specifying the hardware configuration of a board to the Linux Kernel.
particular board.  New device drivers for many embedded products
+
New device drivers for many embedded products are always being
are being produced, and it is strongly encouraged that new drivers
+
produced, and it is strongly encouraged that new drivers
 
and the board support for new ARM boards use device tree as part
 
and the board support for new ARM boards use device tree as part
 
of their driver configuration.  However, some areas of the device
 
of their driver configuration.  However, some areas of the device
Line 25: Line 25:
  
 
Many documents exist which describe the syntax of the device tree,
 
Many documents exist which describe the syntax of the device tree,
(such as the epar document).
+
(such as the epar document, the device-tree wiki and the usage
 +
document in the kernel Documentation directory).  However, some
 +
details are missing from these documents, and in some cases the
 +
explicit practices for working with device tree in the Linux
 +
kernel are different or have evolved from when these original
 +
documents were written.
  
 
The output from this effort would be a readily-accessible document.
 
The output from this effort would be a readily-accessible document.
 
It would probably make sense to put the document in the kernel source
 
It would probably make sense to put the document in the kernel source
tree, under Documentation/devicetree.
+
tree, under Documentation/devicetree.  Failing that, the document
 +
could be placed on the elinux wiki or the device tree wiki.
  
 
== Issues ==
 
== Issues ==
Line 50: Line 56:
 
(If these are already answered by the epar document, please cite the section:)
 
(If these are already answered by the epar document, please cite the section:)
  
1. What is a phandle?  How is it used? What rules are there for defining them?
+
1. What is a phandle?  How is it used? What rules are there for defining them?  For referencing them?
  
 
2. How are #foo-cells used?
 
2. How are #foo-cells used?
Line 56: Line 62:
 
3. What are the rules for naming attributes?  when should vendor qualifiers be used and when not?
 
3. What are the rules for naming attributes?  when should vendor qualifiers be used and when not?
  
4. How does device-tree interact with device instantiation - when is the device node created?, who creates it, when is the initcall called?  when is the probe function called?
+
4. How does device-tree interact with device instantiation - when is the device node created?, who creates it, when is the initcall called?  when is the probe function called?
  
5. How does device-tree interact with platform/bus instantiation?
+
5. How does device-tree interact with platform/bus instantiation? Do buses instantiate their children device nodes, or does the probe routine do this?
  
 
6. what is the kernel API for interacting with device-tree?  What things are parsed automatically, vs. require manual (coded) parsing?
 
6. what is the kernel API for interacting with device-tree?  What things are parsed automatically, vs. require manual (coded) parsing?

Revision as of 12:07, 18 September 2013

Device-tree documentation project

Summary
Device-tree documentation project
Proposer
Tim Bird, Sony Mobile

Description

The Device Tree is a relatively new (for ARM Linux) framework for specifying the hardware configuration of a board to the Linux Kernel. New device drivers for many embedded products are always being produced, and it is strongly encouraged that new drivers and the board support for new ARM boards use device tree as part of their driver configuration. However, some areas of the device tree bindings are non-uniform and not well-documented.

This project would consist of documenting aspects of the device tree system that would be useful for:

  • board support developers (board/platform developers)
  • device driver developers
  • kernel sub-system maintainers

Kernel sub-system maintainers would be well-served by a document describing "rules", guidelines and best practices for device tree bindings.

Many documents exist which describe the syntax of the device tree, (such as the epar document, the device-tree wiki and the usage document in the kernel Documentation directory). However, some details are missing from these documents, and in some cases the explicit practices for working with device tree in the Linux kernel are different or have evolved from when these original documents were written.

The output from this effort would be a readily-accessible document. It would probably make sense to put the document in the kernel source tree, under Documentation/devicetree. Failing that, the document could be placed on the elinux wiki or the device tree wiki.

Issues

Some areas of device tree bindings (and driver infrastructure) are in flux (e.g. pinctrl, dma). Would it be better to wait until these areas have settled down?

Related work

Some questions to answer

Here are some possible questions that this documentation could address: (If these are already answered by the epar document, please cite the section:)

1. What is a phandle? How is it used? What rules are there for defining them? For referencing them?

2. How are #foo-cells used?

3. What are the rules for naming attributes? when should vendor qualifiers be used and when not?

4. How does device-tree interact with device instantiation - when is the device node created?, who creates it, when is the initcall called? when is the probe function called?

5. How does device-tree interact with platform/bus instantiation? Do buses instantiate their children device nodes, or does the probe routine do this?

6. what is the kernel API for interacting with device-tree? What things are parsed automatically, vs. require manual (coded) parsing?

Scope

A rough guess of the amount of work required for this document is approximately 3 months (12 person-weeks).

Contractor Candidates

  • Jonathan Corbet (output could also be part of LDD4??)
  • Thomas Petazzoni - is presenting a tutorial on device tree at ELCE
  • one of the device-tree maintainers? (Grant, Stephen, Mark, etc.)

Comments