From 632c47b4de44429b650344a908ac0938bdfbb789 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 23 May 2015 15:27:45 +0000 Subject: [PATCH] ipq806x: disable i2c device on gsbi4 Patch cherry-picked from the following location: https://chromium-review.googlesource.com/#/c/269931/ Disable the i2c device on gsbi4 and mark gsbi4_h and gsbi4_qup clks as unused. If they are enabled, clock framework will turn them off at end of probe. On ipq806x by design gsbi4_qup, gsbi4_h clks and i2c on gsbi4 are meant for RPM usage. So turning them off in kernel is incorrect. Signed-off-by: Mathieu Olivari git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45728 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch | 53 ++++++++++++++++++++++ ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch | 2 +- ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 2 +- .../patches-3.18/700-add-gmac-dts-suport.patch | 4 +- ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch | 53 ++++++++++++++++++++++ ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 2 +- .../patches-4.0/700-add-gmac-dts-suport.patch | 4 +- 7 files changed, 113 insertions(+), 7 deletions(-) create mode 100644 target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch create mode 100644 target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch diff --git a/target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch b/target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch new file mode 100644 index 0000000000..319859b109 --- /dev/null +++ b/target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch @@ -0,0 +1,53 @@ +--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts ++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +@@ -46,15 +46,12 @@ + serial@16340000 { + status = "ok"; + }; +- +- i2c4: i2c@16380000 { +- status = "ok"; +- +- clock-frequency = <200000>; +- +- pinctrl-0 = <&i2c4_pins>; +- pinctrl-names = "default"; +- }; ++ /* ++ * The i2c device on gsbi4 should not be enabled. ++ * On ipq806x designs gsbi4 i2c is meant for exclusive ++ * RPM usage. Turning this on in kernel manifests as ++ * i2c failure for the RPM. ++ */ + }; + + gsbi5: gsbi@1a200000 { +--- a/drivers/clk/qcom/gcc-ipq806x.c ++++ b/drivers/clk/qcom/gcc-ipq806x.c +@@ -794,7 +794,7 @@ static struct clk_rcg gsbi7_qup_src = { + .parent_names = gcc_pxo_pll8, + .num_parents = 2, + .ops = &clk_rcg_ops, +- .flags = CLK_SET_PARENT_GATE, ++ .flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED, + }, + }, + }; +@@ -810,7 +810,7 @@ static struct clk_branch gsbi7_qup_clk = + .parent_names = (const char *[]){ "gsbi7_qup_src" }, + .num_parents = 1, + .ops = &clk_branch_ops, +- .flags = CLK_SET_RATE_PARENT, ++ .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, + }, + }, + }; +@@ -858,7 +858,7 @@ static struct clk_branch gsbi4_h_clk = { + .hw.init = &(struct clk_init_data){ + .name = "gsbi4_h_clk", + .ops = &clk_branch_ops, +- .flags = CLK_IS_ROOT, ++ .flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED, + }, + }, + }; diff --git a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch index f1b41648a3..8f17397380 100644 --- a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch +++ b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts -@@ -112,5 +112,29 @@ +@@ -109,5 +109,29 @@ sata@29000000 { status = "ok"; }; diff --git a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch index 2613dff4df..3c1ae617fe 100644 --- a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch +++ b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch @@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari spi_pins: spi_pins { mux { pins = "gpio18", "gpio19", "gpio21"; -@@ -136,5 +152,19 @@ +@@ -133,5 +149,19 @@ usb30@1 { status = "ok"; }; diff --git a/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch b/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch index fe670cf99e..4e8f8591f9 100644 --- a/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch +++ b/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch @@ -42,7 +42,7 @@ }; gsbi@16300000 { -@@ -92,6 +118,7 @@ +@@ -89,6 +115,7 @@ #size-cells = <1>; spi-max-frequency = <50000000>; reg = <0>; @@ -50,7 +50,7 @@ partition@0 { label = "lowlevel_init"; -@@ -166,5 +193,66 @@ +@@ -163,5 +190,66 @@ pinctrl-0 = <&pcie2_pins>; pinctrl-names = "default"; }; diff --git a/target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch b/target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch new file mode 100644 index 0000000000..75595cacf6 --- /dev/null +++ b/target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch @@ -0,0 +1,53 @@ +--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts ++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +@@ -46,15 +46,12 @@ + serial@16340000 { + status = "ok"; + }; +- +- i2c4: i2c@16380000 { +- status = "ok"; +- +- clock-frequency = <200000>; +- +- pinctrl-0 = <&i2c4_pins>; +- pinctrl-names = "default"; +- }; ++ /* ++ * The i2c device on gsbi4 should not be enabled. ++ * On ipq806x designs gsbi4 i2c is meant for exclusive ++ * RPM usage. Turning this on in kernel manifests as ++ * i2c failure for the RPM. ++ */ + }; + + gsbi5: gsbi@1a200000 { +--- a/drivers/clk/qcom/gcc-ipq806x.c ++++ b/drivers/clk/qcom/gcc-ipq806x.c +@@ -805,7 +805,7 @@ static struct clk_rcg gsbi7_qup_src = { + .parent_names = gcc_pxo_pll8, + .num_parents = 2, + .ops = &clk_rcg_ops, +- .flags = CLK_SET_PARENT_GATE, ++ .flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED, + }, + }, + }; +@@ -821,7 +821,7 @@ static struct clk_branch gsbi7_qup_clk = + .parent_names = (const char *[]){ "gsbi7_qup_src" }, + .num_parents = 1, + .ops = &clk_branch_ops, +- .flags = CLK_SET_RATE_PARENT, ++ .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, + }, + }, + }; +@@ -869,7 +869,7 @@ static struct clk_branch gsbi4_h_clk = { + .hw.init = &(struct clk_init_data){ + .name = "gsbi4_h_clk", + .ops = &clk_branch_ops, +- .flags = CLK_IS_ROOT, ++ .flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED, + }, + }, + }; diff --git a/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch index 593bc32790..90095758f2 100644 --- a/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch +++ b/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch @@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari spi_pins: spi_pins { mux { pins = "gpio18", "gpio19", "gpio21"; -@@ -112,5 +128,19 @@ +@@ -109,5 +125,19 @@ sata@29000000 { status = "ok"; }; diff --git a/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch b/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch index 16defd135d..b5643dfd17 100644 --- a/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch +++ b/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch @@ -42,7 +42,7 @@ }; gsbi@16300000 { -@@ -92,6 +118,7 @@ +@@ -89,6 +115,7 @@ #size-cells = <1>; spi-max-frequency = <50000000>; reg = <0>; @@ -50,7 +50,7 @@ partition@0 { label = "lowlevel_init"; -@@ -142,5 +169,66 @@ +@@ -139,5 +166,66 @@ pinctrl-0 = <&pcie2_pins>; pinctrl-names = "default"; }; -- 2.11.0