linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt: bindings: Add a generic ethernet device binding
@ 2016-07-13 10:20 Hans de Goede
  2016-07-14 23:17 ` David Miller
  2016-07-15 20:42 ` Arnd Bergmann
  0 siblings, 2 replies; 10+ messages in thread
From: Hans de Goede @ 2016-07-13 10:20 UTC (permalink / raw)
  To: linux-arm-kernel

On some boards (android tablets) different batches use different sdio
wifi modules. This is not a problem since sdio is a discoverable bus,
so we only need to describe and activate the mmc controller in dt and
then the kernel will automatically load the right driver.

But sometimes it is useful to specify certain ethernet properties for
these "unknown" sdio devices, specifically we want the boot-loader
to be able to set "local-mac-address" as some of these sdio wifi
modules come without an eeprom / without a factory programmed mac
address.

Since the exact device is unknown (differs per batch) we cannot use
a wifi-chip specific compatible. This commit adds a new
"generic,ethernet" binding for use in dt-nodes describing such an
unknown ethernet device.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 Documentation/devicetree/bindings/net/generic.txt | 30 +++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/generic.txt

diff --git a/Documentation/devicetree/bindings/net/generic.txt b/Documentation/devicetree/bindings/net/generic.txt
new file mode 100644
index 0000000..2325709
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/generic.txt
@@ -0,0 +1,30 @@
+* Generic ethernet controller
+
+This binding is for ethernet devices which need a dt node so that certain
+standard properties, e.g. a mac-address can be specified via dt, but
+otherwise can be detected automatically as they are on a discoverable bus.
+
+Required properties:
+- compatible: should be "generic,ethernet"
+
+Optional properties:
+- See bindings/ethernet.txt
+
+Example:
+
+/ {
+	aliases {
+		/* Make u-boot set mac-address for the sdio-wifi (no eeprom) */
+		ethernet0 = &sdio_wifi;
+	};
+};
+
+&mmc1 {
+	non-removable;
+	status = "okay";
+
+	sdio_wifi: sdio_wifi at 1 {
+		compatible = "generic,ethernet"
+		reg = <1>;
+	};
+};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-17  1:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13 10:20 [PATCH] dt: bindings: Add a generic ethernet device binding Hans de Goede
2016-07-14 23:17 ` David Miller
2016-07-15  6:40   ` Hans de Goede
2016-07-15  6:44     ` Hans de Goede
2016-07-15 17:51     ` David Miller
2016-07-16 10:12       ` Hans de Goede
2016-07-17  1:02         ` David Miller
2016-07-15 20:42 ` Arnd Bergmann
2016-07-16 10:18   ` Hans de Goede
2016-07-16 19:19     ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).