linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Device Tree Binding for DSA on P1023RDB
@ 2014-06-12 15:36 Pannirselvam Kanagaratnam
  2014-06-12 21:21 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Pannirselvam Kanagaratnam @ 2014-06-12 15:36 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/html, Size: 43231 bytes --]

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

* Re: Device Tree Binding for DSA on P1023RDB
  2014-06-12 15:36 Device Tree Binding for DSA on P1023RDB Pannirselvam Kanagaratnam
@ 2014-06-12 21:21 ` Scott Wood
  2014-06-13 10:34   ` Pannirselvam Kanagaratnam
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2014-06-12 21:21 UTC (permalink / raw)
  To: Pannirselvam Kanagaratnam; +Cc: linuxppc-dev

On Thu, 2014-06-12 at 23:36 +0800, Pannirselvam Kanagaratnam wrote:
> The QORIQ P1023RDB has an option to populate the Marvell 88E6165
> Ethernet switch. We populated this device and was able to initialize
> it as a basic switch in U-Boot. However, the switch driver was not
> loaded upon kernel bootup. DSA kernel config was enabled for the
> 88E6165. The following patch was applied:
> 
> 
> http://patchwork.ozlabs.org/patch/230257/
> 
> 
> The switch is attached to phy address 0x3 via dtsec2. My dts file is
> as below. Would appreciate any feedback on whether the DSA is
> correctly structured in the dts.

If you have a dtsec driver you're not working with an upstream kernel
(or you've ported a lot of SDK code to it)...  What tree are you working
with?  Are there prerequisites to the above patch that you might be
missing?

The above patch is a platform driver and you put the node in the
toplevel device tree node.  Have you added marvell,dsa to the list of
compatible strings that get probed (of_device_ids in corenet_generic.c
or an equivalent list in your SDK kernel)?
> 
>     dsa@0 {
>             compatible = "marvell,dsa";
>             #address-cells = <2>;
>             #size-cells = <0>;
> 
>             interrupts = <3>;

This interrupts property needs to be four cells rather than one, if MPIC
is the parent -- assuming you have #interrupt-cells = <4> and not some
old device tree with #interrupt-cells = <2>, but in any case you need
more than one cell.

-Scott

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

* Re: Device Tree Binding for DSA on P1023RDB
  2014-06-12 21:21 ` Scott Wood
@ 2014-06-13 10:34   ` Pannirselvam Kanagaratnam
  0 siblings, 0 replies; 3+ messages in thread
From: Pannirselvam Kanagaratnam @ 2014-06-13 10:34 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev



On Fri, Jun 13, 2014, at 05:21 AM, Scott Wood wrote:
> On Thu, 2014-06-12 at 23:36 +0800, Pannirselvam Kanagaratnam wrote:
> > The QORIQ P1023RDB has an option to populate the Marvell 88E6165
> > Ethernet switch. We populated this device and was able to initialize
> > it as a basic switch in U-Boot. However, the switch driver was not
> > loaded upon kernel bootup. DSA kernel config was enabled for the
> > 88E6165. The following patch was applied:
> > 
> > 
> > http://patchwork.ozlabs.org/patch/230257/
> > 
> > 
> > The switch is attached to phy address 0x3 via dtsec2. My dts file is
> > as below. Would appreciate any feedback on whether the DSA is
> > correctly structured in the dts.
> 
> If you have a dtsec driver you're not working with an upstream kernel
> (or you've ported a lot of SDK code to it)...  What tree are you working
> with?  Are there prerequisites to the above patch that you might be
> missing?
> 

I am using QorIQ-SDK-V1.5-20131219-yocto (3.8-r11.1). Not sure if I am
missing
any prerequisites. 

> The above patch is a platform driver and you put the node in the
> toplevel device tree node.  Have you added marvell,dsa to the list of
> compatible strings that get probed (of_device_ids in corenet_generic.c
> or an equivalent list in your SDK kernel)?
> > 

I was missing this. I added it in arch/powerpc/platforms/85xx/common.c

After adding the above, the driver is now attempting to probe. However,
I got the following message:

Distributed Switch Architecture driver version 0.1
dsa: probe of dsa.16 failed with error -22

I dumped the mdio, mdio_bus and ethernet parameters:

1) For mdio = of_parse_phandle(np, "dsa,mii-bus", 0); I get the
following:
np-name: dsa
mdio-name: mdio
mdio-type: <NULL>
mdio-full-name: /soc@ff600000/fman@100000/mdio@e1120 

2) mdio_bus = of_mdio_find_bus(mdio);
mdio_bus_name: Freescale PowerQUICC MII Bus
mdio_bus_id: mdio@ff7e1120

3) ethernet = of_parse_phandle(np, "dsa,ethernet", 0);
ethernet-name: ethernet
ethernet-type: <NULL>
ethernet-full-name: /soc@ff600000/fman@100000/ethernet@e2000

Anything amiss here?

> >     dsa@0 {
> >             compatible = "marvell,dsa";
> >             #address-cells = <2>;
> >             #size-cells = <0>;
> > 
> >             interrupts = <3>;
> 
> This interrupts property needs to be four cells rather than one, if MPIC
> is the parent -- assuming you have #interrupt-cells = <4> and not some
> old device tree with #interrupt-cells = <2>, but in any case you need
> more than one cell.
> 

The interrupt is an optional entry and not supported by the driver. I
have omitted it for now.

Pannir

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

end of thread, other threads:[~2014-06-13 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-12 15:36 Device Tree Binding for DSA on P1023RDB Pannirselvam Kanagaratnam
2014-06-12 21:21 ` Scott Wood
2014-06-13 10:34   ` Pannirselvam Kanagaratnam

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).