arm/versatile: Add device tree support
Subsystems (8)
PATCH 1/1 arm/versatile: Add device tree support
For testing the dt work, define a dt-enabled versatile platform.
This patch adds a new versatile platform for when using the device tree. Add platform and amba devices are discovered and registered by parsing the device tree. Clocks and initial io mappings are still configured statically.
This patch still depends on some static platform_data for a few devices which is passed via the auxdata structure to of_platform_populate(), but it is a viable starting point until the drivers can get all configuration data out of the device tree.
---
Hi Russell,
Assuming you're okay with this, I would like to merge this Versatile board support patch for v3.1. It's not perfect, but it can be changed in place after it is merged and should not break existing versatile board support. In fact I can build a kernel with this that boots in both DT and non-DT configurations; very useful for debug.
It depends on patches in devicetree/next, so I'd like to merge it via the arm-soc tree after devicetree/next gets merged. I'll provide a git branch with the relevant commits if it looks good to you.
g.
Documentation/devicetree/bindings/arm/arm-boards | 20 ++ .../devicetree/bindings/i2c/arm-versatile.txt | 10 + .../devicetree/bindings/mtd/arm-versatile.txt | 8 + .../devicetree/bindings/net/smsc-lan91c111.txt | 10 + arch/arm/boot/dts/versatile-ab.dts | 192 ++++++++++++++++++++ arch/arm/boot/dts/versatile-pb.dts | 48 +++++ arch/arm/mach-versatile/Kconfig | 8 + arch/arm/mach-versatile/Makefile | 1 arch/arm/mach-versatile/core.c | 61 ++++++ arch/arm/mach-versatile/core.h | 2 arch/arm/mach-versatile/versatile_dt.c | 51 +++++ 11 files changed, 411 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/arm-boards create mode 100644 Documentation/devicetree/bindings/i2c/arm-versatile.txt create mode 100644 Documentation/devicetree/bindings/mtd/arm-versatile.txt create mode 100644 Documentation/devicetree/bindings/net/smsc-lan91c111.txt create mode 100644 arch/arm/boot/dts/versatile-ab.dts create mode 100644 arch/arm/boot/dts/versatile-pb.dts create mode 100644 arch/arm/mach-versatile/versatile_dt.c
Documentation/devicetree/bindings/arm/arm-boards new file +20 -0
@@ -0,0 +1,20 @@ +ARM Versatile Application and Platform Baseboards +------------------------------------------------- +ARM's development hardware platform with connectors for customizable +core tiles. The hardware configuration of the Versatile boards is +highly customizable. + +Required properties (in root node): + compatible = "arm,versatile-ab"; /* Application baseboard */ + compatible = "arm,versatile-pb"; /* Platform baseboard */ + +Interrupt controllers: +- VIC required properties: + compatible = "arm,versatile-vic"; + interrupt-controller; + #interrupt-cells = <1>; + +- SIC required properties: + compatible = "arm,versatile-sic"; + interrupt-controller; + #interrupt-cells = <1>;
Documentation/devicetree/bindings/i2c/arm-versatile.txt new file +10 -0
@@ -0,0 +1,10 @@ +i2c Controller on ARM Versatile platform: + +Required properties: +- compatible : Must be "arm,versatile-i2c"; +- reg +- #address-cells = <1>; +- #size-cells = <0>; + +Optional properties: +- Child nodes conforming to i2c bus binding
Documentation/devicetree/bindings/mtd/arm-versatile.txt new file +8 -0
@@ -0,0 +1,8 @@ +Flash device on ARM Versatile board + +Required properties: +- compatible : must be "arm,versatile-flash"; +- bank-width : width in bytes of flash interface. + +Optional properties: +- Subnode partition map from mtd flash binding
Documentation/devicetree/bindings/net/smsc-lan91c111.txt new file +10 -0
@@ -0,0 +1,10 @@ +SMSC LAN91c111 Ethernet mac + +Required properties: +- compatible = "smsc,lan91c111"; +- reg : physical address and size of registers +- interrupts : interrupt connection + +Optional properties: +- phy-device : phandle to Ethernet phy +- local-mac-address : Ethernet mac address to use
arch/arm/boot/dts/versatile-ab.dts new file +192 -0
192 lines not on this page · raw message
arch/arm/boot/dts/versatile-pb.dts new file +48 -0
48 lines not on this page · raw message
arch/arm/mach-versatile/Kconfig +8 -0
@@ -17,4 +17,12 @@ config MACH_VERSATILE_AB Include support for the ARM(R) Versatile Application Baseboard for the ARM926EJ-S. +config MACH_VERSATILE_DT + bool "Support Versatile platform from device tree" + select USE_OF + select CPU_ARM926T + help + Include support for the ARM(R) Versatile/PB platform, + using the device tree for discovery + endmenu
arch/arm/mach-versatile/Makefile +1 -0
@@ -5,4 +5,5 @@ obj-y := core.o obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o +obj-$(CONFIG_MACH_VERSATILE_DT) += versatile_dt.o obj-$(CONFIG_PCI) += pci.o
arch/arm/mach-versatile/core.c +61 -0
86 lines not on this page · raw message
arch/arm/mach-versatile/core.h +2 -0
@@ -23,6 +23,7 @@#define __ASM_ARCH_VERSATILE_H#include <linux/amba/bus.h> +#include <linux/of_platform.h> extern void __init versatile_init (void );extern void __init versatile_init_early (void );
@@ -30,6 +31,7 @@ extern void __init versatile_init_irq(void);extern void __init versatile_map_io (void );extern struct sys_timer versatile_timer;extern unsigned int mmc_status (struct device *dev); +extern struct of_dev_auxdata versatile_auxdata_lookup[];#define AMBA_DEVICE (name,busid,base,plat) \ static struct amba_device name##_device = { \
arch/arm/mach-versatile/versatile_dt.c new file +51 -0
51 lines not on this page · raw message