From 4b40d01e74f0ca2b0e1eaa0500cfc17ca7b8c2a3 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 8 Dec 2016 00:00:49 +0000 Subject: arm64: dts: marvell: mcbin: workaround wrongly wired i2c1 bus The I2C1 bus on early mcbin hardware is mis-wired, swapping SCL and SDA. Work around this by using the i2c-gpio driver instead. XXX Caught early and this commit should be removed for mainline. XXX Signed-off-by: Russell King --- arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi') diff --git a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi index 077f4a41063b..446e3f15b2a0 100644 --- a/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi @@ -106,6 +106,23 @@ pinctrl-0 = <&cp0_sfp_1g_pins &cp1_sfp_1g_pins>; maximum-power-milliwatt = <2000>; }; + +#ifdef MCBIN_BROKEN_I2C1 + /* work-around the wrongly wired I2C bus on Rev 1.1 boards */ + broken_i2c1: i2c-controller@0 { + compatible = "i2c-gpio"; + gpios = <&cp0_gpio2 4 GPIO_ACTIVE_HIGH>, + <&cp0_gpio2 3 GPIO_ACTIVE_HIGH>; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; +#define I2C1 broken_i2c1 +#define I2C1_PINMUX "gpio" +#else +#define I2C1 cp0_i2c1 +#define I2C1_PINMUX "i2c1" +#endif }; &uart0 { @@ -136,7 +153,7 @@ status = "okay"; }; -&cp0_i2c1 { +&I2C1 { clock-frequency = <100000>; pinctrl-names = "default"; pinctrl-0 = <&cp0_i2c1_pins>; @@ -205,7 +222,7 @@ /* mpp33 - mss? */ cp0_i2c1_pins: i2c1-pins { marvell,pins = "mpp35", "mpp36"; - marvell,function = "i2c1"; + marvell,function = I2C1_PINMUX; }; cp0_i2c0_pins: i2c0-pins { marvell,pins = "mpp37", "mpp38"; -- cgit