On Wed, Sep 12, 2018 at 11:11 AM Patrick Menschel <menschel.p@xxxxxxxxx> wrote: > > Hi, > > I'm adding the devicetree mailing list to CC as they are the experts. > > Normally you should get your numbering to work with aliases but I'm not > sure if it is used the same way in overlays. > > aliases { > can0 = &can0; > can1 = &can1; > can2 = &can2; > can3 = &can3; > }; Yes, some platforms do this for built-in CAN controllers. I'm not sure if this can really work for overlays though. You might get away with it because the base dt doesn't have any can aliases, but what if it did? Or what happens when you plugin a USB to CAN device (assuming such a thing exists)? I'd suggest using "label" properties if there's a human identifiable connector/port and then support something like /dev/can/by-label/<some label name>. udev would create symlinks for each /sys/class/can/ device. That's how other classes of devices work. I guess if it is like ethernet though, that's a bit different, but still solved without fixed numbering. > Btw nice that my kicad contributions come to work by itself. > https://github.com/KiCad/kicad-symbols/pull/201 > I was routing my own board but unpredictably holidays were over ;-) > > Regards, > Patrick > > > > Thank you Chris! > > > > Unfortunately, using multiple DT overlays is not a good solution for me; > > I want the raspi bootloader to load the overlay from the hat's EEPROM, > > and afaik, there can be only one overlay per EEPROM. > > > > For now, I'm using a udev rules file: > > --- > > ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/soc/*/spi0.0/net/can?", NAME="can0" > > ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/soc/*/spi0.1/net/can?", NAME="can1" > > ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/soc/*/spi1.0/net/can?", NAME="can2" > > ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/soc/*/spi1.1/net/can?", NAME="can3" The main problem with this is it is very much platform specific. This problem is solved for other devices and not by fixed indexes. No one expects eth0, eth1, etc. anymore. Rob