drivers/amba: create devices from device tree
Subsystems (2)
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
@@ -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
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 theof_platform_populate()function which can callof_amba_device_createbased 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 todriver/of/platform.cso platform and amba devices are created in the same way.
(v4 was posted by Rob Herring)Signed-off-by Jeremy Kerr <[email protected]>Acked-by Linus Walleij <[email protected]>Signed-off-by Rob Herring <rob.herring-bsGFqQB8/[email protected]>Reviewed-by Arnd Bergmann <[email protected]>[grant.likely: add Jeremy's original s-o-b line, changes from review comments, and moved all code to
drivers/of/platform.c]Signed-off-by Grant Likely <grant.likely-s3s/[email protected]>---
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.
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 theof_platform_populate()function which can callof_amba_device_createbased 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 todriver/of/platform.cso platform and amba devices are created in the same way.
(v4 was posted by Rob Herring)Signed-off-by Jeremy Kerr<[email protected]>Acked-by Linus Walleij<[email protected]>Signed-off-by Rob Herring<rob.herring-bsGFqQB8/[email protected]>Reviewed-by Arnd Bergmann<[email protected]>[grant.likely: add Jeremy's original s-o-b line, changes from review
comments, and moved all code todrivers/of/platform.c]
Quoted 7 lines
Signed-off-by Grant Likely<grant.likely-s3s/[email protected]>---
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