From 503a87a1a307384baeaad540ecb8b6b251f6e7e4 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 22 Jul 2017 15:12:59 +0100 Subject: [PATCH] Fixes for Raspberry Pi UARTS (hopefully Bluetooth too) and SD/mmc controllers, and an IRQ controller fix --- ...id-warning-from-__irq_do_set_handler.patch | 30 +++ ...sdhost.patch => bcm2837-sdhost-fixes.patch | 41 +++++ ...Define-UART-pinmuxing-on-board-level.patch | 171 ++++++++++++++++++ kernel.spec | 20 +- 4 files changed, 253 insertions(+), 9 deletions(-) rename bcm2837-sdhost.patch => bcm2837-sdhost-fixes.patch (51%) create mode 100644 bcm283x-Define-UART-pinmuxing-on-board-level.patch diff --git a/bcm2835-pinctrl-Avoid-warning-from-__irq_do_set_handler.patch b/bcm2835-pinctrl-Avoid-warning-from-__irq_do_set_handler.patch index d44e5318b..258d3b210 100644 --- a/bcm2835-pinctrl-Avoid-warning-from-__irq_do_set_handler.patch +++ b/bcm2835-pinctrl-Avoid-warning-from-__irq_do_set_handler.patch @@ -38,3 +38,33 @@ index 1eb7a1a..2308831 100644 /* * Use the same handler for all groups: this is necessary * since we use one gpiochip to cover all lines - the +From 8aa99fe688734f249b07314cdd7c5e25651c9c6d Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 27 Oct 2016 16:21:19 +0100 +Subject: irq-bcm2836: Prevent spurious interrupts, and trap them early + +The old arch-specific IRQ macros included a dsb to ensure the +write to clear the mailbox interrupt completed before returning +from the interrupt. The BCM2836 irqchip driver needs the same +precaution to avoid spurious interrupts. + +Signed-off-by: Phil Elwell +--- + drivers/irqchip/irq-bcm2836.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c +index e7463e3..a8db33b 100644 +--- a/drivers/irqchip/irq-bcm2836.c ++++ b/drivers/irqchip/irq-bcm2836.c +@@ -175,6 +175,7 @@ __exception_irq_entry bcm2836_arm_irqchip_handle_irq(struct pt_regs *regs) + u32 ipi = ffs(mbox_val) - 1; + + writel(1 << ipi, mailbox0); ++ dsb(sy); + handle_IPI(ipi, regs); + #endif + } else if (stat) { +-- +cgit v0.12 + diff --git a/bcm2837-sdhost.patch b/bcm2837-sdhost-fixes.patch similarity index 51% rename from bcm2837-sdhost.patch rename to bcm2837-sdhost-fixes.patch index ea6cf1d97..9b81005ad 100644 --- a/bcm2837-sdhost.patch +++ b/bcm2837-sdhost-fixes.patch @@ -40,3 +40,44 @@ index c309633..972f14d 100644 -- cgit v0.12 +From 0c1759bc4fc8884d790d4ab99b5276132559b5a1 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 21 Jun 2016 10:00:58 +0200 +Subject: arm: dts: bcm283x: switch from &sdhci to &sdhost + +sdcard access with the sdhost controller is faster. + +Read access (dd with 64k blocks on rpi2): + CONFIG_MMC_SDHCI_IPROC: 11-12 MB/s + CONFIG_MMC_BCM2835: 19-20 MB/s + +Differences on write access are pretty much in the noise. + +Signed-off-by: Gerd Hoffmann +Acked-by: Eric Anholt +--- + arch/arm/boot/dts/bcm2835-rpi.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi +index 8b95832..e36c392 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi +@@ -65,13 +65,13 @@ + &sdhci { + pinctrl-names = "default"; + pinctrl-0 = <&emmc_gpio48>; +- status = "okay"; + bus-width = <4>; + }; + + &sdhost { + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_gpio48>; ++ status = "okay"; + bus-width = <4>; + }; + +-- +cgit v0.12 + diff --git a/bcm283x-Define-UART-pinmuxing-on-board-level.patch b/bcm283x-Define-UART-pinmuxing-on-board-level.patch new file mode 100644 index 000000000..26efe9007 --- /dev/null +++ b/bcm283x-Define-UART-pinmuxing-on-board-level.patch @@ -0,0 +1,171 @@ +From patchwork Thu Jul 20 19:37:07 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [1/3] ARM: bcm283x: Define UART pinmuxing on board level +From: Stefan Wahren +X-Patchwork-Id: 9855625 +Message-Id: <1500579429-9101-2-git-send-email-stefan.wahren@i2se.com> +To: Eric Anholt , Rob Herring , + Mark Rutland +Cc: Stefan Wahren , devicetree@vger.kernel.org, + Florian Fainelli , + Scott Branden , + linux-rpi-kernel@lists.infradead.org, + linux-arm-kernel@lists.infradead.org, Gerd Hoffmann +Date: Thu, 20 Jul 2017 21:37:07 +0200 + +Until RPI 3 and Zero W the pl011 (uart0) was always on pin 14/15. So in +order to take care of them and other boards in the future, +we need to define UART pinmuxing on board level. + +This work based on Eric Anholt's patch "ARM: bcm2385: Don't force pl011 +onto pins 14/15." and Fabian Vogt's patch "ARM64: dts: bcm2837: assign +uart0 to BT and uart1 to pin headers". + +Signed-off-by: Stefan Wahren +--- + arch/arm/boot/dts/bcm2835-rpi-a-plus.dts | 6 ++++++ + arch/arm/boot/dts/bcm2835-rpi-a.dts | 6 ++++++ + arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 6 ++++++ + arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 6 ++++++ + arch/arm/boot/dts/bcm2835-rpi-b.dts | 6 ++++++ + arch/arm/boot/dts/bcm2835-rpi-zero.dts | 6 ++++++ + arch/arm/boot/dts/bcm2835-rpi.dtsi | 2 +- + arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 6 ++++++ + arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts | 10 ++++++++++ + 9 files changed, 53 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts +index d070454..9f86649 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts ++++ b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts +@@ -99,3 +99,9 @@ + &hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_gpio14>; ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/bcm2835-rpi-a.dts b/arch/arm/boot/dts/bcm2835-rpi-a.dts +index 46d078e..4b1af06 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi-a.dts ++++ b/arch/arm/boot/dts/bcm2835-rpi-a.dts +@@ -94,3 +94,9 @@ + &hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; + }; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_gpio14>; ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts +index 432088e..a846f1e 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts +@@ -101,3 +101,9 @@ + &hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_gpio14>; ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts +index 4133bc2..e860964 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts ++++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts +@@ -94,3 +94,9 @@ + &hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_gpio14>; ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts +index 4d56fe3..5d77f3f 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts +@@ -89,3 +89,9 @@ + &hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; + }; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_gpio14>; ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero.dts b/arch/arm/boot/dts/bcm2835-rpi-zero.dts +index 79a20d5..7036240 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi-zero.dts ++++ b/arch/arm/boot/dts/bcm2835-rpi-zero.dts +@@ -103,3 +103,9 @@ + &hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_gpio14>; ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi +index e55b362..e36c392 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi +@@ -39,7 +39,7 @@ + }; + + alt0: alt0 { +- brcm,pins = <4 5 7 8 9 10 11 14 15>; ++ brcm,pins = <4 5 7 8 9 10 11>; + brcm,function = ; + }; + }; +diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts +index bf19e8c..e8de414 100644 +--- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts +@@ -39,3 +39,9 @@ + &hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_gpio14>; ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts +index 972f14d..20725ca 100644 +--- a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts ++++ b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts +@@ -19,7 +19,17 @@ + }; + }; + ++/* uart0 communicates with the BT module */ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_ctsrts_gpio30 &gpclk2_gpio43>; ++ status = "okay"; ++}; ++ ++/* uart1 is mapped to the pin header */ + &uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_gpio14>; + status = "okay"; + }; + diff --git a/kernel.spec b/kernel.spec index 53b7dabc9..ec69965e6 100644 --- a/kernel.spec +++ b/kernel.spec @@ -614,20 +614,21 @@ Patch320: bcm283x-vc4-fix-vblank.patch # https://patchwork.kernel.org/patch/9802555/ Patch321: bcm2835-pinctrl-Avoid-warning-from-__irq_do_set_handler.patch -Patch322: bcm2837-sdhost.patch - -Patch323: bcm2835-clk-audio-jitter-issues.patch -Patch324: bcm2835-fix-potential-null-pointer-dereferences.patch - -# http://www.spinics.net/lists/devicetree/msg163238.html -Patch325: bcm2837-arm32-support.patch +Patch322: bcm2835-clk-audio-jitter-issues.patch +Patch323: bcm2835-fix-potential-null-pointer-dereferences.patch # http://www.spinics.net/lists/dri-devel/msg132235.html -Patch326: bcm283x-drm-vc4-Fix-OOPSes-from-trying-to-cache-a-partially-constructed-BO..patch +Patch324: bcm283x-drm-vc4-Fix-OOPSes-from-trying-to-cache-a-partially-constructed-BO..patch + +Patch325: bcm2837-sdhost-fixes.patch +Patch326: bcm283x-Define-UART-pinmuxing-on-board-level.patch + +# http://www.spinics.net/lists/devicetree/msg163238.html +Patch329: bcm2837-arm32-support.patch # This breaks RPi booting with a LPAE kernel, we don't support the DSI ports currently # Revert it while I engage upstream to work out what's going on -Patch327: Revert-ARM-dts-bcm2835-Add-the-DSI-module-nodes-and-.patch +Patch330: Revert-ARM-dts-bcm2835-Add-the-DSI-module-nodes-and-.patch # 400 - IBM (ppc/s390x) patches @@ -2241,6 +2242,7 @@ fi %changelog * Sat Jul 22 2017 Peter Robinson - Fix bcm2837 SDIO (WiFi) +- Raspberry Pi fixes (UART, mmc controller) * Fri Jul 21 2017 Justin M. Forbes - 4.12.3-100 - Linux v4.12.3