[RFC PATCH v2] net: dm9000: add support for device tree probing

Jamie Iles jamie at jamieiles.com
Tue Aug 16 00:21:16 EST 2011


Hi Daniel,

On Sun, Aug 14, 2011 at 07:34:12PM +0200, Daniel Morsing wrote:
> This patch adds support for probing the dm9000 driver through device
> trees.
> 
> The patch works by supplying its own platform_data struct when probed
> via device tree. This allows us to rely on the existing options parsing
> in the driver and avoid ifdeffery in the probe function.
> 
> Signed-off-by: Daniel Morsing <daniel.morsing at gmail.com>
> ---
> Currently there are no users of this functionality, but once support for
> DT on OMAP3 matures, I plan to migrate the devkit8000 board to DT.
> 
>  Changes since v1:
> 	- Changed the binding with input from Grant Likely.
> 	- Make explicit what the bindings do instead of refering
> 	  to linux specific flags.
> 	- Length check the mac address read so we don't copy random data.
> 	- simplify parsing of the device tree.
> 	- Add relevant driver maintainers to CC (sorry about that)
> 
>  Documentation/devicetree/bindings/net/dm9000.txt |   42 +++++++++++
>  drivers/net/dm9000.c                             |   83 +++++++++++++++++++++-
>  2 files changed, 122 insertions(+), 3 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/dm9000.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/dm9000.txt b/Documentation/devicetree/bindings/net/dm9000.txt
> new file mode 100644
> index 0000000..cbbdb3d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/dm9000.txt
> @@ -0,0 +1,42 @@
> +Davicom DM9000 ethernet controller
> +
> +Required properties:
> +
> + - compatible : Should be "davicom,dm9000"
> +
> + - interrupts : Interrupt controller specific encoding, which specifies 1
> +   or 2 interrupts. The first interrupt is for rx/tx and is required by the
> +   driver to function. The second interrupt is for wake on lan support
> +   and is optional.
> +
> + - reg : 2 Physical address specifiers, where the first specifies the address
> +   register of device, and the second specifies the data register of the device
> +
> +Optional properties:
> +
> + - local-mac-address : Binary data specifying a mac address override
> +
> + - reg-io-width : one cell specifying the width of IO operations in bits.
> +   valid values are 8, 16, and 32. If this property is not specified, or has
> +   an invalid value, the driver will default to 32 bits.

Minor nit, but rightly or wrongly, the of-serial binding that uses 
reg-io-width specifies this in bytes and it would be nice to be 
consistent here.

Jamie


More information about the devicetree-discuss mailing list