bcm4908: backport watchdog and I2C changes
authorRafał Miłecki <rafal@milecki.pl>
Wed, 16 Feb 2022 06:56:07 +0000 (07:56 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 16 Feb 2022 08:15:52 +0000 (09:15 +0100)
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 923cc869a6eec7dd6fdf728b2adb05824e4b9ac0)

target/linux/bcm4908/config-5.4
target/linux/bcm4908/patches-5.4/036-v5.18-0003-arm64-dts-broadcom-bcm4908-add-watchdog-block.patch [new file with mode: 0644]
target/linux/bcm4908/patches-5.4/036-v5.18-0004-arm64-dts-broadcom-bcm4908-add-I2C-block.patch [new file with mode: 0644]
target/linux/bcm4908/patches-5.4/087-v5.18-0001-i2c-brcmstb-allow-compiling-on-BCM4908.patch [new file with mode: 0644]
target/linux/bcm4908/patches-5.4/180-i2c-brcmstb-fix-support-for-DSL-and-CM-variants.patch [new file with mode: 0644]
target/linux/bcm4908/patches-5.4/181-watchdog-allow-building-BCM7038_WDT-for-BCM4908.patch [new file with mode: 0644]
target/linux/bcm4908/patches-5.4/182-watchdog-bcm7038_wdt-Support-BCM6345-compatible-stri.patch [new file with mode: 0644]
target/linux/bcm4908/patches-5.4/300-arm64-dts-broadcom-bcm4908-limit-amount-of-GPIOs.patch
target/linux/bcm4908/patches-5.4/301-arm64-dts-broadcom-bcm4908-add-TWD-block.patch [deleted file]
target/linux/bcm4908/patches-5.4/800-watchdog-bcm7038_wdt-allow-building-on-ARCH_BCM4908.patch [deleted file]

index 10a5ee2bfa80a4d4ff69fa60661333a6e687b531..86bbfc2910c148124c531f739411d7086a8b3d17 100644 (file)
@@ -119,6 +119,9 @@ CONFIG_HOLES_IN_ZONE=y
 CONFIG_HZ=250
 CONFIG_HZ_250=y
 CONFIG_HZ_PERIODIC=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_BRCMSTB=y
 CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
 CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
