All of lore.kernel.org
 help / color / mirror / Atom feed
* DSA incompatible with TI CPSW device model in dual mac mode
@ 2019-01-18 23:09 Daniele Orlandi
  2019-01-20 17:30 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Daniele Orlandi @ 2019-01-18 23:09 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]


Hello,

I am trying to connect a Marvell switch (88E6172) to an AM3352 ethernet 
port.

In the DSA devicetree description the CPU port has to have an "ethernet" 
  attribute with a reference to a device node. From which it derives the 
net_device with a call of of_find_net_device_by_node

The CPSW driver, however, has a single device node with multiple (two) 
net_devices associated.

Thus, if I reference the "mac" (ethernet@4a100000) node the first (eth0) 
port is matched.

There is no way to actually reference eth1.

I patched dsa2.c to also support a "ethernet-name" attribute which 
references to the device by name but it is super ugly...


Any idea an what could be the best approach for such scenarios?

Thanks,
Regards,

-- 
   Daniele Orlandi


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3994 bytes --]

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

* Re: DSA incompatible with TI CPSW device model in dual mac mode
  2019-01-18 23:09 DSA incompatible with TI CPSW device model in dual mac mode Daniele Orlandi
@ 2019-01-20 17:30 ` Andrew Lunn
  2019-01-21 14:57   ` Daniele Orlandi
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2019-01-20 17:30 UTC (permalink / raw)
  To: Daniele Orlandi; +Cc: netdev

On Sat, Jan 19, 2019 at 12:09:39AM +0100, Daniele Orlandi wrote:
> 
> Hello,
> 
> I am trying to connect a Marvell switch (88E6172) to an AM3352 ethernet
> port.
> 
> In the DSA devicetree description the CPU port has to have an "ethernet"
> attribute with a reference to a device node. From which it derives the
> net_device with a call of of_find_net_device_by_node
> 
> The CPSW driver, however, has a single device node with multiple (two)
> net_devices associated.
> 
> Thus, if I reference the "mac" (ethernet@4a100000) node the first (eth0)
> port is matched.
> 
> There is no way to actually reference eth1.

Hi Daniele

Looking at Documentation/devicetree/bindings/net/cpsw.txt, your DSA
Ethernet phandle should point to cpsw_emac1: slave@1. I don't know if
this actually works, but i _think_ some people have used DSA with this
device.


	 Andrew

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

* Re: DSA incompatible with TI CPSW device model in dual mac mode
  2019-01-20 17:30 ` Andrew Lunn
@ 2019-01-21 14:57   ` Daniele Orlandi
  2019-01-21 16:55     ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Daniele Orlandi @ 2019-01-21 14:57 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev

On 20/01/19 18:30, Andrew Lunn wrote:
> 
> Looking at Documentation/devicetree/bindings/net/cpsw.txt, your DSA
> Ethernet phandle should point to cpsw_emac1: slave@1.

Hi Andrew,

Yes, that's what sounds logical, however that node does not become the 
parent device net class nodes:

root@r600:/sys/class/net# ls -l
[...]
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth0 -> 
../../devices/platform/ocp/4a100000.ethernet/net/eth0
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth1 -> 
../../devices/platform/ocp/4a100000.ethernet/net/eth1
[...]

root@r600:/sys/class/net# cd eth0
root@r600:/sys/devices/platform/ocp/4a100000.ethernet/net/eth0# ls -l
[...]
lrwxrwxrwx    1 root     root             0 Jan  1  1970 device -> 
../../../4a100000.ethernet
[...]

root@r600:/sys/class/net# cd eth1
root@r600:/sys/devices/platform/ocp/4a100000.ethernet/net/eth1# ls -l
[...]
lrwxrwxrwx    1 root     root             0 Jan  1  1970 device -> 
../../../4a100000.ethernet
[...]

 > I don't know if this actually works, but i _think_ some people have 
used DSA with this
> device.

IMHO it should be the CPSW driver that should istantiate two separate 
devices, one for each cpsw_emacX node in the device tree.

Do you think they could be receptive to such proposal?

Thanks,
Bye,

-- 
   Daniele Orlandi

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

* Re: DSA incompatible with TI CPSW device model in dual mac mode
  2019-01-21 14:57   ` Daniele Orlandi
@ 2019-01-21 16:55     ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2019-01-21 16:55 UTC (permalink / raw)
  To: Daniele Orlandi; +Cc: netdev

On Mon, Jan 21, 2019 at 03:57:32PM +0100, Daniele Orlandi wrote:
> On 20/01/19 18:30, Andrew Lunn wrote:
> >
> >Looking at Documentation/devicetree/bindings/net/cpsw.txt, your DSA
> >Ethernet phandle should point to cpsw_emac1: slave@1.
> 
> Hi Andrew,
> 
> Yes, that's what sounds logical, however that node does not become the
> parent device net class nodes:
> 
> root@r600:/sys/class/net# ls -l
> [...]
> lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth0 ->
> ../../devices/platform/ocp/4a100000.ethernet/net/eth0
> lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth1 ->
> ../../devices/platform/ocp/4a100000.ethernet/net/eth1
> [...]
> 
> root@r600:/sys/class/net# cd eth0
> root@r600:/sys/devices/platform/ocp/4a100000.ethernet/net/eth0# ls -l
> [...]
> lrwxrwxrwx    1 root     root             0 Jan  1  1970 device ->
> ../../../4a100000.ethernet
> [...]
> 
> root@r600:/sys/class/net# cd eth1
> root@r600:/sys/devices/platform/ocp/4a100000.ethernet/net/eth1# ls -l
> [...]
> lrwxrwxrwx    1 root     root             0 Jan  1  1970 device ->
> ../../../4a100000.ethernet
> [...]
> 
> > I don't know if this actually works, but i _think_ some people have used
> DSA with this
> >device.
> 
> IMHO it should be the CPSW driver that should istantiate two separate
> devices, one for each cpsw_emacX node in the device tree.
> 
> Do you think they could be receptive to such proposal?

Hi Danielse

I suggest you ask. Or post a patch.

CPSW does all sorts of things in odd ways. So i would always expect
trouble with this device. From what i hear, there is a new driver
being written for it, so hopefully that driver will be more normal and
easier to use.

       Andrew

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

end of thread, other threads:[~2019-01-21 16:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-18 23:09 DSA incompatible with TI CPSW device model in dual mac mode Daniele Orlandi
2019-01-20 17:30 ` Andrew Lunn
2019-01-21 14:57   ` Daniele Orlandi
2019-01-21 16:55     ` Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.