[RFC] ARM: dts: Add i2cmux-pinctrl config to Raspberry Pi i2c-0
Stephen Warren
swarren at wwwdotorg.org
Mon Nov 20 09:05:01 PST 2017
On 11/20/2017 07:09 AM, Dave Stevenson wrote:
> The first i2c controller on the Raspberry Pi family can
> be pinmuxed to either GPIOs 0&1, 28&29, or 44&45.
> The default has always been 0&1 as those are exposed on
> the 40 pin GPIO header of the more recent models.
> GPIOs 28&29 on Pi 0/1/2/3 and GPIOs 44&45 on Pi3 are
> used for i2c to the DSI display and the camera module.
On the model A and B at least, pins 28/29/44/45 are used for other
purposes, and cannot be used as I2C. It's hard/impossible to tell on the
more recent Pis since the schematics are obscured:-( This change appears
to add the I2C pinctrl mux to the original A/B, so at the very least
needs to be modified not to do that. More investigation is needed to
tell whether it's appropriate for the later models or not.
> The i2c-mux-pinctrl driver allows pinctrl setup to be used
> to expose the GPIO sets as alternate i2c adapters.
Yes, i2c-mux-pinctrl does exist. However, the intent is not to expose
I2C buses for every possible pinmux configuration, but rather to allow
exposing multiple mux'd I2C buses /if/ there's a specific need; if it
makes sense to do so. As far as I know, the Pi HW is designed to have a
specific static pinmux configuration for each of the I2C controllers.
Put another way: What user benefit does making this change create?
If a user has modified their HW and changed what the pins are connected
to, that's something user-specific. They should modify the DT themselves
to match that HW change. However, the default/standard DT shouldn't be
modified, since not all users will have made that HW change.
> This
> patch configures that driver to expose two adapters -
> i2c0 on GPIOs 0&1, and i2c_csi_dsi on the correct GPIOs for
> the camera and display.
Looking at the schematics for the original A/B Pi, the camera should be
controlled by the second I2C controller on GPIO pins 2/3, and the DSI
port has no I2C. On the B+ schematics, both CSI and DSI use the same I2C
controller, which must use some GPIOs in the second GPIO bank (and I
believe the second I2C controller) since they aren't shown on the
schematic. The 2nd I2C controller is typically under firmware not Linux
control.
More information about the linux-rpi-kernel
mailing list