diff --git a/target/linux/bcm4908/patches-5.4/036-v5.18-0003-arm64-dts-broadcom-bcm4908-add-watchdog-block.patch b/target/linux/bcm4908/patches-5.4/036-v5.18-0003-arm64-dts-broadcom-bcm4908-add-watchdog-block.patch
new file mode 100644 (file)
index 0000000..3ca778d
--- /dev/null
@@ -0,0 +1,35 @@
+From 47513f6dd93b5b7d91143219c2c1fb883664ed13 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Wed, 9 Feb 2022 21:14:17 +0100
+Subject: [PATCH] arm64: dts: broadcom: bcm4908: add watchdog block
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+BCM4908 has the same watchdog as BCM63xx devices. Use "brcm,bcm6345-wdt"
+binding which matches the first SoC with that block.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
+@@ -276,6 +276,15 @@
+               twd: timer-mfd@400 {
+                       compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon";
+                       reg = <0x400 0x4c>;
++                      ranges = <0x0 0x400 0x4c>;
++
++                      #address-cells = <1>;
++                      #size-cells = <1>;
++
++                      watchdog@28 {
++                              compatible = "brcm,bcm6345-wdt";
++                              reg = <0x28 0x8>;
++                      };
+               };
+               gpio0: gpio-controller@500 {
diff --git a/target/linux/bcm4908/patches-5.4/036-v5.18-0004-arm64-dts-broadcom-bcm4908-add-I2C-block.patch b/target/linux/bcm4908/patches-5.4/036-v5.18-0004-arm64-dts-broadcom-bcm4908-add-I2C-block.patch
new file mode 100644 (file)
index 0000000..ab00f44
--- /dev/null
@@ -0,0 +1,34 @@
+From ba5dfa2fd8d0aed4e4b6f650ba9e8ea7cdd6ead1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Tue, 15 Feb 2022 07:36:39 +0100
+Subject: [PATCH] arm64: dts: broadcom: bcm4908: add I2C block
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+BCM4908 uses the same I2C hw as BCM63xx / BCM67xx / BCM68xx SoCs.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
++++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
+@@ -456,6 +456,15 @@
+                       };
+               };
++              i2c@2100 {
++                      compatible = "brcm,brcmper-i2c";
++                      reg = <0x2100 0x58>;
++                      clock-frequency = <97500>;
++                      pinctrl-names = "default";
++                      pinctrl-0 = <&pins_i2c_a>;
++                      status = "disabled";
++              };
++
+               misc@2600 {
+                       compatible = "brcm,misc", "simple-mfd";
+                       reg = <0x2600 0xe4>;
diff --git a/target/linux/bcm4908/patches-5.4/087-v5.18-0001-i2c-brcmstb-allow-compiling-on-BCM4908.patch b/target/linux/bcm4908/patches-5.4/087-v5.18-0001-i2c-brcmstb-allow-compiling-on-BCM4908.patch
new file mode 100644 (file)
index 0000000..81952ec
--- /dev/null
@@ -0,0 +1,30 @@
+From d0aee048d648ec2d9aa7af43b127ebf847d497d5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Fri, 11 Feb 2022 11:58:06 +0100
+Subject: [PATCH] i2c: brcmstb: allow compiling on BCM4908
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+BCM4908 SoCs use the same I2C hardware block as STB and BCM63xx devices.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+---
+ drivers/i2c/busses/Kconfig | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/i2c/busses/Kconfig
++++ b/drivers/i2c/busses/Kconfig
+@@ -472,8 +472,8 @@ config I2C_BCM_KONA
+ config I2C_BRCMSTB
+       tristate "BRCM Settop/DSL I2C controller"
+-      depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_63XX || \
+-                 COMPILE_TEST
++      depends on ARCH_BCM4908 || ARCH_BCM_63XX || ARCH_BRCMSTB || \
++                 BMIPS_GENERIC || COMPILE_TEST
+       default y
+       help
+         If you say yes to this option, support will be included for the
diff --git a/target/linux/bcm4908/patches-5.4/180-i2c-brcmstb-fix-support-for-DSL-and-CM-variants.patch b/target/linux/bcm4908/patches-5.4/180-i2c-brcmstb-fix-support-for-DSL-and-CM-variants.patch
new file mode 100644 (file)
index 0000000..6f4ae30
--- /dev/null
@@ -0,0 +1,30 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Tue, 15 Feb 2022 08:27:35 +0100
+Subject: [PATCH] i2c: brcmstb: fix support for DSL and CM variants
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+DSL and CM (Cable Modem) support 8 B max transfer size and have a custom
+DT binding for that reason. This driver was checking for a wrong
+"compatible" however which resulted in an incorrect setup.
+
+Fixes: e2e5a2c61837 ("i2c: brcmstb: Adding support for CM and DSL SoCs")
+Cc: Kamal Dasu <kdasu.kdev@gmail.com>
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ drivers/i2c/busses/i2c-brcmstb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/i2c/busses/i2c-brcmstb.c
++++ b/drivers/i2c/busses/i2c-brcmstb.c
+@@ -640,7 +640,7 @@ static int brcmstb_i2c_probe(struct plat
+       /* set the data in/out register size for compatible SoCs */
+       if (of_device_is_compatible(dev->device->of_node,
+-                                  "brcmstb,brcmper-i2c"))
++                                  "brcm,brcmper-i2c"))
+               dev->data_regsz = sizeof(u8);
+       else
+               dev->data_regsz = sizeof(u32);
diff --git a/target/linux/bcm4908/patches-5.4/181-watchdog-allow-building-BCM7038_WDT-for-BCM4908.patch b/target/linux/bcm4908/patches-5.4/181-watchdog-allow-building-BCM7038_WDT-for-BCM4908.patch
new file mode 100644 (file)
index 0000000..a42fb7d
--- /dev/null
@@ -0,0 +1,28 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Wed, 9 Feb 2022 21:32:02 +0100
+Subject: [PATCH] watchdog: allow building BCM7038_WDT for BCM4908
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+BCM4908 is a SoCs family that shares a lot of hardware with BCM63xx
+including the watchdog block. Allow building this driver for it.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Acked-by: Florian Fainelli <f.fainelli@gmail.com>
+Reviewed-by: Guenter Roeck <linux@roeck-us.net>
+---
+ drivers/watchdog/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/watchdog/Kconfig
++++ b/drivers/watchdog/Kconfig
+@@ -1759,7 +1759,7 @@ config BCM7038_WDT
+       tristate "BCM7038 Watchdog"
+       select WATCHDOG_CORE
+       depends on HAS_IOMEM
+-      depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
++      depends on ARCH_BCM4908 || ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
+       help
+        Watchdog driver for the built-in hardware in Broadcom 7038 and
+        later SoCs used in set-top boxes.  BCM7038 was made public
diff --git a/target/linux/bcm4908/patches-5.4/182-watchdog-bcm7038_wdt-Support-BCM6345-compatible-stri.patch b/target/linux/bcm4908/patches-5.4/182-watchdog-bcm7038_wdt-Support-BCM6345-compatible-stri.patch
new file mode 100644 (file)
index 0000000..6a6f7e4
--- /dev/null
@@ -0,0 +1,28 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Wed, 16 Feb 2022 07:28:34 +0100
+Subject: [PATCH] watchdog: bcm7038_wdt: Support BCM6345 compatible string
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+A new "compatible" value has been added in the commit 17fffe91ba36
+("dt-bindings: watchdog: Add BCM6345 compatible to BCM7038 binding").
+It's meant to be used for BCM63xx SoCs family but hardware block can be
+programmed just like the 7038 one.
+
+Cc: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+---
+ drivers/watchdog/bcm7038_wdt.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/watchdog/bcm7038_wdt.c
++++ b/drivers/watchdog/bcm7038_wdt.c
+@@ -193,6 +193,7 @@ static SIMPLE_DEV_PM_OPS(bcm7038_wdt_pm_
+                        bcm7038_wdt_resume);
+ static const struct of_device_id bcm7038_wdt_match[] = {
++      { .compatible = "brcm,bcm6345-wdt" },
+       { .compatible = "brcm,bcm7038-wdt" },
+       {},
+ };
index c28c69c6f890ac46ce24fc63100ac6c8d4f86c7d..5d924d68c6f1ad37e6b36e094c5c65f3efbfd6ef 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
 
 --- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
 +++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
