tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

question about enumeration of buses on arm systems with dtb files



I am trying to understand the enumeration of the GPIO pins on a RPI-zero-2 
which boots up and runs under current.

The DTS lists i2c0 with gpio pins 0 & 1 and i2c1 with gpio pin 2 & 3. These 
appear to be the only i2c interfaces defined (unless there are others hidden 
in the dtsi files). These gpio pins are exposed on the 40 pin connector.

NetBSD shows 3 i2c devices

NetBSD 9.99.93 (GENERIC) #1: Fri Feb 25 22:45:01 GMT 2022        
root%cruncher.anduin.org.uk@localhost:/usr/arm7obj/sys/arch/evbarm/compile/GENERIC
bsciic0 at simplebus1: Broadcom Serial Controller
bsciic0: interrupting on icu irq 53
iic0 at bsciic0: I2C bus
bsciic1 at simplebus1: Broadcom Serial Controller
bsciic1: interrupting on icu irq 53
iic1 at bsciic1: I2C bus
bsciic2 at simplebus1: Broadcom Serial Controller
bsciic2: interrupting on icu irq 53
iic2 at bsciic2: I2C bus

If I plug devices into the two buses defined in the dts then I can probe and 
see devices on iic1 and iic2 using i2cscan -r , but iic0 shows nothing - but 
doesn't report any errors either.
 
So it would appear that NetBSD maps /dev/iic1 to gpio iic0 and /dev/iic2 to 
gpio iic1 which is not intuitive...
 
So how does the kernel map its devices to those listed in the dtb?

I wonder what  /dev/iic0 is mapped to :-) 

From the RPI documentation it would appear that you can add overrides in
/boot/config.txt to override the dts config - I am guessing this is picked up 
by linux, but there is no NetBSD support.

Any info gratefully received!
 
Cheers,
Dave
~



Home | Main Index | Thread Index | Old Index