Skip to contentSkip to conversation

drivers/amba: create devices from device tree

PATCH In review Rob Herring 2 participants 3 messages Jun 10, 2011 – Jun 11, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 drivers/amba: create devices from device tree

Add a function to create amba_devices (i.e. primecell peripherals) from device tree nodes. The device tree scanning is done by the of_platform_populate() function which can call of_amba_device_create based on a match table entry.

Nodes with a "arm,primecell-periphid" property can override the h/w peripheral id value.

Based on the original work by Jeremy Kerr.

v5: - restored Jeremy's original s-o-b line
- changed to using arm,primecell compatible value
- moved all code to driver/of/platform.c so platform and amba devices are created in the same way.
(v4 was posted by Rob Herring)

[grant.likely: add Jeremy's original s-o-b line, changes from review
comments, and moved all code to drivers/of/platform.c]

---

Hey Rob. I took a good look at the patches you posted, and how all this stuff was being done, and it turns out to be a lot less impact if all of it is rolled into driver/of/platform.c. Take a look and let me know what you think.

g.

 .../devicetree/bindings/arm/primecell.txt          |   21 +++++++
 drivers/of/platform.c                              |   58 ++++++++++++++++++++
 2 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/primecell.txt
Documentation/devicetree/bindings/arm/primecell.txt new file +21 -0
new file mode 100644
index 0000000..1d5d7a8
@@ -0,0 +1,21 @@
+* ARM Primecell Peripherals
+
+ARM, Ltd. Primecell peripherals have a standard id register that can be used to
+identify the peripheral type, vendor, and revision. This value can be used for
+driver matching.
+
+Required properties:
+
+- compatible : should be a specific value for peripheral and "arm,primecell"
+
+Optional properties:
+
+- arm,primecell-periphid : Value to override the h/w value with
+
+Example:
+
+serial@fff36000 {
+	compatible = "arm,pl011", "arm,primecell";
+	arm,primecell-periphid = <0x00341011>;
+};
+
drivers/of/platform.c +58 -0

76 lines not on this page · raw message

#1 lore raw

On Fri, Jun 10, 2011 at 5:26 PM, Rob Herring <grant.likely-s3s/[email protected]> wrote:

                                 ^^^^^^^^^^^

Hmmm, that was odd. stgit plays strange games when sending patches sometimes.

g.

Quoted 31 lines

Add a function to create amba_devices (i.e. primecell peripherals) from device tree nodes. The device tree scanning is done by the of_platform_populate() function which can call of_amba_device_create based on a match table entry.

Nodes with a "arm,primecell-periphid" property can override the h/w peripheral id value.

Based on the original work by Jeremy Kerr.

v5: - restored Jeremy's original s-o-b line
   - changed to using arm,primecell compatible value
   - moved all code to driver/of/platform.c so platform and amba devices are created in the same way.
(v4 was posted by Rob Herring)

[grant.likely: add Jeremy's original s-o-b line, changes from review comments, and moved all code to drivers/of/platform.c]

---

Hey Rob.  I took a good look at the patches you posted, and how all this stuff was being done, and it turns out to be a lot less impact if all of it is rolled into driver/of/platform.c.  Take a look and let me know what you think.

g.

#2 lore raw
In reply to Rob Herring
Quoted 22 lines · Rob Herring

Add a function to create amba_devices (i.e. primecell peripherals) from device tree nodes. The device tree scanning is done by the of_platform_populate() function which can call of_amba_device_create based on a match table entry.

Nodes with a "arm,primecell-periphid" property can override the h/w peripheral id value.

Based on the original work by Jeremy Kerr.

v5: - restored Jeremy's original s-o-b line
- changed to using arm,primecell compatible value
- moved all code to driver/of/platform.c so platform and amba devices are created in the same way.
(v4 was posted by Rob Herring)

[grant.likely: add Jeremy's original s-o-b line, changes from review
comments, and moved all code to drivers/of/platform.c]

Quoted 7 lines

---

Hey Rob. I took a good look at the patches you posted, and how all this stuff was being done, and it turns out to be a lot less impact if all of it is rolled into driver/of/platform.c. Take a look and let me know what you think.

Looks good. I will test it out on my tree.

Rob