Skip to content

net: smc911x: Convert to DM

Marek Vasut u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 12 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 12 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] net: smc911x: Convert to DM
Quoted 28 lines · Adam Ford
Quoted 9 lines · Marek Vasut
Quoted 1 line · Masahiro Yamada

Hi Marek,

Hi,

Quoted 3 lines · Marek Vasut
Quoted 2 lines

Perform DM conversion of the SMC911x driver. Note that as I do not have

Thanks for taking this on.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

any hardware with this chip, I only compile-tested this conversion. But it seems Yamada-san has one, so please test.

I have a DM3730 with this chip. Without DM_ETH, the omap3_logic_defconfig doesn't compile with the following errors:

drivers/net/smc911x.c: In function ?smc911x_initialize?:
drivers/net/smc911x.c:477:2: error: ?dev? undeclared (first use in this function)

  477 |  dev = kzalloc(sizeof(*priv), GFP_KERNEL);
      |  ^~~

drivers/net/smc911x.c:477:2: note: each undeclared identifier is reported only once for each function it appears in drivers/net/smc911x.c:477:8: warning: implicit declaration of function ?kzalloc?; did you mean ?calloc?? [-Wimplicit-function-declaration]

Quoted 8 lines
  477 |  dev = kzalloc(sizeof(*priv), GFP_KERNEL);
      |        ^~~~~~~
      |        calloc
drivers/net/smc911x.c:477:31: error: ?GFP_KERNEL? undeclared (first
use in this function)
  477 |  dev = kzalloc(sizeof(*priv), GFP_KERNEL);
      |                               ^~~~~~~~~~

make[1]: *** [scripts/Makefile.build:279: drivers/net/smc911x.o] Error 1

Well, replace the kzalloc with calloc.

Quoted 28 lines
Quoted 8 lines
Quoted 6 lines

With a quick test on my board, it worked for me.

I will leave comments to each patch, but
they are mostly nit-picking.

Thanks for the cleanups and the conversion.

I fixed most of those, thanks for testing.

If I enable DM_ETH, I need to make a few changes to the device tree, but with those changes, I was able to get the Ethernet working. The OMAP3 boards have the Ethernet node attached to their GPMC bus which currently doesn't have a driver. Making the GPMC compatible with 'simple-bus' wasn't sufficient. With only that change, the system would hang while trying to probe the network interface.

What I ended up having to do was add the following to my root node:

ethernet at 08000000 {
     compatible = "smsc,lan9221","smsc,lan9115";
     reg = <0x08000000>;
     bank-width = <2>;
     vddvario-supply = <&vddvario>;
     vdd33a-supply = <&vdd33a>;
     reg-io-width = <4>;
     smsc,save-mac-address;
};
Quoted 4 lines

I didn't look to see if I needed all those entries, but I was able to get an IP address and ping a different computer.
If there is a future revision to fix the default build errors, I can add similar comments with my tested-by if you want to CC me.

I'm about to send a V3.