stmmac: Add device-tree support
Subsystems (5)
PATCH v3 1/1 stmmac: Add device-tree support
This patch adds support to configure the STMMAC ethernet driver via device-tree instead of platform_data.
Currently, only the properties needed on SPEAr600 are provided. All other properties should be added once needed on other platforms.
---
v3:
- Fixed return value (removed ERR_PTR)
- Changed "gmac0: stmmac@e0800000" to "gmac0: ethernet@e0800000"
- Removed phy-addr for real from code
- Fixed indentation issue
v2:
- Renamed stm -> st
- Renamed compatible to "st,spear600-gmac"
- Removed "prog-burst-len", "had-gmac", has-pmt" properties. They are now implicitly set for "st,spear600-gmac" compatible devices.
- Removed phy-addr
- Used "if (pdev->dev.of_node)" to distinguish between DT and non-DT version instead of #ifdef
Documentation/devicetree/bindings/net/stmmac.txt | 28 ++++++++ .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 74 +++++++++++++++++++- 2 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/stmmac.txt
Documentation/devicetree/bindings/net/stmmac.txt new file +28 -0
@@ -0,0 +1,28 @@ +* STMicroelectronics 10/100/1000 Ethernet driver (GMAC) + +Required properties: +- compatible: Should be "st,spear600-gmac" +- reg: Address and length of the register set for the device +- interrupt-parent: Should be the phandle for the interrupt controller + that services interrupts for this device +- interrupts: Should contain the STMMAC interrupts +- interrupt-names: Should contain the interrupt names "macirq" + "eth_wake_irq" if this interrupt is supported in the "interrupts" + property +- phy-mode: String, operation mode of the PHY interface. + Supported values are: "mii", "rmii", "gmii", "rgmii". + +Optional properties: +- mac-address: 6 bytes, mac address + +Examples: + + gmac0: ethernet@e0800000 { + compatible = "st,spear600-gmac"; + reg = <0xe0800000 0x8000>; + interrupt-parent = <&vic1>; + interrupts = <24 23>; + interrupt-names = "macirq", "eth_wake_irq"; + mac-address = [000000000000]; /* Filled in by U-Boot */ + phy-mode = "gmii"; + };
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +72 -2
112 lines not on this page · raw message
Signature · 1 line
1.7.9.2
From: Stefan Roese <[email protected]>
Date: Tue, 13 Mar 2012 15:56:37 +0100
Quoted 8 lines
This patch adds support to configure the STMMAC ethernet driver via device-tree instead of
platform_data.Currently, only the properties needed on SPEAr600 are provided. All other properties should be added once needed on other platforms.
Signed-off-by Stefan Roese <[email protected]>Cc Giuseppe Cavallaro <[email protected]>
Applied, thanks.