Skip to contentSkip to conversation

net: dm9000: Allow instantiation using device tree

PATCH Applied Tomasz Figa 4 participants 4 messages May 20, 2013

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

PATCH v3 1/1 net: dm9000: Allow instantiation using device tree

This patch adds Device Tree support to dm9000 driver.

---

Changes since v2:
- corrected a typo in bindings documentation
- removed redundant error message about failed memory allocation
Changes since v1:
- dropped davicom,simple-phy property as it seems to be of no use
- used of_get_mac_address() to get MAC address from device tree
- replaced #ifdef CONFIG_OF around dm9000_parse_dt() with IS_ENABLED

 .../devicetree/bindings/net/davicom-dm9000.txt     | 26 ++++++++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 drivers/net/ethernet/davicom/dm9000.c              | 42 ++++++++++++++++++++++
 3 files changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/davicom-dm9000.txt
Documentation/devicetree/bindings/net/davicom-dm9000.txt new file +26 -0
new file mode 100644
index 0000000..2d39c99
@@ -0,0 +1,26 @@
+Davicom DM9000 Fast Ethernet controller
+
+Required properties:
+- compatible = "davicom,dm9000";
+- reg : physical addresses and sizes of registers, must contain 2 entries:
+    first entry : address register,
+    second entry : data register.
+- interrupt-parent : interrupt controller to which the device is connected
+- interrupts : interrupt specifier specific to interrupt controller
+
+Optional properties:
+- local-mac-address : A bytestring of 6 bytes specifying Ethernet MAC address
+    to use (from firmware or bootloader)
+- davicom,no-eeprom : Configuration EEPROM is not available
+- davicom,ext-phy : Use external PHY
+
+Example:
+
+	ethernet at 18000000 {
+		compatible = "davicom,dm9000";
+		reg = <0x18000000 0x2 0x18000004 0x2>;
+		interrupt-parent = <&gpn>;
+		interrupts = <7 4>;
+		local-mac-address = [00 00 de ad be ef];
+		davicom,no-eeprom;
+	};
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 6931c43..2fe74e6 100644
@@ -18,6 +18,7 @@ chrp	Common Hardware Reference Platform
 cirrus	Cirrus Logic, Inc.
 cortina	Cortina Systems, Inc.
 dallas	Maxim Integrated Products (formerly Dallas Semiconductor)
+davicom	DAVICOM Semiconductor, Inc.
 denx	Denx Software Engineering
 emmicro	EM Microelectronic
 epson	Seiko Epson Corp.
drivers/net/ethernet/davicom/dm9000.c +42 -0

71 lines not on this page · raw message

Signature · 1 line
1.8.2.1
Reviewed-by on v3 1/1
#2 lore raw
In reply to Tomasz Figa
Quoted 3 lines · Tomasz Figa

This patch adds Device Tree support to dm9000 driver.

Looks good for me aswell, thanks.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |