lkml.org 
[lkml]   [2014]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ARM: mvebu: add Device Tree for the Armada 385 RD board
> >>> I think you can use aliases to get the order correct, independent of
> >>> how you list them in DT. That should be a lot safer than assuming
> >>> things are instantiated from top to bottom.
> >>
> >> It sounds interesting, how would you do this?
> >
> > As there already is in armada-370-xp.dtsi
> >
> > aliases {
> > eth0 = &eth0;
> > eth1 = &eth1;
> > };
> >
> >
> > eth0: ethernet@70000 {
> > }
> > eth1: ethernet@74000 {
> > }
> >
> > This at least works for i2c devices. The pdev->id is set using the
> > alias number.
>
> Well I think it doesn't work with ethernet devices because we already do
> this in aramda-38x.dtsi:
>
> aliases {
> gpio0 = &gpio0;
> gpio1 = &gpio1;
> eth0 = &eth0;
> eth1 = &eth1;
> eth2 = &eth2;
> };
>
> eth1: ethernet@30000 {
> }
> eth2: ethernet@34000 {
> }
> eth0: ethernet@70000 {
> }

Ah, Erm, O.K.

It seems to be an i2c thing. Take a look at i2c_add_adapter().

if (dev->of_node) {
id = of_alias_get_id(dev->of_node, "i2c");

You could put something similar into the ethernet driver.

Andrew


\
 
 \ /
  Last update: 2014-03-06 16:41    [W:0.128 / U:7.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site