-@@ -281,7 +281,7 @@
+@@ -290,7 +290,7 @@
                gpio0: gpio-controller@500 {
                        compatible = "brcm,bcm6345-gpio";
                        reg-names = "dirout", "dat";
diff --git a/target/linux/bcm4908/patches-5.4/301-arm64-dts-broadcom-bcm4908-add-TWD-block.patch b/target/linux/bcm4908/patches-5.4/301-arm64-dts-broadcom-bcm4908-add-TWD-block.patch
deleted file mode 100644 (file)
index c505a46..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Tue, 9 Nov 2021 11:39:42 +0100
-Subject: [PATCH] arm64: dts: broadcom: bcm4908: add TWD block
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-BCM4908 contains TWD block that provides few functions:
-1. Timers
-2. Wathchdog
-3. Software reset
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
----
- .../boot/dts/broadcom/bcm4908/bcm4908.dtsi      | 17 +++++++++++++----
- 1 file changed, 13 insertions(+), 4 deletions(-)
-
---- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
-+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
-@@ -276,6 +276,15 @@
-               twd: timer-mfd@400 {
-                       compatible = "brcm,bcm4908-twd", "simple-mfd", "syscon";
-                       reg = <0x400 0x4c>;
-+                      ranges = <0x0 0x400 0x4c>;
-+
-+                      #address-cells = <1>;
-+                      #size-cells = <1>;
-+
-+                      watchdog@28 {
-+                              compatible = "brcm,bcm7038-wdt";
-+                              reg = <0x28 0x8>;
-+                      };
-               };
-               gpio0: gpio-controller@500 {
diff --git a/target/linux/bcm4908/patches-5.4/800-watchdog-bcm7038_wdt-allow-building-on-ARCH_BCM4908.patch b/target/linux/bcm4908/patches-5.4/800-watchdog-bcm7038_wdt-allow-building-on-ARCH_BCM4908.patch
deleted file mode 100644 (file)
index 16ed3f5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Tue, 9 Nov 2021 11:34:28 +0100
-Subject: [PATCH] watchdog: bcm7038_wdt: allow building on ARCH_BCM4908
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The same hardware block is present on BCM4908 SoCs family.
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
----
- drivers/watchdog/Kconfig | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/watchdog/Kconfig
-+++ b/drivers/watchdog/Kconfig
-@@ -1759,7 +1759,7 @@ config BCM7038_WDT
-       tristate "BCM7038 Watchdog"
-       select WATCHDOG_CORE
-       depends on HAS_IOMEM
--      depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
-+      depends on ARCH_BCM4908 || ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
-       help
-        Watchdog driver for the built-in hardware in Broadcom 7038 and
-        later SoCs used in set-top boxes.  BCM7038 was made public