* [PATCH 1/4] clk: gxbb: expose i2c clocks
2016-09-14 10:06 [PATCH 0/4] ARM: amlogic: add i2c support to Amlogic's gxbb family Jerome Brunet
@ 2016-09-14 10:06 ` Jerome Brunet
2016-09-14 18:25 ` Stephen Boyd
2016-09-14 10:06 ` [PATCH 2/4] ARM64: dts: meson-gxbb: add pins for I2C Jerome Brunet
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Jerome Brunet @ 2016-09-14 10:06 UTC (permalink / raw)
To: linus-amlogic
I2C and AO_I2C clocks are needed for the i2c driver, expose to DT
(and comment out in clk driver)
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
drivers/clk/meson/gxbb.h | 4 ++--
include/dt-bindings/clock/gxbb-clkc.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/meson/gxbb.h b/drivers/clk/meson/gxbb.h
index 044fc44e9144..0252939ba58f 100644
--- a/drivers/clk/meson/gxbb.h
+++ b/drivers/clk/meson/gxbb.h
@@ -190,7 +190,7 @@
#define CLKID_PL301 19
#define CLKID_PERIPHS 20
#define CLKID_SPICC 21
-#define CLKID_I2C 22
+/* CLKID_I2C */
#define CLKID_SAR_ADC 23
#define CLKID_SMART_CARD 24
#define CLKID_RNG0 25
@@ -261,7 +261,7 @@
#define CLKID_AO_AHB_SRAM 90
#define CLKID_AO_AHB_BUS 91
#define CLKID_AO_IFACE 92
-#define CLKID_AO_I2C 93
+/* CLKID_AO_I2C */
/* CLKID_SD_EMMC_A */
/* CLKID_SD_EMMC_B */
/* CLKID_SD_EMMC_C */
diff --git a/include/dt-bindings/clock/gxbb-clkc.h b/include/dt-bindings/clock/gxbb-clkc.h
index 743c45b40361..baade6f429d0 100644
--- a/include/dt-bindings/clock/gxbb-clkc.h
+++ b/include/dt-bindings/clock/gxbb-clkc.h
@@ -13,12 +13,14 @@
#define CLKID_CLK81 12
#define CLKID_MPLL2 15
#define CLKID_SPI 34
+#define CLKID_I2C 22
#define CLKID_ETH 36
#define CLKID_USB0 50
#define CLKID_USB1 51
#define CLKID_USB 55
#define CLKID_USB1_DDR_BRIDGE 64
#define CLKID_USB0_DDR_BRIDGE 65
+#define CLKID_AO_I2C 93
#define CLKID_SD_EMMC_A 94
#define CLKID_SD_EMMC_B 95
#define CLKID_SD_EMMC_C 96
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] ARM64: dts: meson-gxbb: add pins for I2C
2016-09-14 10:06 [PATCH 0/4] ARM: amlogic: add i2c support to Amlogic's gxbb family Jerome Brunet
2016-09-14 10:06 ` [PATCH 1/4] clk: gxbb: expose i2c clocks Jerome Brunet
@ 2016-09-14 10:06 ` Jerome Brunet
2016-09-14 10:06 ` [PATCH 3/4] ARM64: dts: meson-gxbb: add I2C nodes Jerome Brunet
2016-09-14 10:06 ` [PATCH 4/4] ARM64: dts: gxbb: add i2c bus Jerome Brunet
3 siblings, 0 replies; 6+ messages in thread
From: Jerome Brunet @ 2016-09-14 10:06 UTC (permalink / raw)
To: linus-amlogic
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 32 +++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 9506597fcc1c..75aca5013e61 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -293,6 +293,14 @@
};
};
+ i2c_ao_pins: i2c_ao {
+ mux {
+ groups = "i2c_sck_ao",
+ "i2c_sda_ao";
+ function = "i2c_ao";
+ };
+ };
+
pwm_ao_a_3_pins: pwm_ao_a_3 {
mux {
groups = "pwm_ao_a_3";
@@ -455,6 +463,30 @@
};
};
+ i2c_a_pins: i2c_a {
+ mux {
+ groups = "i2c_sck_a",
+ "i2c_sda_a";
+ function = "i2c_a";
+ };
+ };
+
+ i2c_b_pins: i2c_b {
+ mux {
+ groups = "i2c_sck_b",
+ "i2c_sda_b";
+ function = "i2c_b";
+ };
+ };
+
+ i2c_c_pins: i2c_c {
+ mux {
+ groups = "i2c_sck_c",
+ "i2c_sda_c";
+ function = "i2c_c";
+ };
+ };
+
eth_pins: eth_c {
mux {
groups = "eth_mdio",
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] ARM64: dts: meson-gxbb: add I2C nodes
2016-09-14 10:06 [PATCH 0/4] ARM: amlogic: add i2c support to Amlogic's gxbb family Jerome Brunet
2016-09-14 10:06 ` [PATCH 1/4] clk: gxbb: expose i2c clocks Jerome Brunet
2016-09-14 10:06 ` [PATCH 2/4] ARM64: dts: meson-gxbb: add pins for I2C Jerome Brunet
@ 2016-09-14 10:06 ` Jerome Brunet
2016-09-14 10:06 ` [PATCH 4/4] ARM64: dts: gxbb: add i2c bus Jerome Brunet
3 siblings, 0 replies; 6+ messages in thread
From: Jerome Brunet @ 2016-09-14 10:06 UTC (permalink / raw)
To: linus-amlogic
From: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 40 +++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 75aca5013e61..4aa59dc2beb9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -242,6 +242,36 @@
clocks = <&clkc CLKID_SPI>;
status = "disabled";
};
+
+ i2c_A: i2c at 8500 {
+ compatible = "amlogic,meson-gxbb-i2c";
+ reg = <0x0 0x08500 0x0 0x20>;
+ interrupts = <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&clkc CLKID_I2C>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c_B: i2c at 87c0 {
+ compatible = "amlogic,meson-gxbb-i2c";
+ reg = <0x0 0x087c0 0x0 0x20>;
+ interrupts = <GIC_SPI 214 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&clkc CLKID_I2C>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c_C: i2c at 87e0 {
+ compatible = "amlogic,meson-gxbb-i2c";
+ reg = <0x0 0x087e0 0x0 0x20>;
+ interrupts = <GIC_SPI 215 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&clkc CLKID_I2C>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
};
gic: interrupt-controller at c4301000 {
@@ -358,6 +388,16 @@
#pwm-cells = <3>;
status = "disabled";
};
+
+ i2c_AO: i2c at 500 {
+ compatible = "amlogic,meson-gxbb-i2c";
+ reg = <0x0 0x500 0x0 0x20>;
+ interrupts = <GIC_SPI 195 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&clkc CLKID_AO_I2C>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
};
periphs: periphs at c8834000 {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] ARM64: dts: gxbb: add i2c bus
2016-09-14 10:06 [PATCH 0/4] ARM: amlogic: add i2c support to Amlogic's gxbb family Jerome Brunet
` (2 preceding siblings ...)
2016-09-14 10:06 ` [PATCH 3/4] ARM64: dts: meson-gxbb: add I2C nodes Jerome Brunet
@ 2016-09-14 10:06 ` Jerome Brunet
3 siblings, 0 replies; 6+ messages in thread
From: Jerome Brunet @ 2016-09-14 10:06 UTC (permalink / raw)
To: linus-amlogic
Add nodes for i2c bus on gxbb based platforms.
On the OdroidC2 (I2C A) and P200 (I2C B), the pull-up resistor are
present directly on the board. This indicates that these pins are
dedicated to i2c.
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 6 ++++++
arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index 4f1554a27422..c6d78d3a018f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -180,3 +180,9 @@
vmmc-supply = <&vcc3v3>;
vqmmc-supply = <&vcc1v8>;
};
+
+&i2c_A {
+ status = "okay";
+ pinctrl-0 = <&i2c_a_pins>;
+ pinctrl-names = "default";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
index 62979076e250..03e3d76626dd 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts
@@ -50,3 +50,9 @@
compatible = "amlogic,p200", "amlogic,meson-gxbb";
model = "Amlogic Meson GXBB P200 Development Board";
};
+
+&i2c_B {
+ status = "okay";
+ pinctrl-0 = <&i2c_b_pins>;
+ pinctrl-names = "default";
+};
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread