From: Álvaro Fernández Rojas Date: Sat, 10 Sep 2016 12:54:26 +0000 (+0200) Subject: brcm2708: update linux 4.4 patches to latest version X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2b1c6b21b5e6c82ebb55d7fb7df90e60e88cbb14;p=openwrt%2Fstaging%2Fldir.git brcm2708: update linux 4.4 patches to latest version As usual these patches were extracted and rebased from the raspberry pi repo: https://github.com/raspberrypi/linux/tree/rpi-4.4.y Also adds support for Raspberry Pi Compute Module 3 (untested). Signed-off-by: Álvaro Fernández Rojas --- diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile index 81a7647ec2..85c72e27da 100644 --- a/target/linux/brcm2708/image/Makefile +++ b/target/linux/brcm2708/image/Makefile @@ -68,8 +68,8 @@ ifeq ($(SUBTARGET),bcm2709) endif define Device/rpi-3 - DEVICE_TITLE := Raspberry Pi 3 B - DEVICE_DTS := bcm2710-rpi-3-b + DEVICE_TITLE := Raspberry Pi 3 B/CM + DEVICE_DTS := bcm2710-rpi-3-b bcm2710-rpi-cm3 DEVICE_PACKAGES := brcmfmac43430-firmware-sdio kmod-brcmfmac wpad-mini endef ifeq ($(SUBTARGET),bcm2710) diff --git a/target/linux/brcm2708/image/config.txt b/target/linux/brcm2708/image/config.txt index 23adf27675..b0fbd7a5eb 100644 --- a/target/linux/brcm2708/image/config.txt +++ b/target/linux/brcm2708/image/config.txt @@ -947,6 +947,7 @@ dtparam=spi=on #dtoverlay=hifiberry-dac #dtoverlay=hifiberry-dacplus #dtoverlay=hifiberry-digi +#dtoverlay=hifiberry-digi-pro #dtoverlay=iqaudio-dac #dtoverlay=iqaudio-dacplus #dtoverlay=iqaudio-digi-wm8804-audio diff --git a/target/linux/brcm2708/modules.mk b/target/linux/brcm2708/modules.mk index 70ef662897..4cfdd6d7c4 100644 --- a/target/linux/brcm2708/modules.mk +++ b/target/linux/brcm2708/modules.mk @@ -183,7 +183,7 @@ endef $(eval $(call KernelPackage,sound-soc-hifiberry-dacplus)) define KernelPackage/sound-soc-hifiberry-digi - TITLE:=Support for HifiBerry Digi + TITLE:=Support for HifiBerry Digi / Digi+ / Digi+ Pro KCONFIG:= \ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI \ CONFIG_SND_SOC_WM8804 diff --git a/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch index 9b384a265a..5e6a82cb15 100644 --- a/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch +++ b/target/linux/brcm2708/patches-4.4/0001-smsx95xx-fix-crimes-against-truesize.patch @@ -1,7 +1,7 @@ -From 047957666a5478b924a129892c54ab9c41816a43 Mon Sep 17 00:00:00 2001 +From 4f81faf37ec66edd44da24800c5a5ae87edae808 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/423] smsx95xx: fix crimes against truesize +Subject: [PATCH] smsx95xx: fix crimes against truesize smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings. diff --git a/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch b/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch index 9fc6c91ac8..1a79fd08df 100644 --- a/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch +++ b/target/linux/brcm2708/patches-4.4/0002-smsc95xx-Disable-turbo-mode-by-default.patch @@ -1,7 +1,7 @@ -From 4b0c62e74a6e2e01e7d37fb6be0865df77c0ad03 Mon Sep 17 00:00:00 2001 +From 588a0950ef065eb5a0b36974394245ae2c9fc75b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 002/423] smsc95xx: Disable turbo mode by default +Subject: [PATCH] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- diff --git a/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch b/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch index 74ada1637e..e93fc31b8e 100644 --- a/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch +++ b/target/linux/brcm2708/patches-4.4/0003-vmstat-Workaround-for-issue-where-dirty-page-count-g.patch @@ -1,8 +1,8 @@ -From d69c65cb5ad6738d5bec2531df75824c44459800 Mon Sep 17 00:00:00 2001 +From 8ca7ff8021f8d9bcbac83bd4584da9bbc854b829 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 003/423] vmstat: Workaround for issue where dirty page count - goes negative +Subject: [PATCH] vmstat: Workaround for issue where dirty page count goes + negative See: https://github.com/raspberrypi/linux/issues/617 diff --git a/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch b/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch index 8585c23a7c..bd4e1f731d 100644 --- a/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch +++ b/target/linux/brcm2708/patches-4.4/0004-BCM2835_DT-Fix-I2S-register-map.patch @@ -1,7 +1,7 @@ -From 7d5a47372854564f8071edeaf217360d2f53cde0 Mon Sep 17 00:00:00 2001 +From 7aa3931981956896b353b58c068a941f522182bf Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 004/423] BCM2835_DT: Fix I2S register map +Subject: [PATCH] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- diff --git a/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch b/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch index bcc521efbf..3977b8d9b3 100644 --- a/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch +++ b/target/linux/brcm2708/patches-4.4/0005-irq-bcm2836-Prevent-spurious-interrupts-and-trap-the.patch @@ -1,8 +1,7 @@ -From 8ec469e6ed6a5dd357c04322dfc4e2ddbfcc040b Mon Sep 17 00:00:00 2001 +From 71609ab22785edd13b385920b1b0c6de24adc901 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 005/423] irq-bcm2836: Prevent spurious interrupts, and trap - them early +Subject: [PATCH] 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 diff --git a/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch b/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch index 592773c8a7..8ad59ed4d7 100644 --- a/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch +++ b/target/linux/brcm2708/patches-4.4/0006-irqchip-bcm2835-Add-FIQ-support.patch @@ -1,7 +1,7 @@ -From daf4407e90396b12f87cfd75651505dee67f1c0c Mon Sep 17 00:00:00 2001 +From e34586ca8f6b346d1ee37230f26c7ad44ca15786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 12 Jun 2015 19:01:05 +0200 -Subject: [PATCH 006/423] irqchip: bcm2835: Add FIQ support +Subject: [PATCH] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch b/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch index 53cec549f0..b58728de54 100644 --- a/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch +++ b/target/linux/brcm2708/patches-4.4/0007-irqchip-irq-bcm2835-Add-2836-FIQ-support.patch @@ -1,7 +1,7 @@ -From d6cad8a047430f5095e43e0d0e8f083e6ab411df Mon Sep 17 00:00:00 2001 +From e6387565d57b8d3912948dfb89d27705ef04bb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Oct 2015 16:26:55 +0200 -Subject: [PATCH 007/423] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch b/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch index 156798d97b..49ead89722 100644 --- a/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch +++ b/target/linux/brcm2708/patches-4.4/0008-serial-8250-Don-t-crash-when-nr_uarts-is-0.patch @@ -1,7 +1,7 @@ -From cc33367763a6674463698cffab1a4a653df4ebd3 Mon Sep 17 00:00:00 2001 +From 5638cf1b2b8a418553790662c414b29ced8521dd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 008/423] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ diff --git a/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch b/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch index f0f47cbc29..c9c093635b 100644 --- a/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch +++ b/target/linux/brcm2708/patches-4.4/0009-pinctrl-bcm2835-Set-base-to-0-give-expected-gpio-num.patch @@ -1,8 +1,7 @@ -From f168c856794b7a771661df395f3fd16b8c8435b3 Mon Sep 17 00:00:00 2001 +From d64c6c6de97acb1f18415dfeeabd7e19294830a1 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 009/423] pinctrl-bcm2835: Set base to 0 give expected gpio - numbering +Subject: [PATCH] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes --- diff --git a/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch b/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch index 0b84e729e6..44e79fad25 100644 --- a/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch +++ b/target/linux/brcm2708/patches-4.4/0010-pinctrl-bcm2835-Fix-interrupt-handling-for-GPIOs-28-.patch @@ -1,8 +1,8 @@ -From 62e5e9d21249eb4818c37bbcc07b334f97684f0b Mon Sep 17 00:00:00 2001 +From 1d1f6e6688a282e9b091fcb56719893c72e88a3a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 010/423] pinctrl-bcm2835: Fix interrupt handling for GPIOs - 28-31 and 46-53 +Subject: [PATCH] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and + 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has four interrupt lines - one each for the three IRQ groups and one common. Rather diff --git a/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch b/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch index 20cbbcfb8c..7ac6970a9e 100644 --- a/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch +++ b/target/linux/brcm2708/patches-4.4/0011-pinctrl-bcm2835-Only-request-the-interrupts-listed-i.patch @@ -1,8 +1,8 @@ -From 33665d0e0cca6401025655121d66450716353f75 Mon Sep 17 00:00:00 2001 +From d52d6e440040cd5139f9f9ef0071ea00b103302e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 011/423] pinctrl-bcm2835: Only request the interrupts listed - in the DTB +Subject: [PATCH] pinctrl-bcm2835: Only request the interrupts listed in the + DTB Although the GPIO controller can generate three interrupts (four counting the common one), the device tree files currently only specify two. In the diff --git a/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch b/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch index 5eb0f9c7bd..13ef4396e9 100644 --- a/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch +++ b/target/linux/brcm2708/patches-4.4/0012-spi-bcm2835-Support-pin-groups-other-than-7-11.patch @@ -1,7 +1,7 @@ -From 9cb63901af94334ee9f4bf55f731633ea478626a Mon Sep 17 00:00:00 2001 +From 41c1cc2920df75124c931cd58f6b67ec586a5a6a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 012/423] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH] spi-bcm2835: Support pin groups other than 7-11 The spi-bcm2835 driver automatically uses GPIO chip-selects due to some unreliability of the native ones. In doing so it chooses the diff --git a/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch b/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch index 125b3fdfad..a1b4af0c9d 100644 --- a/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch +++ b/target/linux/brcm2708/patches-4.4/0013-ARM-bcm2835-Set-Serial-number-and-Revision.patch @@ -1,7 +1,7 @@ -From d9bc838cde2a45c850c3a23d96c8ebe9715ea253 Mon Sep 17 00:00:00 2001 +From 3b9d28ec938020106f431f5a47ab5525b73bb0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Jun 2015 12:26:13 +0200 -Subject: [PATCH 013/423] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch b/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch index 3ac376a454..9e551b9ebc 100644 --- a/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch +++ b/target/linux/brcm2708/patches-4.4/0014-bcm2835-i2s-get-base-address-for-DMA-from-devicetree.patch @@ -1,7 +1,7 @@ -From 5d071d8a4f3a0c60bd48071d64f9d311d019d296 Mon Sep 17 00:00:00 2001 +From 17025015a60ffc92d09ade98131ed080bbf09106 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 16:44:05 +0200 -Subject: [PATCH 014/423] bcm2835-i2s: get base address for DMA from devicetree +Subject: [PATCH] bcm2835-i2s: get base address for DMA from devicetree Code copied from spi-bcm2835. Get physical address from devicetree instead of using hardcoded constant. diff --git a/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch b/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch index 9dfb283247..5afab2e6d1 100644 --- a/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch +++ b/target/linux/brcm2708/patches-4.4/0015-bcm2835-i2s-add-24bit-support-update-bclk_ratio-to-m.patch @@ -1,8 +1,8 @@ -From b4e96aa5e8f7825050d7ef74ec59d684cedcc8f1 Mon Sep 17 00:00:00 2001 +From fb1dbd3a7ff1ae0ccd429a4decafc882473f5d94 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:21:16 +0200 -Subject: [PATCH 015/423] bcm2835-i2s: add 24bit support, update bclk_ratio to - more correct values +Subject: [PATCH] bcm2835-i2s: add 24bit support, update bclk_ratio to more + correct values Code ported from bcm2708-i2s driver in Raspberry Pi tree. diff --git a/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch b/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch index dfcb747140..e61700f976 100644 --- a/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch +++ b/target/linux/brcm2708/patches-4.4/0016-bcm2835-i2s-setup-clock-only-if-CPU-is-clock-master.patch @@ -1,7 +1,7 @@ -From bd46c6f9df173b2b81bac5cb19814f0b66063b25 Mon Sep 17 00:00:00 2001 +From 63e23a08bd0bcf782f870bacaf82404e36a6a1bd Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:25:51 +0200 -Subject: [PATCH 016/423] bcm2835-i2s: setup clock only if CPU is clock master +Subject: [PATCH] bcm2835-i2s: setup clock only if CPU is clock master Code ported from bcm2708-i2s driver in Raspberry Pi tree. diff --git a/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch b/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch index bfa51fed03..306dd977b4 100644 --- a/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch +++ b/target/linux/brcm2708/patches-4.4/0017-bcm2835-i2s-Eliminate-debugfs-directory-error.patch @@ -1,7 +1,7 @@ -From 83f3ec096572e1f1878eb5f97632e7830fc606bd Mon Sep 17 00:00:00 2001 +From 487c53a0c7bbf586ccc441dfc6f7021dc5f1522d Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:49:51 +0200 -Subject: [PATCH 017/423] bcm2835-i2s: Eliminate debugfs directory error +Subject: [PATCH] bcm2835-i2s: Eliminate debugfs directory error Code ported from bcm2708-i2s driver in Raspberry Pi tree. diff --git a/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch b/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch index 44a2b00dd9..f7470a36cb 100644 --- a/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch +++ b/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch @@ -1,7 +1,7 @@ -From c096f1d64ef032af2c9f2713727de6ec849969c5 Mon Sep 17 00:00:00 2001 +From d86d8ab0405b4eecee7516670e9497ce450c1bbe Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:35:20 +0200 -Subject: [PATCH 018/423] bcm2835-i2s: Register PCM device +Subject: [PATCH] bcm2835-i2s: Register PCM device Code ported from bcm2708-i2s driver in Raspberry Pi tree. diff --git a/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch b/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch index 2f16bf7f1a..6624efba47 100644 --- a/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch +++ b/target/linux/brcm2708/patches-4.4/0019-bcm2835-i2s-Enable-MMAP-support-via-a-DT-property.patch @@ -1,7 +1,7 @@ -From ec8796e8ccf92931ff87fb7626be8f3e63ddc2d0 Mon Sep 17 00:00:00 2001 +From 4d08d5e742e59e1e73787bfeca27595d5afbf1af Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:55:21 +0200 -Subject: [PATCH 019/423] bcm2835-i2s: Enable MMAP support via a DT property +Subject: [PATCH] bcm2835-i2s: Enable MMAP support via a DT property Code ported from bcm2708-i2s driver in Raspberry Pi tree. diff --git a/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch b/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch index 8155cc751a..651f96ea67 100644 --- a/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch +++ b/target/linux/brcm2708/patches-4.4/0020-dmaengine-bcm2835-Add-slave-dma-support.patch @@ -1,7 +1,7 @@ -From a272c5805686c77e924f85e314cb5df77bea40be Mon Sep 17 00:00:00 2001 +From c9f03ab8241d445daebd5fb8c4cf63c976460e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 9 Apr 2015 12:34:11 +0200 -Subject: [PATCH 020/423] dmaengine: bcm2835: Add slave dma support +Subject: [PATCH] dmaengine: bcm2835: Add slave dma support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch b/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch index 7be45f7c70..336f50d3cd 100644 --- a/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch +++ b/target/linux/brcm2708/patches-4.4/0021-dmaengine-bcm2835-set-residue_granularity-field.patch @@ -1,7 +1,7 @@ -From 5780349e26ba486276936393f666bea55c5dbf1e Mon Sep 17 00:00:00 2001 +From f4f1c7f4084eca4b826a07a43c467e2febe57f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Oct 2015 15:58:59 +0200 -Subject: [PATCH 021/423] dmaengine: bcm2835: set residue_granularity field +Subject: [PATCH] dmaengine: bcm2835: set residue_granularity field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch index 9f86ae9bed..00ba9cd554 100644 --- a/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch +++ b/target/linux/brcm2708/patches-4.4/0022-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch @@ -1,8 +1,7 @@ -From 24e006fc71be77120ac237af3797f4aa103ca0e1 Mon Sep 17 00:00:00 2001 +From d7714e2a4e40cbeb4e69fb7465621f2014b358d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Oct 2015 22:22:55 +0200 -Subject: [PATCH 022/423] dmaengine: bcm2835: Load driver early and support - legacy API +Subject: [PATCH] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch b/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch index 490cadb0ce..403e2970bc 100644 --- a/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch +++ b/target/linux/brcm2708/patches-4.4/0023-bcm2835-dma-Fix-dreq-not-set-for-slave-transfers.patch @@ -1,7 +1,7 @@ -From 411b5abcce1b72fdba106a7236548b8b5315a6e6 Mon Sep 17 00:00:00 2001 +From 93e23eca701dfbf20def2a598af43d64c39bd9b8 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sat, 10 Oct 2015 12:29:18 +0200 -Subject: [PATCH 023/423] bcm2835-dma: Fix dreq not set for slave transfers +Subject: [PATCH] bcm2835-dma: Fix dreq not set for slave transfers Set dreq to slave_id if it is not set like in bcm2708-dmaengine. --- diff --git a/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch b/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch index b332fe6f19..92f1c030cd 100644 --- a/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch +++ b/target/linux/brcm2708/patches-4.4/0024-bcm2835-dma-Limit-cyclic-transfers-on-lite-channels-.patch @@ -1,8 +1,7 @@ -From 8eb5210cea099d814f9e583358343d8680c5d05d Mon Sep 17 00:00:00 2001 +From fc5bc111e65b27883284591aec9db5a290665ac9 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 12:28:30 +0200 -Subject: [PATCH 024/423] bcm2835-dma: Limit cyclic transfers on lite channels - to 32k +Subject: [PATCH] bcm2835-dma: Limit cyclic transfers on lite channels to 32k Transfers larger than 32k cause repeated clicking with I2S soundcards. The exact reason is yet unknown, so limit to 32k as bcm2708-dmaengine diff --git a/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch b/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch index f7faeff0c2..d1c8941488 100644 --- a/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch +++ b/target/linux/brcm2708/patches-4.4/0025-bcm2835-Add-support-for-uart1.patch @@ -1,7 +1,7 @@ -From c8963aeb4b3fbebc8e1de91a65e9f188a1e43d59 Mon Sep 17 00:00:00 2001 +From e95d949879bf632a5fa82c9a1c5607b40388484e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 15 Aug 2015 20:50:02 +0200 -Subject: [PATCH 025/423] bcm2835: Add support for uart1 +Subject: [PATCH] bcm2835: Add support for uart1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch b/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch index f303420394..14c3aac713 100644 --- a/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch +++ b/target/linux/brcm2708/patches-4.4/0026-firmware-bcm2835-Add-missing-property-tags.patch @@ -1,7 +1,7 @@ -From ed165fd5d29fa90e6605cb4b87ec5cd35e4209c7 Mon Sep 17 00:00:00 2001 +From 65277e76bcc581bb99f98bb69d9b603bdbfa1d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:21:20 +0200 -Subject: [PATCH 026/423] firmware: bcm2835: Add missing property tags +Subject: [PATCH] firmware: bcm2835: Add missing property tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch b/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch index 7fd31ebeda..766e49990f 100644 --- a/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch +++ b/target/linux/brcm2708/patches-4.4/0027-Main-bcm2708-bcm2709-linux-port.patch @@ -1,7 +1,7 @@ -From 50d8450a9fd5b05873e3b404e2089067920d53c1 Mon Sep 17 00:00:00 2001 +From cea9e735ed55e4e75819e984290cf147e9712c73 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 027/423] Main bcm2708/bcm2709 linux port +Subject: [PATCH] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch b/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch index 99a6bedcd8..63231fab6d 100644 --- a/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch +++ b/target/linux/brcm2708/patches-4.4/0028-squash-include-ARCH_BCM2708-ARCH_BCM2709.patch @@ -1,7 +1,7 @@ -From f455b928205d24aebbf0cc3cf5a9fff4cfb9563e Mon Sep 17 00:00:00 2001 +From 613412454d5196c8982a3abc0820389c16599a51 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 11 Nov 2015 21:01:15 +0000 -Subject: [PATCH 028/423] squash: include ARCH_BCM2708 / ARCH_BCM2709 +Subject: [PATCH] squash: include ARCH_BCM2708 / ARCH_BCM2709 --- drivers/char/hw_random/Kconfig | 2 +- diff --git a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch index 379d35c153..57f442cf5f 100644 --- a/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0029-Add-dwc_otg-driver.patch @@ -1,7 +1,7 @@ -From 89ea7c60a305783a6790e7e7e91b1451cd40fe78 Mon Sep 17 00:00:00 2001 +From 130a06f0f8becad1e93d3dda1ce96d6e5413ee39 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 029/423] Add dwc_otg driver +Subject: [PATCH] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch b/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch index 7e9426a8a2..18be5797ee 100644 --- a/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0030-bcm2708-framebuffer-driver.patch @@ -1,7 +1,7 @@ -From 006091f6aa1f34a2b92fb8ff1defd86d232b7e90 Mon Sep 17 00:00:00 2001 +From c634714a43035371d4035b65e67413dcf1ff0f8e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 030/423] bcm2708 framebuffer driver +Subject: [PATCH] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch b/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch index 14dd81be2d..067b5ad013 100644 --- a/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch +++ b/target/linux/brcm2708/patches-4.4/0031-dmaengine-Add-support-for-BCM2708.patch @@ -1,7 +1,7 @@ -From 6ab9b89c4a3def17db462e0902bb0ba325a7c191 Mon Sep 17 00:00:00 2001 +From 5fca3a9b2f0c0c928fa94368cdb767829a696ed5 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 031/423] dmaengine: Add support for BCM2708 +Subject: [PATCH] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch b/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch index a22069109b..2c9534f19d 100644 --- a/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0032-MMC-added-alternative-MMC-driver.patch @@ -1,7 +1,7 @@ -From ed0042e046abbd2cee8425ff8e8c535cb025c22a Mon Sep 17 00:00:00 2001 +From 28aa7cada5d110ced59ef0d9392a7fb3121cc551 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 032/423] MMC: added alternative MMC driver +Subject: [PATCH] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch b/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch index 333c30289f..5ec38b2fb6 100644 --- a/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch +++ b/target/linux/brcm2708/patches-4.4/0033-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch @@ -1,8 +1,7 @@ -From 7b251a5ab7f06c8f5720a0d49529e0dbe0514503 Mon Sep 17 00:00:00 2001 +From 0c9b7e17d022e45363737d67da590524416f8e3d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 033/423] Adding bcm2835-sdhost driver, and an overlay to - enable it +Subject: [PATCH] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. diff --git a/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch b/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch index 3773cd734a..e9a6ed1147 100644 --- a/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch +++ b/target/linux/brcm2708/patches-4.4/0034-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch @@ -1,7 +1,7 @@ -From effd8d3a65306de4f6cb43aa2139a75d181d9cee Mon Sep 17 00:00:00 2001 +From dec8e7bfb37280733ec278955f1bd8dd2bc176b8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 034/423] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH] cma: Add vc_cma driver to enable use of CMA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch b/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch index 06b770f4e5..f4bbcf3983 100644 --- a/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0035-bcm2708-alsa-sound-driver.patch @@ -1,7 +1,7 @@ -From 809b8fb074a009dec508c02986b27979c5d78b1d Mon Sep 17 00:00:00 2001 +From b3f75cc54e1ee4612cfb34e2a91e03e3d1923534 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 035/423] bcm2708: alsa sound driver +Subject: [PATCH] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch b/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch index 3b94b8e694..5086521898 100644 --- a/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0036-bcm2708-vchiq-driver.patch @@ -1,7 +1,7 @@ -From 1b37904494fc7c9923dde14aa08a63405d89d989 Mon Sep 17 00:00:00 2001 +From 9a1f0040b1f125f8729c772c1ad8e6940b923d7a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 036/423] bcm2708 vchiq driver +Subject: [PATCH] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch b/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch index 189c77172f..ead1162c9e 100644 --- a/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0037-vc_mem-Add-vc_mem-driver.patch @@ -1,7 +1,7 @@ -From 1dc99a2709085bc7bda11bd457280e9f00fd173b Mon Sep 17 00:00:00 2001 +From bad77c41a36b52033392a19b2b6d51037f2614a5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 037/423] vc_mem: Add vc_mem driver +Subject: [PATCH] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch b/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch index e6e088ccb3..fd193b0e2e 100644 --- a/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch +++ b/target/linux/brcm2708/patches-4.4/0038-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch @@ -1,7 +1,7 @@ -From 98151664c3404e6ce9abe16241aaef78d260c967 Mon Sep 17 00:00:00 2001 +From 6bdbcad7cce6f6a6fc02f67add6b82d3fcc9e0c6 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 038/423] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch b/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch index f9d03e154f..25a2ae76bd 100644 --- a/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch +++ b/target/linux/brcm2708/patches-4.4/0039-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch @@ -1,7 +1,7 @@ -From ccfc207deae0f9e76975908af6c16460a4e05650 Mon Sep 17 00:00:00 2001 +From 5dc37246986844910511379a5c57ca87a50c6c0d Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 039/423] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren diff --git a/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch b/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch index e6e8da6b97..c69862fe7c 100644 --- a/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0040-Add-SMI-driver.patch @@ -1,7 +1,7 @@ -From d2e199c4c3e599a0166cbaed671f5446a366ccd6 Mon Sep 17 00:00:00 2001 +From d85d7801b25872d08bd848c40da8fce973db5e46 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 040/423] Add SMI driver +Subject: [PATCH] Add SMI driver Signed-off-by: Luke Wren --- diff --git a/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch b/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch index 3c5692a125..b5fe99009f 100644 --- a/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0041-Add-SMI-NAND-driver.patch @@ -1,7 +1,7 @@ -From f7066cd5ed22219015dd9e55dd2070f4822da956 Mon Sep 17 00:00:00 2001 +From b1718d13dae01f04ead925c9562bf18634bbf267 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 041/423] Add SMI NAND driver +Subject: [PATCH] Add SMI NAND driver Signed-off-by: Luke Wren --- diff --git a/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch b/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch index dd4a033f14..d9e9079b38 100644 --- a/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch +++ b/target/linux/brcm2708/patches-4.4/0042-lirc-added-support-for-RaspberryPi-GPIO.patch @@ -1,7 +1,7 @@ -From 687cb2fff7d0f3480fd39e5ffbebe912e46fa972 Mon Sep 17 00:00:00 2001 +From b4269ab1d08d22959ec26ce1d31a45a1c5e85191 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 042/423] lirc: added support for RaspberryPi GPIO +Subject: [PATCH] lirc: added support for RaspberryPi GPIO lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others See: https://github.com/raspberrypi/linux/issues/525 diff --git a/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch b/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch index 884abdf55f..11659f6747 100644 --- a/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0043-Add-cpufreq-driver.patch @@ -1,7 +1,7 @@ -From bf5b94ef7f3f667e384108aa84bee8195da04383 Mon Sep 17 00:00:00 2001 +From f3f2bddacba23cab954a421d490bd17364e69d2d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 043/423] Add cpufreq driver +Subject: [PATCH] Add cpufreq driver Signed-off-by: popcornmix --- diff --git a/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch b/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch index f55071da8f..deb88d4c96 100644 --- a/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch +++ b/target/linux/brcm2708/patches-4.4/0044-Added-hwmon-thermal-driver-for-reporting-core-temper.patch @@ -1,8 +1,8 @@ -From 83b388b35dea05c454a5b2eceec0eff06cc863fb Mon Sep 17 00:00:00 2001 +From 688fec3024a2648a48396168a73ada00131682e1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 044/423] Added hwmon/thermal driver for reporting core - temperature. Thanks Dorian +Subject: [PATCH] Added hwmon/thermal driver for reporting core temperature. + Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch b/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch index 874796ab0d..21d0674c1f 100644 --- a/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0045-Add-Chris-Boot-s-i2c-driver.patch @@ -1,7 +1,7 @@ -From d25b6fcbf3005ae61c5a1940b8a0a47ee545289b Mon Sep 17 00:00:00 2001 +From b78bc1bb96c2db043c3be03c1bcccefa22621543 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 045/423] Add Chris Boot's i2c driver +Subject: [PATCH] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch b/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch index 92f728cc38..0b21588e57 100644 --- a/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch +++ b/target/linux/brcm2708/patches-4.4/0046-char-broadcom-Add-vcio-module.patch @@ -1,7 +1,7 @@ -From ea599a4e38ae921ec5aa8966163ea442357281df Mon Sep 17 00:00:00 2001 +From 0fed71c0553d0bc86798f395c7e354cd132c9802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:27:06 +0200 -Subject: [PATCH 046/423] char: broadcom: Add vcio module +Subject: [PATCH] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch b/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch index 5e9b745a18..2713d7fd76 100644 --- a/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch +++ b/target/linux/brcm2708/patches-4.4/0047-firmware-bcm2835-Support-ARCH_BCM270x.patch @@ -1,7 +1,7 @@ -From 996a87d316243001486fe36b36a7b6ffb4dd1b28 Mon Sep 17 00:00:00 2001 +From 2d716ee18a62c6e8b3a2e28a225bb3484693b6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:25:01 +0200 -Subject: [PATCH 047/423] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch b/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch index 51b150168d..6f59f573ab 100644 --- a/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch +++ b/target/linux/brcm2708/patches-4.4/0048-bcm2835-add-v4l2-camera-device.patch @@ -1,7 +1,7 @@ -From b7c2738cecfa7e32e689f9e9f51f7a0283c6e494 Mon Sep 17 00:00:00 2001 +From b2868be5ed011e649590efdbcc6356bee4fcf257 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 048/423] bcm2835: add v4l2 camera device +Subject: [PATCH] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. diff --git a/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch b/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch index ddde544172..06d2a0bcf1 100644 --- a/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch +++ b/target/linux/brcm2708/patches-4.4/0049-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch @@ -1,8 +1,7 @@ -From 5ea28aea74a57b9cbbb59ee7df29c5994fc6ad81 Mon Sep 17 00:00:00 2001 +From 10a2bc39e76f415f9a42166ccc7af7e7b43565fc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 049/423] scripts: Add mkknlimg and knlinfo scripts from tools - repo +Subject: [PATCH] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to determine whether it was compiled with Device Tree support enabled. diff --git a/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch b/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch index c1308c5d41..60bed19c76 100644 --- a/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch +++ b/target/linux/brcm2708/patches-4.4/0050-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch @@ -1,7 +1,7 @@ -From ef0a1dc5b8069728671aa1d4a9cee2a2beda16be Mon Sep 17 00:00:00 2001 +From 5e3dd32b2906cc4f07b81f18de3d4a23c417e8fc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 050/423] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- diff --git a/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch b/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch index 8f0f23102a..9631c93a7d 100644 --- a/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch +++ b/target/linux/brcm2708/patches-4.4/0051-BCM2708-Add-core-Device-Tree-support.patch @@ -1,7 +1,7 @@ -From c159387861a9b3e1b0f9fe12d6afe06f0cb8994d Mon Sep 17 00:00:00 2001 +From 48b5e0d194a88c4de6956f94ddd788e126de0a77 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 051/423] BCM2708: Add core Device Tree support +Subject: [PATCH] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. diff --git a/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch b/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch index bd48e73647..5d3ebc5e9d 100644 --- a/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch +++ b/target/linux/brcm2708/patches-4.4/0052-bcm2835-Match-with-BCM2708-Device-Trees.patch @@ -1,7 +1,7 @@ -From d867b1d6a7470aec5946b495a10a311742b08c18 Mon Sep 17 00:00:00 2001 +From a8bd4a9fead66a720889c5693bf0d21608d9e2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 15 Aug 2015 20:47:07 +0200 -Subject: [PATCH 052/423] bcm2835: Match with BCM2708 Device Trees +Subject: [PATCH] bcm2835: Match with BCM2708 Device Trees MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch b/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch index b4944e4771..2a07c75040 100644 --- a/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch +++ b/target/linux/brcm2708/patches-4.4/0053-fbdev-add-FBIOCOPYAREA-ioctl.patch @@ -1,7 +1,7 @@ -From 6e0a601e2a1eb727b7b3f00c41e5d54197087feb Mon Sep 17 00:00:00 2001 +From a05a655545efe01002cf061b4373a9bb0071a302 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 053/423] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 diff --git a/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch b/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch index 05bbf2a9e6..8325ba9735 100644 --- a/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch +++ b/target/linux/brcm2708/patches-4.4/0057-Speed-up-console-framebuffer-imageblit-function.patch @@ -1,7 +1,7 @@ -From 90df15f55607a4ec3b29374c5f7781300160bac3 Mon Sep 17 00:00:00 2001 +From 4d7fd18a26cbb4a3cab0aff6ed48070e3aaf3599 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 057/423] Speed up console framebuffer imageblit function +Subject: [PATCH] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing diff --git a/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch b/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch index afc515a732..31adff746e 100644 --- a/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch +++ b/target/linux/brcm2708/patches-4.4/0058-Allow-mac-address-to-be-set-in-smsc95xx.patch @@ -1,7 +1,7 @@ -From 531927425d5bfd1525c7d47d321eeddff1eb3364 Mon Sep 17 00:00:00 2001 +From e681d15368e0c4515a5ee4bf238f859e8c501cf9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 058/423] Allow mac address to be set in smsc95xx +Subject: [PATCH] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- diff --git a/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch b/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch index ef5bf1d52e..890bd744e3 100644 --- a/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch +++ b/target/linux/brcm2708/patches-4.4/0059-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch @@ -1,8 +1,8 @@ -From f339686c292d0a4e50fbe6f9ccb294291f103605 Mon Sep 17 00:00:00 2001 +From cab5187fbbc59808bab951b7f2736c4f0deff9fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 059/423] enabling the realtime clock 1-wire chip DS1307 and - 1-wire on GPIO4 (as a module) +Subject: [PATCH] enabling the realtime clock 1-wire chip DS1307 and 1-wire on + GPIO4 (as a module) 1-wire: Add support for configuring pin for w1-gpio kernel module See: https://github.com/raspberrypi/linux/pull/457 diff --git a/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch b/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch index 09c6aad3dd..457377205a 100644 --- a/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch +++ b/target/linux/brcm2708/patches-4.4/0060-Added-Device-IDs-for-August-DVB-T-205.patch @@ -1,7 +1,7 @@ -From 934350e21fb2edfd042742892bbd4ea5173208ab Mon Sep 17 00:00:00 2001 +From c21be4772d67bc0b6bd3a59ce878b5dae705af44 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:54:08 +0100 -Subject: [PATCH 060/423] Added Device IDs for August DVB-T 205 +Subject: [PATCH] Added Device IDs for August DVB-T 205 --- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 4 ++++ diff --git a/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch b/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch index 6418cc0af3..662d90dd2c 100644 --- a/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch +++ b/target/linux/brcm2708/patches-4.4/0061-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch @@ -1,8 +1,8 @@ -From 1ca424ef0079f90d9c5d1310bcbefe928b5e3fec Mon Sep 17 00:00:00 2001 +From 7106c05e5f71588e746c786f93b1fca9dcdd3c50 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 061/423] config: Enable CONFIG_MEMCG, but leave it disabled - (due to memory cost). Enable with cgroup_enable=memory. +Subject: [PATCH] config: Enable CONFIG_MEMCG, but leave it disabled (due to + memory cost). Enable with cgroup_enable=memory. --- kernel/cgroup.c | 23 ++++++++++++++++++++++- diff --git a/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch b/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch index 12a87afe23..3001849ce1 100644 --- a/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch +++ b/target/linux/brcm2708/patches-4.4/0062-ASoC-Add-support-for-PCM5102A-codec.patch @@ -1,7 +1,7 @@ -From fe45c479a680651326d22e6b966df63b2e719f70 Mon Sep 17 00:00:00 2001 +From dbcc62f3ac4f3996b77cfb6b00ec26dc99f2521b Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 062/423] ASoC: Add support for PCM5102A codec +Subject: [PATCH] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. diff --git a/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch b/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch index 5b90e115d7..943febc5c1 100644 --- a/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch +++ b/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-HifiBerry-DAC.patch @@ -1,7 +1,7 @@ -From 35b87454d0cc08adf25c4e4e50cfbcae16af45eb Mon Sep 17 00:00:00 2001 +From 592ac515f17d49627b6653375267bad5c4bb1e5c Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 063/423] ASoC: Add support for HifiBerry DAC +Subject: [PATCH] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can diff --git a/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch b/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch index 8e6e1e0b5e..5adc0476de 100644 --- a/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch +++ b/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-Rpi-DAC.patch @@ -1,7 +1,7 @@ -From 3f7614446e868612ab9099c7c959f43f29aa7e03 Mon Sep 17 00:00:00 2001 +From ffd6597f0c3cff5d2171347f23b9a98d4e6fa95e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 064/423] ASoC: Add support for Rpi-DAC +Subject: [PATCH] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ diff --git a/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch b/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch index fa02163623..b71141cc2c 100644 --- a/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch +++ b/target/linux/brcm2708/patches-4.4/0065-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch @@ -1,16 +1,16 @@ -From 6148931ae669f041a7036c9eb0ec1b225275c1dd Mon Sep 17 00:00:00 2001 +From 34e0545c33b0f444a5dd8c066cfe37420e95db33 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 065/423] ASoC: wm8804: Implement MCLK configuration options, - add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs - for most sample rates. At 192kHz only 128xfs is supported. The existing - driver selects 128xfs automatically for some lower samples rates. By using an - additional mclk_div divider, it is now possible to control the behaviour. - This allows using 256xfs PLL frequency on all sample rates up to 96kHz. It - should allow lower jitter and better signal quality. The behavior has to be - controlled by the sound card driver, because some sample frequency share the - same setting. e.g. 192kHz and 96kHz use 24.576MHz master clock. The only - difference is the MCLK divider. +Subject: [PATCH] ASoC: wm8804: Implement MCLK configuration options, add 32bit + support WM8804 can run with PLL frequencies of 256xfs and 128xfs for most + sample rates. At 192kHz only 128xfs is supported. The existing driver selects + 128xfs automatically for some lower samples rates. By using an additional + mclk_div divider, it is now possible to control the behaviour. This allows + using 256xfs PLL frequency on all sample rates up to 96kHz. It should allow + lower jitter and better signal quality. The behavior has to be controlled by + the sound card driver, because some sample frequency share the same setting. + e.g. 192kHz and 96kHz use 24.576MHz master clock. The only difference is the + MCLK divider. This also added support for 32bit data. diff --git a/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch b/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch index fb95a676f0..727e72728e 100644 --- a/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch +++ b/target/linux/brcm2708/patches-4.4/0066-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch @@ -1,8 +1,8 @@ -From 8678473916702a1f744f65ca953febb10c297827 Mon Sep 17 00:00:00 2001 +From 1d300db91ccab78593f0ea40d4e1c8a931232197 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 066/423] ASoC: BCM:Add support for HiFiBerry Digi. Driver is - based on the patched WM8804 driver. +Subject: [PATCH] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on + the patched WM8804 driver. Signed-off-by: Daniel Matuschek diff --git a/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch b/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch index 4cd07fd4eb..f9c706798a 100644 --- a/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch +++ b/target/linux/brcm2708/patches-4.4/0067-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch @@ -1,8 +1,8 @@ -From db3e779eb462f937984d57ed072b84c736ac179c Mon Sep 17 00:00:00 2001 +From 0dd064b656993f40c09c055a6bef13fa023ceedf Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 067/423] ASoC: wm8804: Set idle_bias_off to false Idle bias - has been change to remove warning on driver startup +Subject: [PATCH] ASoC: wm8804: Set idle_bias_off to false Idle bias has been + change to remove warning on driver startup Signed-off-by: Daniel Matuschek --- diff --git a/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch b/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch index 0088c6ec12..2c86d25ce3 100644 --- a/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch +++ b/target/linux/brcm2708/patches-4.4/0068-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch @@ -1,7 +1,7 @@ -From b4efbfd86348893b2317131b7d355f64e619ab06 Mon Sep 17 00:00:00 2001 +From 8a4af475fccaff7b70b3d93ef1730001a2376063 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 068/423] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control diff --git a/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch b/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch index aeadeb69ef..c3b599900a 100644 --- a/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch +++ b/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch @@ -1,7 +1,7 @@ -From 2238f04766e0b653319a3291b546ba49d651ce81 Mon Sep 17 00:00:00 2001 +From 8529e2130a7d67c7595746e5cf618e6058c3315c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 069/423] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- diff --git a/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch b/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch index dcdddf3e47..a6a55f3af7 100644 --- a/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch +++ b/target/linux/brcm2708/patches-4.4/0070-Added-support-for-HiFiBerry-DAC.patch @@ -1,7 +1,7 @@ -From 3d116a8311017380e686bdddf80143d1a6cf885e Mon Sep 17 00:00:00 2001 +From aaa93fd9dee0084d0c2d9b50021fe7f2a2457fd7 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 070/423] Added support for HiFiBerry DAC+ +Subject: [PATCH] Added support for HiFiBerry DAC+ The driver is based on the HiFiBerry DAC driver. However HiFiBerry DAC+ uses a different codec chip (PCM5122), therefore a new driver is necessary. diff --git a/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch b/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch index 7c3fb9d0cc..1d71ac9fdc 100644 --- a/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch +++ b/target/linux/brcm2708/patches-4.4/0071-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch @@ -1,7 +1,7 @@ -From 7266f151fac2e09d08b71dc0bdd404506dc00055 Mon Sep 17 00:00:00 2001 +From 4f718b9dbd8bd3d9ce465351463b0240116f4945 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 071/423] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH] Added driver for HiFiBerry Amp amplifier add-on board The driver contains a low-level hardware driver for the TAS5713 and the drivers for the Raspberry Pi I2S subsystem. diff --git a/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch b/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch index e3322fb84c..0259d5edf1 100644 --- a/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch +++ b/target/linux/brcm2708/patches-4.4/0072-Update-ds1307-driver-for-device-tree-support.patch @@ -1,7 +1,7 @@ -From 62e75253eba759318d83706ba162a14c53182ff5 Mon Sep 17 00:00:00 2001 +From 5527e5534c58f8555d699d10d2d67afc3aa768e0 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 072/423] Update ds1307 driver for device-tree support +Subject: [PATCH] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- diff --git a/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch b/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch index 44b2866877..63ac021aad 100644 --- a/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch +++ b/target/linux/brcm2708/patches-4.4/0073-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch @@ -1,8 +1,7 @@ -From 8404a4fe589f3b7a42eb4d3e61719d76dfb83658 Mon Sep 17 00:00:00 2001 +From b19a2e678c297e81b8b9ab6db1f4775be1c678a8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 073/423] BCM270x_DT: Add pwr_led, and the required "input" - trigger +Subject: [PATCH] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support the Raspberry Pi PWR LED, which is driven by external hardware in normal use. diff --git a/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch b/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch index b11ad3b96b..bb88376441 100644 --- a/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch +++ b/target/linux/brcm2708/patches-4.4/0074-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch @@ -1,8 +1,7 @@ -From ec66f897c2625ff0764c64229b4756b0b6f88a03 Mon Sep 17 00:00:00 2001 +From 2eb050c58ca0620dd91af4e49a584118fadd9398 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 074/423] enc28j60: Add device tree compatible string and an - overlay +Subject: [PATCH] enc28j60: Add device tree compatible string and an overlay --- drivers/net/ethernet/microchip/enc28j60.c | 7 +++++++ diff --git a/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch b/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch index 3ee2aef630..20f0dc36a1 100644 --- a/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch +++ b/target/linux/brcm2708/patches-4.4/0075-Add-driver-for-rpi-proto.patch @@ -1,7 +1,7 @@ -From f48bdbd9477a98b4ab42e72c45ce7162eb09c030 Mon Sep 17 00:00:00 2001 +From bae12047250724b26ffd0acdceeede7dfe766f52 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 075/423] Add driver for rpi-proto +Subject: [PATCH] Add driver for rpi-proto Forward port of 3.10.x driver from https://github.com/koalo We are using a custom board and would like to use rpi 3.18.x diff --git a/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch b/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch index 7500bb2438..4f4934849b 100644 --- a/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch +++ b/target/linux/brcm2708/patches-4.4/0076-config-Add-default-configs.patch @@ -1,7 +1,7 @@ -From 212f11d668fe451c892828d1882ddc5d8b591621 Mon Sep 17 00:00:00 2001 +From b9a95c01f53d1ae5e2e5d24682d7533ee1f487a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 076/423] config: Add default configs +Subject: [PATCH] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1254 +++++++++++++++++++++++++++++++++++ diff --git a/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch b/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch index 28309e20e4..1726f5a1d4 100644 --- a/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch +++ b/target/linux/brcm2708/patches-4.4/0077-bcm2835-bcm2835_defconfig.patch @@ -1,7 +1,7 @@ -From cc0e6881fbf29462ec038d308a655c935a9096f7 Mon Sep 17 00:00:00 2001 +From c06545159fe86fd45a9ff570e0a1b7cf04c2ebe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 29 Apr 2015 17:24:02 +0200 -Subject: [PATCH 077/423] bcm2835: bcm2835_defconfig +Subject: [PATCH] bcm2835: bcm2835_defconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch b/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch index 50b55fd3a0..960b19fc76 100644 --- a/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch +++ b/target/linux/brcm2708/patches-4.4/0078-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch @@ -1,7 +1,7 @@ -From 6910ec0ffdad51f2a970f8080545c3ce621f3042 Mon Sep 17 00:00:00 2001 +From 1c0f57f0ad2d226ec0d1ef1e91a38c3abdee891a Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 078/423] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH] rpi-ft5406: Add touchscreen driver for pi LCD display Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected diff --git a/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch index c685572f64..235008e2a2 100644 --- a/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/brcm2708/patches-4.4/0079-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -1,8 +1,7 @@ -From efa4432e1c5b0a373108e2f4cefc23d882939e0c Mon Sep 17 00:00:00 2001 +From 74c81d3d8233d758e3e58f9a72dd6370d08077ac Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 079/423] Improve __copy_to_user and __copy_from_user - performance +Subject: [PATCH] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use optimised memcpy/memmove/memcmp/memset implementations. diff --git a/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch b/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch index 2f6dcccf8c..d02152db49 100644 --- a/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch +++ b/target/linux/brcm2708/patches-4.4/0080-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch @@ -1,7 +1,7 @@ -From 2fd2d651ece51accc95f9f9fcb8256e7d05a26df Mon Sep 17 00:00:00 2001 +From 24703d6981447867a7092997e29ac911698ec77d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 080/423] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH] gpio-poweroff: Allow it to work on Raspberry Pi The Raspberry Pi firmware manages the power-down and reboot process. To do this it installs a pm_power_off handler, causing diff --git a/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch b/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch index cddfab2afa..875d31944f 100644 --- a/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch +++ b/target/linux/brcm2708/patches-4.4/0081-spidev-Add-spidev-compatible-string-to-silence-warni.patch @@ -1,8 +1,7 @@ -From 2cba4b03311a1d55f96d6e759ffb234f67d02080 Mon Sep 17 00:00:00 2001 +From 962e7c5c04075063b86f389043dcfe1ac948a868 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 081/423] spidev: Add "spidev" compatible string to silence - warning +Subject: [PATCH] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 --- diff --git a/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch b/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch index 8915537587..31c02d61ab 100644 --- a/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch +++ b/target/linux/brcm2708/patches-4.4/0082-scripts-dtc-Add-overlay-support.patch @@ -1,7 +1,7 @@ -From 48bbf5d241136bc7cf19db80aeb4b09040dde4da Mon Sep 17 00:00:00 2001 +From cd035dbd2c541ab1f517f79d6b7c54948a91ed8b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 17:00:18 +0100 -Subject: [PATCH 082/423] scripts/dtc: Add overlay support +Subject: [PATCH] scripts/dtc: Add overlay support --- scripts/dtc/checks.c | 119 ++- diff --git a/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch b/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch index f2b07d2c80..7d491d5149 100644 --- a/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0083-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch @@ -1,7 +1,7 @@ -From cb1da07eaac82084fe16f086989d98b5590a4d61 Mon Sep 17 00:00:00 2001 +From 2b475b95bcf5487bd23b7a636ce36fae98f6e81a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 083/423] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + diff --git a/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch b/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch index 035088d34e..b1870462f4 100644 --- a/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch +++ b/target/linux/brcm2708/patches-4.4/0084-RaspiDAC3-support.patch @@ -1,7 +1,7 @@ -From 10cbc09000e1d326cff1273f92423c30f9a848a9 Mon Sep 17 00:00:00 2001 +From 89afb4f891b10c2f736cfac22f274e33ebc5256e Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 084/423] RaspiDAC3 support +Subject: [PATCH] RaspiDAC3 support Signed-off-by: Jan Grulich diff --git a/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch b/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch index 2919498e5e..aca4d75103 100644 --- a/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch +++ b/target/linux/brcm2708/patches-4.4/0085-tpa6130a2-Add-headphone-switch-control.patch @@ -1,7 +1,7 @@ -From dcfb4303fbbc327ec5f1b990d12c79384cd5a8db Mon Sep 17 00:00:00 2001 +From d182e9b8453b663bb0c75f73e1791bf78f2d4bcc Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:02:34 +0100 -Subject: [PATCH 085/423] tpa6130a2: Add headphone switch control +Subject: [PATCH] tpa6130a2: Add headphone switch control Signed-off-by: Jan Grulich --- diff --git a/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch b/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch index 4e76983a74..edd36602d7 100644 --- a/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch +++ b/target/linux/brcm2708/patches-4.4/0086-irq-bcm2835-Fix-building-with-2708.patch @@ -1,7 +1,7 @@ -From 20bc23d5669c1a70a03db60768eb3d4b100a658f Mon Sep 17 00:00:00 2001 +From 80bd42a96b7c6a20219803609651acd9e49f4db6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Sep 2015 23:38:59 +0100 -Subject: [PATCH 086/423] irq-bcm2835: Fix building with 2708 +Subject: [PATCH] irq-bcm2835: Fix building with 2708 --- drivers/irqchip/irq-bcm2835.c | 3 ++- diff --git a/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch b/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch index f1a7db89b8..db292ccd5c 100644 --- a/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0087-rpi_display-add-backlight-driver-and-overlay.patch @@ -1,7 +1,7 @@ -From cabbd4561f8a04b087fb867cedb002cd5170375f Mon Sep 17 00:00:00 2001 +From a8124cba46bd8d4d8fdf9e09fe3046b01ff21c42 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 087/423] rpi_display: add backlight driver and overlay +Subject: [PATCH] rpi_display: add backlight driver and overlay Add a mailbox-driven backlight controller for the Raspberry Pi DSI touchscreen display. Requires updated GPU firmware to recognise the diff --git a/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch b/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch index 364f4ffe7f..ef15b9ecec 100644 --- a/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch +++ b/target/linux/brcm2708/patches-4.4/0088-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch @@ -1,7 +1,7 @@ -From c0af79182427336015c026314b7c35a82c24b7aa Mon Sep 17 00:00:00 2001 +From 7e7500431515d41e1498cef0984ef6f9b91cac67 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Mon, 16 Nov 2015 14:05:35 +0000 -Subject: [PATCH 088/423] bcm2835-dma: Fix up convert to DMA pool +Subject: [PATCH] bcm2835-dma: Fix up convert to DMA pool --- drivers/dma/bcm2835-dma.c | 36 ++++++++++++++++++++++++++---------- diff --git a/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch b/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch index 8b93b5a1cb..a3bd0a0c09 100644 --- a/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch +++ b/target/linux/brcm2708/patches-4.4/0089-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch @@ -1,8 +1,7 @@ -From 644468c76c90757811b1490557d7fa1ab8e9477b Mon Sep 17 00:00:00 2001 +From 93ede86bcccc686cdc933e0711289b0312f0361a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Nov 2015 11:38:59 +0000 -Subject: [PATCH 089/423] scripts: Multi-platform support for mkknlimg and - knlinfo +Subject: [PATCH] scripts: Multi-platform support for mkknlimg and knlinfo The firmware uses tags in the kernel trailer to choose which dtb file to load. Current firmware loads bcm2835-*.dtb if the '283x' tag is true, diff --git a/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch b/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch index 3a8892bdc1..c3ca12800d 100644 --- a/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch +++ b/target/linux/brcm2708/patches-4.4/0090-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch @@ -1,8 +1,7 @@ -From b2366bf5c6c6c13d7d3b0e7099c6e71f4f775df6 Mon Sep 17 00:00:00 2001 +From a70ea1cd22e9b4e7278dfea3b2d6fb87e8902ca3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 2 Mar 2015 13:01:12 -0800 -Subject: [PATCH 090/423] drm/vc4: Add suport for 3D rendering using the V3D - engine. +Subject: [PATCH] drm/vc4: Add suport for 3D rendering using the V3D engine. This is a squash of the out-of-tree development series. Since that series contained code from the first "get a demo triangle rendered diff --git a/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch index a6f78ef355..00a22d384e 100644 --- a/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch +++ b/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Force-HDMI-to-connected.patch @@ -1,7 +1,7 @@ -From ffe4a5fe0c4dfb0c58193b6ff2e5e7eb37b350ad Mon Sep 17 00:00:00 2001 +From 1c356bdfac710d5427cfeac2ce2216d0bb17a6db Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Oct 2015 11:32:14 -0700 -Subject: [PATCH 091/423] drm/vc4: Force HDMI to connected. +Subject: [PATCH] drm/vc4: Force HDMI to connected. For some reason on the downstream tree, the HPD GPIO isn't working. diff --git a/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch b/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch index b8df5457fb..df465b4178 100644 --- a/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch +++ b/target/linux/brcm2708/patches-4.4/0092-drm-vc4-bo-cache-locking-fixes.patch @@ -1,7 +1,7 @@ -From ac56795420156559b5381fbf4ad1f607baca2935 Mon Sep 17 00:00:00 2001 +From 99cab11df7185247a24977d8cbcf5d660d0f861b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:23:18 -0700 -Subject: [PATCH 092/423] drm/vc4: bo cache locking fixes. +Subject: [PATCH] drm/vc4: bo cache locking fixes. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch b/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch index 223524e753..b0ae22f807 100644 --- a/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch +++ b/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-cleanup.patch @@ -1,7 +1,7 @@ -From 0ff2836cb0c35edfaa40124957f5884527bd4c1e Mon Sep 17 00:00:00 2001 +From beac608ce63d6537a89f3de8080a1c2d16aa1a4c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:29:41 -0700 -Subject: [PATCH 093/423] drm/vc4: bo cache locking cleanup. +Subject: [PATCH] drm/vc4: bo cache locking cleanup. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch b/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch index 8292103ff5..4a29fc15ec 100644 --- a/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch +++ b/target/linux/brcm2708/patches-4.4/0094-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch @@ -1,7 +1,7 @@ -From 616e0a78750f2c92c52ac7f6638a8f5a901afdaf Mon Sep 17 00:00:00 2001 +From 454b9dabe51753598732a2d91f742abdd82f3b18 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:32:24 -0700 -Subject: [PATCH 094/423] drm/vc4: Use job_lock to protect seqno_cb_list. +Subject: [PATCH] drm/vc4: Use job_lock to protect seqno_cb_list. We're (mostly) not supposed to be using struct_mutex in drivers these days. diff --git a/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch b/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch index edc6f7534c..0cf7654920 100644 --- a/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch +++ b/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Drop-struct_mutex-around-CL-validation.patch @@ -1,7 +1,7 @@ -From c554ca947004989217c25487dfadedd633928dc3 Mon Sep 17 00:00:00 2001 +From 72634a2adb667d991249e66e691878cd7e7722a0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:44:35 -0700 -Subject: [PATCH 095/423] drm/vc4: Drop struct_mutex around CL validation. +Subject: [PATCH] drm/vc4: Drop struct_mutex around CL validation. We were using it so that we could make sure that shader validation state didn't change while we were validating, but now shader diff --git a/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch b/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch index 1ab2a2f4b3..98412c140e 100644 --- a/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch +++ b/target/linux/brcm2708/patches-4.4/0096-drm-vc4-Drop-struct_mutex-around-CL-validation.patch @@ -1,7 +1,7 @@ -From c43a9027e42856592c071e5bbc7e38e8f236ce51 Mon Sep 17 00:00:00 2001 +From 81fcdac0b54488a1fea35a0fe2e799511888fa84 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:44:35 -0700 -Subject: [PATCH 096/423] drm/vc4: Drop struct_mutex around CL validation. +Subject: [PATCH] drm/vc4: Drop struct_mutex around CL validation. We were using it so that we could make sure that shader validation state didn't change while we were validating, but now shader diff --git a/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch b/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch index 8e479a9f2e..6f0ad8aef8 100644 --- a/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch +++ b/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Add-support-for-more-display-plane-formats.patch @@ -1,7 +1,7 @@ -From ea5d1ac38aba536dcd088cbf8eae229e4651ccbd Mon Sep 17 00:00:00 2001 +From 593759c954e9ac7b237bb4e2136a12952ae107d0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Oct 2015 13:59:15 +0100 -Subject: [PATCH 097/423] drm/vc4: Add support for more display plane formats. +Subject: [PATCH] drm/vc4: Add support for more display plane formats. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch b/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch index 004c1a33ce..18dffd6d8a 100644 --- a/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch +++ b/target/linux/brcm2708/patches-4.4/0098-drm-vc4-No-need-to-stop-the-stopped-threads.patch @@ -1,7 +1,7 @@ -From 910b5fa15403115a76d5ee2a4f7932b051454e9c Mon Sep 17 00:00:00 2001 +From ab2cd74a31d3da208cc6264ab79c1c0ee503498d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Oct 2015 12:31:56 +0100 -Subject: [PATCH 098/423] drm/vc4: No need to stop the stopped threads. +Subject: [PATCH] drm/vc4: No need to stop the stopped threads. This was leftover debug code from the hackdriver. We never submit unless the thread is already idle. diff --git a/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch b/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch index 47bde13eca..432a60ebf4 100644 --- a/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch +++ b/target/linux/brcm2708/patches-4.4/0099-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch @@ -1,8 +1,7 @@ -From bc2764818666e6b24c4dc41e65a472a3fd0bdd74 Mon Sep 17 00:00:00 2001 +From 7ab57c24a8c094163c2a5da180edbba0c45b5765 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Oct 2015 12:33:43 +0100 -Subject: [PATCH 099/423] drm/vc4: Remove extra barrier()s aroudn CTnCA/CTnEA - setup. +Subject: [PATCH] drm/vc4: Remove extra barrier()s aroudn CTnCA/CTnEA setup. The writel() that these expand to already does barriers. diff --git a/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch b/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch index ca8c8b6193..e15cae83bc 100644 --- a/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch +++ b/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch @@ -1,7 +1,7 @@ -From b474d69ad1b4e5032c565868082e36f64854106e Mon Sep 17 00:00:00 2001 +From b1cfa411e68e4afc1d8bedda4ae1924108a5c2fa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Oct 2015 14:57:22 +0100 -Subject: [PATCH 100/423] drm/vc4: Fix a typo in a V3D debug register. +Subject: [PATCH] drm/vc4: Fix a typo in a V3D debug register. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch b/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch index ff46406539..5cf4a64036 100644 --- a/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch +++ b/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch @@ -1,8 +1,8 @@ -From 29e3799c22dba7bb579a8caacc957f888965b2dc Mon Sep 17 00:00:00 2001 +From 7a4238c79a815c0cb87eecb30897f6710f5e4a82 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 2 Nov 2015 17:07:33 +0000 -Subject: [PATCH 101/423] drm/vc4: Enable VC4 modules, and increase CMA size - with overlay +Subject: [PATCH] drm/vc4: Enable VC4 modules, and increase CMA size with + overlay If using the overlay, be careful not to boot to GUI or run startx, or the Pi will almost hang, reporting stalls in kernel threads. diff --git a/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch b/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch index eb92ddfba7..f9046563b4 100644 --- a/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch +++ b/target/linux/brcm2708/patches-4.4/0102-squash-fixups.patch @@ -1,7 +1,7 @@ -From 9727788fde8cab56ee1f6957aa6a0d369401dfbb Mon Sep 17 00:00:00 2001 +From 505327ef0c6712565139bfbae6fde8c881566088 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Nov 2015 18:29:58 +0000 -Subject: [PATCH 102/423] squash: fixups +Subject: [PATCH] squash: fixups --- drivers/gpu/drm/vc4/Kconfig | 2 +- diff --git a/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch b/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch index d8f12f318b..ee54a40298 100644 --- a/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch +++ b/target/linux/brcm2708/patches-4.4/0103-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch @@ -1,8 +1,7 @@ -From aefe0ee79893899fcbbaeac2c1ea27828d5b9645 Mon Sep 17 00:00:00 2001 +From fd632236b26e841d032acc5fce6cdd4d50780daa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Nov 2015 20:26:03 +0000 -Subject: [PATCH 103/423] squash: add missing vc4-kms-v3d-overlay.dtb to - makefile +Subject: [PATCH] squash: add missing vc4-kms-v3d-overlay.dtb to makefile --- arch/arm/boot/dts/overlays/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch b/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch index 93b752e362..3cf0524c70 100644 --- a/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch +++ b/target/linux/brcm2708/patches-4.4/0104-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch @@ -1,8 +1,7 @@ -From 02f9b12f8c9335eb9312bbde0f2a06ae52d35191 Mon Sep 17 00:00:00 2001 +From d8d6facbd16527ccc11a926e769ec3e86f60dcdb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Oct 2015 11:23:34 -0700 -Subject: [PATCH 104/423] clk: bcm2835: Also build the driver for downstream - kernels. +Subject: [PATCH] clk: bcm2835: Also build the driver for downstream kernels. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch b/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch index 25cecf26c6..da3fcce9fa 100644 --- a/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0105-dts-Added-overlay-for-gpio_ir_recv-driver.patch @@ -1,7 +1,7 @@ -From 9bf65a0b3903fdd475b8c6a59426c415ecdf3ec3 Mon Sep 17 00:00:00 2001 +From d47719348c1c616d8ffa42d9ae8827147c0251ea Mon Sep 17 00:00:00 2001 From: Holger Steinhaus Date: Sat, 14 Nov 2015 18:37:43 +0100 -Subject: [PATCH 105/423] dts: Added overlay for gpio_ir_recv driver +Subject: [PATCH] dts: Added overlay for gpio_ir_recv driver --- arch/arm/boot/dts/overlays/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch b/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch index f3cecaafb9..5b3a401df0 100644 --- a/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch +++ b/target/linux/brcm2708/patches-4.4/0106-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch @@ -1,8 +1,8 @@ -From 377a971a6d66cd45f011daeb17eaf6cbba59f54c Mon Sep 17 00:00:00 2001 +From 85b8ee017f92d4aa0e004e01878cab3ba5b88851 Mon Sep 17 00:00:00 2001 From: Alistair Buxton Date: Sun, 1 Nov 2015 22:27:56 +0000 -Subject: [PATCH 106/423] Build i2c_gpio module and add a device tree overlay - to configure it. +Subject: [PATCH] Build i2c_gpio module and add a device tree overlay to + configure it. --- arch/arm/boot/dts/overlays/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch b/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch index 22ed096c59..94bb91f37b 100644 --- a/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch +++ b/target/linux/brcm2708/patches-4.4/0107-New-overlay-for-PiScreen2r.patch @@ -1,7 +1,7 @@ -From 40fb51ca3709e962289b659216d5fa29758b5044 Mon Sep 17 00:00:00 2001 +From 1e78b98d827b57373b0a984af0ceb21e576b6037 Mon Sep 17 00:00:00 2001 From: mwilliams03 Date: Sun, 18 Oct 2015 17:07:24 -0700 -Subject: [PATCH 107/423] New overlay for PiScreen2r +Subject: [PATCH] New overlay for PiScreen2r --- arch/arm/boot/dts/overlays/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch b/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch index a840bb8cd8..3deca391b1 100644 --- a/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch +++ b/target/linux/brcm2708/patches-4.4/0108-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch @@ -1,8 +1,8 @@ -From 413f3dadca77a06ea8f0ed1f83a2adc99cdc1fe0 Mon Sep 17 00:00:00 2001 +From cd12f8bd219b60685803c427847909f5151d8143 Mon Sep 17 00:00:00 2001 From: Ondrej Wisniewski Date: Fri, 6 Nov 2015 15:01:28 +0100 -Subject: [PATCH 108/423] dts: Added overlay for Adafruit PiTFT 2.8" capacitive - touch screen +Subject: [PATCH] dts: Added overlay for Adafruit PiTFT 2.8" capacitive touch + screen --- arch/arm/boot/dts/overlays/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch b/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch index a1834b6fff..cce82ef422 100644 --- a/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch +++ b/target/linux/brcm2708/patches-4.4/0109-Add-support-for-the-HiFiBerry-DAC-Pro.patch @@ -1,7 +1,7 @@ -From 03155cfced4c9bf25f22f125aeeb820ca4d08e64 Mon Sep 17 00:00:00 2001 +From bc4c561b1b11b068263addb6ca5055136859cc5e Mon Sep 17 00:00:00 2001 From: Stuart MacLean Date: Fri, 2 Oct 2015 15:12:59 +0100 -Subject: [PATCH 109/423] Add support for the HiFiBerry DAC+ Pro. +Subject: [PATCH] Add support for the HiFiBerry DAC+ Pro. The HiFiBerry DAC+ and DAC+ Pro products both use the existing bcm sound driver with the DAC+ Pro having a special clock device driver representing the two high precision oscillators. diff --git a/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch b/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch index c3b98b55f4..614ab0c1a3 100644 --- a/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0110-BCM270X_DT-Add-at86rf233-overlay.patch @@ -1,7 +1,7 @@ -From 787c2642cbfe90d0ea548926f3eab12bc5d3e378 Mon Sep 17 00:00:00 2001 +From c952f560bf95867368542c0f2e46abe536ad9afc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 5 Oct 2015 10:47:45 +0100 -Subject: [PATCH 110/423] BCM270X_DT: Add at86rf233 overlay +Subject: [PATCH] BCM270X_DT: Add at86rf233 overlay Add an overlay to support the Atmel AT86RF233 WPAN transceiver on spi0.0. diff --git a/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch b/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch index 59e61b7486..d2e3547312 100644 --- a/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch +++ b/target/linux/brcm2708/patches-4.4/0111-mm-Remove-the-PFN-busy-warning.patch @@ -1,7 +1,7 @@ -From 2da545ccd7f9bada3a8afe11c735f772a1907acc Mon Sep 17 00:00:00 2001 +From daf482fad156e7bf39e3e2a26183452068796e7d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 111/423] mm: Remove the PFN busy warning +Subject: [PATCH] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams diff --git a/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch b/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch index 6777acd2bc..91694add77 100644 --- a/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch +++ b/target/linux/brcm2708/patches-4.4/0112-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch @@ -1,8 +1,8 @@ -From 1936051dc9366b134607f626e92a6c58f3a645e6 Mon Sep 17 00:00:00 2001 +From a1fbf2a0424262c6f2d974aa5a6e71d47288e1a8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 19 Nov 2014 12:06:38 -0800 -Subject: [PATCH 112/423] drm: Put an optional field in the driver struct for - GEM obj struct size. +Subject: [PATCH] drm: Put an optional field in the driver struct for GEM obj + struct size. This allows a driver to derive from the CMA object without copying all of the code. diff --git a/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch b/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch index efb7f9f5ed..16dbe75b43 100644 --- a/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch +++ b/target/linux/brcm2708/patches-4.4/0113-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch @@ -1,8 +1,8 @@ -From 513851ff3c5601e7ebcbc0d22df31a0c8ef141e6 Mon Sep 17 00:00:00 2001 +From 66b424ecf55290f394d004e13f800bec1b44a87a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2015 10:09:02 -0700 -Subject: [PATCH 113/423] drm/vc4: Add an interface for capturing the GPU state - after a hang. +Subject: [PATCH] drm/vc4: Add an interface for capturing the GPU state after a + hang. This can be parsed with vc4-gpu-tools tools for trying to figure out what was going on. diff --git a/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch b/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch index d7065fc88b..d99aca9b1e 100644 --- a/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch +++ b/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch @@ -1,8 +1,7 @@ -From 20619faf6bc00265bb70b0ef189a1f8618f3e508 Mon Sep 17 00:00:00 2001 +From c6f6dec9e9b7956d7261f11caf6e2a0b78a54d89 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 4 Dec 2015 11:35:34 -0800 -Subject: [PATCH 114/423] drm/vc4: Update a bunch of code to match upstream - submission. +Subject: [PATCH] drm/vc4: Update a bunch of code to match upstream submission. This gets almost everything matching, except for the MSAA support and using generic PM domains. diff --git a/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch b/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch index 3b99f25926..f7eaf9152b 100644 --- a/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch +++ b/target/linux/brcm2708/patches-4.4/0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch @@ -1,8 +1,8 @@ -From ea38a9fb0b8312167361ea9957b4f7a3233492aa Mon Sep 17 00:00:00 2001 +From 3fb1fdfad76d7ebbe1c78e262f57e636cfa2545d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 11 Dec 2015 19:45:03 -0800 -Subject: [PATCH 115/423] drm: Use the driver's gem_object_free function from - CMA helpers. +Subject: [PATCH] drm: Use the driver's gem_object_free function from CMA + helpers. VC4 wraps the CMA objects in its own structures, so it needs to do its own teardown (waiting for GPU to finish, updating bo_stats tracking). diff --git a/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch b/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch index c4546a0fc4..d8cc64678a 100644 --- a/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch +++ b/target/linux/brcm2708/patches-4.4/0116-drm-vc4-Add-support-for-MSAA-rendering.patch @@ -1,7 +1,7 @@ -From 37a1421ea161a9da980cae4ff81a3fb5521d5090 Mon Sep 17 00:00:00 2001 +From 3fcab2551c8649da57ad5fc5166f85edd870f641 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 17 Jul 2015 13:15:50 -0700 -Subject: [PATCH 116/423] drm/vc4: Add support for MSAA rendering. +Subject: [PATCH] drm/vc4: Add support for MSAA rendering. For MSAA, you set a bit in the binner that halves the size of tiles in each direction, so you can pack 4 samples per pixel in the tile diff --git a/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch b/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch index 3a6798f02e..8cf3997326 100644 --- a/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch +++ b/target/linux/brcm2708/patches-4.4/0117-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch @@ -1,7 +1,7 @@ -From a7d3659d3eefde8fc449f0ca33584a9490165d15 Mon Sep 17 00:00:00 2001 +From 4c19d1b2713fd0452edfc479cea4628229048994 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 8 Dec 2015 14:00:43 -0800 -Subject: [PATCH 117/423] drm/vc4: A few more non-functional changes to sync to +Subject: [PATCH] drm/vc4: A few more non-functional changes to sync to upstream. At this point all that's left is the force-enable of HDMI connector, diff --git a/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch b/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch index f4627ae6d1..ea9ba0b2f9 100644 --- a/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch +++ b/target/linux/brcm2708/patches-4.4/0118-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch @@ -1,8 +1,8 @@ -From d3e66a857abb05fe9eb367e0a8160584ec1db1a7 Mon Sep 17 00:00:00 2001 +From b45971f3b371a7e50bfa2ebd8545abaf299182d5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 15 Dec 2015 23:46:32 +0000 -Subject: [PATCH 118/423] drm/vc4: Use "hpd-gpios" for HDMI GPIO, like what - landed upstream. +Subject: [PATCH] drm/vc4: Use "hpd-gpios" for HDMI GPIO, like what landed + upstream. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch b/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch index 4fe630f98f..0a855188d8 100644 --- a/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch +++ b/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch @@ -1,8 +1,8 @@ -From 10caa2cc688e4837723da80f010e89a79e040c26 Mon Sep 17 00:00:00 2001 +From 837fa77c227eda3ebdab64b24acb3dc94599e76d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 7 Dec 2015 12:35:01 -0800 -Subject: [PATCH 119/423] drm/vc4: Synchronize validation code for v2 - submission upstream. +Subject: [PATCH] drm/vc4: Synchronize validation code for v2 submission + upstream. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch b/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch index 405980232b..4a81e5a3aa 100644 --- a/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch +++ b/target/linux/brcm2708/patches-4.4/0120-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch @@ -1,8 +1,7 @@ -From f6d5c3deefad3bf030e1410afeac8f562ed7be4d Mon Sep 17 00:00:00 2001 +From 6a602d99694b69c8cd19970f7d2b019dadaaaa09 Mon Sep 17 00:00:00 2001 From: janluca Date: Sun, 27 Dec 2015 14:34:04 +0100 -Subject: [PATCH 120/423] MMC: Do not use mmc_debug if CONFIG_MMC_BCM2835 is - not set +Subject: [PATCH] MMC: Do not use mmc_debug if CONFIG_MMC_BCM2835 is not set If CONFIG_MMC_BCM2835 was not set the compiling of the kernel failed since mmc_debug was not defined but used in drivers/mmc/core/quirks.c. diff --git a/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch b/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch index 0969926d34..eb39fffbc2 100644 --- a/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch +++ b/target/linux/brcm2708/patches-4.4/0121-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch @@ -1,8 +1,7 @@ -From 4baa30f9ca6367b354e98536f838d0b60499a51e Mon Sep 17 00:00:00 2001 +From 29171b2e2b69a4edb84bd228e1d9ea0451e7dcd2 Mon Sep 17 00:00:00 2001 From: Devon Fyson Date: Wed, 30 Dec 2015 16:40:47 -0500 -Subject: [PATCH 121/423] Extend clock timeout, fix modprobe baudrate - parameter. +Subject: [PATCH] Extend clock timeout, fix modprobe baudrate parameter. Set the BSC_CLKT clock streching timeout to 35ms as per SMBus specs.\n- Increase priority of baudrate parameter passed to modprobe (in /etc/modprobe.d/*.conf or command line). Currently custom baudrates don't work because they are overridden by clock-frequency in the platform_device passed to the function. --- diff --git a/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch b/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch index 39a0733027..03a2eca16b 100644 --- a/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch +++ b/target/linux/brcm2708/patches-4.4/0122-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch @@ -1,7 +1,7 @@ -From 0af77632d0318f69474e46a0473e64854562842c Mon Sep 17 00:00:00 2001 +From 9715590cd5024b1eb657d06a6eb60a48751e221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 31 Dec 2015 16:44:58 +0100 -Subject: [PATCH 122/423] bcm270x_dt: Add dwc2 and dwc-otg overlays +Subject: [PATCH] bcm270x_dt: Add dwc2 and dwc-otg overlays --- arch/arm/boot/dts/overlays/Makefile | 2 ++ diff --git a/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch b/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch index 2bdcdc1ebe..abb58a35d3 100644 --- a/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch +++ b/target/linux/brcm2708/patches-4.4/0123-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch @@ -1,8 +1,7 @@ -From 2d13c12edb132e32ab3e500cd1f783cc7bba84ac Mon Sep 17 00:00:00 2001 +From 5c8479b7e82155eed9e86658935dda7bf8202b8d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 4 Jan 2016 14:42:17 +0000 -Subject: [PATCH 123/423] BCM270X_DT: Add the sdtweak overlay, for tuning - sdhost +Subject: [PATCH] BCM270X_DT: Add the sdtweak overlay, for tuning sdhost The sdhost overlay declares the sdhost interface and allows parameters to be set. This is overkill for situations where the user just wants to diff --git a/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch b/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch index 5f379bcb79..907b1fe303 100644 --- a/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch +++ b/target/linux/brcm2708/patches-4.4/0124-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch @@ -1,8 +1,8 @@ -From a49c5fc29582017da47598db437cf253e7620e7e Mon Sep 17 00:00:00 2001 +From 5e45aa3d7aa8a59d82fb57cafd341e2c8c908f81 Mon Sep 17 00:00:00 2001 From: Andrew Litt Date: Mon, 11 Jan 2016 07:54:21 +0000 -Subject: [PATCH 124/423] bcm2835-mmc: Don't override bus width capabilities - from devicetree +Subject: [PATCH] bcm2835-mmc: Don't override bus width capabilities from + devicetree Take out the force setting of the MMC_CAP_4_BIT_DATA host capability so that the result read from devicetree via mmc_of_parse() is diff --git a/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch b/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch index 6de7437040..6a3d874c44 100644 --- a/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch +++ b/target/linux/brcm2708/patches-4.4/0125-SDIO-overlay-add-bus_width-parameter.patch @@ -1,7 +1,7 @@ -From c7f6e0ebbdbff464b2eaad598adb9e592e7e5a21 Mon Sep 17 00:00:00 2001 +From bafb94810a17cd66baa5d220f6005d8f1db1e516 Mon Sep 17 00:00:00 2001 From: Andrew Litt Date: Mon, 11 Jan 2016 07:55:54 +0000 -Subject: [PATCH 125/423] SDIO-overlay: add bus_width parameter +Subject: [PATCH] SDIO-overlay: add bus_width parameter Allow setting of the SDIO bus width capability of the bcm2835-mmc host. This is helpful when only a 1 bit wide bus is connected diff --git a/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch b/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch index fca4df9570..b9c2918bd9 100644 --- a/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch +++ b/target/linux/brcm2708/patches-4.4/0126-bcm2835-extend-allowed-range-of-channels-and-sampler.patch @@ -1,8 +1,7 @@ -From 05c2e0a07f9b7f7f348f05f127871be618b66ad8 Mon Sep 17 00:00:00 2001 +From 0b6eb4c6015ead6da180ef4a4da695b660bcb99f Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:41:45 +0100 -Subject: [PATCH 126/423] bcm2835: extend allowed range of channels and - samplerates +Subject: [PATCH] bcm2835: extend allowed range of channels and samplerates Allow everything the videocore accepts. --- diff --git a/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch b/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch index 0883222cd5..52601b139d 100644 --- a/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch +++ b/target/linux/brcm2708/patches-4.4/0127-bcm2835-restrict-channels-rate-to-8-960000.patch @@ -1,7 +1,7 @@ -From eeb06bfcdcc321f270753d6ba822c9212c49db00 Mon Sep 17 00:00:00 2001 +From 4b235ff95b0fcfa9731c1159402f4fef0e26f1d3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:42:18 +0100 -Subject: [PATCH 127/423] bcm2835: restrict channels*rate to 8*960000 +Subject: [PATCH] bcm2835: restrict channels*rate to 8*960000 This is required at least for SPDIF. If the bitrate goes above, videocore will either resample the audio or corrupt it due to diff --git a/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch b/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch index 8efedf0742..a6b211dfe7 100644 --- a/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch +++ b/target/linux/brcm2708/patches-4.4/0128-rpi-update-vc_vchi_audioserv_defs.h.patch @@ -1,7 +1,7 @@ -From 74e3804dcc18b79f64c2f9d36e5481277ee2f7eb Mon Sep 17 00:00:00 2001 +From fa0c088b7f7372b6946a2f2139f0e391cace34d6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:42:48 +0100 -Subject: [PATCH 128/423] rpi: update vc_vchi_audioserv_defs.h +Subject: [PATCH] rpi: update vc_vchi_audioserv_defs.h Add audioserv 3 extensions. The changes were taken from the paste linked here: diff --git a/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch b/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch index 256d38bd52..6f3f5a45d5 100644 --- a/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch +++ b/target/linux/brcm2708/patches-4.4/0129-bcm2835-implement-channel-map-API.patch @@ -1,7 +1,7 @@ -From 134223185c5da1678106310a2ca98146d8d80c49 Mon Sep 17 00:00:00 2001 +From 55349969a1914b515956c14f3fafd25df5c827a9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:43:12 +0100 -Subject: [PATCH 129/423] bcm2835: implement channel map API +Subject: [PATCH] bcm2835: implement channel map API Report all layouts supported by the HDMI protocol to userspace. Make the videocore set the correct layout according to the diff --git a/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch b/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch index 5d925076a2..099c8ec0f2 100644 --- a/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch +++ b/target/linux/brcm2708/patches-4.4/0130-bcm2835-access-controls-under-the-audio-mutex.patch @@ -1,7 +1,7 @@ -From 8aa6bca1b7f62cc2b953d6384138bb262dc16434 Mon Sep 17 00:00:00 2001 +From 7067b04bc0f05e25621868e47e3de42befa8ac61 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:43:35 +0100 -Subject: [PATCH 130/423] bcm2835: access controls under the audio mutex +Subject: [PATCH] bcm2835: access controls under the audio mutex I don't think the ALSA framework provides any kind of automatic synchronization within the control callbacks. We most likely need diff --git a/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch b/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch index c12a10404b..731091d49e 100644 --- a/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch +++ b/target/linux/brcm2708/patches-4.4/0131-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch @@ -1,8 +1,7 @@ -From bbbdf3afb567a7bded1b606d34ba6d97cbf1fb0a Mon Sep 17 00:00:00 2001 +From db9dc8093738d064963257f19b8b6d927d137dd9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:44:03 +0100 -Subject: [PATCH 131/423] bcm2835: always use 2/4/8 channels for multichannel - layouts +Subject: [PATCH] bcm2835: always use 2/4/8 channels for multichannel layouts Pad the unused channels with NA. This means userspace needs to write additional, silent padding channels, which is not ideal, but better diff --git a/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch b/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch index 84b6a5dfc1..98be6d2b8a 100644 --- a/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch +++ b/target/linux/brcm2708/patches-4.4/0132-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch @@ -1,8 +1,7 @@ -From 9e26f4ac9231419f7dcc0f793fb2d1f17748eae9 Mon Sep 17 00:00:00 2001 +From 8bf3ca92ea1352a4b97258eee4b225240e525a54 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:44:24 +0100 -Subject: [PATCH 132/423] bcm2835: only allow stereo if analogue jack is - selected +Subject: [PATCH] bcm2835: only allow stereo if analogue jack is selected Sending more than 2 channels to videocore while outputting to analogue mysteriously outputs heavy artifacts. So just paint it over with a diff --git a/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch b/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch index 79a40407d7..3ea75eed0b 100644 --- a/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch +++ b/target/linux/brcm2708/patches-4.4/0133-bcm2835-interpolate-audio-delay.patch @@ -1,7 +1,7 @@ -From 44ea54f0017696e00153c389a274b97938f093e9 Mon Sep 17 00:00:00 2001 +From 7756cf7615123045c60b9f9e311d2491a5e23424 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Jan 2016 19:44:47 +0100 -Subject: [PATCH 133/423] bcm2835: interpolate audio delay +Subject: [PATCH] bcm2835: interpolate audio delay It appears the GPU only sends us a message all 10ms to update the playback progress. Other than this, the playback position diff --git a/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch b/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch index 014fd5db2a..8eda6d5949 100644 --- a/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch +++ b/target/linux/brcm2708/patches-4.4/0134-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch @@ -1,8 +1,8 @@ -From 58389f0ac10212334f0146ca72a4ef364e8c15df Mon Sep 17 00:00:00 2001 +From 2e34fd2e06d95cd4e4e29d94ce016ab4426f75af Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Jan 2016 17:16:38 +0000 -Subject: [PATCH 134/423] bcm2835-sdhost: Add workaround for odd behaviour on - some cards +Subject: [PATCH] bcm2835-sdhost: Add workaround for odd behaviour on some + cards For reasons not understood, the sdhost driver fails when reading sectors very near the end of some SD cards. The problem could diff --git a/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch b/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch index f7d9d3de17..4086649214 100644 --- a/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch +++ b/target/linux/brcm2708/patches-4.4/0135-bcm2835-sdhost-Add-debug_flags-dtparam.patch @@ -1,7 +1,7 @@ -From 2b579856474546abebe0a3e38899893bbd7345c2 Mon Sep 17 00:00:00 2001 +From 8349a032c4e1d3f9c3c5e4bb66064b6addf6f111 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 22 Jan 2016 16:03:24 +0000 -Subject: [PATCH 135/423] bcm2835-sdhost: Add debug_flags dtparam +Subject: [PATCH] bcm2835-sdhost: Add debug_flags dtparam Bit zero disables the single-read-sectors map: diff --git a/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch b/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch index ab0ebbbc0b..13aec51cac 100644 --- a/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch +++ b/target/linux/brcm2708/patches-4.4/0136-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch @@ -1,8 +1,7 @@ -From b02faf882ad1216f89a12391f1499e7c47dbbb13 Mon Sep 17 00:00:00 2001 +From 1bb36898f708926752ef4afa43c62056b376d7a4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 25 Jan 2016 09:12:06 +0000 -Subject: [PATCH 136/423] BCM270X_DT: Add sdio_overclock parameter to sdio - overlay +Subject: [PATCH] BCM270X_DT: Add sdio_overclock parameter to sdio overlay The sdio_overclock parameter is like the overclock_50 parameter, i.e. it sets an alternate frequency (in MHz) to use when the MMC framework diff --git a/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch b/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch index 626519ff3f..7be2d88f8c 100644 --- a/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch +++ b/target/linux/brcm2708/patches-4.4/0137-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch @@ -1,8 +1,7 @@ -From a74004694a521e40b57db19b761265759d4279e2 Mon Sep 17 00:00:00 2001 +From e4bd962eeb728b924ebdaca077c2136280a190f2 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Thu, 21 Jan 2016 18:10:16 +0100 -Subject: [PATCH 137/423] rtc: ds1307: add support for the DT property - 'wakeup-source' +Subject: [PATCH] rtc: ds1307: add support for the DT property 'wakeup-source' For RTC chips with no IRQ directly connected to the SoC, the RTC chip can be forced as a wakeup source by stating that explicitly in diff --git a/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch b/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch index 88cef6df3a..a08502152e 100644 --- a/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch +++ b/target/linux/brcm2708/patches-4.4/0138-dt-overlay-add-wittypi-overlay.dts.patch @@ -1,7 +1,7 @@ -From 8f9769d2ca0c6743ccaac0f5a43e8a690aaec3c1 Mon Sep 17 00:00:00 2001 +From 44a37e094bbe4dd9ee63fb1d5426b3945981fd26 Mon Sep 17 00:00:00 2001 From: vitalogy Date: Tue, 19 Jan 2016 07:02:02 +0100 -Subject: [PATCH 138/423] dt-overlay: add wittypi-overlay.dts +Subject: [PATCH] dt-overlay: add wittypi-overlay.dts --- arch/arm/boot/dts/overlays/wittypi-overlay.dts | 44 ++++++++++++++++++++++++++ diff --git a/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch b/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch index bcb1636775..37cf64ac3a 100644 --- a/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch +++ b/target/linux/brcm2708/patches-4.4/0139-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch @@ -1,8 +1,7 @@ -From cdc262a3377780a97c4bf2054d55ec8752d80e89 Mon Sep 17 00:00:00 2001 +From 4efc768113042d0b48fdb4e170d5469f93f6e20b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Jan 2016 16:28:05 +0000 -Subject: [PATCH 139/423] FIXUP i2c_bcm2708: Don't change module baudrate - parameter +Subject: [PATCH] FIXUP i2c_bcm2708: Don't change module baudrate parameter Overwriting the baudrate module parameter creates an apparent forced baudrate for i2c busses after the first. Not only does this diff --git a/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch b/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch index 20489bb0dd..0af3a52d88 100644 --- a/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch +++ b/target/linux/brcm2708/patches-4.4/0140-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch @@ -1,8 +1,8 @@ -From ccbc06892764dda07be0a17c8541f3dc18de97c6 Mon Sep 17 00:00:00 2001 +From 290cec3c415ef37c10465f201545f26423241249 Mon Sep 17 00:00:00 2001 From: Digital Dreamtime Date: Thu, 4 Feb 2016 14:14:44 +0000 -Subject: [PATCH 140/423] Allow up to 24dB digital gain to be applied when - using IQAudIO DAC+ +Subject: [PATCH] Allow up to 24dB digital gain to be applied when using + IQAudIO DAC+ 24db_digital_gain DT param can be used to specify that PCM512x codec "Digital" volume control should not be limited to 0dB gain, diff --git a/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch b/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch index 8ad2afabc2..7003f57639 100644 --- a/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch +++ b/target/linux/brcm2708/patches-4.4/0141-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch @@ -1,8 +1,8 @@ -From 427a1c87dc8100722e3a8c7476573fe3715f5b5a Mon Sep 17 00:00:00 2001 +From 3f38eac723b07d22f70a77ae006d18eb84218a9e Mon Sep 17 00:00:00 2001 From: Digital Dreamtime Date: Thu, 4 Feb 2016 20:04:00 +0000 -Subject: [PATCH 141/423] Limit PCM512x "Digital" gain to 0dB by default with - HiFiBerry DAC+ +Subject: [PATCH] Limit PCM512x "Digital" gain to 0dB by default with HiFiBerry + DAC+ 24db_digital_gain DT param can be used to specify that PCM512x codec "Digital" volume control should not be limited to 0dB gain, diff --git a/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch b/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch index 614f5b6fc2..20b44254f4 100644 --- a/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch +++ b/target/linux/brcm2708/patches-4.4/0142-BCM270X_DT-Adjust-overlay-README-formatting.patch @@ -1,7 +1,7 @@ -From 305469eecd74e0c7e78b1646dfbc3bdd498b341e Mon Sep 17 00:00:00 2001 +From 8d559133434730d0a1c5f661e6cdaca27f6ee184 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 8 Feb 2016 09:46:33 +0000 -Subject: [PATCH 142/423] BCM270X_DT: Adjust overlay README formatting +Subject: [PATCH] BCM270X_DT: Adjust overlay README formatting --- arch/arm/boot/dts/overlays/README | 414 +++++++++++++++++++------------------- diff --git a/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch b/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch index 90a15a41eb..9a8364a29a 100644 --- a/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch +++ b/target/linux/brcm2708/patches-4.4/0143-bcm2835-sdhost-Major-revision.patch @@ -1,7 +1,7 @@ -From 8fcc1b75df2cfc5e75b36ab6cf62232291b47df1 Mon Sep 17 00:00:00 2001 +From da5b64aae5cb189a2a2e24a459e84cb5fab5d864 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 11 Feb 2016 16:51:01 +0000 -Subject: [PATCH 143/423] bcm2835-sdhost: Major revision +Subject: [PATCH] bcm2835-sdhost: Major revision This is a significant revision of the bcm2835-sdhost driver. It improves on the original in a number of ways: diff --git a/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch b/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch index a1db24cdcc..5ff574f6f7 100644 --- a/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch +++ b/target/linux/brcm2708/patches-4.4/0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch @@ -1,7 +1,7 @@ -From 367af45e7a38258b1198af604070cc09198b1a61 Mon Sep 17 00:00:00 2001 +From f6031fa472bf8ce9eaba902b00cd2af3d00f0fb4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 12 Feb 2016 15:38:00 +0000 -Subject: [PATCH 144/423] BCM270X_DT: Add dtparams for the SD interface +Subject: [PATCH] BCM270X_DT: Add dtparams for the SD interface Add new base dtparams sd_overclock, sd_force_pio, sd_pio_limit and sd_debug. diff --git a/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch b/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch index 5217c72c8e..70d0764c30 100644 --- a/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch +++ b/target/linux/brcm2708/patches-4.4/0145-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch @@ -1,8 +1,8 @@ -From f9149b39714c2115a49fe806f3e5117fa2f55ec8 Mon Sep 17 00:00:00 2001 +From 20c4f162386eea18273c461a183244a472ecc1da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 12 Feb 2016 14:50:25 +0000 -Subject: [PATCH 145/423] dcw_otg: trim xfer length when buffer larger than - allocated size is received +Subject: [PATCH] dcw_otg: trim xfer length when buffer larger than allocated + size is received --- drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 11 +++++++++++ diff --git a/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch b/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch index b3a1e2f681..6ca2b54081 100644 --- a/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch +++ b/target/linux/brcm2708/patches-4.4/0146-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch @@ -1,7 +1,7 @@ -From 865b951f9bc7ce938c240eb17e829fd666a3f5eb Mon Sep 17 00:00:00 2001 +From 2ace17c79f413a43950944cf282235ea3de8c6e2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Feb 2016 10:00:27 +0000 -Subject: [PATCH 146/423] bcm2835-sdhost: Restore ATOMIC flag to PIO sg mapping +Subject: [PATCH] bcm2835-sdhost: Restore ATOMIC flag to PIO sg mapping Allocation problems have been seen in a wireless driver, and this is the only change which might have been responsible. diff --git a/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch b/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch index ac947ae41b..476e01b680 100644 --- a/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch +++ b/target/linux/brcm2708/patches-4.4/0147-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch @@ -1,9 +1,8 @@ -From af4e7094adf051d1cec6ebc04cfbc5d3049ce126 Mon Sep 17 00:00:00 2001 +From ef351705676a8a3906bfbc3696e7d44bcc3a320b Mon Sep 17 00:00:00 2001 From: Craig Roberts Date: Tue, 16 Feb 2016 10:03:42 +0000 -Subject: [PATCH 147/423] Updated smsc95xx driver to check for a valid MAC - address in eeprom before using smsc95xx.macaddr parameter passed on command - line. +Subject: [PATCH] Updated smsc95xx driver to check for a valid MAC address in + eeprom before using smsc95xx.macaddr parameter passed on command line. The built-in RPi adaptor will still get a MAC address based on the parameter passed on the command line as the RPi hardware does not have an eeprom, however usb->ethernet adaptors using the same driver should have an eeprom with MAC address as part of their hardware and therefore will use this diff --git a/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch b/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch index 9e20d191df..790d2969ba 100644 --- a/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch +++ b/target/linux/brcm2708/patches-4.4/0148-dcw_otg-Make-trimming-messages-less-noisy.patch @@ -1,7 +1,7 @@ -From f65f992c827f63ab148a991fe3599804704fa338 Mon Sep 17 00:00:00 2001 +From 82973637f761439a9ff507bf7a0a4aa325d98870 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Feb 2016 19:02:31 +0000 -Subject: [PATCH 148/423] dcw_otg: Make trimming messages less noisy +Subject: [PATCH] dcw_otg: Make trimming messages less noisy --- drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 6 ++++-- diff --git a/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch b/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch index d73f1a2a5f..47db7aa8db 100644 --- a/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch +++ b/target/linux/brcm2708/patches-4.4/0149-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch @@ -1,7 +1,7 @@ -From dbf8f761e366f4c93e8c2c2a1558561faa762f9f Mon Sep 17 00:00:00 2001 +From dfcdab5a069fb85d39ae9b0b86dca5f7277a5a47 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Feb 2016 15:28:14 +0000 -Subject: [PATCH 149/423] BCM270X_DT: at86rf233 overlay - drop to 3MHz +Subject: [PATCH] BCM270X_DT: at86rf233 overlay - drop to 3MHz The consensus is that 6MHz is too fast, but that 3MHz is OK. diff --git a/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch b/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch index 9776c10285..a39efeb84a 100644 --- a/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch +++ b/target/linux/brcm2708/patches-4.4/0150-bcm2835-sdhost-Downgrade-log-message-status.patch @@ -1,7 +1,7 @@ -From c7dc70d85fa909f1ffb7b490f93b56cabf0b155f Mon Sep 17 00:00:00 2001 +From 0f091b751bab3fcedb2281d3a201c42c627c7867 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Feb 2016 12:04:48 +0000 -Subject: [PATCH 150/423] bcm2835-sdhost: Downgrade log message status +Subject: [PATCH] bcm2835-sdhost: Downgrade log message status --- drivers/mmc/host/bcm2835-sdhost.c | 4 ++-- diff --git a/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch b/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch index d98d401b71..e39870746e 100644 --- a/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch +++ b/target/linux/brcm2708/patches-4.4/0151-config-Enable-HCI-over-UARTs.patch @@ -1,7 +1,7 @@ -From 6c1cfd3b278d6f0656f33646392c81f41b2dc5ac Mon Sep 17 00:00:00 2001 +From 87614bfb6cc2eba2b5dd80596a76866f42bef42a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 15 Jan 2016 16:48:27 +0000 -Subject: [PATCH 151/423] config: Enable HCI over UARTs +Subject: [PATCH] config: Enable HCI over UARTs --- arch/arm/configs/bcm2709_defconfig | 3 +++ diff --git a/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch b/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch index 963fa86ee7..05c2ae2641 100644 --- a/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch +++ b/target/linux/brcm2708/patches-4.4/0152-hci_h5-Don-t-send-conf_req-when-ACTIVE.patch @@ -1,7 +1,7 @@ -From f736186a0650f05ba00fa51957b25d6486ea3358 Mon Sep 17 00:00:00 2001 +From fc507785b54db0e908719ba738531f45fb1797d3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 152/423] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH] hci_h5: Don't send conf_req when ACTIVE Without this patch, a modem and kernel can continuously bombard each other with conf_req and conf_rsp messages, in a demented game of tag. diff --git a/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch b/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch index 8c2872c1e0..7cadb2a8ea 100644 --- a/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch +++ b/target/linux/brcm2708/patches-4.4/0153-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch @@ -1,7 +1,7 @@ -From 36b4312e6c109ead13feef44315fa73d1e1fa9f0 Mon Sep 17 00:00:00 2001 +From e0f147530d17dfe705fee528c40232047bd1ee47 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 153/423] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH] amba_pl011: Don't use DT aliases for numbering The pl011 driver looks for DT aliases of the form "serial", and if found uses as the device ID. This can cause diff --git a/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch b/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch index 526dcc7111..7e1b2bab29 100644 --- a/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch +++ b/target/linux/brcm2708/patches-4.4/0154-clk-bcm2835-Add-bindings-for-the-auxiliary-periphera.patch @@ -1,8 +1,8 @@ -From 36dba68f842fac976afdd4487958d014ffdb130d Mon Sep 17 00:00:00 2001 +From 0ace9f0a0b1d5768cec58a69bd0d4fffd5995ad2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 15 Dec 2015 15:35:57 -0800 -Subject: [PATCH 154/423] clk: bcm2835: Add bindings for the auxiliary - peripheral clock gates. +Subject: [PATCH] clk: bcm2835: Add bindings for the auxiliary peripheral clock + gates. These will be used for enabling UART1, SPI1, and SPI2. diff --git a/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch b/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch index 868ebbe72b..f095a7a884 100644 --- a/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch +++ b/target/linux/brcm2708/patches-4.4/0155-clk-bcm2835-Add-a-driver-for-the-auxiliary-periphera.patch @@ -1,8 +1,8 @@ -From 308d421f734ecdf5664603b87d2b327c2f46f810 Mon Sep 17 00:00:00 2001 +From 19a393608fdcadad7fdde85e4439f05d10381d84 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 15 Dec 2015 15:35:58 -0800 -Subject: [PATCH 155/423] clk: bcm2835: Add a driver for the auxiliary - peripheral clock gates. +Subject: [PATCH] clk: bcm2835: Add a driver for the auxiliary peripheral clock + gates. There are a pair of SPI masters and a mini UART that were last minute additions. As a result, they didn't get integrated in the same way as diff --git a/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch b/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch index 58e8b0a4a3..8094495f34 100644 --- a/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch +++ b/target/linux/brcm2708/patches-4.4/0156-Aux-SPI-1-2-implementation.patch @@ -1,7 +1,7 @@ -From 70fb111800b9bb01e4c95ea9e351cb15748f692f Mon Sep 17 00:00:00 2001 +From fb47ac65c77bd2bc6480bb45a0bef29056108984 Mon Sep 17 00:00:00 2001 From: Fraser Date: Tue, 23 Feb 2016 10:04:37 +1100 -Subject: [PATCH 156/423] Aux SPI 1&2 implementation +Subject: [PATCH] Aux SPI 1&2 implementation Adds aux spi 1 & 2 devices to compatible raspberry PIs. * Minor config of the driver build environment to ensure they get built diff --git a/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch b/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch index 92919b2f4f..953b0f2f17 100644 --- a/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch +++ b/target/linux/brcm2708/patches-4.4/0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch @@ -1,8 +1,7 @@ -From 5590ca50d54491e5fc3f273f03198a1b08fd88cc Mon Sep 17 00:00:00 2001 +From 8369af719005849271d4c50a87dc6422b83dc276 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 23 Feb 2016 17:28:23 +0100 -Subject: [PATCH 157/423] ASoC: bcm: add missing .owner fields in sound card - drivers +Subject: [PATCH] ASoC: bcm: add missing .owner fields in sound card drivers If snd_soc_card.owner is not set the kernel won't do usage refcounting and one can remove the card driver module while it's in use (eg playback diff --git a/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch b/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch index bd052f24e1..b94313ca83 100644 --- a/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch +++ b/target/linux/brcm2708/patches-4.4/0158-smsx95xx-Add-option-to-disable-the-crimes-against-tr.patch @@ -1,8 +1,8 @@ -From 10a0c1a532cb7800e2eb56ac6e38dedbaf262ce5 Mon Sep 17 00:00:00 2001 +From 3bd2928682ee70f260d9c62a17d1a5e43f979fec Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 20 Jan 2016 17:50:09 +0000 -Subject: [PATCH 158/423] smsx95xx: Add option to disable the crimes against - truesize fix +Subject: [PATCH] smsx95xx: Add option to disable the crimes against truesize + fix It may improve iperf numbers on Pi 1, but may generate dmesg warnings and possibly cause network issues See issue 1248. diff --git a/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch b/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch index d78cabe1d8..e0bcd93426 100644 --- a/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0159-bcm2835-virtgpio-Virtual-GPIO-driver.patch @@ -1,7 +1,7 @@ -From e08489bbbba7a911dc99495e152c4366ed646db8 Mon Sep 17 00:00:00 2001 +From fba2e30e3511cbc94249468490843723268a0c39 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 159/423] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. diff --git a/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch b/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch index ec015cd23a..04c5e0969e 100644 --- a/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch +++ b/target/linux/brcm2708/patches-4.4/0160-BCM270X_DT-Add-Pi3-support.patch @@ -1,7 +1,7 @@ -From 5985096850e6608704489e7c7936d885fb3a3507 Mon Sep 17 00:00:00 2001 +From d5ed78c5a2305b7952f4e86f4de4c68630875264 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Jan 2016 17:57:49 +0000 -Subject: [PATCH 160/423] BCM270X_DT: Add Pi3 support +Subject: [PATCH] BCM270X_DT: Add Pi3 support --- arch/arm/boot/dts/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch b/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch index ccadd82ea1..145c6e705c 100644 --- a/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch +++ b/target/linux/brcm2708/patches-4.4/0161-DT-Add-overlays-to-configure-I2C-pins.patch @@ -1,7 +1,7 @@ -From f2f877b174c8dc15f77cbaea553edf21c74d525c Mon Sep 17 00:00:00 2001 +From ff7f4e8e8f46f1132b1013cf1799abb7dde687cb Mon Sep 17 00:00:00 2001 From: Dave Stevenson <6by9@users.noreply.github.com> Date: Mon, 8 Feb 2016 23:49:41 +0000 -Subject: [PATCH 161/423] DT: Add overlays to configure I2C pins +Subject: [PATCH] DT: Add overlays to configure I2C pins Lifted from https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=120938&p=825883 diff --git a/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch b/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch index 8753693d51..04616bf6ea 100644 --- a/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch +++ b/target/linux/brcm2708/patches-4.4/0162-bcm2835-camera-fix-a-bug-in-computation-of-frame-tim.patch @@ -1,8 +1,7 @@ -From c2132fecb5584da2653ce99ebbfb382673489e94 Mon Sep 17 00:00:00 2001 +From 185f82a6c86933b1df3ba8ec99f82fbcdd77d396 Mon Sep 17 00:00:00 2001 From: Dhiraj Goel Date: Thu, 3 Mar 2016 21:10:50 -0800 -Subject: [PATCH 162/423] bcm2835-camera: fix a bug in computation of frame - timestamp +Subject: [PATCH] bcm2835-camera: fix a bug in computation of frame timestamp Fixes #1318 --- diff --git a/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch b/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch index 7ac4ca8fb1..d2c554c5bc 100644 --- a/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0163-BCM270X_DT-Add-pi3-disable-bt-overlay.patch @@ -1,7 +1,7 @@ -From a8b3a8c0c610b29be2d685548a1b21269b651b33 Mon Sep 17 00:00:00 2001 +From f74038a8afbdbb109f831befeb53ce2b641a8805 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 2 Mar 2016 10:59:05 +0000 -Subject: [PATCH 163/423] BCM270X_DT: Add pi3-disable-bt overlay +Subject: [PATCH] BCM270X_DT: Add pi3-disable-bt overlay Disable Bluetooth and restore UART0/ttyAMA0 over GPIOs 14 & 15. To disable the systemd service that initialises the modem so it doesn't use the UART: diff --git a/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch b/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch index 3cad9ca529..27d7390007 100644 --- a/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch @@ -1,7 +1,7 @@ -From 8a2725220ebcc2207c979e2c816a911aa20fa3f3 Mon Sep 17 00:00:00 2001 +From 3a7f5db20ed4d685ce8b5336f859d547bdd98a85 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 09:53:03 +0000 -Subject: [PATCH 164/423] BCM270X_DT: Add pi3-miniuart-bt DT overlay +Subject: [PATCH] BCM270X_DT: Add pi3-miniuart-bt DT overlay Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum diff --git a/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch b/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch index d1b6ce72d0..ecccb2a17d 100644 --- a/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch +++ b/target/linux/brcm2708/patches-4.4/0165-Pi3-DT-Add-dtparams-for-the-SD-interface.patch @@ -1,7 +1,7 @@ -From bcd71e5dd7b7f9ad1a5b7b77edc3350feede7bfb Mon Sep 17 00:00:00 2001 +From a241da2b069599afab9ee1259855d3c2e509894d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 13:38:39 +0000 -Subject: [PATCH 165/423] Pi3 DT: Add dtparams for the SD interface +Subject: [PATCH] Pi3 DT: Add dtparams for the SD interface Add new base dtparams sd_overclock, sd_force_pio, sd_pio_limit and sd_debug. These were missed out of the initial Pi3 DTB. diff --git a/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch b/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch index e6b704a01e..d293862335 100644 --- a/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch +++ b/target/linux/brcm2708/patches-4.4/0166-vchiq_arm-Tweak-the-logging-output.patch @@ -1,7 +1,7 @@ -From 0b72e9bbaf15534b6437d6377a20870125bfcb06 Mon Sep 17 00:00:00 2001 +From 37f28c9626c8217166a1096e1d6432fca73a0849 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 15:05:11 +0000 -Subject: [PATCH 166/423] vchiq_arm: Tweak the logging output +Subject: [PATCH] vchiq_arm: Tweak the logging output Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch b/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch index 8cc918b4a9..c487d66292 100644 --- a/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch +++ b/target/linux/brcm2708/patches-4.4/0167-bcm2835-sdhost-Only-claim-one-DMA-channel.patch @@ -1,7 +1,7 @@ -From 71804345eb4c8408fb50b0f15b750915776a20ad Mon Sep 17 00:00:00 2001 +From 5f0af4369aeb791f481e05447e1d4d05579367cd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 16:46:39 +0000 -Subject: [PATCH 167/423] bcm2835-sdhost: Only claim one DMA channel +Subject: [PATCH] bcm2835-sdhost: Only claim one DMA channel With both MMC controllers enabled there are few DMA channels left. The bcm2835-sdhost driver only uses DMA in one direction at a time, so it diff --git a/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch b/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch index 4444c54a8e..8d78521360 100644 --- a/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch +++ b/target/linux/brcm2708/patches-4.4/0168-bcm2835-mmc-Only-claim-one-DMA-channel.patch @@ -1,7 +1,7 @@ -From c9c0bca2cf5a88e1bbfe1c0ebfc190e3f9c80bef Mon Sep 17 00:00:00 2001 +From fba9024580be3eed90cce59f776fc27e6ca8fbc9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Mar 2016 09:49:16 +0000 -Subject: [PATCH 168/423] bcm2835-mmc: Only claim one DMA channel +Subject: [PATCH] bcm2835-mmc: Only claim one DMA channel With both MMC controllers enabled there are few DMA channels left. The bcm2835-mmc driver only uses DMA in one direction at a time, so it diff --git a/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch b/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch index 2a40041c0f..186667ab46 100644 --- a/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch +++ b/target/linux/brcm2708/patches-4.4/0169-config-rebuild-with-savedefconfig.patch @@ -1,7 +1,7 @@ -From 3ca8b2725059ac5f0255f6304777af2b3f6d8d38 Mon Sep 17 00:00:00 2001 +From fe221477aa6c78391646e226c029a56e34595873 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 Mar 2016 17:08:39 +0000 -Subject: [PATCH 169/423] config: rebuild with savedefconfig +Subject: [PATCH] config: rebuild with savedefconfig --- arch/arm/configs/bcm2709_defconfig | 3 +-- diff --git a/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch b/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch index 938362a168..b1806928e1 100644 --- a/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch +++ b/target/linux/brcm2708/patches-4.4/0170-config-Add-module-for-mcp3422-ADC.patch @@ -1,7 +1,7 @@ -From 3ff0e5914f2868ff8fdbb42247e96726296bea5d Mon Sep 17 00:00:00 2001 +From 8ceec2dfed10944e299b4114d756dbe494baaaec Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 Mar 2016 17:06:33 +0000 -Subject: [PATCH 170/423] config: Add module for mcp3422 ADC +Subject: [PATCH] config: Add module for mcp3422 ADC --- arch/arm/configs/bcm2709_defconfig | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch b/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch index e81681981c..94f24ea24b 100644 --- a/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch +++ b/target/linux/brcm2708/patches-4.4/0171-Pi3-DT-Add-pull-ups-on-the-UART-RX-lines.patch @@ -1,7 +1,7 @@ -From 89946d941588d63fb3a84c039acb154a4441e3f0 Mon Sep 17 00:00:00 2001 +From e1fd7a9ccd89e291334d4a9d6b7d1f3040d7aad0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Mar 2016 16:18:57 +0000 -Subject: [PATCH 171/423] Pi3 DT: Add pull-ups on the UART RX lines +Subject: [PATCH] Pi3 DT: Add pull-ups on the UART RX lines Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch b/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch index e783f33f3c..f6d1fc96f9 100644 --- a/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch +++ b/target/linux/brcm2708/patches-4.4/0173-BCM270X_DT-rpi-display-overlay-add-swapxy-param.patch @@ -1,7 +1,7 @@ -From 7a33a72a9f2fd1091cd8b5f38bd9468c3fdbfdb9 Mon Sep 17 00:00:00 2001 +From 94ffee1a2cbfa8016ca9e4782342618bf88a14c7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 9 Mar 2016 21:28:52 +0000 -Subject: [PATCH 173/423] BCM270X_DT: rpi-display overlay - add swapxy param +Subject: [PATCH] BCM270X_DT: rpi-display overlay - add swapxy param Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch b/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch index 11972b6030..f064c03a2f 100644 --- a/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch +++ b/target/linux/brcm2708/patches-4.4/0174-Remove-I2S-config-from-bt_pins.patch @@ -1,7 +1,7 @@ -From aa4e7d0b5d49c77ace418c07ba301fafb53c38ef Mon Sep 17 00:00:00 2001 +From 1bdb6cc0903dce08e168a6d23ba6675202c3dd0f Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Fri, 11 Mar 2016 11:44:35 +0000 -Subject: [PATCH 174/423] Remove I2S config from bt_pins. +Subject: [PATCH] Remove I2S config from bt_pins. Remove I2S config from bt_pins. Causes issues with clock alignment when I2S is used by an external DAC via GPIO header. diff --git a/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch b/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch index 3f1f955f95..50e54786e6 100644 --- a/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch +++ b/target/linux/brcm2708/patches-4.4/0175-Revert-scripts-dtc-Add-overlay-support.patch @@ -1,7 +1,7 @@ -From 769fa207da8b9cf5e87f67fc7a1d4644257e29da Mon Sep 17 00:00:00 2001 +From f8a8a35b960f948c60c9d0a4b544366c9154d5a0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:44:59 +0100 -Subject: [PATCH 175/423] Revert "scripts/dtc: Add overlay support" +Subject: [PATCH] Revert "scripts/dtc: Add overlay support" This reverts commit fa6d1755c2fdd9451077d8248e3804f0619f19b9. --- diff --git a/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch b/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch index 2c5f00465e..82a744363a 100644 --- a/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch +++ b/target/linux/brcm2708/patches-4.4/0176-scripts-dtc-Update-to-upstream-version-1.4.1.patch @@ -1,7 +1,7 @@ -From 58d2939986c3db3d57cad899a758cf5e325072c5 Mon Sep 17 00:00:00 2001 +From c128c19379082f13558d4b51ae7d15a209bd9918 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 176/423] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. diff --git a/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch b/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch index d80a7f36f7..03d68146e3 100644 --- a/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch +++ b/target/linux/brcm2708/patches-4.4/0177-configfs-implement-binary-attributes.patch @@ -1,7 +1,7 @@ -From 4105c60fc35515eb614e54b5ca51e2da2f6e78e7 Mon Sep 17 00:00:00 2001 +From 14ea3d6ac7fea0e515bbde859379b0a43b6d67b9 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Thu, 22 Oct 2015 23:30:04 +0300 -Subject: [PATCH 177/423] configfs: implement binary attributes +Subject: [PATCH] configfs: implement binary attributes ConfigFS lacked binary attributes up until now. This patch introduces support for binary attributes in a somewhat similar diff --git a/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch b/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch index d4ee94c490..4dae3cfa75 100644 --- a/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch +++ b/target/linux/brcm2708/patches-4.4/0178-OF-DT-Overlay-configfs-interface.patch @@ -1,7 +1,7 @@ -From 4f9177551b224eb3cf97bbe797a2909bb6ab2998 Mon Sep 17 00:00:00 2001 +From 9745f13ee715e7f47ac11a31d0f75b9661b63344 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 178/423] OF: DT-Overlay configfs interface +Subject: [PATCH] OF: DT-Overlay configfs interface This is a port of Pantelis Antoniou's v3 port that makes use of the new upstreamed configfs support for binary attributes. diff --git a/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch b/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch index d450c09748..39f260cd45 100644 --- a/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch +++ b/target/linux/brcm2708/patches-4.4/0179-Protect-__release_resource-against-resources-without.patch @@ -1,8 +1,7 @@ -From b20701a18267d97ae47407f713bda22e2b647bc1 Mon Sep 17 00:00:00 2001 +From 984c98b47f9ffd5f57599e604df2cc09c63f74ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 179/423] Protect __release_resource against resources without - parents +Subject: [PATCH] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. diff --git a/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch b/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch index 816edda380..45de5b83e8 100644 --- a/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch +++ b/target/linux/brcm2708/patches-4.4/0180-BCM270X_DT-Add-a-.dtbo-target-use-for-overlays.patch @@ -1,7 +1,7 @@ -From 931d7ab56b2798d9b72ef2308d981d824335b7de Mon Sep 17 00:00:00 2001 +From 95aee427e91922408870627e6e3d66f975791336 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 20:00:21 +0000 -Subject: [PATCH 180/423] BCM270X_DT: Add a .dtbo target, use for overlays +Subject: [PATCH] BCM270X_DT: Add a .dtbo target, use for overlays Change the filenames and extensions to keep the pre-DDT style of overlay (-overlay.dtb) distinct from new ones that use a diff --git a/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch b/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch index 1dc8283592..e793f1a08f 100644 --- a/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch +++ b/target/linux/brcm2708/patches-4.4/0181-scripts-knlinfo-Decode-DDTK-atom.patch @@ -1,7 +1,7 @@ -From 97ce4cd9a2b9c596c382c4af688518eaf6a5a84b Mon Sep 17 00:00:00 2001 +From 5f1a77a98df6352d585a906a61166062cb43c14b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 May 2015 11:18:58 +0100 -Subject: [PATCH 181/423] scripts/knlinfo: Decode DDTK atom +Subject: [PATCH] scripts/knlinfo: Decode DDTK atom Show the DDTK atom as being a boolean. diff --git a/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch b/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch index a1ced93610..418a8d77e9 100644 --- a/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch +++ b/target/linux/brcm2708/patches-4.4/0182-Enable-Dynamic-Device-Tree-for-bcmrpi_defconfig-and-.patch @@ -1,7 +1,7 @@ -From b6d96f1dc239d7b7e71aa658156c893e46e6a2bf Mon Sep 17 00:00:00 2001 +From 6d4c8ab1f16bc536dd5d858341e1c0d0b67d930b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 May 2015 11:48:59 +0100 -Subject: [PATCH 182/423] Enable Dynamic Device Tree for bcmrpi_defconfig and +Subject: [PATCH] Enable Dynamic Device Tree for bcmrpi_defconfig and bcm2709_defconfig Signed-off-by: Phil Elwell diff --git a/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch b/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch index 1a2e0c6d42..0100df7a1b 100644 --- a/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch +++ b/target/linux/brcm2708/patches-4.4/0183-SQUASH-Add-CONFIG_OF_CONFIGFS-to-bcmrpi_defconfig.patch @@ -1,7 +1,7 @@ -From dbe624ecbe5f601297665da59ba6cfc11e8150d4 Mon Sep 17 00:00:00 2001 +From fbc9f06dc47543dbd6b7f2806f6535082eac3696 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 13 Mar 2016 16:14:44 +0000 -Subject: [PATCH 183/423] SQUASH: Add CONFIG_OF_CONFIGFS to bcmrpi_defconfig +Subject: [PATCH] SQUASH: Add CONFIG_OF_CONFIGFS to bcmrpi_defconfig Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch b/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch index 501c0fc966..68898477b5 100644 --- a/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch +++ b/target/linux/brcm2708/patches-4.4/0184-dts-kbuild-dtbs_install-installs-.dtbo-files-too.patch @@ -1,7 +1,7 @@ -From ac5048f5b6df22924f23952107e3810f999387bf Mon Sep 17 00:00:00 2001 +From 68bdbeeade267f4aff7a4eaf9a122baf306982f4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 14 Mar 2016 16:56:54 +0000 -Subject: [PATCH 184/423] dts, kbuild: dtbs_install installs .dtbo files too +Subject: [PATCH] dts, kbuild: dtbs_install installs .dtbo files too Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch b/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch index 9b68f5b70e..7640647146 100644 --- a/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch +++ b/target/linux/brcm2708/patches-4.4/0185-bcm2835-sdhost-Workaround-for-slow-sectors.patch @@ -1,7 +1,7 @@ -From 4f52f1f19ee9c54eb0022eeff03a380fca01384b Mon Sep 17 00:00:00 2001 +From a4a7cdd3364de9fa9edfb32a64fa0e7a577d9143 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Mar 2016 14:10:29 +0000 -Subject: [PATCH 185/423] bcm2835-sdhost: Workaround for "slow" sectors +Subject: [PATCH] bcm2835-sdhost: Workaround for "slow" sectors Some cards have been seen to cause timeouts after certain sectors are read. This workaround enforces a minimum delay between the stop after diff --git a/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch b/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch index 0355f09c03..d2277b960d 100644 --- a/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch +++ b/target/linux/brcm2708/patches-4.4/0186-BCM270X_DT-Add-labels-to-spidev-nodes.patch @@ -1,7 +1,7 @@ -From 69b8da40b814a65b49a19058e906b26b44303fba Mon Sep 17 00:00:00 2001 +From bf6a2bb922c5ef6831d40eb934597733836080bf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Mar 2016 15:49:16 +0000 -Subject: [PATCH 186/423] BCM270X_DT: Add labels to spidev nodes +Subject: [PATCH] BCM270X_DT: Add labels to spidev nodes Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch b/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch index 50d139fee9..e1facfa72d 100644 --- a/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch +++ b/target/linux/brcm2708/patches-4.4/0187-BCM270X_DT-Use-spidev-labels-in-overlays.patch @@ -1,7 +1,7 @@ -From 37d926b159b0cb6ebe80c24b9641e12b6fbd3dd5 Mon Sep 17 00:00:00 2001 +From 66c35d065749cfb8b128077cfc1a114674273bea Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Mar 2016 16:27:26 +0000 -Subject: [PATCH 187/423] BCM270X_DT: Use spidev labels in overlays +Subject: [PATCH] BCM270X_DT: Use spidev labels in overlays --- arch/arm/boot/dts/overlays/ads7846-overlay.dts | 22 ++++++++++------- diff --git a/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch b/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch index bdfd289e7d..d74ce04a63 100644 --- a/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0188-BCM270X_DT-Build-and-document-the-wittypi-overlay.patch @@ -1,7 +1,7 @@ -From 286f21ae694dd4e3798011d771f6833318f8371c Mon Sep 17 00:00:00 2001 +From 3b2ac4714efbc144e8df9fd939498313958eaac5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Mar 2016 16:41:37 +0000 -Subject: [PATCH 188/423] BCM270X_DT: Build and document the wittypi overlay +Subject: [PATCH] BCM270X_DT: Build and document the wittypi overlay Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch b/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch index a028ec78e8..cfa53d4ed8 100644 --- a/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch +++ b/target/linux/brcm2708/patches-4.4/0189-scripts-dtc-Fix-UMR-causing-corrupt-dtbo-overlay-fil.patch @@ -1,8 +1,7 @@ -From 65d8417f8d87161c1bc6b6b0bc43a32a89546ee4 Mon Sep 17 00:00:00 2001 +From c12c80f4a33ca959cb0a62c6284bbc27cdce0b48 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 15 Mar 2016 21:13:39 +0100 -Subject: [PATCH 189/423] scripts/dtc: Fix UMR causing corrupt dtbo overlay - files +Subject: [PATCH] scripts/dtc: Fix UMR causing corrupt dtbo overlay files struct fixup_entry is allocated from the heap but it's member local_fixup_generated was never initialized. This lead to diff --git a/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch b/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch index 9e3f2fe979..b707548525 100644 --- a/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch +++ b/target/linux/brcm2708/patches-4.4/0190-BCM270X_DT-Add-dtparam-for-uart1.patch @@ -1,7 +1,7 @@ -From 0913a8d9a13e327cd592970da2555c32963a90e7 Mon Sep 17 00:00:00 2001 +From 64b838bcfcd490561e919bd569da8ab3afb83f83 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 16 Mar 2016 08:35:06 +0000 -Subject: [PATCH 190/423] BCM270X_DT: Add dtparam for uart1 +Subject: [PATCH] BCM270X_DT: Add dtparam for uart1 Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch b/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch index d7ca6acdfd..0e0583e666 100644 --- a/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch +++ b/target/linux/brcm2708/patches-4.4/0191-dwc-overlay-Use-label-so-overrides-can-apply.patch @@ -1,7 +1,7 @@ -From 664a65f96f3a1afdacf3697460fb57e3a34080fb Mon Sep 17 00:00:00 2001 +From a81b12982d9624ad84d05996233239bb7e213f70 Mon Sep 17 00:00:00 2001 From: Przemek Rudy Date: Fri, 11 Mar 2016 22:41:26 +0100 -Subject: [PATCH 191/423] dwc-overlay: Use label so overrides can apply. +Subject: [PATCH] dwc-overlay: Use label so overrides can apply. --- arch/arm/boot/dts/overlays/dwc2-overlay.dts | 10 +++++----- diff --git a/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch b/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch index 7b57c64f7e..2a0ffc5d8e 100644 --- a/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch +++ b/target/linux/brcm2708/patches-4.4/0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch @@ -1,8 +1,7 @@ -From 52a53c8b62c8e5500ffa6131ed367c0271c05679 Mon Sep 17 00:00:00 2001 +From 2bcb714370ae69fe808d7e2061927c2ea1753ff7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 22 Jan 2016 13:06:39 -0800 -Subject: [PATCH 192/423] drm/vc4: Add a debugfs node for tracking execution - state. +Subject: [PATCH] drm/vc4: Add a debugfs node for tracking execution state. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch b/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch index f3db1bde1c..da107905fe 100644 --- a/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch +++ b/target/linux/brcm2708/patches-4.4/0193-drm-vc4-Include-vc4_drm.h-in-uapi-in-downstream-buil.patch @@ -1,8 +1,7 @@ -From aa0275b3a1823ea863d2f9f2635cc6ca446adb92 Mon Sep 17 00:00:00 2001 +From e8da5a4c9dfbb65205cc9e4d448af3e8965af88d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 13:03:33 -0800 -Subject: [PATCH 193/423] drm/vc4: Include vc4_drm.h in uapi in downstream - build. +Subject: [PATCH] drm/vc4: Include vc4_drm.h in uapi in downstream build. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch b/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch index 7e76e2b184..f53dcecbd6 100644 --- a/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch +++ b/target/linux/brcm2708/patches-4.4/0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch @@ -1,7 +1,7 @@ -From 5528526faa0302e28b284590f761d43d66e85632 Mon Sep 17 00:00:00 2001 +From baf132f97c5fa25c0dcec59369e225e759ab22e6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 13:05:00 -0800 -Subject: [PATCH 194/423] drm/vc4: Validate that WAIT_BO padding is cleared. +Subject: [PATCH] drm/vc4: Validate that WAIT_BO padding is cleared. This is ABI future-proofing if we ever want to extend the pad to mean something. diff --git a/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch b/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch index 06b501291f..a1a3d6be1e 100644 --- a/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch +++ b/target/linux/brcm2708/patches-4.4/0195-drm-vc4-Fix-the-clear-color-for-the-first-tile-rende.patch @@ -1,8 +1,7 @@ -From 68cbe5055b8b2d1b96fd6b5009f16064783e6b00 Mon Sep 17 00:00:00 2001 +From 339e2ea50b25fe0183161cee31f640e691f2a1c0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 13:52:41 -0800 -Subject: [PATCH 195/423] drm/vc4: Fix the clear color for the first tile - rendered. +Subject: [PATCH] drm/vc4: Fix the clear color for the first tile rendered. Apparently in hardware (as opposed to simulation), the clear colors need to be uploaded before the render config, otherwise they won't diff --git a/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch b/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch index 1ef827b9c9..f9daa878d2 100644 --- a/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch +++ b/target/linux/brcm2708/patches-4.4/0196-drm-vc4-Return-an-ERR_PTR-from-BO-creation-instead-o.patch @@ -1,8 +1,7 @@ -From 8833c229e00291163a2464d82d0d7902e24466ca Mon Sep 17 00:00:00 2001 +From 96cfc336eb33c0152c4aff462bd6a21cd75cc731 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 14:13:12 -0800 -Subject: [PATCH 196/423] drm/vc4: Return an ERR_PTR from BO creation instead - of NULL. +Subject: [PATCH] drm/vc4: Return an ERR_PTR from BO creation instead of NULL. Fixes igt vc4_create_bo/create-bo-0 by returning -EINVAL from the ioctl instead of -ENOMEM. diff --git a/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch b/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch index c1129516b1..0d185a63e6 100644 --- a/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch +++ b/target/linux/brcm2708/patches-4.4/0197-drm-vc4-Fix-ERESTARTSYS-error-return-from-BO-waits.patch @@ -1,7 +1,7 @@ -From a60ba3cce2f5fb3bb34443d4b5ba8cbf135e6163 Mon Sep 17 00:00:00 2001 +From 0304e9381edf30280122d981e5a1b8dedc4c003f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 14:32:41 -0800 -Subject: [PATCH 197/423] drm/vc4: Fix -ERESTARTSYS error return from BO waits. +Subject: [PATCH] drm/vc4: Fix -ERESTARTSYS error return from BO waits. This caused the wait ioctls to claim that waiting had completed when we actually got interrupted by a signal before it was done. Fixes diff --git a/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch b/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch index f61a459e82..c0ec5260c1 100644 --- a/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch +++ b/target/linux/brcm2708/patches-4.4/0198-drm-vc4-Drop-error-message-on-seqno-wait-timeouts.patch @@ -1,7 +1,7 @@ -From e3ff132f57aa1837e2ec8deff44c263157962bb6 Mon Sep 17 00:00:00 2001 +From d12dd7a58fcc585b75fae60ab230a51b2ac9a6cb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 14:33:50 -0800 -Subject: [PATCH 198/423] drm/vc4: Drop error message on seqno wait timeouts. +Subject: [PATCH] drm/vc4: Drop error message on seqno wait timeouts. These ioctls end up getting exposed to userspace, and having normal user requests print DRM errors is obviously wrong. The message was diff --git a/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch b/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch index 24ea18ccbb..9e0044673d 100644 --- a/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch +++ b/target/linux/brcm2708/patches-4.4/0199-BCM270X_DT-Add-1-bit-SDIO-using-minimal-pins.patch @@ -1,7 +1,7 @@ -From e1b1b8a6f9dbdcf019b8975d5ced5a0393b23dd3 Mon Sep 17 00:00:00 2001 +From 895c93a3efd6653df6bbabc12c2e0205be5560dd Mon Sep 17 00:00:00 2001 From: campag Date: Wed, 24 Feb 2016 16:45:42 +0000 -Subject: [PATCH 199/423] BCM270X_DT: Add 1-bit SDIO using minimal pins... +Subject: [PATCH] BCM270X_DT: Add 1-bit SDIO using minimal pins... ... for that mode: GPIOs 22-25. --- diff --git a/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch b/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch index 51e58851a1..56e6b506b4 100644 --- a/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch +++ b/target/linux/brcm2708/patches-4.4/0201-Add-overlay-and-enable-support-for-QCA7000-board.patch @@ -1,7 +1,7 @@ -From 51405bd458e0e16e1b1a912e6361c83633567de1 Mon Sep 17 00:00:00 2001 +From 52ca91f1e28a45f4584432525b149f32a0048dd0 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Fri, 29 Jan 2016 12:00:37 +0100 -Subject: [PATCH 201/423] Add overlay and enable support for QCA7000 board +Subject: [PATCH] Add overlay and enable support for QCA7000 board This adds a device tree overlay for the QCA7000 which can be used when attaching an I2SE's PLC Stamp micro EVK to the Raspberry Pi. diff --git a/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch b/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch index a5049d8bd8..e917d443e2 100644 --- a/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch +++ b/target/linux/brcm2708/patches-4.4/0202-serial-Take-care-starting-a-hung-up-tty-s-port.patch @@ -1,7 +1,7 @@ -From 91796069d412600985585cbb8d72cb5dbf7d9a2e Mon Sep 17 00:00:00 2001 +From baaee4dd48573d8de4e22d812717c6863ba4b7e6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 9 Mar 2016 13:28:24 +0000 -Subject: [PATCH 202/423] serial: Take care starting a hung-up tty's port +Subject: [PATCH] serial: Take care starting a hung-up tty's port tty_port_hangup sets a port's tty field to NULL (holding the port lock), but uart_tx_stopped, called from __uart_start (with the port lock), diff --git a/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch b/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch index feef4ca3e4..340be02969 100644 --- a/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch +++ b/target/linux/brcm2708/patches-4.4/0203-pi3-miniuart-bt-overlay-Correct-and-clarify-info.patch @@ -1,7 +1,7 @@ -From c920022cc697e98b64bc9af5fc64ca0f2c802ccd Mon Sep 17 00:00:00 2001 +From f763209fb1c001b84b03ba86c72db7a7ae8fb441 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Mar 2016 10:16:16 +0000 -Subject: [PATCH 203/423] pi3-miniuart-bt-overlay: Correct and clarify info +Subject: [PATCH] pi3-miniuart-bt-overlay: Correct and clarify info Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch b/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch index 1aee8c51cd..8921375b83 100644 --- a/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch +++ b/target/linux/brcm2708/patches-4.4/0204-pwm-overlays-Params-must-have-in-overlay-targets.patch @@ -1,7 +1,7 @@ -From 0ba5b23995c38e7c477647aaf84df0a0dc136b70 Mon Sep 17 00:00:00 2001 +From 45513400f0b487f9bbca90e823fa591ef741dad8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Mar 2016 10:41:56 +0000 -Subject: [PATCH 204/423] pwm overlays: Params must have in-overlay targets +Subject: [PATCH] pwm overlays: Params must have in-overlay targets --- arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts | 9 ++++++++- diff --git a/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch b/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch index eb3b1dea92..a328f35b75 100644 --- a/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch +++ b/target/linux/brcm2708/patches-4.4/0205-BCM270X_DT-Switch-Compute-Module-to-MMC.patch @@ -1,7 +1,7 @@ -From ffb63fd81160a7ec5876a7e3f29b78b68e481bc7 Mon Sep 17 00:00:00 2001 +From 263f82e038a8ae204e6beaf2102ad9d91d5ca4ee Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 18 Mar 2016 13:06:29 +0000 -Subject: [PATCH 205/423] BCM270X_DT: Switch Compute Module to MMC +Subject: [PATCH] BCM270X_DT: Switch Compute Module to MMC Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch b/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch index 934289225f..5c9edea13c 100644 --- a/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch +++ b/target/linux/brcm2708/patches-4.4/0206-dwc_otg-Don-t-free-qh-align-buffers-in-atomic-contex.patch @@ -1,8 +1,7 @@ -From d309ffcbd73c0fb942d4f92b1a5089a40fe3855e Mon Sep 17 00:00:00 2001 +From c237ff4a1325ac94169ed1f5f9022f1358b79ac9 Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 18 Mar 2016 17:38:37 +0000 -Subject: [PATCH 206/423] dwc_otg: Don't free qh align buffers in atomic - context +Subject: [PATCH] dwc_otg: Don't free qh align buffers in atomic context --- drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 9 +++++++-- diff --git a/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch b/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch index 560b6b2f90..783efbae42 100644 --- a/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch +++ b/target/linux/brcm2708/patches-4.4/0207-dwc_otg-Enable-the-hack-for-Split-Interrupt-transact.patch @@ -1,8 +1,8 @@ -From 7db6ea3f5e135665bb4275d8b74bbe900d9aad7a Mon Sep 17 00:00:00 2001 +From 87dd923568a28a6784581a3f4c18970b834779a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Mar 2016 15:38:38 +0000 -Subject: [PATCH 207/423] dwc_otg: Enable the hack for Split Interrupt - transactions by default +Subject: [PATCH] dwc_otg: Enable the hack for Split Interrupt transactions by + default dwc_otg.fiq_fsm_mask=0xF has long been a suggestion for users with audio stutters or other USB bandwidth issues. So far we are aware of many success stories but no failure caused by this setting. diff --git a/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch b/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch index 78b540534b..d4eb172f6c 100644 --- a/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch +++ b/target/linux/brcm2708/patches-4.4/0208-BCM270X_DT-Remove-explicit-claiming-of-UART-pins.patch @@ -1,7 +1,7 @@ -From 4416c9473baa7439421aba5b58bc55cfc23f0a15 Mon Sep 17 00:00:00 2001 +From 678f08c4c3fd62b5e3cd95cc9596733354b2ba19 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 19 Mar 2016 16:51:37 +0000 -Subject: [PATCH 208/423] BCM270X_DT: Remove explicit claiming of UART pins +Subject: [PATCH] BCM270X_DT: Remove explicit claiming of UART pins It is convenient to be able to map a different function to the UART pins (e.g. DPI for vga666) without having to disable the UART first. diff --git a/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch b/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch index 9376121bfb..663d9cc7b0 100644 --- a/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch +++ b/target/linux/brcm2708/patches-4.4/0209-lirc_rpi-Lower-IR-reception-error-to-debug.patch @@ -1,7 +1,7 @@ -From 324d6d326ca794bf6d639b85c9745628b99b47c9 Mon Sep 17 00:00:00 2001 +From f05cfb491a1895d0975be326a9e7e061c6db2d5a Mon Sep 17 00:00:00 2001 From: Rodrigo Freire Date: Tue, 22 Mar 2016 12:40:33 -0300 -Subject: [PATCH 209/423] lirc_rpi: Lower IR reception error to debug +Subject: [PATCH] lirc_rpi: Lower IR reception error to debug Lowers a IR reception error condition message to KERNEL_DEBUG --- diff --git a/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch b/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch index 664d110bec..861f8853fc 100644 --- a/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch +++ b/target/linux/brcm2708/patches-4.4/0210-vchiq_arm-Access-the-dequeue_pending-flag-locked.patch @@ -1,7 +1,7 @@ -From 8a4ce18b5f3ca5570666284a3a0208534dd41c26 Mon Sep 17 00:00:00 2001 +From 39afc75832ce9cd81f09b035630dd30e325f1797 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 14:16:25 +0000 -Subject: [PATCH 210/423] vchiq_arm: Access the dequeue_pending flag locked +Subject: [PATCH] vchiq_arm: Access the dequeue_pending flag locked Reading through this code looking for another problem (now found in userland) the use of dequeue_pending outside a lock didn't seem safe. diff --git a/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch b/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch index 018cbf70c0..9a9ec8108e 100644 --- a/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0211-BCM270X_DT-Add-pi3-act-led-overlay.patch @@ -1,7 +1,7 @@ -From 47e82ea7d35926f12bd642e1ad2727b9a128536a Mon Sep 17 00:00:00 2001 +From 48ba5a6ae0158827e416d8b8cd21680672737b79 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 15:57:14 +0000 -Subject: [PATCH 211/423] BCM270X_DT: Add pi3-act-led overlay +Subject: [PATCH] BCM270X_DT: Add pi3-act-led overlay Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch b/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch index 134abc8cce..533a3a295d 100644 --- a/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch +++ b/target/linux/brcm2708/patches-4.4/0212-vchiq_arm-Service-callbacks-must-not-fail.patch @@ -1,7 +1,7 @@ -From 81e1683aced46435585f3a0a81e47f9bc7609abf Mon Sep 17 00:00:00 2001 +From 827e46013755254e526f0b682495ee88066a05a3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 20:53:47 +0000 -Subject: [PATCH 212/423] vchiq_arm: Service callbacks must not fail +Subject: [PATCH] vchiq_arm: Service callbacks must not fail Service callbacks are not allowed to return an error. The internal callback that delivers events and messages to user tasks does not enqueue them if diff --git a/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch b/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch index 3ad04108e5..d7bb6a215b 100644 --- a/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch +++ b/target/linux/brcm2708/patches-4.4/0213-Add-configs-and-overlay-for-PCA9548-I2C-mux.patch @@ -1,7 +1,7 @@ -From 9a4c1bb2dd7727a0592ec0456b6763bd9d12bf2b Mon Sep 17 00:00:00 2001 +From 07207eccca9d4439d69e56fb5df378ac669087bf Mon Sep 17 00:00:00 2001 From: Dave Stevenson <6by9@users.noreply.github.com> Date: Thu, 17 Mar 2016 18:16:16 +0000 -Subject: [PATCH 213/423] Add configs and overlay for PCA9548 I2C mux +Subject: [PATCH] Add configs and overlay for PCA9548 I2C mux Adds kernel configs for I2C muxes and a dt overlay for PCA9548 that adds the 8 muxed I2C buses and mux device. diff --git a/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch b/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch index 853311762e..3155ccea7c 100644 --- a/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0214-BCM270X_DT-Add-DS1339-to-i2c-rtc-overlay.patch @@ -1,7 +1,7 @@ -From 1523d333d0f5df470b0c0beedc9aa0b5a26e03aa Mon Sep 17 00:00:00 2001 +From d491a6a5acfeacccf0a24171babc0d5cf80a91da Mon Sep 17 00:00:00 2001 From: Nicolas Boullis Date: Wed, 23 Mar 2016 23:40:15 +0100 -Subject: [PATCH 214/423] BCM270X_DT: Add DS1339 to i2c-rtc overlay +Subject: [PATCH] BCM270X_DT: Add DS1339 to i2c-rtc overlay --- arch/arm/boot/dts/overlays/README | 4 ++++ diff --git a/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch b/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch index 3859d090a1..0203f96ab6 100644 --- a/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch +++ b/target/linux/brcm2708/patches-4.4/0215-copy_from_user-CPU_SW_DOMAIN_PAN-compatibility.patch @@ -1,7 +1,7 @@ -From b6d043f90d9f788b1aae010f76884c62c646c9bf Mon Sep 17 00:00:00 2001 +From 2f3fc168789eb4952a99e19c046867516fc522f7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 29 Mar 2016 15:32:30 +0100 -Subject: [PATCH 215/423] copy_from_user: CPU_SW_DOMAIN_PAN compatibility +Subject: [PATCH] copy_from_user: CPU_SW_DOMAIN_PAN compatibility The downstream copy_from_user acceleration must also play nice with CONFIG_CPU_SW_DOMAIN_PAN. diff --git a/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch b/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch index 09d6647f1e..4717b20aeb 100644 --- a/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch +++ b/target/linux/brcm2708/patches-4.4/0216-bcm2835-sdhost-Adjust-to-core-clock-changes.patch @@ -1,7 +1,7 @@ -From 3410a0f56bdd85a526ce87eebb1b14b9f7b28f87 Mon Sep 17 00:00:00 2001 +From f48a0653d0d30576b57061c30e3907e3363b6107 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Mar 2016 16:33:09 +0100 -Subject: [PATCH 216/423] bcm2835-sdhost: Adjust to core clock changes +Subject: [PATCH] bcm2835-sdhost: Adjust to core clock changes The SDHOST block uses the core clock, so previously it has been necessary to prevent the core clock from changing in order to maintain diff --git a/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch b/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch index 79f686490f..b30040f86c 100644 --- a/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0217-BCM270X_DT-Document-hazards-of-sdhost-overlay.patch @@ -1,7 +1,7 @@ -From cef80f622db0010b80505bb5ffe200918e1c5cdb Mon Sep 17 00:00:00 2001 +From b80428cf646d37e5b84103807a7259f8dccfe4d0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Mar 2016 17:07:15 +0100 -Subject: [PATCH 217/423] BCM270X_DT: Document hazards of sdhost overlay +Subject: [PATCH] BCM270X_DT: Document hazards of sdhost overlay Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch b/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch index 030485b328..1997e32553 100644 --- a/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch +++ b/target/linux/brcm2708/patches-4.4/0218-cpufreq-Temporarily-ignore-io_is_busy-1.patch @@ -1,7 +1,7 @@ -From 282da1ae4ebaa2fbc33b6dc96f4d483c43715a51 Mon Sep 17 00:00:00 2001 +From 6a91406ee4a03844ef1dd7b9db4f4d52eee9047d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Mar 2016 17:23:15 +0100 -Subject: [PATCH 218/423] cpufreq: Temporarily ignore io_is_busy=1 +Subject: [PATCH] cpufreq: Temporarily ignore io_is_busy=1 To speed testing of the new sdhost driver that adapts to changes in core_freq, hack the on-demand governor to treat io_is_busy=1 as diff --git a/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch b/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch index 98e9e6e29e..3cdd24e2d3 100644 --- a/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch +++ b/target/linux/brcm2708/patches-4.4/0219-Revert-cpufreq-Temporarily-ignore-io_is_busy-1.patch @@ -1,7 +1,7 @@ -From 80f0513490df97cbc5cea73c6047fd80388467c3 Mon Sep 17 00:00:00 2001 +From 29e93302df7295b89c3819c304ce25d7830bd857 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 30 Mar 2016 20:18:38 +0100 -Subject: [PATCH 219/423] Revert "cpufreq: Temporarily ignore io_is_busy=1" +Subject: [PATCH] Revert "cpufreq: Temporarily ignore io_is_busy=1" This reverts commit 2af1218a8a0220fec526f64d03977b8451afb4c8. --- diff --git a/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch b/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch index 6a19b8e219..38f86fd9b7 100644 --- a/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch +++ b/target/linux/brcm2708/patches-4.4/0220-net-sched-add-skb_at_tc_ingress-helper.patch @@ -1,7 +1,7 @@ -From 5383498b7d0c4976b35d0a1dfaa0e71f20541440 Mon Sep 17 00:00:00 2001 +From cb795ee030d3ed4b792e795e545b81c00254df25 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Thu, 7 Jan 2016 15:50:22 +0100 -Subject: [PATCH 220/423] net, sched: add skb_at_tc_ingress helper +Subject: [PATCH] net, sched: add skb_at_tc_ingress helper Add a skb_at_tc_ingress() as this will be needed elsewhere as well and can hide the ugly ifdef. diff --git a/target/linux/brcm2708/patches-4.4/0221-bpf-add-skb_postpush_rcsum-and-fix-dev_forward_skb-o.patch b/target/linux/brcm2708/patches-4.4/0221-bpf-add-skb_postpush_rcsum-and-fix-dev_forward_skb-o.patch deleted file mode 100644 index ee8548f553..0000000000 --- a/target/linux/brcm2708/patches-4.4/0221-bpf-add-skb_postpush_rcsum-and-fix-dev_forward_skb-o.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 367956e87b62ae1f015ccbff58c7920a2e7a3511 Mon Sep 17 00:00:00 2001 -From: Daniel Borkmann -Date: Thu, 7 Jan 2016 15:50:23 +0100 -Subject: [PATCH 221/423] bpf: add skb_postpush_rcsum and fix dev_forward_skb - occasions - -Add a small helper skb_postpush_rcsum() and fix up redirect locations -that need CHECKSUM_COMPLETE fixups on ingress. dev_forward_skb() expects -a proper csum that covers also Ethernet header, f.e. since 2c26d34bbcc0 -("net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding"), we -also do skb_postpull_rcsum() after pulling Ethernet header off via -eth_type_trans(). - -When using eBPF in a netns setup f.e. with vxlan in collect metadata mode, -I can trigger the following csum issue with an IPv6 setup: - - [ 505.144065] dummy1: hw csum failure - [...] - [ 505.144108] Call Trace: - [ 505.144112] [] dump_stack+0x44/0x5c - [ 505.144134] [] netdev_rx_csum_fault+0x3a/0x40 - [ 505.144142] [] __skb_checksum_complete+0xcf/0xe0 - [ 505.144149] [] nf_ip6_checksum+0xb2/0x120 - [ 505.144161] [] icmpv6_error+0x17e/0x328 [nf_conntrack_ipv6] - [ 505.144170] [] ? ip6t_do_table+0x2fa/0x645 [ip6_tables] - [ 505.144177] [] ? ipv6_get_l4proto+0x65/0xd0 [nf_conntrack_ipv6] - [ 505.144189] [] nf_conntrack_in+0xc2/0x5a0 [nf_conntrack] - [ 505.144196] [] ipv6_conntrack_in+0x1c/0x20 [nf_conntrack_ipv6] - [ 505.144204] [] nf_iterate+0x5d/0x70 - [ 505.144210] [] nf_hook_slow+0x66/0xc0 - [ 505.144218] [] ipv6_rcv+0x3f2/0x4f0 - [ 505.144225] [] ? ip6_make_skb+0x1b0/0x1b0 - [ 505.144232] [] __netif_receive_skb_core+0x36b/0x9a0 - [ 505.144239] [] ? __netif_receive_skb+0x18/0x60 - [ 505.144245] [] __netif_receive_skb+0x18/0x60 - [ 505.144252] [] process_backlog+0x9f/0x140 - [ 505.144259] [] net_rx_action+0x145/0x320 - [...] - -What happens is that on ingress, we push Ethernet header back in, either -from cls_bpf or right before skb_do_redirect(), but without updating csum. -The "hw csum failure" can be fixed by using the new skb_postpush_rcsum() -helper for the dev_forward_skb() case to correct the csum diff again. - -Thanks to Hannes Frederic Sowa for the csum_partial() idea! - -Fixes: 3896d655f4d4 ("bpf: introduce bpf_clone_redirect() helper") -Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper") -Signed-off-by: Daniel Borkmann -Acked-by: Alexei Starovoitov -Signed-off-by: David S. Miller ---- - net/core/filter.c | 17 +++++++++++++---- - 1 file changed, 13 insertions(+), 4 deletions(-) - ---- a/net/core/filter.c -+++ b/net/core/filter.c -@@ -1291,8 +1291,9 @@ static u64 bpf_skb_store_bytes(u64 r1, u - /* skb_store_bits cannot return -EFAULT here */ - skb_store_bits(skb, offset, ptr, len); - -- if (BPF_RECOMPUTE_CSUM(flags) && skb->ip_summed == CHECKSUM_COMPLETE) -- skb->csum = csum_add(skb->csum, csum_partial(ptr, len, 0)); -+ if (BPF_RECOMPUTE_CSUM(flags)) -+ skb_postpush_rcsum(skb, ptr, len); -+ - return 0; - } - -@@ -1415,8 +1416,12 @@ static u64 bpf_clone_redirect(u64 r1, u6 - if (unlikely(!skb2)) - return -ENOMEM; - -- if (BPF_IS_REDIRECT_INGRESS(flags)) -+ if (BPF_IS_REDIRECT_INGRESS(flags)) { -+ if (skb_at_tc_ingress(skb2)) -+ skb_postpush_rcsum(skb2, skb_mac_header(skb2), -+ skb2->mac_len); - return dev_forward_skb(dev, skb2); -+ } - - skb2->dev = dev; - skb_sender_cpu_clear(skb2); -@@ -1459,8 +1464,12 @@ int skb_do_redirect(struct sk_buff *skb) - return -EINVAL; - } - -- if (BPF_IS_REDIRECT_INGRESS(ri->flags)) -+ if (BPF_IS_REDIRECT_INGRESS(ri->flags)) { -+ if (skb_at_tc_ingress(skb)) -+ skb_postpush_rcsum(skb, skb_mac_header(skb), -+ skb->mac_len); - return dev_forward_skb(dev, skb); -+ } - - skb->dev = dev; - skb_sender_cpu_clear(skb); diff --git a/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch b/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch index 2b8813491c..9863595bc0 100644 --- a/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch +++ b/target/linux/brcm2708/patches-4.4/0222-bcm2835-sdhost-Precalc-divisors-and-overclocks.patch @@ -1,7 +1,7 @@ -From 5891d0fea3401ae4248fb98d6e70c9e6ffcf1aab Mon Sep 17 00:00:00 2001 +From 4a680ce7ef96ac561e02c1e02951a210092a2ef6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 31 Mar 2016 15:44:53 +0100 -Subject: [PATCH 222/423] bcm2835-sdhost: Precalc divisors and overclocks +Subject: [PATCH] bcm2835-sdhost: Precalc divisors and overclocks Recalculating the clock divisors when the core clock changes is wasteful and makes it harder to manage the overclock settings. Instead, diff --git a/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch b/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch index 87e4382285..108750191a 100644 --- a/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch +++ b/target/linux/brcm2708/patches-4.4/0223-Revert-bcm2835-sdhost-Precalc-divisors-and-overclock.patch @@ -1,8 +1,7 @@ -From 4d85eac2b4821741269c9e49a0f3d0589291c83a Mon Sep 17 00:00:00 2001 +From 664ffae1f5e89a69f12f83717c2a7efccea008ca Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 4 Apr 2016 12:35:32 +0100 -Subject: [PATCH 223/423] Revert "bcm2835-sdhost: Precalc divisors and - overclocks" +Subject: [PATCH] Revert "bcm2835-sdhost: Precalc divisors and overclocks" This reverts commit 20260462773366a5734e5268dae0a4c179a21a2d. --- diff --git a/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch b/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch index bf0b1e8b17..55d5c89871 100644 --- a/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch +++ b/target/linux/brcm2708/patches-4.4/0224-Revert-bcm2835-sdhost-Adjust-to-core-clock-changes.patch @@ -1,7 +1,7 @@ -From 2f5c0928b44b0d34a975b4fb8165c26a134d7097 Mon Sep 17 00:00:00 2001 +From fe985856bc342027d498cfb5e261fef698ac336b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 4 Apr 2016 12:35:51 +0100 -Subject: [PATCH 224/423] Revert "bcm2835-sdhost: Adjust to core clock changes" +Subject: [PATCH] Revert "bcm2835-sdhost: Adjust to core clock changes" This reverts commit 4b89d07fd299a0f4e25321920cb74416ba2e638e. --- diff --git a/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch b/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch index 27f070bc7b..8d503b844c 100644 --- a/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch +++ b/target/linux/brcm2708/patches-4.4/0225-bcm2835-sdhost-Firmware-manages-the-clock-divisor.patch @@ -1,7 +1,7 @@ -From 0b7ab0214a63a19c8c1a383b3ef89713c91e0251 Mon Sep 17 00:00:00 2001 +From 38575eb0b705f13b039b433687cf2a70cd8d425b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 4 Apr 2016 16:03:18 +0100 -Subject: [PATCH 225/423] bcm2835-sdhost: Firmware manages the clock divisor +Subject: [PATCH] bcm2835-sdhost: Firmware manages the clock divisor The bcm2835-sdhost driver hands control of the CDIV clock divisor register to matching firmware, allowing it to adjust to a changing diff --git a/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch b/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch index 91d52ce337..c3bd751496 100644 --- a/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch +++ b/target/linux/brcm2708/patches-4.4/0226-Revert-Revert-cpufreq-Temporarily-ignore-io_is_busy-.patch @@ -1,8 +1,7 @@ -From 136379745690939706d830547ff754e770e832eb Mon Sep 17 00:00:00 2001 +From 086b24cf253a55acfaa185310fa19b7493ddbe3f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 4 Apr 2016 19:52:27 +0100 -Subject: [PATCH 226/423] Revert "Revert "cpufreq: Temporarily ignore - io_is_busy=1"" +Subject: [PATCH] Revert "Revert "cpufreq: Temporarily ignore io_is_busy=1"" This reverts commit c353af0f83220068c10f6593b1767576b9b6cc18. --- diff --git a/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch b/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch index 06f24e4c33..8dd8dfef56 100644 --- a/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch +++ b/target/linux/brcm2708/patches-4.4/0227-config-Enabled-IPV6_SUBTREES.patch @@ -1,7 +1,7 @@ -From ad66c705ec0cd980297425e2d0541c68eedf1557 Mon Sep 17 00:00:00 2001 +From 2791d33cb965581363a616e116574b16cf279a5a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 31 Mar 2016 16:49:52 +0100 -Subject: [PATCH 227/423] config: Enabled IPV6_SUBTREES +Subject: [PATCH] config: Enabled IPV6_SUBTREES --- arch/arm/configs/bcm2709_defconfig | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch b/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch index 622eaa927c..7258c94d77 100644 --- a/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch +++ b/target/linux/brcm2708/patches-4.4/0228-add-smsc95xx-packetsize-module_param.patch @@ -1,7 +1,7 @@ -From fefd3cd13f39ac77c50b63abcb41dd01163e127a Mon Sep 17 00:00:00 2001 +From 8e367cd08419234412d2d9b430d2ebe7d528b931 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 228/423] add smsc95xx packetsize module_param +Subject: [PATCH] add smsc95xx packetsize module_param Signed-off-by: Sam Nazarko --- diff --git a/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch b/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch index 87296ac45f..278aa619d4 100644 --- a/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch +++ b/target/linux/brcm2708/patches-4.4/0229-reboot-Use-power-off-rather-than-busy-spinning-when-.patch @@ -1,8 +1,8 @@ -From c927d6c160408b033223d7cf7795e2ec0faa78fa Mon Sep 17 00:00:00 2001 +From 9891143d60d8c653db23b6fafaa402fc1de12588 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 229/423] reboot: Use power off rather than busy spinning when - halt is requested +Subject: [PATCH] reboot: Use power off rather than busy spinning when halt is + requested --- arch/arm/kernel/reboot.c | 6 +----- diff --git a/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch b/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch index 0058a5b2e9..c4f36e1fce 100644 --- a/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch +++ b/target/linux/brcm2708/patches-4.4/0230-Revert-bcm2835-dma-Fix-dreq-not-set-for-slave-transf.patch @@ -1,8 +1,7 @@ -From dc09000595f912aec73956e6db7be266c434fd3e Mon Sep 17 00:00:00 2001 +From 8fa158cb700b0fdbb76ede07ec2103b5930e0913 Mon Sep 17 00:00:00 2001 From: HiassofT Date: Wed, 6 Apr 2016 21:45:01 +0200 -Subject: [PATCH 230/423] Revert "bcm2835-dma: Fix dreq not set for slave - transfers" +Subject: [PATCH] Revert "bcm2835-dma: Fix dreq not set for slave transfers" This reverts commit 8ad957e866a1fe1450f663f2b00a57d7de44904c. diff --git a/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch b/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch index 2d2e07c966..f1c6433fdf 100644 --- a/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch +++ b/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch @@ -1,8 +1,8 @@ -From f736b53bdc910c364e8f2cd0f0c1bf1edf41f048 Mon Sep 17 00:00:00 2001 +From 2026557f3f9df2d0563f71b4bd704956c4cfd4ab Mon Sep 17 00:00:00 2001 From: Dave Stevenson <6by9@users.noreply.github.com> Date: Fri, 1 Apr 2016 15:28:46 +0100 -Subject: [PATCH 231/423] RPi config: Add CONFIG_PWM_PCA9685 for NXP PCA9685 - driver over I2C +Subject: [PATCH] RPi config: Add CONFIG_PWM_PCA9685 for NXP PCA9685 driver + over I2C Includes DT overlay to configure it. diff --git a/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch b/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch index b77fef1937..a6630fdeac 100644 --- a/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch +++ b/target/linux/brcm2708/patches-4.4/0232-BCM270X_DT-Don-t-generate-linux-phandle-props.patch @@ -1,7 +1,7 @@ -From 3d7cb0d28c79c6418a3666803960881e21e5c974 Mon Sep 17 00:00:00 2001 +From 28cb7cf5480a77df08bba1e30e7070dff46463d7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 8 Apr 2016 17:43:27 +0100 -Subject: [PATCH 232/423] BCM270X_DT: Don't generate "linux,phandle" props +Subject: [PATCH] BCM270X_DT: Don't generate "linux,phandle" props The EPAPR standard says to use "phandle" properties to store phandles, rather than the deprecated "linux,phandle" version. By default, dtc diff --git a/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch b/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch index 89198b2817..92a834a59b 100644 --- a/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch +++ b/target/linux/brcm2708/patches-4.4/0233-V4L2-driver-updates-1393.patch @@ -1,7 +1,7 @@ -From 901e004652b14261a036e259adac0a380bbb724b Mon Sep 17 00:00:00 2001 +From 35730c81cb94119c117901bbdcc148baf35aa37c Mon Sep 17 00:00:00 2001 From: 6by9 <6by9@users.noreply.github.com> Date: Fri, 8 Apr 2016 18:15:43 +0100 -Subject: [PATCH 233/423] V4L2 driver updates (#1393) +Subject: [PATCH] V4L2 driver updates (#1393) * BCM2835-V4L2: Correct ISO control and add V4L2_CID_ISO_SENSITIVITY_AUTO diff --git a/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch b/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch index b15a89db7b..a01d406dfa 100644 --- a/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch +++ b/target/linux/brcm2708/patches-4.4/0234-bcm2835-sdhost-Reset-the-clock-in-task-context.patch @@ -1,7 +1,7 @@ -From f900cc706eca16b68d335810173b253229109ec5 Mon Sep 17 00:00:00 2001 +From b61249080d5492fdb4bcf22e1672dc773a9bd95a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 Apr 2016 12:50:58 +0100 -Subject: [PATCH 234/423] bcm2835-sdhost: Reset the clock in task context +Subject: [PATCH] bcm2835-sdhost: Reset the clock in task context Since reprogramming the clock can now involve a round-trip to the firmware it must not be done at atomic context, and a tasklet diff --git a/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch b/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch index 0db27e0d95..0b69ca32da 100644 --- a/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch +++ b/target/linux/brcm2708/patches-4.4/0235-config-Enable-CONFIG_IPV6_ROUTER_PREF-for-networks-w.patch @@ -1,8 +1,8 @@ -From 9e67abb08bb66fcffa1540bc18b98beeda7d6285 Mon Sep 17 00:00:00 2001 +From 715ff3d10588ca8b2a72acbc918ba4849a1f988c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 Apr 2016 12:44:24 +0100 -Subject: [PATCH 235/423] config: Enable CONFIG_IPV6_ROUTER_PREF for networks - with multiple routers +Subject: [PATCH] config: Enable CONFIG_IPV6_ROUTER_PREF for networks with + multiple routers --- arch/arm/configs/bcm2709_defconfig | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch b/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch index c66e4289be..9b3f2f65ed 100644 --- a/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch +++ b/target/linux/brcm2708/patches-4.4/0236-Enable-hid-betopff-module.patch @@ -1,7 +1,7 @@ -From b7d3c1f41a346bccd4a8ec3f553a6f109677c37b Mon Sep 17 00:00:00 2001 +From 0561be97d8de22572d91d78c807b1bb4a38255f3 Mon Sep 17 00:00:00 2001 From: jochenberger Date: Thu, 7 Apr 2016 21:38:46 +0200 -Subject: [PATCH 236/423] Enable hid-betopff module +Subject: [PATCH] Enable hid-betopff module Add force feedback support for Betop based devices https://github.com/raspberrypi/linux/blob/rpi-4.1.y/drivers/hid/hid-betopff.c diff --git a/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch b/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch index fb606a48e1..2bd1e96a8f 100644 --- a/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch +++ b/target/linux/brcm2708/patches-4.4/0237-config-Make-IPV6-a-module-and-regenerate-with-defcon.patch @@ -1,8 +1,7 @@ -From 66e5546f065bd4c854e6ccfe192942a76137e80f Mon Sep 17 00:00:00 2001 +From 9efe69a81ab2f031cbfeccb2f606a241f155e6b5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Apr 2016 12:45:16 +0100 -Subject: [PATCH 237/423] config: Make IPV6 a module and regenerate with - defconfig +Subject: [PATCH] config: Make IPV6 a module and regenerate with defconfig --- arch/arm/configs/bcm2709_defconfig | 4 ++-- diff --git a/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch b/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch index 8d24a94fce..66d7985748 100644 --- a/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0238-BCM270X_DT-Add-dpi24-overlay.patch @@ -1,7 +1,7 @@ -From 6db3147b0daf8b893eba23c305ec5e39354587d2 Mon Sep 17 00:00:00 2001 +From f88c6236440972207406742d87692859b4f15612 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 5 Apr 2016 13:01:54 +0100 -Subject: [PATCH 238/423] BCM270X_DT: Add dpi24 overlay +Subject: [PATCH] BCM270X_DT: Add dpi24 overlay Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch b/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch index 33a15e99d5..9d6927a878 100644 --- a/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch +++ b/target/linux/brcm2708/patches-4.4/0239-Modify-IQAudIO-DAC-ASoC-driver-to-set-card-dai-confi.patch @@ -1,8 +1,8 @@ -From e26827db219f8221e20aba5e7f564d61b4fa2be3 Mon Sep 17 00:00:00 2001 +From 6e50eac8d374fa7d6ed3e02564851bc250443402 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 14 Apr 2016 00:57:33 +0100 -Subject: [PATCH 239/423] Modify IQAudIO DAC+ ASoC driver to set card/dai - config from dt +Subject: [PATCH] Modify IQAudIO DAC+ ASoC driver to set card/dai config from + dt Add the ability to set the card name, dai name and dai stream name, from dt config. diff --git a/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch b/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch index 5560412571..a767d3ede1 100644 --- a/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch +++ b/target/linux/brcm2708/patches-4.4/0240-Add-support-for-the-Digital-Dreamtime-Akkordion-musi.patch @@ -1,8 +1,7 @@ -From 69211c7619dd7788d92c8e9c8e47de6a2ac66d76 Mon Sep 17 00:00:00 2001 +From 0a36540c6a3b383a554412bf65cc75d65f7b77f8 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 14 Apr 2016 01:00:58 +0100 -Subject: [PATCH 240/423] Add support for the Digital Dreamtime Akkordion music - player. +Subject: [PATCH] Add support for the Digital Dreamtime Akkordion music player. Support the Digital Dreamtime Akkordion using the OEM IQAudIO DAC+ or DACZero modules. Set ALSA card name, ("Akkordion"), from dt config. diff --git a/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch b/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch index c1c88f1d6b..e0f62c9135 100644 --- a/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch +++ b/target/linux/brcm2708/patches-4.4/0241-Add-Support-for-BoomBerry-Audio-boards.patch @@ -1,7 +1,7 @@ -From acfc71e5a52a8c2389341052d9d4d3f2d807f962 Mon Sep 17 00:00:00 2001 +From 3120b4247e34e255f4f43d291df4b779b3e9d4c8 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 241/423] Add Support for BoomBerry Audio boards +Subject: [PATCH] Add Support for BoomBerry Audio boards --- arch/arm/boot/dts/overlays/Makefile | 2 + diff --git a/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch b/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch index d0a50ef866..9974349c5c 100644 --- a/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch +++ b/target/linux/brcm2708/patches-4.4/0242-Add-support-for-mcp7940x-family-of-RTC.patch @@ -1,7 +1,7 @@ -From 0046657bca51cfb61edcb38cef3039d304863a25 Mon Sep 17 00:00:00 2001 +From 215eb99b0a93a3365c7e3819b2701b416f88a25a Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Fri, 8 Apr 2016 00:06:00 +0100 -Subject: [PATCH 242/423] Add support for mcp7940x family of RTC +Subject: [PATCH] Add support for mcp7940x family of RTC --- arch/arm/boot/dts/overlays/README | 2 ++ diff --git a/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch b/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch index e66f0a4b0b..bfdc32924c 100644 --- a/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch +++ b/target/linux/brcm2708/patches-4.4/0243-bcm2709_defconfig-Fix-typo-on-BoomBerry-configuratio.patch @@ -1,8 +1,8 @@ -From eecfe86df596a7b589040300fead9621aaaa24de Mon Sep 17 00:00:00 2001 +From ab1d490040fb4f7ea284feebb8a1e78bd6d54176 Mon Sep 17 00:00:00 2001 From: Jeremy McDermond Date: Thu, 14 Apr 2016 09:39:20 -0700 -Subject: [PATCH 243/423] bcm2709_defconfig: Fix typo on BoomBerry - configuration directive +Subject: [PATCH] bcm2709_defconfig: Fix typo on BoomBerry configuration + directive The BoomBerry configuration directive in bcm2709_defconfig has a typo. --- diff --git a/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch b/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch index a5ce314b40..f9cfb57261 100644 --- a/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch +++ b/target/linux/brcm2708/patches-4.4/0244-boomberry-dac-Adjust-for-ALSA-API-change.patch @@ -1,7 +1,7 @@ -From b2722225844f050026ed43446d67d26032af05ed Mon Sep 17 00:00:00 2001 +From 9d3c4c7019c68e5eb1c1635c8878f5c6bff3e120 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 15 Apr 2016 10:48:39 +0100 -Subject: [PATCH 244/423] boomberry-dac: Adjust for ALSA API change +Subject: [PATCH] boomberry-dac: Adjust for ALSA API change As of 4.4, snd_soc_limit_volume now takes a struct snd_soc_card * rather than a struct snd_soc_codec *. diff --git a/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch b/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch index b89b4c4ecd..e4ad3c4f86 100644 --- a/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch +++ b/target/linux/brcm2708/patches-4.4/0245-vmcs-Remove-unused-sm_cache_map_vector-definition-14.patch @@ -1,8 +1,7 @@ -From 9a9153d6a6e2c413ff568a9e26dd4711060c0732 Mon Sep 17 00:00:00 2001 +From 39aaeeb6912c97ede930b463c99b7848d1340a45 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Apr 2016 04:44:47 -0700 -Subject: [PATCH 245/423] vmcs: Remove unused sm_cache_map_vector definition - (#1411) +Subject: [PATCH] vmcs: Remove unused sm_cache_map_vector definition (#1411) The code using it also ifdef'ed with 0, anyyd gcc 6 complains diff --git a/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch b/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch index eab548aebf..99bfb66594 100644 --- a/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch +++ b/target/linux/brcm2708/patches-4.4/0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch @@ -1,7 +1,7 @@ -From de215293c91853f39344b66ea18ca49b975f4783 Mon Sep 17 00:00:00 2001 +From 27c3944874a034975d23722b10d6d7e6b7dd930d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 18 Apr 2016 11:56:53 +0100 -Subject: [PATCH 246/423] scripts/mkknlimg: Append a trailer for all input +Subject: [PATCH] scripts/mkknlimg: Append a trailer for all input Now that the firmware assumes an unsigned kernel is DT-capable, it is helpful to be able to mark a kernel as being non-DT-capable. diff --git a/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch b/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch index 14401e2f09..95ba5d653d 100644 --- a/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch +++ b/target/linux/brcm2708/patches-4.4/0247-bcm2835_thermal-Don-t-report-unsupported-trip-type.patch @@ -1,7 +1,7 @@ -From 9f8cfdfbb0850aed63d1489469b36f53affa99aa Mon Sep 17 00:00:00 2001 +From bd462524b465fc6aeed292cca8c2da19be3d9887 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Apr 2016 12:57:52 +0100 -Subject: [PATCH 247/423] bcm2835_thermal: Don't report unsupported trip type +Subject: [PATCH] bcm2835_thermal: Don't report unsupported trip type --- drivers/thermal/bcm2835-thermal.c | 34 +--------------------------------- diff --git a/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch b/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch index 511763f7cf..a73bb234e7 100644 --- a/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch +++ b/target/linux/brcm2708/patches-4.4/0248-scripts-dtc-Only-emit-local-fixups-for-overlays.patch @@ -1,7 +1,7 @@ -From fffbc0bb693d462619402b4ca134c3d591e799bf Mon Sep 17 00:00:00 2001 +From e9e95f1830775a13ccd1a3746d7fa526ed2c722c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 19 Apr 2016 13:55:29 +0100 -Subject: [PATCH 248/423] scripts/dtc: Only emit local fixups for overlays +Subject: [PATCH] scripts/dtc: Only emit local fixups for overlays Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch b/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch index 25b6617684..d50c80287e 100644 --- a/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch +++ b/target/linux/brcm2708/patches-4.4/0249-bcm2835-do-not-require-substream-for-accessing-chmap.patch @@ -1,8 +1,7 @@ -From afad9ef007320f0cda5b97004d07a52e8387e912 Mon Sep 17 00:00:00 2001 +From 955fba9c62f43238b5c3687a78ed812ac95edd44 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Apr 2016 16:08:35 +0200 -Subject: [PATCH 249/423] bcm2835: do not require substream for accessing chmap - ctl +Subject: [PATCH] bcm2835: do not require substream for accessing chmap ctl Fixes alsasctl store/restore operation. --- diff --git a/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch b/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch index 9285411b44..b498d00fb6 100644 --- a/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch +++ b/target/linux/brcm2708/patches-4.4/0250-bcm2835-add-fallback-channel-layouts-if-channel-map-.patch @@ -1,8 +1,8 @@ -From 7c2791eb1e01c8714d5553bd2bd5e611394a6517 Mon Sep 17 00:00:00 2001 +From f3e1f2d9d34ab1cfafc4df7d67b7c65619b69ce0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Apr 2016 16:29:41 +0200 -Subject: [PATCH 250/423] bcm2835: add fallback channel layouts if channel map - API is not used +Subject: [PATCH] bcm2835: add fallback channel layouts if channel map API is + not used Should be more useful than just forcing stereo. diff --git a/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch b/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch index 4b53f36012..9f56fb03c5 100644 --- a/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch +++ b/target/linux/brcm2708/patches-4.4/0251-bcm2835-log-which-channel-map-is-set.patch @@ -1,7 +1,7 @@ -From 317cae9751a3e08bbddaeb6099e05c7700884a30 Mon Sep 17 00:00:00 2001 +From 221eae6137f4ed70aa0c55decd7a0659391cd30b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 19 Apr 2016 16:38:03 +0200 -Subject: [PATCH 251/423] bcm2835: log which channel map is set +Subject: [PATCH] bcm2835: log which channel map is set --- sound/arm/bcm2835-vchiq.c | 5 +++++ diff --git a/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch b/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch index 47e3fe7b71..ae18b44d94 100644 --- a/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch +++ b/target/linux/brcm2708/patches-4.4/0252-clk-bcm2835-add-a-round-up-ability-to-the-clock-divi.patch @@ -1,8 +1,7 @@ -From a216a6ac7b7efad9d9d62ffa6be5fd1809953b6d Mon Sep 17 00:00:00 2001 +From 01993e1dda68d85ff6cf11cab6051bcefa46d2c1 Mon Sep 17 00:00:00 2001 From: Remi Pommarel Date: Sun, 6 Dec 2015 17:22:46 +0100 -Subject: [PATCH 252/423] clk: bcm2835: add a round up ability to the clock - divisor +Subject: [PATCH] clk: bcm2835: add a round up ability to the clock divisor Make bcm2835_clock_choose_div to optionally round up the chosen MASH divisor so that the resulting average rate will not be higher than the requested one. diff --git a/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch b/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch index a6078da960..db53ad343e 100644 --- a/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch +++ b/target/linux/brcm2708/patches-4.4/0253-clk-bcm2835-Support-for-clock-parent-selection.patch @@ -1,7 +1,7 @@ -From 29085f56d20e9c563b183a003f39f7cfc7884b17 Mon Sep 17 00:00:00 2001 +From c9de2447d4b9cf641276d74902405a0b5e1c2a8d Mon Sep 17 00:00:00 2001 From: Remi Pommarel Date: Sun, 6 Dec 2015 17:22:47 +0100 -Subject: [PATCH 253/423] clk: bcm2835: Support for clock parent selection +Subject: [PATCH] clk: bcm2835: Support for clock parent selection Some bcm2835 clocks used by hardware (like "PWM" or "H264") can have multiple parent clocks. These clocks divide the rate of a parent which can be selected by diff --git a/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch b/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch index 6a6b0d8275..5bf7066979 100644 --- a/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch +++ b/target/linux/brcm2708/patches-4.4/0254-clk-bcm2835-Add-PWM-clock-support.patch @@ -1,7 +1,7 @@ -From fc112f40c9d15990686e0481db5bb5ed23567299 Mon Sep 17 00:00:00 2001 +From cbf30c2377959725bfcccc8cbb5b98fe6af4aefb Mon Sep 17 00:00:00 2001 From: Remi Pommarel Date: Sun, 6 Dec 2015 17:22:48 +0100 -Subject: [PATCH 254/423] clk: bcm2835: Add PWM clock support +Subject: [PATCH] clk: bcm2835: Add PWM clock support Register the pwm clock for bcm2835. diff --git a/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch b/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch index 8e570dee94..db44df7cf1 100644 --- a/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch +++ b/target/linux/brcm2708/patches-4.4/0255-clk-bcm2835-added-missing-clock-register-definitions.patch @@ -1,8 +1,7 @@ -From b1871ea5430a67f6476c666b70985924f27a88a0 Mon Sep 17 00:00:00 2001 +From f9855ea88630c3fdf6508db8775f34103f363f50 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 22 Dec 2015 20:13:08 +0000 -Subject: [PATCH 255/423] clk: bcm2835: added missing clock register - definitions +Subject: [PATCH] clk: bcm2835: added missing clock register definitions Added missing CTRL and DIV clock register definitions for: PCM, SLIM, TCNT, TEC, TD0, TD1 diff --git a/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch b/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch index 3ecd5e36ff..1313aead16 100644 --- a/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch +++ b/target/linux/brcm2708/patches-4.4/0256-clk-bcm2835-correctly-enable-fractional-clock-suppor.patch @@ -1,8 +1,7 @@ -From 7182f4321e85d4911762f7dd2b38e6e1a7919073 Mon Sep 17 00:00:00 2001 +From 111293a9f0aa27bfdbb0ca864d9524691bb5934f Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 11:39:21 +0000 -Subject: [PATCH 256/423] clk: bcm2835: correctly enable fractional clock - support +Subject: [PATCH] clk: bcm2835: correctly enable fractional clock support The current driver calculates the clock divider with fractional support enabled. diff --git a/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch b/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch index 30ef85aa63..1c05e87ee5 100644 --- a/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch +++ b/target/linux/brcm2708/patches-4.4/0257-clk-bcm2835-clean-up-coding-style-issues.patch @@ -1,7 +1,7 @@ -From 9da8191efd09a55914c0078ee23317cd79c48b15 Mon Sep 17 00:00:00 2001 +From 30ffff91447cd2d0dc6afd6ada53b13bc04f2f05 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 11:39:22 +0000 -Subject: [PATCH 257/423] clk: bcm2835: clean up coding style issues +Subject: [PATCH] clk: bcm2835: clean up coding style issues Fix all the checkpatch complaints for clk-bcm2835.c diff --git a/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch b/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch index 764ed2bb58..f1f118a2b3 100644 --- a/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch +++ b/target/linux/brcm2708/patches-4.4/0258-clk-bcm2835-expose-raw-clock-registers-via-debugfs.patch @@ -1,7 +1,7 @@ -From f057d681e2af27bd013072cf8b46df927d4c03d1 Mon Sep 17 00:00:00 2001 +From 57390bceca1ef7df484290d3864b76a217c6b553 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 14:20:15 +0000 -Subject: [PATCH 258/423] clk: bcm2835: expose raw clock-registers via debugfs +Subject: [PATCH] clk: bcm2835: expose raw clock-registers via debugfs For debugging purposes under some circumstance it helps to be able to see the actual clock registers. diff --git a/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch b/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch index fca8c89567..acce39c069 100644 --- a/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch +++ b/target/linux/brcm2708/patches-4.4/0259-clk-bcm2835-remove-use-of-BCM2835_CLOCK_COUNT-in-dri.patch @@ -1,8 +1,7 @@ -From 6cf07099604e362169932d82444a0f234cc8cbe0 Mon Sep 17 00:00:00 2001 +From 061e3130a957f04af48ff703209096e8a0b5655e Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 12:51:41 +0000 -Subject: [PATCH 259/423] clk: bcm2835: remove use of BCM2835_CLOCK_COUNT in - driver +Subject: [PATCH] clk: bcm2835: remove use of BCM2835_CLOCK_COUNT in driver As the use of BCM2835_CLOCK_COUNT in include/dt-bindings/clock/bcm2835.h is frowned upon as diff --git a/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch b/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch index 7705ab00e7..21513f0ec2 100644 --- a/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch +++ b/target/linux/brcm2708/patches-4.4/0260-clk-bcm2835-reorganize-bcm2835_clock_array-assignmen.patch @@ -1,8 +1,7 @@ -From fd09548954d1301cce55d136aaeecd617d36b491 Mon Sep 17 00:00:00 2001 +From c0e6c2ae19400047ad0f744f95b6997b579e0ffc Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 12:51:42 +0000 -Subject: [PATCH 260/423] clk: bcm2835: reorganize bcm2835_clock_array - assignment +Subject: [PATCH] clk: bcm2835: reorganize bcm2835_clock_array assignment Reorganize bcm2835_clock_array so that there is no more need for separate bcm2835_*_data structures to be defined. diff --git a/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch b/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch index 42481fdad5..c14dcebc45 100644 --- a/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch +++ b/target/linux/brcm2708/patches-4.4/0261-clk-bcm2835-enable-management-of-PCM-clock.patch @@ -1,7 +1,7 @@ -From be05b91c313b122b4b1cb92bea7582b92eff3950 Mon Sep 17 00:00:00 2001 +From 5be1920e2cfc7e351aeff3920607c4d96fed9f1a Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 12:51:43 +0000 -Subject: [PATCH 261/423] clk: bcm2835: enable management of PCM clock +Subject: [PATCH] clk: bcm2835: enable management of PCM clock Enable the PCM clock in the SOC, which is used by the bcm2835-i2s driver. diff --git a/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch b/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch index dd71a4d6e7..2bb2db6b35 100644 --- a/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch +++ b/target/linux/brcm2708/patches-4.4/0262-clk-bcm2835-add-missing-PLL-clock-dividers.patch @@ -1,7 +1,7 @@ -From bea282aec8f05b08fd5185f7aeb75050a00c1d49 Mon Sep 17 00:00:00 2001 +From 0bd7afe408b2afd845f3b4971cfa641653716a12 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 15:43:56 +0000 -Subject: [PATCH 262/423] clk: bcm2835: add missing PLL clock dividers +Subject: [PATCH] clk: bcm2835: add missing PLL clock dividers Signed-off-by: Martin Sperl Signed-off-by: Eric Anholt diff --git a/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch b/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch index 553de1dfc9..697f3733b8 100644 --- a/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch +++ b/target/linux/brcm2708/patches-4.4/0263-clk-bcm2835-add-missing-osc-and-per-clocks.patch @@ -1,7 +1,7 @@ -From f634bd6444b004d080a6bbcee812f95669d6a91f Mon Sep 17 00:00:00 2001 +From 3f26e43abb4c245d41dfbed03d82c3bc36044b04 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Mon, 29 Feb 2016 15:43:57 +0000 -Subject: [PATCH 263/423] clk: bcm2835: add missing osc and per clocks +Subject: [PATCH] clk: bcm2835: add missing osc and per clocks Add AVE0, DFT, GP0, GP1, GP2, SLIM, SMI, TEC, DPI, CAM0, CAM1, DSI0E, and DSI1E. PULSE is not added because it has an extra divider. diff --git a/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch b/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch index 9ceb0721db..cfe6c9547c 100644 --- a/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch +++ b/target/linux/brcm2708/patches-4.4/0264-ARM-bcm2835-Define-two-new-packets-from-the-latest-f.patch @@ -1,7 +1,7 @@ -From 2d65549219b48c5da3bcc743477567b41017c96f Mon Sep 17 00:00:00 2001 +From 0021fdc59ccc2901f9ae829eb89d624a518eab27 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 1 Dec 2015 16:49:12 -0800 -Subject: [PATCH 264/423] ARM: bcm2835: Define two new packets from the latest +Subject: [PATCH] ARM: bcm2835: Define two new packets from the latest firmware. These packets give us direct access to the firmware's power management diff --git a/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch b/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch index c3330a6344..a27859774b 100644 --- a/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0265-ARM-bcm2835-add-rpi-power-domain-driver.patch @@ -1,7 +1,7 @@ -From 0e371c743ab0adb7ada29fbe13712d7ab5696382 Mon Sep 17 00:00:00 2001 +From fab8814aede95569e5dfe3bad78ceda471bd341f Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Wed, 16 Dec 2015 16:26:47 -0800 -Subject: [PATCH 265/423] ARM: bcm2835: add rpi power domain driver +Subject: [PATCH] ARM: bcm2835: add rpi power domain driver This patch adds support for several power domains on Raspberry Pi, including USB (so it can be enabled even if the bootloader didn't do diff --git a/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch b/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch index 734762ddce..210ea4f366 100644 --- a/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch +++ b/target/linux/brcm2708/patches-4.4/0266-ARM-bcm2835-clarify-RASPBERRYPI_FIRMWARE-dependency.patch @@ -1,7 +1,7 @@ -From b07da9e061614b18af32b80e75843e85a0171e56 Mon Sep 17 00:00:00 2001 +From 98f387ec974ccd45054a13211ed8d91d46bbe4cc Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 31 Dec 2015 23:39:14 +0100 -Subject: [PATCH 266/423] ARM: bcm2835: clarify RASPBERRYPI_FIRMWARE dependency +Subject: [PATCH] ARM: bcm2835: clarify RASPBERRYPI_FIRMWARE dependency The firmware driver can be a loadable module, but the power domain can only be built-in, so we get a build error in an allmodconfig diff --git a/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch b/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch index e6decc36d8..f97b2e7685 100644 --- a/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0267-ARM-bcm2708-Enable-building-power-domain-driver.patch @@ -1,7 +1,7 @@ -From befc30415610ee28c619b14b8cee501184b43bf8 Mon Sep 17 00:00:00 2001 +From 5b934c573b70da98f70b98aa20a1f96bba8ef9b2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Apr 2016 15:55:02 -0700 -Subject: [PATCH 267/423] ARM: bcm2708: Enable building power domain driver. +Subject: [PATCH] ARM: bcm2708: Enable building power domain driver. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch b/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch index 3d6b740318..f11638e845 100644 --- a/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch +++ b/target/linux/brcm2708/patches-4.4/0268-bcm2708-Add-RASPBERRYPI_POWER-to-the-defconfigs.patch @@ -1,7 +1,7 @@ -From b4ca3f0d1ec696492df39df6878a96d1ec14458a Mon Sep 17 00:00:00 2001 +From 9d065d6d38cb379a36e655c98f5e42cbfc1de0b2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Apr 2016 14:23:30 -0700 -Subject: [PATCH 268/423] bcm2708: Add RASPBERRYPI_POWER to the defconfigs. +Subject: [PATCH] bcm2708: Add RASPBERRYPI_POWER to the defconfigs. This will be used by the GPU driver for powering on HDMI at boot time and for 3D hang reset. diff --git a/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch b/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch index 2c6a619212..c7c2148bbd 100644 --- a/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch +++ b/target/linux/brcm2708/patches-4.4/0269-bcm2708-Add-the-power-domain-driver-to-the-device-tr.patch @@ -1,8 +1,7 @@ -From 5a8fe845b22e7ecef4b0d0d7fdfaa21794fa48c9 Mon Sep 17 00:00:00 2001 +From 61a1a146c39f694a1d347ac251ebd9b7d804064f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Apr 2016 14:36:31 -0700 -Subject: [PATCH 269/423] bcm2708: Add the power domain driver to the device - tree. +Subject: [PATCH] bcm2708: Add the power domain driver to the device tree. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch b/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch index c4adce66ed..95c9d91c5d 100644 --- a/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch +++ b/target/linux/brcm2708/patches-4.4/0270-bcm2708-Reference-the-HDMI-power-domain-for-the-HDMI.patch @@ -1,8 +1,7 @@ -From e3f9f86ddec3e4a07333fa7f368440e09a7252ce Mon Sep 17 00:00:00 2001 +From 8c3b6b58d1f49ce8a352379cd48647e8116659ca Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Apr 2016 14:40:08 -0700 -Subject: [PATCH 270/423] bcm2708: Reference the HDMI power domain for the HDMI - driver. +Subject: [PATCH] bcm2708: Reference the HDMI power domain for the HDMI driver. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch b/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch index b630dad659..3ced0ef28c 100644 --- a/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch +++ b/target/linux/brcm2708/patches-4.4/0271-drm-vc4-copy_to_user-returns-the-number-of-bytes-rem.patch @@ -1,8 +1,7 @@ -From a11ebfca5c605cdd30599edf201a65ece99b05fe Mon Sep 17 00:00:00 2001 +From e1d56edafff76ade96b5dce25e7cf1300213929b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 17 Dec 2015 15:36:28 +0300 -Subject: [PATCH 271/423] drm/vc4: copy_to_user() returns the number of bytes - remaining +Subject: [PATCH] drm/vc4: copy_to_user() returns the number of bytes remaining The copy_to/from_user() functions return the number of bytes remaining to be copied. We want to return error codes here. diff --git a/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch b/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch index 06c7a06824..6d1cbc777c 100644 --- a/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch +++ b/target/linux/brcm2708/patches-4.4/0272-drm-vc4-allocate-enough-memory-in-vc4_save_hang_stat.patch @@ -1,8 +1,7 @@ -From 5c182b5f46cb781e945b3e567ac97fbb369d75d4 Mon Sep 17 00:00:00 2001 +From 6d29873e5a006db5b342630976b5527c8049acd2 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 17 Dec 2015 15:39:08 +0300 -Subject: [PATCH 272/423] drm/vc4: allocate enough memory in - vc4_save_hang_state() +Subject: [PATCH] drm/vc4: allocate enough memory in vc4_save_hang_state() "state" is smaller than "kernel_state" so we end up corrupting memory. diff --git a/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch b/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch index 4d3d94c741..a654f14690 100644 --- a/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch +++ b/target/linux/brcm2708/patches-4.4/0273-drm-vc4-fix-warning-in-validate-printf.patch @@ -1,7 +1,7 @@ -From eeafab86c1440009e0a09819019f0d6b562650a1 Mon Sep 17 00:00:00 2001 +From 015bc9646e2ff3586789757645aeee592819d843 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 18 Jan 2016 09:10:42 +1000 -Subject: [PATCH 273/423] drm/vc4: fix warning in validate printf. +Subject: [PATCH] drm/vc4: fix warning in validate printf. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch b/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch index f7215c746d..c31bfbe0f2 100644 --- a/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch +++ b/target/linux/brcm2708/patches-4.4/0274-drm-vc4-Improve-comments-on-vc4_plane_state-members.patch @@ -1,7 +1,7 @@ -From 91b875c48c7aee103c14418730bc9ceb96aa18ac Mon Sep 17 00:00:00 2001 +From 2fa85567b77dc0a771cdeb37a4e6fb27ec23100d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 28 Dec 2015 14:14:09 -0800 -Subject: [PATCH 274/423] drm/vc4: Improve comments on vc4_plane_state members. +Subject: [PATCH] drm/vc4: Improve comments on vc4_plane_state members. Signed-off-by: Eric Anholt (cherry picked from commit f427fb16cf756548c39256b569cf083f39bcc4e9) diff --git a/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch b/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch index 091a2b7fd5..e37fffc281 100644 --- a/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch +++ b/target/linux/brcm2708/patches-4.4/0275-drm-vc4-Add-missing-__iomem-annotation-to-hw_dlist.patch @@ -1,7 +1,7 @@ -From e0ab0c8c87b39aaf254f3b5625509dce3daeb216 Mon Sep 17 00:00:00 2001 +From 66c0f03718b26cb3bf47c60ef94770fab9728464 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 28 Dec 2015 14:14:57 -0800 -Subject: [PATCH 275/423] drm/vc4: Add missing __iomem annotation to hw_dlist. +Subject: [PATCH] drm/vc4: Add missing __iomem annotation to hw_dlist. This is the pointer to the HVS device's memory where we stored the contents of *dlist. diff --git a/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch b/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch index af7bbe162b..0be0676c4f 100644 --- a/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch +++ b/target/linux/brcm2708/patches-4.4/0276-drm-vc4-Move-the-plane-clipping-scaling-setup-to-a-s.patch @@ -1,8 +1,8 @@ -From fd6dfd0af2ab83d8df5d7b17a52fbf0284e42f2b Mon Sep 17 00:00:00 2001 +From eb708cc358e2f94461f971012c9c477a41b01237 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 28 Dec 2015 14:34:44 -0800 -Subject: [PATCH 276/423] drm/vc4: Move the plane clipping/scaling setup to a - separate function. +Subject: [PATCH] drm/vc4: Move the plane clipping/scaling setup to a separate + function. As we add actual scaling, this is going to get way more complicated. diff --git a/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch b/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch index 891383e78e..0e7274803b 100644 --- a/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch +++ b/target/linux/brcm2708/patches-4.4/0277-drm-vc4-Add-a-proper-short-circut-path-for-legacy-cu.patch @@ -1,8 +1,8 @@ -From 3f24f34e62b4bdcff3a5d46e847b200b5380b5ee Mon Sep 17 00:00:00 2001 +From 81f885f1ab1729bb2d14ca44d4861e0bb982b324 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 30 Dec 2015 11:50:22 -0800 -Subject: [PATCH 277/423] drm/vc4: Add a proper short-circut path for legacy - cursor updates. +Subject: [PATCH] drm/vc4: Add a proper short-circut path for legacy cursor + updates. Previously, on every modeset we would allocate new display list memory, recompute changed planes, write all of them to the new memory, diff --git a/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch b/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch index f235996659..c676273d77 100644 --- a/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch +++ b/target/linux/brcm2708/patches-4.4/0278-drm-vc4-Make-the-CRTCs-cooperate-on-allocating-displ.patch @@ -1,8 +1,8 @@ -From 417b8c7dcc6cad23f255a4307dda97d04f9c9b5b Mon Sep 17 00:00:00 2001 +From 1c86cb2794cdba850675a95de59acf505a3d7654 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 28 Dec 2015 13:25:41 -0800 -Subject: [PATCH 278/423] drm/vc4: Make the CRTCs cooperate on allocating - display lists. +Subject: [PATCH] drm/vc4: Make the CRTCs cooperate on allocating display + lists. So far, we've only ever lit up one CRTC, so this has been fine. To extend to more displays or more planes, we need to make sure we don't diff --git a/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch b/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch index 3deccf57c1..8cfb9ea87a 100644 --- a/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch +++ b/target/linux/brcm2708/patches-4.4/0279-drm-vc4-Add-more-display-planes-to-each-CRTC.patch @@ -1,7 +1,7 @@ -From a4e111deb5b2aaff6cd633135825c40d03b3ac74 Mon Sep 17 00:00:00 2001 +From dfda3a55b70ee0b1227ec4551d6376d463dd14b9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Oct 2015 14:18:56 +0100 -Subject: [PATCH 279/423] drm/vc4: Add more display planes to each CRTC. +Subject: [PATCH] drm/vc4: Add more display planes to each CRTC. Previously we only did the primary and cursor plane, but overlay planes are useful and just require this setup to add, since all planes diff --git a/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch b/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch index 980fed1388..ecfc9da637 100644 --- a/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch +++ b/target/linux/brcm2708/patches-4.4/0280-drm-vc4-Fix-which-value-is-being-used-for-source-ima.patch @@ -1,8 +1,7 @@ -From 265a20f8e1c0e3578aea9dcf9d2ea93ea909b76b Mon Sep 17 00:00:00 2001 +From 4ac20cea599c0f91b3240013ce603e608cab2d6a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 28 Dec 2015 14:45:25 -0800 -Subject: [PATCH 280/423] drm/vc4: Fix which value is being used for source - image size. +Subject: [PATCH] drm/vc4: Fix which value is being used for source image size. This doesn't matter yet since we only allow 1:1 scaling, but the comment clearly says we should be using the source size. diff --git a/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch b/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch index 8fd1294726..e7e5986c9f 100644 --- a/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch +++ b/target/linux/brcm2708/patches-4.4/0281-drm-vc4-Add-support-for-scaling-of-display-planes.patch @@ -1,7 +1,7 @@ -From 8d513c7a67cce0bf0ef312323753eccbd0f3f71a Mon Sep 17 00:00:00 2001 +From 0b7d1c1de27840bd1a32bc0a28c8354e362b38ca Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Oct 2015 16:06:57 +0100 -Subject: [PATCH 281/423] drm/vc4: Add support for scaling of display planes. +Subject: [PATCH] drm/vc4: Add support for scaling of display planes. This implements a simple policy for choosing scaling modes (trapezoidal for decimation, PPF for magnification), and a single PPF diff --git a/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch b/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch index fbc712667e..ed999d2411 100644 --- a/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch +++ b/target/linux/brcm2708/patches-4.4/0282-drm-vc4-Add-support-for-YUV-planes.patch @@ -1,7 +1,7 @@ -From 40707ee2d92a2d229aa6b328c93aec0e3026c2a7 Mon Sep 17 00:00:00 2001 +From 64f2da0496d51f7260e18aeed6e72ed09fec7b00 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 30 Dec 2015 12:25:44 -0800 -Subject: [PATCH 282/423] drm/vc4: Add support for YUV planes. +Subject: [PATCH] drm/vc4: Add support for YUV planes. This supports 420 and 422 subsampling with 2 or 3 planes, tested with modetest. It doesn't set up chroma subsampling position (which it diff --git a/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch b/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch index efbcafa136..f699b30f2c 100644 --- a/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch +++ b/target/linux/brcm2708/patches-4.4/0283-drm-vc4-Fix-spurious-GPU-resets-due-to-BO-reuse.patch @@ -1,7 +1,7 @@ -From afe4e8694c719164db2918fe267658e4971bafaa Mon Sep 17 00:00:00 2001 +From bb79ceb9166d67ad8d658dead2f62bda7668f139 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 8 Feb 2016 11:19:14 -0800 -Subject: [PATCH 283/423] drm/vc4: Fix spurious GPU resets due to BO reuse. +Subject: [PATCH] drm/vc4: Fix spurious GPU resets due to BO reuse. We were tracking the "where are the head pointers pointing" globally, so if another job reused the same BOs and execution was at the same diff --git a/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch b/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch index 0173657958..366ac24c59 100644 --- a/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch +++ b/target/linux/brcm2708/patches-4.4/0284-drm-vc4-Fix-a-framebuffer-reference-leak-on-async-fl.patch @@ -1,8 +1,8 @@ -From 0a26ed79b85b1fd55b88a1c3b5d1b4c3382b03f9 Mon Sep 17 00:00:00 2001 +From 2ee2a1f157f4eb81c2aca3a076fe74c1e587d2f8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Feb 2016 15:06:15 -0800 -Subject: [PATCH 284/423] drm/vc4: Fix a framebuffer reference leak on async - flip interrupt. +Subject: [PATCH] drm/vc4: Fix a framebuffer reference leak on async flip + interrupt. We'd need X to queue up an async pageflip while another is outstanding, and then take a SIGIO. I think X actually avoids sending diff --git a/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch b/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch index a435d654d4..5391264828 100644 --- a/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch +++ b/target/linux/brcm2708/patches-4.4/0285-drm-vc4-Bring-HDMI-up-from-power-off-if-necessary.patch @@ -1,7 +1,7 @@ -From aae3a606556af7e815414df480aa49e1e56d1bc1 Mon Sep 17 00:00:00 2001 +From 17467b182d70d76c27d8e498abb281b28f58f92c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 12 Feb 2016 14:15:14 -0800 -Subject: [PATCH 285/423] drm/vc4: Bring HDMI up from power off if necessary. +Subject: [PATCH] drm/vc4: Bring HDMI up from power off if necessary. If the firmware hadn't brought up HDMI for us, we need to do its power-on reset sequence (reset HD and and clear its STANDBY bits, diff --git a/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch b/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch index a24389964d..eb087dfb6b 100644 --- a/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch +++ b/target/linux/brcm2708/patches-4.4/0286-drm-vc4-Add-another-reg-to-HDMI-debug-dumping.patch @@ -1,7 +1,7 @@ -From 6b4cbec225aa2ab85069aecfae8c328892cc7a3d Mon Sep 17 00:00:00 2001 +From 00d72cb223055ccdac7e9cda524b00a26a63c13e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 12 Feb 2016 15:16:56 -0800 -Subject: [PATCH 286/423] drm/vc4: Add another reg to HDMI debug dumping. +Subject: [PATCH] drm/vc4: Add another reg to HDMI debug dumping. This is also involved in the HDMI setup sequence so it's nice to see it. diff --git a/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch b/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch index ac4b27ded9..4e8a119ded 100644 --- a/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch +++ b/target/linux/brcm2708/patches-4.4/0287-drm-vc4-Fix-the-name-of-the-VSYNCD_EVEN-register.patch @@ -1,7 +1,7 @@ -From 3793554fcc4a8aa0545f109b5e8413c3ba42b823 Mon Sep 17 00:00:00 2001 +From 7c26f1c9cbdcaa0e8e3c6b740273f4722ce5c4ed Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 15 Feb 2016 17:06:02 -0800 -Subject: [PATCH 287/423] drm/vc4: Fix the name of the VSYNCD_EVEN register. +Subject: [PATCH] drm/vc4: Fix the name of the VSYNCD_EVEN register. It's used for delaying vsync in interlaced mode. diff --git a/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch b/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch index 4542ac4b6d..97f1c6ad0c 100644 --- a/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch +++ b/target/linux/brcm2708/patches-4.4/0288-drm-vc4-Fix-setting-of-vertical-timings-in-the-CRTC.patch @@ -1,7 +1,7 @@ -From aaf3c3ab336f0ff54be5b7eb4de5adca3cd2c05a Mon Sep 17 00:00:00 2001 +From 9654afa1c26516e3461cd8575f08b367fe5ff42a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 15 Feb 2016 17:31:41 -0800 -Subject: [PATCH 288/423] drm/vc4: Fix setting of vertical timings in the CRTC. +Subject: [PATCH] drm/vc4: Fix setting of vertical timings in the CRTC. It looks like when I went to add the interlaced bits, I just took the existing PV_VERT* block and indented it, instead of copy and pasting diff --git a/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch b/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch index ebda4542ff..608a467883 100644 --- a/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch +++ b/target/linux/brcm2708/patches-4.4/0289-drm-vc4-Initialize-scaler-DISPBKGND-on-modeset.patch @@ -1,7 +1,7 @@ -From bf75b498fa8699b0b3230c33cc16a0633ff0e65c Mon Sep 17 00:00:00 2001 +From a4d7f252c7aca463cd85dd21f5929e4ba12a2a41 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 16 Feb 2016 10:24:08 -0800 -Subject: [PATCH 289/423] drm/vc4: Initialize scaler DISPBKGND on modeset. +Subject: [PATCH] drm/vc4: Initialize scaler DISPBKGND on modeset. We weren't updating the interlaced bit, so we'd scan out incorrectly if the firmware had brought up the TV encoder and we were switching to diff --git a/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch b/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch index 11f7bd2ffb..e03e761402 100644 --- a/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch +++ b/target/linux/brcm2708/patches-4.4/0290-drm-vc4-improve-throughput-by-pipelining-binning-and.patch @@ -1,7 +1,7 @@ -From 346367864363fa323ee502d9e8fb36b964cbbdb0 Mon Sep 17 00:00:00 2001 +From 1624a40cc0b7760e60b842b15fe46859940a9f48 Mon Sep 17 00:00:00 2001 From: Varad Gautam Date: Wed, 17 Feb 2016 19:08:21 +0530 -Subject: [PATCH 290/423] drm/vc4: improve throughput by pipelining binning and +Subject: [PATCH] drm/vc4: improve throughput by pipelining binning and rendering jobs The hardware provides us with separate threads for binning and diff --git a/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch b/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch index daf76bc5ef..d282d259fc 100644 --- a/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch +++ b/target/linux/brcm2708/patches-4.4/0291-drm-vc4-Let-gpiolib-know-that-we-re-OK-with-sleeping.patch @@ -1,8 +1,8 @@ -From 52a8cd7d35e6c8860c2449e04ae305a3cdc671f1 Mon Sep 17 00:00:00 2001 +From 92bceb9faef5ef033e79b746aa8d5fd465548fbc Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 29 Feb 2016 17:53:00 -0800 -Subject: [PATCH 291/423] drm/vc4: Let gpiolib know that we're OK with sleeping - for HPD. +Subject: [PATCH] drm/vc4: Let gpiolib know that we're OK with sleeping for + HPD. Fixes an error thrown every few seconds when we poll HPD when it's on a I2C to GPIO expander. diff --git a/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch b/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch index cb5311062b..e6f8e9b06f 100644 --- a/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch +++ b/target/linux/brcm2708/patches-4.4/0292-drm-vc4-Respect-GPIO_ACTIVE_LOW-on-HDMI-HPD-if-set-i.patch @@ -1,8 +1,8 @@ -From dd556129599f962e6da90bcd1150d8604979ceee Mon Sep 17 00:00:00 2001 +From ce00fb0111a4b7c47dc301d7d4845736ee9bb493 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 29 Feb 2016 17:53:01 -0800 -Subject: [PATCH 292/423] drm/vc4: Respect GPIO_ACTIVE_LOW on HDMI HPD if set - in the devicetree. +Subject: [PATCH] drm/vc4: Respect GPIO_ACTIVE_LOW on HDMI HPD if set in the + devicetree. The original Raspberry Pi had the GPIO active high, but the later models are active low. The DT GPIO bindings allow specifying the diff --git a/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch b/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch index 082dec57a7..202425f57a 100644 --- a/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch +++ b/target/linux/brcm2708/patches-4.4/0293-drm-vc4-Return-EFAULT-on-copy_from_user-failure.patch @@ -1,7 +1,7 @@ -From deb04405c9c7362840387414fcf33f01d056c697 Mon Sep 17 00:00:00 2001 +From b73a3233de4b17d80cfb100dcda2216cb3fcf8c6 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 8 Mar 2016 15:09:41 +0300 -Subject: [PATCH 293/423] drm/vc4: Return -EFAULT on copy_from_user() failure +Subject: [PATCH] drm/vc4: Return -EFAULT on copy_from_user() failure The copy_from_user() function returns the number of bytes not copied but we want to return a negative error code. diff --git a/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch b/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch index 14cc70261b..c7fe18cf2a 100644 --- a/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch +++ b/target/linux/brcm2708/patches-4.4/0294-drm-vc4-Recognize-a-more-specific-compatible-string-.patch @@ -1,8 +1,7 @@ -From 16410f120e31739e61b0a89f91539cd551e088cc Mon Sep 17 00:00:00 2001 +From 4e30b1819e50588d5a3720ad1ac42cfbcb913101 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 4 Mar 2016 12:32:07 -0800 -Subject: [PATCH 294/423] drm/vc4: Recognize a more specific compatible string - for V3D. +Subject: [PATCH] drm/vc4: Recognize a more specific compatible string for V3D. The Raspberry Pi Foundation's firmware updates are shipping device trees using the old string, so we'll keep recognizing that as this rev diff --git a/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch b/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch index a6afa301e5..4661e4a703 100644 --- a/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch +++ b/target/linux/brcm2708/patches-4.4/0295-ARM-bcm2708-Move-the-CMA-range-down-for-kernel-4.4.patch @@ -1,7 +1,7 @@ -From 08b78882a19227210b133f5fd66c923c4dec2d5d Mon Sep 17 00:00:00 2001 +From 6cdbac4755ed4e63299ea24635597e1d1188e8c8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Apr 2016 17:21:06 -0700 -Subject: [PATCH 295/423] ARM: bcm2708: Move the CMA range down for kernel 4.4. +Subject: [PATCH] ARM: bcm2708: Move the CMA range down for kernel 4.4. The previous area no longer works, for reasons I haven't investigated. Just move it somewhere that works. diff --git a/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch b/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch index 11a5abad12..376d992748 100644 --- a/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch +++ b/target/linux/brcm2708/patches-4.4/0296-clk-bcm2835-fix-check-of-error-code-returned-by-devm.patch @@ -1,7 +1,7 @@ -From 962b219e1cbec5b7fc6a3b5c9e03077ca759695d Mon Sep 17 00:00:00 2001 +From e16d40b0eafe97952af1005d8b1ab97ce4440066 Mon Sep 17 00:00:00 2001 From: Vladimir Zapolskiy Date: Sun, 6 Mar 2016 03:21:35 +0200 -Subject: [PATCH 296/423] clk: bcm2835: fix check of error code returned by +Subject: [PATCH] clk: bcm2835: fix check of error code returned by devm_ioremap_resource() The change fixes potential oops while accessing iomem on invalid diff --git a/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch b/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch index 8075b63a88..6dd4180b00 100644 --- a/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch +++ b/target/linux/brcm2708/patches-4.4/0297-vchiq_arm-Add-completion-records-under-the-mutex.patch @@ -1,7 +1,7 @@ -From 3ea5efb1f91da877b375eccb94e1cd4517fd8638 Mon Sep 17 00:00:00 2001 +From d4bbd21245e600f32074724152f77a4ae9904047 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 13:49:32 +0100 -Subject: [PATCH 297/423] vchiq_arm: Add completion records under the mutex +Subject: [PATCH] vchiq_arm: Add completion records under the mutex An issue was observed when flushing openmax components which generate a large number of messages returning diff --git a/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch b/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch index 4dd489c631..1b0aff70e0 100644 --- a/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch +++ b/target/linux/brcm2708/patches-4.4/0298-config-Add-DRM_UDL-module.patch @@ -1,7 +1,7 @@ -From 51453a026306a2b1c7ccad6bcc9ab95a24d49bc3 Mon Sep 17 00:00:00 2001 +From 03fb94e9e8e68ba9809bdd0f966346ea2807d1dd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 16:07:15 +0100 -Subject: [PATCH 298/423] config: Add DRM_UDL module +Subject: [PATCH] config: Add DRM_UDL module See: https://github.com/raspberrypi/linux/issues/1422 diff --git a/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch b/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch index d4b4492d6b..1048b2ae31 100644 --- a/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch +++ b/target/linux/brcm2708/patches-4.4/0299-bcm2835-i2s-Reduce-the-TX-DREQ-threshold.patch @@ -1,7 +1,7 @@ -From c2dd47a309d6eee486191ef7805ba3f544ff3dae Mon Sep 17 00:00:00 2001 +From a7f989cdcb11a8ff5bbb51a675e3662872b5dd55 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 15:44:14 +0100 -Subject: [PATCH 299/423] bcm2835-i2s: Reduce the TX DREQ threshold +Subject: [PATCH] bcm2835-i2s: Reduce the TX DREQ threshold TX FIFO overrun is thought to be the cause of channel swapping, so reducing the DREQ threshold seems reasonable and appears to be diff --git a/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch b/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch index f980400a37..9c3bdeae1a 100644 --- a/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch +++ b/target/linux/brcm2708/patches-4.4/0300-V4L2-Request-maximum-resolution-from-GPU.patch @@ -1,7 +1,7 @@ -From 99f198703d9ba6c286ca936850a12e6ca3f6b78b Mon Sep 17 00:00:00 2001 +From 4bf5d7236db0e122eb20cf73699557122f49c9dc Mon Sep 17 00:00:00 2001 From: Dave Stevenson <6by9@users.noreply.github.com> Date: Sat, 16 Apr 2016 23:09:54 +0100 -Subject: [PATCH 300/423] V4L2: Request maximum resolution from GPU +Subject: [PATCH] V4L2: Request maximum resolution from GPU Get resolution information about the sensors from the GPU and advertise it correctly. diff --git a/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch b/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch index 6ec13c9a84..132ee07ca9 100644 --- a/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch +++ b/target/linux/brcm2708/patches-4.4/0301-ARM-bcm2835-add-i2s-gpio28-31-for-cm.patch @@ -1,7 +1,7 @@ -From 19244064105686007a875c423970e3113da4e73c Mon Sep 17 00:00:00 2001 +From c865e89f79eca5a324d541a03aa4725bc0614f64 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Sat, 23 Apr 2016 15:21:41 +0000 -Subject: [PATCH 301/423] ARM: bcm2835: add i2s-gpio28-31 for cm +Subject: [PATCH] ARM: bcm2835: add i2s-gpio28-31 for cm Add i2s-gpio28-31 overlay for compute module so that i2s is using gpio28-31 diff --git a/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch b/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch index 5f04f2ff16..34f0e8053d 100644 --- a/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch +++ b/target/linux/brcm2708/patches-4.4/0302-drm-vc4-Add-DT-parameters-to-control-CMA-usage.patch @@ -1,7 +1,7 @@ -From 5f632f8aba2da50bba83537926a1d3a466ca2a51 Mon Sep 17 00:00:00 2001 +From 4f7d976e703d5196ade9d27074ce4bb49c11bb52 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 24 Apr 2016 17:28:15 +0100 -Subject: [PATCH 302/423] drm/vc4: Add DT parameters to control CMA usage +Subject: [PATCH] drm/vc4: Add DT parameters to control CMA usage Example: dtoverlay=vc4-kms-v3d,cma-128 diff --git a/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch b/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch index 9c0916908f..866983f0be 100644 --- a/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch +++ b/target/linux/brcm2708/patches-4.4/0303-SQUASH-BCM270X_DT-Add-make-rule-for-sdio-1bit.patch @@ -1,7 +1,7 @@ -From 2745d40fb64e1663fba690f69ea0a87a171a43f6 Mon Sep 17 00:00:00 2001 +From 314c504fe66cf918a847fd0ab5a4c9f82def6e06 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 25 Apr 2016 10:43:36 +0100 -Subject: [PATCH 303/423] SQUASH: BCM270X_DT: Add make rule for sdio-1bit +Subject: [PATCH] SQUASH: BCM270X_DT: Add make rule for sdio-1bit See: https://github.com/raspberrypi/linux/pull/1301 diff --git a/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch b/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch index 2c3706f4c4..e6f53cdd6b 100644 --- a/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch +++ b/target/linux/brcm2708/patches-4.4/0304-dts-add-overlay-for-pitft22.patch @@ -1,7 +1,7 @@ -From 2e099f313b5fa1f2eb508da3b7322dea3c27053d Mon Sep 17 00:00:00 2001 +From d2ecf44fbe03bd988a608473d5b515d21fab8950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= Date: Fri, 8 Jan 2016 09:02:44 +0100 -Subject: [PATCH 304/423] dts: add overlay for pitft22 +Subject: [PATCH] dts: add overlay for pitft22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch b/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch index 3b348506a0..db5ecb2722 100644 --- a/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch +++ b/target/linux/brcm2708/patches-4.4/0305-BCM270X_DT-Sound-DT-adjustments-for-Dynamic-DT.patch @@ -1,7 +1,7 @@ -From ef21e99d52371ca26385dce327687880143316a1 Mon Sep 17 00:00:00 2001 +From 5bab2e037ad60c491b7a48171b33fb1413e91352 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 26 Apr 2016 10:44:59 +0100 -Subject: [PATCH 305/423] BCM270X_DT: Sound DT adjustments for Dynamic DT +Subject: [PATCH] BCM270X_DT: Sound DT adjustments for Dynamic DT There are a number of issues when loading and unloading overlays for sound cards: diff --git a/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch b/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch index 8cbc0c8d86..e32f9f37b4 100644 --- a/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0306-BCM270X_DT-Fix-codec-use-in-hifiberry-dac-overlay.patch @@ -1,7 +1,7 @@ -From 27105cf8f4de0124cfdeb3413d5475aff3c8f00f Mon Sep 17 00:00:00 2001 +From 5f01fff2c8d665404e11aff29278d63f6250af61 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 Apr 2016 12:01:41 +0100 -Subject: [PATCH 306/423] BCM270X_DT: Fix codec use in hifiberry-dac overlay +Subject: [PATCH] BCM270X_DT: Fix codec use in hifiberry-dac overlay Signed-off-by: Phil Elwell --- diff --git a/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch b/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch index aafca79c0f..d04a1eb446 100644 --- a/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch +++ b/target/linux/brcm2708/patches-4.4/0309-Revert-bcm2835-log-which-channel-map-is-set.patch @@ -1,7 +1,7 @@ -From ad45da06f725ba7f1280c69e0476919d87f8030c Mon Sep 17 00:00:00 2001 +From 593366c81d96fb54152093ab5ca3d62607440cf8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:27:33 +0100 -Subject: [PATCH 309/423] Revert "bcm2835: log which channel map is set" +Subject: [PATCH] Revert "bcm2835: log which channel map is set" This reverts commit cd560b8658868d9652ab31754e02f86daf6831ba. --- diff --git a/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch b/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch index 9f8d7d9603..56497d139a 100644 --- a/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch +++ b/target/linux/brcm2708/patches-4.4/0310-Revert-bcm2835-add-fallback-channel-layouts-if-chann.patch @@ -1,8 +1,8 @@ -From f8473a921ad7208ca5b4218571f3ffd267b18cff Mon Sep 17 00:00:00 2001 +From ed9e011f0f6a823a2e278ce7dd9e8bb620b08e56 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:27:35 +0100 -Subject: [PATCH 310/423] Revert "bcm2835: add fallback channel layouts if - channel map API is not used" +Subject: [PATCH] Revert "bcm2835: add fallback channel layouts if channel map + API is not used" This reverts commit ceacfff9f86f89826dbc8a6df667f485894327d1. --- diff --git a/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch b/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch index 152ab91980..83b675d680 100644 --- a/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch +++ b/target/linux/brcm2708/patches-4.4/0311-Revert-bcm2835-do-not-require-substream-for-accessin.patch @@ -1,8 +1,8 @@ -From 75045e771ab867b6cd397b1d1280e81584ddc401 Mon Sep 17 00:00:00 2001 +From e26366439123ef9f20f7728942f35937035c9c73 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:27:36 +0100 -Subject: [PATCH 311/423] Revert "bcm2835: do not require substream for - accessing chmap ctl" +Subject: [PATCH] Revert "bcm2835: do not require substream for accessing chmap + ctl" This reverts commit a05b4815196018c329ea98c24205bc6fa9c097e0. --- diff --git a/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch b/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch index a972170c19..0b50d279b0 100644 --- a/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch +++ b/target/linux/brcm2708/patches-4.4/0312-Revert-bcm2835-interpolate-audio-delay.patch @@ -1,7 +1,7 @@ -From 65978c7586dc8fe403a3a3bebf40de881b8d2741 Mon Sep 17 00:00:00 2001 +From 30abbf1d6db5eb081c9693958b098d86758aa7f4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:27:37 +0100 -Subject: [PATCH 312/423] Revert "bcm2835: interpolate audio delay" +Subject: [PATCH] Revert "bcm2835: interpolate audio delay" This reverts commit 83eca613d0eddd2c8299f114b8fe573ccaffdefc. --- diff --git a/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch b/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch index ce48ff162a..c601196725 100644 --- a/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch +++ b/target/linux/brcm2708/patches-4.4/0313-Revert-bcm2835-only-allow-stereo-if-analogue-jack-is.patch @@ -1,8 +1,8 @@ -From 71c5f4311cf466ec59d058102c21b12c93d46a64 Mon Sep 17 00:00:00 2001 +From ad3d718e72cdc2c01c22578831603ea1981f9906 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:28:06 +0100 -Subject: [PATCH 313/423] Revert "bcm2835: only allow stereo if analogue jack - is selected" +Subject: [PATCH] Revert "bcm2835: only allow stereo if analogue jack is + selected" This reverts commit 5f7049894f47b3836838cd68e29ee883179c80b3. --- diff --git a/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch b/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch index 4d8e508ee0..e1efbf78d1 100644 --- a/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch +++ b/target/linux/brcm2708/patches-4.4/0314-Revert-bcm2835-always-use-2-4-8-channels-for-multich.patch @@ -1,8 +1,8 @@ -From 36b6b25b8fe95dc3d4c9b0ded58827b5660e1a87 Mon Sep 17 00:00:00 2001 +From 506c92b9847bb1fb0ef2fab567b74da572c2ad97 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:28:08 +0100 -Subject: [PATCH 314/423] Revert "bcm2835: always use 2/4/8 channels for - multichannel layouts" +Subject: [PATCH] Revert "bcm2835: always use 2/4/8 channels for multichannel + layouts" This reverts commit 06931f74092d86087144f070b06a4444df8b444b. --- diff --git a/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch b/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch index d6c5b6ca3b..d5d70b350d 100644 --- a/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch +++ b/target/linux/brcm2708/patches-4.4/0315-Revert-bcm2835-implement-channel-map-API.patch @@ -1,7 +1,7 @@ -From f830d4081e228776a7236be435921016b3ae1347 Mon Sep 17 00:00:00 2001 +From 1e3a2bebcbd26fdf1b0d13d2219186163708ae4c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:29:03 +0100 -Subject: [PATCH 315/423] Revert "bcm2835: implement channel map API" +Subject: [PATCH] Revert "bcm2835: implement channel map API" This reverts commit 5efba3f8c180c39609a8d40033ef92046ef0de75. --- diff --git a/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch b/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch index cb549a0a47..c128686e2d 100644 --- a/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch +++ b/target/linux/brcm2708/patches-4.4/0316-Revert-bcm2835-extend-allowed-range-of-channels-and-.patch @@ -1,7 +1,7 @@ -From c46ed63ab5c1c24f3732aa410e9b9661d4c18ce7 Mon Sep 17 00:00:00 2001 +From cb54a471f7066a763b9da5d33d6613fe15d2aa3d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 29 Apr 2016 17:30:00 +0100 -Subject: [PATCH 316/423] Revert "bcm2835: extend allowed range of channels and +Subject: [PATCH] Revert "bcm2835: extend allowed range of channels and samplerates" This reverts commit 688a5f0daa45e0a51b324707768d472e1d715c13. diff --git a/target/linux/brcm2708/patches-4.4/0317-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch b/target/linux/brcm2708/patches-4.4/0317-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch new file mode 100644 index 0000000000..685cd79704 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0317-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch @@ -0,0 +1,40 @@ +From 550960c37d5de04808943e9ae6cecb16ad003070 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 6 May 2016 12:32:47 +0100 +Subject: [PATCH] pinctrl-bcm2835: Return pins to inputs when freed + +When dynamically unloading overlays, it is important that freed pins are +restored to being inputs to prevent functions from being enabled in +multiple places at once. + +Signed-off-by: Phil Elwell +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -831,6 +831,15 @@ static const struct pinctrl_ops bcm2835_ + .dt_free_map = bcm2835_pctl_dt_free_map, + }; + ++static void bcm2835_pmx_free(struct pinctrl_dev *pctldev, ++ unsigned offset) ++{ ++ struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); ++ ++ /* disable by setting to GPIO_IN */ ++ bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_IN); ++} ++ + static int bcm2835_pmx_get_functions_count(struct pinctrl_dev *pctldev) + { + return BCM2835_FSEL_COUNT; +@@ -890,6 +899,7 @@ static int bcm2835_pmx_gpio_set_directio + } + + static const struct pinmux_ops bcm2835_pmx_ops = { ++ .free = bcm2835_pmx_free, + .get_functions_count = bcm2835_pmx_get_functions_count, + .get_function_name = bcm2835_pmx_get_function_name, + .get_function_groups = bcm2835_pmx_get_function_groups, diff --git a/target/linux/brcm2708/patches-4.4/0318-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch b/target/linux/brcm2708/patches-4.4/0318-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch new file mode 100644 index 0000000000..fdebd34cab --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0318-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch @@ -0,0 +1,99 @@ +From 9b6cc71b7159bebe78cd1ee823a479c0ca485c82 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 6 May 2016 12:53:16 +0100 +Subject: [PATCH] BCM270X_DT: i2c0-bcm2708 - pin group params + +Add parameters to set pin groups as a unit, setting the pin function +appropriately. The parameters are: + pins_0_1 + pins_28_29 + pins_44_45 + pins_46_47 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 11 ++++-- + .../arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 43 +++++++++++++++++----- + 2 files changed, 42 insertions(+), 12 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -449,10 +449,15 @@ Params: ds1307 Select t + + + Name: i2c0-bcm2708 +-Info: Enable the i2c_bcm2708 driver for the i2c0 bus ++Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations ++ are usable on all platforms. + Load: dtoverlay=i2c0-bcm2708,= +-Params: sda0_pin GPIO pin for SDA0 (0, 28 [or 44] - default 0) +- scl0_pin GPIO pin for SCL0 (1, 29 [or 45] - default 1) ++Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*) ++ scl0_pin GPIO pin for SCL0 (deprecated - use pins_*) ++ pins_0_1 Use pins 0 and 1 (default) ++ pins_28_29 Use pins 28 and 29 ++ pins_44_45 Use pins 44 and 45 ++ pins_46_47 Use pins 46 and 47 + + + Name: i2c1-bcm2708 +--- a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts +@@ -14,23 +14,48 @@ + fragment@0 { + target = <&i2c0>; + __overlay__ { +- pinctrl-0 = <&i2c0_pins>; + status = "okay"; + }; + }; + + fragment@1 { +- target = <&gpio>; +- __overlay__ { +- i2c0_pins: i2c0 { +- brcm,pins = <0 1>; +- brcm,function = <4>; /* alt0 */ +- }; ++ target = <&i2c0_pins>; ++ frag1: __overlay__ { ++ brcm,pins = <0 1>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c0_pins>; ++ __dormant__ { ++ brcm,pins = <28 29>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c0_pins>; ++ __dormant__ { ++ brcm,pins = <44 45>; ++ brcm,function = <5>; /* alt1 */ ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c0_pins>; ++ __dormant__ { ++ brcm,pins = <46 47>; ++ brcm,function = <4>; /* alt0 */ + }; + }; + + __overrides__ { +- sda0_pin = <&i2c0_pins>,"brcm,pins:0"; +- scl0_pin = <&i2c0_pins>,"brcm,pins:4"; ++ sda0_pin = <&frag1>,"brcm,pins:0"; ++ scl0_pin = <&frag1>,"brcm,pins:4"; ++ pins_0_1 = <0>,"+1-2-3-4"; ++ pins_28_29 = <0>,"-1+2-3-4"; ++ pins_44_45 = <0>,"-1-2+3-4"; ++ pins_46_47 = <0>,"-1-2-3+4"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0318-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch b/target/linux/brcm2708/patches-4.4/0318-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch deleted file mode 100644 index 89bc34ae45..0000000000 --- a/target/linux/brcm2708/patches-4.4/0318-pinctrl-bcm2835-Return-pins-to-inputs-when-freed.patch +++ /dev/null @@ -1,40 +0,0 @@ -From a336b35810263be890a30356837c75dc54b2e3be Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 6 May 2016 12:32:47 +0100 -Subject: [PATCH 318/423] pinctrl-bcm2835: Return pins to inputs when freed - -When dynamically unloading overlays, it is important that freed pins are -restored to being inputs to prevent functions from being enabled in -multiple places at once. - -Signed-off-by: Phil Elwell ---- - drivers/pinctrl/bcm/pinctrl-bcm2835.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - ---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c -+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -831,6 +831,15 @@ static const struct pinctrl_ops bcm2835_ - .dt_free_map = bcm2835_pctl_dt_free_map, - }; - -+static void bcm2835_pmx_free(struct pinctrl_dev *pctldev, -+ unsigned offset) -+{ -+ struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); -+ -+ /* disable by setting to GPIO_IN */ -+ bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_IN); -+} -+ - static int bcm2835_pmx_get_functions_count(struct pinctrl_dev *pctldev) - { - return BCM2835_FSEL_COUNT; -@@ -890,6 +899,7 @@ static int bcm2835_pmx_gpio_set_directio - } - - static const struct pinmux_ops bcm2835_pmx_ops = { -+ .free = bcm2835_pmx_free, - .get_functions_count = bcm2835_pmx_get_functions_count, - .get_function_name = bcm2835_pmx_get_function_name, - .get_function_groups = bcm2835_pmx_get_function_groups, diff --git a/target/linux/brcm2708/patches-4.4/0319-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch b/target/linux/brcm2708/patches-4.4/0319-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch deleted file mode 100644 index 04f2e11611..0000000000 --- a/target/linux/brcm2708/patches-4.4/0319-BCM270X_DT-i2c0-bcm2708-pin-group-params.patch +++ /dev/null @@ -1,99 +0,0 @@ -From e239ab77f367aff3bcb1d2ed807c438cf0f2ffe8 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 6 May 2016 12:53:16 +0100 -Subject: [PATCH 319/423] BCM270X_DT: i2c0-bcm2708 - pin group params - -Add parameters to set pin groups as a unit, setting the pin function -appropriately. The parameters are: - pins_0_1 - pins_28_29 - pins_44_45 - pins_46_47 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 11 ++++-- - .../arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 43 +++++++++++++++++----- - 2 files changed, 42 insertions(+), 12 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -449,10 +449,15 @@ Params: ds1307 Select t - - - Name: i2c0-bcm2708 --Info: Enable the i2c_bcm2708 driver for the i2c0 bus -+Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations -+ are usable on all platforms. - Load: dtoverlay=i2c0-bcm2708,= --Params: sda0_pin GPIO pin for SDA0 (0, 28 [or 44] - default 0) -- scl0_pin GPIO pin for SCL0 (1, 29 [or 45] - default 1) -+Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*) -+ scl0_pin GPIO pin for SCL0 (deprecated - use pins_*) -+ pins_0_1 Use pins 0 and 1 (default) -+ pins_28_29 Use pins 28 and 29 -+ pins_44_45 Use pins 44 and 45 -+ pins_46_47 Use pins 46 and 47 - - - Name: i2c1-bcm2708 ---- a/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts -@@ -14,23 +14,48 @@ - fragment@0 { - target = <&i2c0>; - __overlay__ { -- pinctrl-0 = <&i2c0_pins>; - status = "okay"; - }; - }; - - fragment@1 { -- target = <&gpio>; -- __overlay__ { -- i2c0_pins: i2c0 { -- brcm,pins = <0 1>; -- brcm,function = <4>; /* alt0 */ -- }; -+ target = <&i2c0_pins>; -+ frag1: __overlay__ { -+ brcm,pins = <0 1>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c0_pins>; -+ __dormant__ { -+ brcm,pins = <28 29>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&i2c0_pins>; -+ __dormant__ { -+ brcm,pins = <44 45>; -+ brcm,function = <5>; /* alt1 */ -+ }; -+ }; -+ -+ fragment@4 { -+ target = <&i2c0_pins>; -+ __dormant__ { -+ brcm,pins = <46 47>; -+ brcm,function = <4>; /* alt0 */ - }; - }; - - __overrides__ { -- sda0_pin = <&i2c0_pins>,"brcm,pins:0"; -- scl0_pin = <&i2c0_pins>,"brcm,pins:4"; -+ sda0_pin = <&frag1>,"brcm,pins:0"; -+ scl0_pin = <&frag1>,"brcm,pins:4"; -+ pins_0_1 = <0>,"+1-2-3-4"; -+ pins_28_29 = <0>,"-1+2-3-4"; -+ pins_44_45 = <0>,"-1-2+3-4"; -+ pins_46_47 = <0>,"-1-2-3+4"; - }; - }; diff --git a/target/linux/brcm2708/patches-4.4/0319-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0319-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch new file mode 100644 index 0000000000..13ee212028 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0319-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch @@ -0,0 +1,30 @@ +From 708cc4c531fdf3b6061589031cd15b9382e042b8 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 6 May 2016 12:40:37 +0100 +Subject: [PATCH] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -815,6 +815,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m ++CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -807,6 +807,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m ++CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y diff --git a/target/linux/brcm2708/patches-4.4/0320-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch b/target/linux/brcm2708/patches-4.4/0320-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch new file mode 100644 index 0000000000..a2e5b6e250 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0320-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch @@ -0,0 +1,63 @@ +From 61a0378d024e96bfe068fac75a4ed401eef46676 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 6 May 2016 17:18:57 +0100 +Subject: [PATCH] Revert "rpi: update vc_vchi_audioserv_defs.h" + +This reverts commit 64fa9f963dffab0145f7960a593422064bb0aa8d. +--- + sound/arm/vc_vchi_audioserv_defs.h | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +--- a/sound/arm/vc_vchi_audioserv_defs.h ++++ b/sound/arm/vc_vchi_audioserv_defs.h +@@ -16,7 +16,7 @@ + #define _VC_AUDIO_DEFS_H_ + + #define VC_AUDIOSERV_MIN_VER 1 +-#define VC_AUDIOSERV_VER 3 ++#define VC_AUDIOSERV_VER 2 + + // FourCC code used for VCHI connection + #define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS") +@@ -36,7 +36,6 @@ typedef enum { + VC_AUDIO_MSG_TYPE_START, // Configure audio + VC_AUDIO_MSG_TYPE_STOP, // Configure audio + VC_AUDIO_MSG_TYPE_WRITE, // Configure audio +- VC_AUDIO_MSG_TYPE_LATENCY, // request latency in cycles + VC_AUDIO_MSG_TYPE_MAX + } VC_AUDIO_MSG_TYPE; + +@@ -45,7 +44,6 @@ typedef struct { + uint32_t channels; + uint32_t samplerate; + uint32_t bps; +- uint32_t channelmap; + + } VC_AUDIO_CONFIG_T; + +@@ -86,12 +84,6 @@ typedef struct { + uint16_t max_packet; + } VC_AUDIO_WRITE_T; + +-// query latency in samples of sink +-typedef struct +-{ +- uint32_t dummy; +-} VC_AUDIO_LATENCY_T; +- + // Generic result for a request (VC->HOST) + typedef struct { + int32_t success; // Success value +@@ -116,10 +108,9 @@ typedef struct { + VC_AUDIO_START_T start; + VC_AUDIO_STOP_T stop; + VC_AUDIO_WRITE_T write; +- VC_AUDIO_LATENCY_T latency; + VC_AUDIO_RESULT_T result; + VC_AUDIO_COMPLETE_T complete; + } u; + } VC_AUDIO_MSG_T; + +-#endif // _VC_AUDIO_DEFS_H_ +\ No newline at end of file ++#endif // _VC_AUDIO_DEFS_H_ diff --git a/target/linux/brcm2708/patches-4.4/0320-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0320-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch deleted file mode 100644 index 82df548536..0000000000 --- a/target/linux/brcm2708/patches-4.4/0320-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch +++ /dev/null @@ -1,30 +0,0 @@ -From e43e0bc1fe4a0a1c9e02b7a66dc9481e54c6f8cd Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 6 May 2016 12:40:37 +0100 -Subject: [PATCH 320/423] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE - ---- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) - ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -815,6 +815,7 @@ CONFIG_VIDEO_TW9906=m - CONFIG_VIDEO_OV7640=m - CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m -+CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m - CONFIG_DRM_VC4=m - CONFIG_FB=y ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -807,6 +807,7 @@ CONFIG_VIDEO_TW9906=m - CONFIG_VIDEO_OV7640=m - CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m -+CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m - CONFIG_DRM_VC4=m - CONFIG_FB=y diff --git a/target/linux/brcm2708/patches-4.4/0321-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0321-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch new file mode 100644 index 0000000000..bcfe02ba14 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0321-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch @@ -0,0 +1,31 @@ +From d796713d0e6da4b9fdfd88350f0321d8f63ccf91 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 6 May 2016 17:21:58 +0100 +Subject: [PATCH] Revert "config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE" + +This reverts commit 417aed4cb35a479e001c8389fd8d97c3ea612999. +--- + arch/arm/configs/bcm2709_defconfig | 1 - + arch/arm/configs/bcmrpi_defconfig | 1 - + 2 files changed, 2 deletions(-) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -815,7 +815,6 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m +-CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -807,7 +807,6 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m +-CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y diff --git a/target/linux/brcm2708/patches-4.4/0321-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch b/target/linux/brcm2708/patches-4.4/0321-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch deleted file mode 100644 index 0820c8a7f8..0000000000 --- a/target/linux/brcm2708/patches-4.4/0321-Revert-rpi-update-vc_vchi_audioserv_defs.h.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 07abcf3c2c3ae76a2be75e4fcc85ecd49d727a8a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 6 May 2016 17:18:57 +0100 -Subject: [PATCH 321/423] Revert "rpi: update vc_vchi_audioserv_defs.h" - -This reverts commit 64fa9f963dffab0145f7960a593422064bb0aa8d. ---- - sound/arm/vc_vchi_audioserv_defs.h | 13 ++----------- - 1 file changed, 2 insertions(+), 11 deletions(-) - ---- a/sound/arm/vc_vchi_audioserv_defs.h -+++ b/sound/arm/vc_vchi_audioserv_defs.h -@@ -16,7 +16,7 @@ - #define _VC_AUDIO_DEFS_H_ - - #define VC_AUDIOSERV_MIN_VER 1 --#define VC_AUDIOSERV_VER 3 -+#define VC_AUDIOSERV_VER 2 - - // FourCC code used for VCHI connection - #define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS") -@@ -36,7 +36,6 @@ typedef enum { - VC_AUDIO_MSG_TYPE_START, // Configure audio - VC_AUDIO_MSG_TYPE_STOP, // Configure audio - VC_AUDIO_MSG_TYPE_WRITE, // Configure audio -- VC_AUDIO_MSG_TYPE_LATENCY, // request latency in cycles - VC_AUDIO_MSG_TYPE_MAX - } VC_AUDIO_MSG_TYPE; - -@@ -45,7 +44,6 @@ typedef struct { - uint32_t channels; - uint32_t samplerate; - uint32_t bps; -- uint32_t channelmap; - - } VC_AUDIO_CONFIG_T; - -@@ -86,12 +84,6 @@ typedef struct { - uint16_t max_packet; - } VC_AUDIO_WRITE_T; - --// query latency in samples of sink --typedef struct --{ -- uint32_t dummy; --} VC_AUDIO_LATENCY_T; -- - // Generic result for a request (VC->HOST) - typedef struct { - int32_t success; // Success value -@@ -116,10 +108,9 @@ typedef struct { - VC_AUDIO_START_T start; - VC_AUDIO_STOP_T stop; - VC_AUDIO_WRITE_T write; -- VC_AUDIO_LATENCY_T latency; - VC_AUDIO_RESULT_T result; - VC_AUDIO_COMPLETE_T complete; - } u; - } VC_AUDIO_MSG_T; - --#endif // _VC_AUDIO_DEFS_H_ -\ No newline at end of file -+#endif // _VC_AUDIO_DEFS_H_ diff --git a/target/linux/brcm2708/patches-4.4/0322-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch b/target/linux/brcm2708/patches-4.4/0322-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch new file mode 100644 index 0000000000..e6ba86610d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0322-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch @@ -0,0 +1,285 @@ +From e6728a3fb4b185e632a63b7d0d61838d8d690548 Mon Sep 17 00:00:00 2001 +From: Andrey Grodzovsky +Date: Tue, 3 May 2016 22:10:59 -0400 +Subject: [PATCH] ARM: adau1977-adc: Add basic machine driver for adau1977 + codec driver. + +This commit adds basic support for the codec usage including: Device tree overlay, +binding I2S bus and setting I2S mode, clock source and frequency setting according +to spec. + +Signed-off-by: Andrey Grodzovsky +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 7 ++ + .../arm/boot/dts/overlays/adau1977-adc-overlay.dts | 53 +++++++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 7 ++ + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/adau1977-adc.c | 125 +++++++++++++++++++++ + 8 files changed, 197 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/adau1977-adc-overlay.dts + create mode 100644 sound/soc/bcm/adau1977-adc.c + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -12,6 +12,7 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) + RPI_DT_OVERLAYS=y + endif + ++dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc.dtbo + dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo + dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo + dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -161,6 +161,13 @@ Params: + and the other i2c baudrate parameters. + + ++Name: adau1977-adc ++Info: Overlay for activation of ADAU1977 ADC codec over I2C for control ++ and I2S for data. ++Load: dtoverlay=adau1977-adc ++Params: ++ ++ + Name: ads7846 + Info: ADS7846 Touch controller + Load: dtoverlay=ads7846,= +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/adau1977-adc-overlay.dts +@@ -0,0 +1,53 @@ ++// Definitions for ADAU1977 ADC ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&soc>; ++ ++ __overlay__ { ++ codec_supply: fixedregulator@0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "AVDD"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c>; ++ ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ adau1977: codec@11 { ++ compatible = "adi,adau1977"; ++ reg = <0x11>; ++ reset-gpios = <&gpio 5 0>; ++ AVDD-supply = <&codec_supply>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "adi,adau1977-adc"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -861,6 +861,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m + CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m ++CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -853,6 +853,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m + CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m ++CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -78,3 +78,10 @@ config SND_BCM2708_SOC_RASPIDAC3 + select SND_SOC_TPA6130A2 + help + Say Y or M if you want to add support for RaspiDAC Rev.3x. ++ ++config SND_BCM2708_SOC_ADAU1977_ADC ++ tristate "Support for ADAU1977 ADC" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_ADAU1977_I2C ++ help ++ Say Y or M if you want to add support for ADAU1977 ADC. +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -4,6 +4,7 @@ snd-soc-bcm2835-i2s-objs := bcm2835-i2s. + obj-$(CONFIG_SND_BCM2835_SOC_I2S) += snd-soc-bcm2835-i2s.o + + # BCM2708 Machine Support ++snd-soc-adau1977-adc-objs := adau1977-adc.o + snd-soc-hifiberry-dac-objs := hifiberry_dac.o + snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o + snd-soc-hifiberry-digi-objs := hifiberry_digi.o +@@ -15,6 +16,7 @@ snd-soc-rpi-proto-objs := rpi-proto.o + snd-soc-iqaudio-dac-objs := iqaudio-dac.o + snd-soc-raspidac3-objs := raspidac3.o + ++obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o +--- /dev/null ++++ b/sound/soc/bcm/adau1977-adc.c +@@ -0,0 +1,125 @@ ++/* ++ * ASoC Driver for ADAU1977 ADC ++ * ++ * Author: Andrey Grodzovsky ++ * Copyright 2016 ++ * ++ * This file is based on hifibery_dac driver by Florian Meier. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++enum adau1977_clk_id { ++ ADAU1977_SYSCLK, ++}; ++ ++enum adau1977_sysclk_src { ++ ADAU1977_SYSCLK_SRC_MCLK, ++ ADAU1977_SYSCLK_SRC_LRCLK, ++}; ++ ++static int eval_adau1977_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ int ret; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ ++ ret = snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 0, 0); ++ if (ret < 0) ++ return ret; ++ ++ return snd_soc_codec_set_sysclk(rtd->codec, ADAU1977_SYSCLK, ++ ADAU1977_SYSCLK_SRC_MCLK, 11289600, SND_SOC_CLOCK_IN); ++} ++ ++static struct snd_soc_dai_link snd_rpi_adau1977_dai[] = { ++ { ++ .name = "adau1977", ++ .stream_name = "ADAU1977", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "adau1977-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "adau1977.1-0011", ++ .init = eval_adau1977_init, ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBM_CFM, ++ }, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_adau1977_adc = { ++ .name = "snd_rpi_adau1977_adc", ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_adau1977_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_adau1977_dai), ++}; ++ ++static int snd_adau1977_adc_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_adau1977_adc.dev = &pdev->dev; ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_rpi_adau1977_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_adau1977_adc); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_adau1977_adc_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_adau1977_adc); ++} ++ ++static const struct of_device_id snd_adau1977_adc_of_match[] = { ++ { .compatible = "adi,adau1977-adc", }, ++ {}, ++}; ++ ++MODULE_DEVICE_TABLE(of, snd_adau1977_adc_of_match); ++ ++static struct platform_driver snd_adau1977_adc_driver = { ++ .driver = { ++ .name = "snd-adau1977-adc", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_adau1977_adc_of_match, ++ }, ++ .probe = snd_adau1977_adc_probe, ++ .remove = snd_adau1977_adc_remove, ++}; ++ ++module_platform_driver(snd_adau1977_adc_driver); ++ ++MODULE_AUTHOR("Andrey Grodzovsky "); ++MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0322-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0322-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch deleted file mode 100644 index 54bf7a8c0c..0000000000 --- a/target/linux/brcm2708/patches-4.4/0322-Revert-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 19526f5f7bdd0ffe5f079197598f1276fed9bcff Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 6 May 2016 17:21:58 +0100 -Subject: [PATCH 322/423] Revert "config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE" - -This reverts commit 417aed4cb35a479e001c8389fd8d97c3ea612999. ---- - arch/arm/configs/bcm2709_defconfig | 1 - - arch/arm/configs/bcmrpi_defconfig | 1 - - 2 files changed, 2 deletions(-) - ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -815,7 +815,6 @@ CONFIG_VIDEO_TW9906=m - CONFIG_VIDEO_OV7640=m - CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m --CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m - CONFIG_DRM_VC4=m - CONFIG_FB=y ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -807,7 +807,6 @@ CONFIG_VIDEO_TW9906=m - CONFIG_VIDEO_OV7640=m - CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m --CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m - CONFIG_DRM_VC4=m - CONFIG_FB=y diff --git a/target/linux/brcm2708/patches-4.4/0323-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch b/target/linux/brcm2708/patches-4.4/0323-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch deleted file mode 100644 index 76fdef605b..0000000000 --- a/target/linux/brcm2708/patches-4.4/0323-ARM-adau1977-adc-Add-basic-machine-driver-for-adau19.patch +++ /dev/null @@ -1,285 +0,0 @@ -From 8c2a8f26d78f29aa349b184a9e87586df735b51e Mon Sep 17 00:00:00 2001 -From: Andrey Grodzovsky -Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 323/423] ARM: adau1977-adc: Add basic machine driver for - adau1977 codec driver. - -This commit adds basic support for the codec usage including: Device tree overlay, -binding I2S bus and setting I2S mode, clock source and frequency setting according -to spec. - -Signed-off-by: Andrey Grodzovsky ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 7 ++ - .../arm/boot/dts/overlays/adau1977-adc-overlay.dts | 53 +++++++++ - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - sound/soc/bcm/Kconfig | 7 ++ - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/adau1977-adc.c | 125 +++++++++++++++++++++ - 8 files changed, 197 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/adau1977-adc-overlay.dts - create mode 100644 sound/soc/bcm/adau1977-adc.c - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -12,6 +12,7 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) - RPI_DT_OVERLAYS=y - endif - -+dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc.dtbo - dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo - dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo - dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -161,6 +161,13 @@ Params: - and the other i2c baudrate parameters. - - -+Name: adau1977-adc -+Info: Overlay for activation of ADAU1977 ADC codec over I2C for control -+ and I2S for data. -+Load: dtoverlay=adau1977-adc -+Params: -+ -+ - Name: ads7846 - Info: ADS7846 Touch controller - Load: dtoverlay=ads7846,= ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/adau1977-adc-overlay.dts -@@ -0,0 +1,53 @@ -+// Definitions for ADAU1977 ADC -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&soc>; -+ -+ __overlay__ { -+ codec_supply: fixedregulator@0 { -+ compatible = "regulator-fixed"; -+ regulator-name = "AVDD"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c>; -+ -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ adau1977: codec@11 { -+ compatible = "adi,adau1977"; -+ reg = <0x11>; -+ reset-gpios = <&gpio 5 0>; -+ AVDD-supply = <&codec_supply>; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&sound>; -+ __overlay__ { -+ compatible = "adi,adau1977-adc"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+}; ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -861,6 +861,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m - CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m -+CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m - CONFIG_SND_SIMPLE_CARD=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -853,6 +853,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m - CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m -+CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m - CONFIG_SND_SIMPLE_CARD=m ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -78,3 +78,10 @@ config SND_BCM2708_SOC_RASPIDAC3 - select SND_SOC_TPA6130A2 - help - Say Y or M if you want to add support for RaspiDAC Rev.3x. -+ -+config SND_BCM2708_SOC_ADAU1977_ADC -+ tristate "Support for ADAU1977 ADC" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_ADAU1977_I2C -+ help -+ Say Y or M if you want to add support for ADAU1977 ADC. ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -4,6 +4,7 @@ snd-soc-bcm2835-i2s-objs := bcm2835-i2s. - obj-$(CONFIG_SND_BCM2835_SOC_I2S) += snd-soc-bcm2835-i2s.o - - # BCM2708 Machine Support -+snd-soc-adau1977-adc-objs := adau1977-adc.o - snd-soc-hifiberry-dac-objs := hifiberry_dac.o - snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o - snd-soc-hifiberry-digi-objs := hifiberry_digi.o -@@ -15,6 +16,7 @@ snd-soc-rpi-proto-objs := rpi-proto.o - snd-soc-iqaudio-dac-objs := iqaudio-dac.o - snd-soc-raspidac3-objs := raspidac3.o - -+obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o ---- /dev/null -+++ b/sound/soc/bcm/adau1977-adc.c -@@ -0,0 +1,125 @@ -+/* -+ * ASoC Driver for ADAU1977 ADC -+ * -+ * Author: Andrey Grodzovsky -+ * Copyright 2016 -+ * -+ * This file is based on hifibery_dac driver by Florian Meier. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+enum adau1977_clk_id { -+ ADAU1977_SYSCLK, -+}; -+ -+enum adau1977_sysclk_src { -+ ADAU1977_SYSCLK_SRC_MCLK, -+ ADAU1977_SYSCLK_SRC_LRCLK, -+}; -+ -+static int eval_adau1977_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ int ret; -+ struct snd_soc_dai *codec_dai = rtd->codec_dai; -+ -+ ret = snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 0, 0); -+ if (ret < 0) -+ return ret; -+ -+ return snd_soc_codec_set_sysclk(rtd->codec, ADAU1977_SYSCLK, -+ ADAU1977_SYSCLK_SRC_MCLK, 11289600, SND_SOC_CLOCK_IN); -+} -+ -+static struct snd_soc_dai_link snd_rpi_adau1977_dai[] = { -+ { -+ .name = "adau1977", -+ .stream_name = "ADAU1977", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "adau1977-hifi", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "adau1977.1-0011", -+ .init = eval_adau1977_init, -+ .dai_fmt = SND_SOC_DAIFMT_I2S | -+ SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBM_CFM, -+ }, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_adau1977_adc = { -+ .name = "snd_rpi_adau1977_adc", -+ .owner = THIS_MODULE, -+ .dai_link = snd_rpi_adau1977_dai, -+ .num_links = ARRAY_SIZE(snd_rpi_adau1977_dai), -+}; -+ -+static int snd_adau1977_adc_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ -+ snd_adau1977_adc.dev = &pdev->dev; -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai = &snd_rpi_adau1977_dai[0]; -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ } -+ -+ ret = snd_soc_register_card(&snd_adau1977_adc); -+ if (ret) -+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); -+ -+ return ret; -+} -+ -+static int snd_adau1977_adc_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_adau1977_adc); -+} -+ -+static const struct of_device_id snd_adau1977_adc_of_match[] = { -+ { .compatible = "adi,adau1977-adc", }, -+ {}, -+}; -+ -+MODULE_DEVICE_TABLE(of, snd_adau1977_adc_of_match); -+ -+static struct platform_driver snd_adau1977_adc_driver = { -+ .driver = { -+ .name = "snd-adau1977-adc", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_adau1977_adc_of_match, -+ }, -+ .probe = snd_adau1977_adc_probe, -+ .remove = snd_adau1977_adc_remove, -+}; -+ -+module_platform_driver(snd_adau1977_adc_driver); -+ -+MODULE_AUTHOR("Andrey Grodzovsky "); -+MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0323-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch b/target/linux/brcm2708/patches-4.4/0323-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch new file mode 100644 index 0000000000..3278745176 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0323-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch @@ -0,0 +1,60 @@ +From 691922255a15630c6f726c4c871ce2475d4fec72 Mon Sep 17 00:00:00 2001 +From: DigitalDreamtime +Date: Fri, 6 May 2016 09:42:55 +0100 +Subject: [PATCH] Allow up to 24dB digital gain to be applied when using + IQAudIO DAC + +24db_digital_gain DT param can be used to specify that PCM512x +codec "Digital" volume control should not be limited to 0dB gain, +and if specified will allow the full 24dB gain. + +Signed-off-by: DigitalDreamtime +--- + arch/arm/boot/dts/overlays/README | 17 +++++++++++++++-- + arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts | 6 +++++- + 2 files changed, 20 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -490,8 +490,21 @@ Params: + + Name: iqaudio-dac + Info: Configures the IQaudio DAC audio card +-Load: dtoverlay=iqaudio-dac +-Params: ++Load: dtoverlay=iqaudio-dac, ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. Enable with ++ "dtoverlay=iqaudio-dac,24db_digital_gain" ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) + + + Name: iqaudio-dacplus +--- a/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts ++++ b/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts +@@ -30,10 +30,14 @@ + + fragment@2 { + target = <&sound>; +- __overlay__ { ++ frag2: __overlay__ { + compatible = "iqaudio,iqaudio-dac"; + i2s-controller = <&i2s>; + status = "okay"; + }; + }; ++ ++ __overrides__ { ++ 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?"; ++ }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0324-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch b/target/linux/brcm2708/patches-4.4/0324-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch deleted file mode 100644 index ad4d3b1b96..0000000000 --- a/target/linux/brcm2708/patches-4.4/0324-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch +++ /dev/null @@ -1,60 +0,0 @@ -From d81de2a4a1223296b17dac8e652b0b31911f6dd1 Mon Sep 17 00:00:00 2001 -From: DigitalDreamtime -Date: Fri, 6 May 2016 09:42:55 +0100 -Subject: [PATCH 324/423] Allow up to 24dB digital gain to be applied when - using IQAudIO DAC - -24db_digital_gain DT param can be used to specify that PCM512x -codec "Digital" volume control should not be limited to 0dB gain, -and if specified will allow the full 24dB gain. - -Signed-off-by: DigitalDreamtime ---- - arch/arm/boot/dts/overlays/README | 17 +++++++++++++++-- - arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts | 6 +++++- - 2 files changed, 20 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -490,8 +490,21 @@ Params: - - Name: iqaudio-dac - Info: Configures the IQaudio DAC audio card --Load: dtoverlay=iqaudio-dac --Params: -+Load: dtoverlay=iqaudio-dac, -+Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec -+ Digital volume control. Enable with -+ "dtoverlay=iqaudio-dac,24db_digital_gain" -+ (The default behaviour is that the Digital -+ volume control is limited to a maximum of -+ 0dB. ie. it can attenuate but not provide -+ gain. For most users, this will be desired -+ as it will prevent clipping. By appending -+ the 24db_digital_gain parameter, the Digital -+ volume control will allow up to 24dB of -+ gain. If this parameter is enabled, it is the -+ responsibility of the user to ensure that -+ the Digital volume control is set to a value -+ that does not result in clipping/distortion!) - - - Name: iqaudio-dacplus ---- a/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts -+++ b/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts -@@ -30,10 +30,14 @@ - - fragment@2 { - target = <&sound>; -- __overlay__ { -+ frag2: __overlay__ { - compatible = "iqaudio,iqaudio-dac"; - i2s-controller = <&i2s>; - status = "okay"; - }; - }; -+ -+ __overrides__ { -+ 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?"; -+ }; - }; diff --git a/target/linux/brcm2708/patches-4.4/0324-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0324-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch new file mode 100644 index 0000000000..bfb7bf693d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0324-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch @@ -0,0 +1,30 @@ +From e84d0b3f337b2ad8f8b7879fb64bcd48a87919c6 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 6 May 2016 12:40:37 +0100 +Subject: [PATCH] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -815,6 +815,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m ++CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -807,6 +807,7 @@ CONFIG_VIDEO_TW9906=m + CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m ++CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y diff --git a/target/linux/brcm2708/patches-4.4/0325-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch b/target/linux/brcm2708/patches-4.4/0325-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch new file mode 100644 index 0000000000..ef74e1eb07 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0325-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch @@ -0,0 +1,324 @@ +From a2d2ac2146d46c29d9fd086c777ca7643eb699db Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 6 May 2016 11:48:35 -0700 +Subject: [PATCH] BCM270X_DT: Move vc4 node contents to bcm2708_common.dtsi. + +This should clarify what's going on with the overlay: The hardware is +always present, we're just enabling the DT node so that the vc4 driver +probes. + +The interrupts are left in the overlay, because the firmware doesn't +check node status before masking out the vc4 interrupts. + +By having the nodes in the common file, we'll be able to correctly +connect the HDMI HPD GPIO so that we can detect whether an HDMI +monitor is connected. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 51 +++++++ + arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 160 ++++++++++----------- + 2 files changed, 129 insertions(+), 82 deletions(-) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -1,4 +1,7 @@ ++#include "dt-bindings/clock/bcm2835.h" + #include ++#include "dt-bindings/power/raspberrypi-power.h" ++#include "dt-bindings/gpio/gpio.h" + #include "skeleton.dtsi" + + / { +@@ -170,6 +173,18 @@ + status = "disabled"; + }; + ++ pixelvalve0: pixelvalve@7e206000 { ++ compatible = "brcm,bcm2835-pixelvalve0"; ++ reg = <0x7e206000 0x100>; ++ status = "disabled"; ++ }; ++ ++ pixelvalve1: pixelvalve@7e207000 { ++ compatible = "brcm,bcm2835-pixelvalve1"; ++ reg = <0x7e207000 0x100>; ++ status = "disabled"; ++ }; ++ + pwm: pwm@7e20c000 { + compatible = "brcm,bcm2835-pwm"; + reg = <0x7e20c000 0x28>; +@@ -227,6 +242,12 @@ + status = "disabled"; + }; + ++ hvs: hvs@7e400000 { ++ compatible = "brcm,bcm2835-hvs"; ++ reg = <0x7e400000 0x6000>; ++ status = "disabled"; ++ }; ++ + i2c1: i2c@7e804000 { + compatible = "brcm,bcm2708-i2c"; + reg = <0x7e804000 0x1000>; +@@ -261,6 +282,25 @@ + status = "disabled"; + }; + ++ pixelvalve2: pixelvalve@7e807000 { ++ compatible = "brcm,bcm2835-pixelvalve2"; ++ reg = <0x7e807000 0x100>; ++ status = "disabled"; ++ }; ++ ++ hdmi: hdmi@7e902000 { ++ compatible = "brcm,bcm2835-hdmi"; ++ reg = <0x7e902000 0x600>, ++ <0x7e808000 0x100>; ++ ddc = <&i2c2>; ++ hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; ++ clocks = <&cprman BCM2835_PLLH_PIX>, ++ <&cprman BCM2835_CLOCK_HSM>; ++ clock-names = "pixel", "hdmi"; ++ power-domains = <&power RPI_POWER_DOMAIN_HDMI>; ++ status = "disabled"; ++ }; ++ + usb: usb@7e980000 { + compatible = "brcm,bcm2708-usb"; + reg = <0x7e980000 0x10000>, +@@ -269,6 +309,12 @@ + <1 9>; + }; + ++ v3d: v3d@7ec00000 { ++ compatible = "brcm,vc4-v3d"; ++ reg = <0x7ec00000 0x1000>; ++ status = "disabled"; ++ }; ++ + firmware: firmware { + compatible = "raspberrypi,bcm2835-firmware"; + mboxes = <&mailbox>; +@@ -303,6 +349,11 @@ + firmware = <&firmware>; + }; + ++ gpu: gpu { ++ compatible = "brcm,bcm2835-vc4"; ++ status = "disabled"; ++ }; ++ + /* Onboard audio */ + audio: audio { + compatible = "brcm,bcm2835-audio"; +--- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts ++++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts +@@ -5,129 +5,125 @@ + /dts-v1/; + /plugin/; + +-#include "dt-bindings/clock/bcm2835.h" +-#include "dt-bindings/power/raspberrypi-power.h" +-#include "dt-bindings/gpio/gpio.h" +- + / { + compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; + + fragment@0 { ++ target-path = "/chosen"; ++ __overlay__ { ++ bootargs = "cma=256M@256M"; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=192M@256M"; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=128M@128M"; ++ }; ++ }; ++ ++ fragment@3 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=96M@128M"; ++ }; ++ }; ++ ++ fragment@4 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=64M@64M"; ++ }; ++ }; ++ ++ fragment@5 { + target = <&i2c2>; + __overlay__ { + status = "okay"; + }; + }; + +- fragment@1 { ++ fragment@6 { + target = <&cprman>; + __overlay__ { + status = "okay"; + }; + }; + +- fragment@2 { ++ fragment@7 { + target = <&fb>; + __overlay__ { + status = "disabled"; + }; + }; + +- fragment@3 { +- target = <&soc>; ++ fragment@8 { ++ target = <&pixelvalve0>; + __overlay__ { +- #address-cells = <1>; +- #size-cells = <1>; ++ interrupts = <2 13>; /* pwa0 */ ++ status = "okay"; ++ }; ++ }; + +- pixelvalve@7e206000 { +- compatible = "brcm,bcm2835-pixelvalve0"; +- reg = <0x7e206000 0x100>; +- interrupts = <2 13>; /* pwa0 */ +- }; +- +- pixelvalve@7e207000 { +- compatible = "brcm,bcm2835-pixelvalve1"; +- reg = <0x7e207000 0x100>; +- interrupts = <2 14>; /* pwa1 */ +- }; +- +- hvs@7e400000 { +- compatible = "brcm,bcm2835-hvs"; +- reg = <0x7e400000 0x6000>; +- interrupts = <2 1>; +- }; +- +- pixelvalve@7e807000 { +- compatible = "brcm,bcm2835-pixelvalve2"; +- reg = <0x7e807000 0x100>; +- interrupts = <2 10>; /* pixelvalve */ +- }; +- +- hdmi@7e902000 { +- compatible = "brcm,bcm2835-hdmi"; +- reg = <0x7e902000 0x600>, +- <0x7e808000 0x100>; +- interrupts = <2 8>, <2 9>; +- ddc = <&i2c2>; +- hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; +- clocks = <&cprman BCM2835_PLLH_PIX>, +- <&cprman BCM2835_CLOCK_HSM>; +- clock-names = "pixel", "hdmi"; +- power-domains = <&power RPI_POWER_DOMAIN_HDMI>; +- }; +- +- v3d@7ec00000 { +- compatible = "brcm,vc4-v3d"; +- reg = <0x7ec00000 0x1000>; +- interrupts = <1 10>; +- }; +- +- gpu@7e4c0000 { +- compatible = "brcm,bcm2835-vc4"; +- }; ++ fragment@9 { ++ target = <&pixelvalve1>; ++ __overlay__ { ++ interrupts = <2 14>; /* pwa1 */ ++ status = "okay"; + }; + }; + +- fragment@4 { +- target-path = "/chosen"; +- __overlay__ { +- bootargs = "cma=256M@256M"; ++ fragment@10 { ++ target = <&pixelvalve2>; ++ __overlay__ { ++ interrupts = <2 10>; /* pixelvalve */ ++ status = "okay"; + }; + }; + +- fragment@5 { +- target-path = "/chosen"; +- __dormant__ { +- bootargs = "cma=192M@256M"; ++ fragment@11 { ++ target = <&hvs>; ++ __overlay__ { ++ interrupts = <2 1>; ++ status = "okay"; + }; + }; + +- fragment@6 { +- target-path = "/chosen"; +- __dormant__ { +- bootargs = "cma=128M@128M"; ++ fragment@12 { ++ target = <&hdmi>; ++ __overlay__ { ++ interrupts = <2 8>, <2 9>; ++ status = "okay"; + }; + }; + +- fragment@7 { +- target-path = "/chosen"; +- __dormant__ { +- bootargs = "cma=96M@128M"; ++ fragment@13 { ++ target = <&v3d>; ++ __overlay__ { ++ interrupts = <1 10>; ++ status = "okay"; + }; + }; + +- fragment@8 { +- target-path = "/chosen"; +- __dormant__ { +- bootargs = "cma=64M@64M"; ++ fragment@14 { ++ target = <&gpu>; ++ __overlay__ { ++ status = "okay"; + }; + }; + + __overrides__ { +- cma-256 = <0>,"+4-5-6-7-8"; +- cma-192 = <0>,"-4+5-6-7-8"; +- cma-128 = <0>,"-4-5+6-7-8"; +- cma-96 = <0>,"-4-5-6+7-8"; +- cma-64 = <0>,"-4-5-6-7+8"; ++ cma-256 = <0>,"+0-1-2-3-4"; ++ cma-192 = <0>,"-0+1-2-3-4"; ++ cma-128 = <0>,"-0-1+2-3-4"; ++ cma-96 = <0>,"-0-1-2+3-4"; ++ cma-64 = <0>,"-0-1-2-3+4"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0325-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch b/target/linux/brcm2708/patches-4.4/0325-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch deleted file mode 100644 index 20cb9db8ed..0000000000 --- a/target/linux/brcm2708/patches-4.4/0325-config-Add-CONFIG_DRM_LOAD_EDID_FIRMWARE.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 65042bea86d4204f83acd09cb665a2d91b365105 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 6 May 2016 12:40:37 +0100 -Subject: [PATCH 325/423] config: Add CONFIG_DRM_LOAD_EDID_FIRMWARE - ---- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) - ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -815,6 +815,7 @@ CONFIG_VIDEO_TW9906=m - CONFIG_VIDEO_OV7640=m - CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m -+CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m - CONFIG_DRM_VC4=m - CONFIG_FB=y ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -807,6 +807,7 @@ CONFIG_VIDEO_TW9906=m - CONFIG_VIDEO_OV7640=m - CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m -+CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m - CONFIG_DRM_VC4=m - CONFIG_FB=y diff --git a/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch b/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch deleted file mode 100644 index 3dc05f6b5b..0000000000 --- a/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Move-vc4-node-contents-to-bcm2708_common..patch +++ /dev/null @@ -1,325 +0,0 @@ -From c571a3b93af54fb31cf6125d7a3dfba634b4f099 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 6 May 2016 11:48:35 -0700 -Subject: [PATCH 326/423] BCM270X_DT: Move vc4 node contents to - bcm2708_common.dtsi. - -This should clarify what's going on with the overlay: The hardware is -always present, we're just enabling the DT node so that the vc4 driver -probes. - -The interrupts are left in the overlay, because the firmware doesn't -check node status before masking out the vc4 interrupts. - -By having the nodes in the common file, we'll be able to correctly -connect the HDMI HPD GPIO so that we can detect whether an HDMI -monitor is connected. - -Signed-off-by: Eric Anholt ---- - arch/arm/boot/dts/bcm2708_common.dtsi | 51 +++++++ - arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 160 ++++++++++----------- - 2 files changed, 129 insertions(+), 82 deletions(-) - ---- a/arch/arm/boot/dts/bcm2708_common.dtsi -+++ b/arch/arm/boot/dts/bcm2708_common.dtsi -@@ -1,4 +1,7 @@ -+#include "dt-bindings/clock/bcm2835.h" - #include -+#include "dt-bindings/power/raspberrypi-power.h" -+#include "dt-bindings/gpio/gpio.h" - #include "skeleton.dtsi" - - / { -@@ -170,6 +173,18 @@ - status = "disabled"; - }; - -+ pixelvalve0: pixelvalve@7e206000 { -+ compatible = "brcm,bcm2835-pixelvalve0"; -+ reg = <0x7e206000 0x100>; -+ status = "disabled"; -+ }; -+ -+ pixelvalve1: pixelvalve@7e207000 { -+ compatible = "brcm,bcm2835-pixelvalve1"; -+ reg = <0x7e207000 0x100>; -+ status = "disabled"; -+ }; -+ - pwm: pwm@7e20c000 { - compatible = "brcm,bcm2835-pwm"; - reg = <0x7e20c000 0x28>; -@@ -227,6 +242,12 @@ - status = "disabled"; - }; - -+ hvs: hvs@7e400000 { -+ compatible = "brcm,bcm2835-hvs"; -+ reg = <0x7e400000 0x6000>; -+ status = "disabled"; -+ }; -+ - i2c1: i2c@7e804000 { - compatible = "brcm,bcm2708-i2c"; - reg = <0x7e804000 0x1000>; -@@ -261,6 +282,25 @@ - status = "disabled"; - }; - -+ pixelvalve2: pixelvalve@7e807000 { -+ compatible = "brcm,bcm2835-pixelvalve2"; -+ reg = <0x7e807000 0x100>; -+ status = "disabled"; -+ }; -+ -+ hdmi: hdmi@7e902000 { -+ compatible = "brcm,bcm2835-hdmi"; -+ reg = <0x7e902000 0x600>, -+ <0x7e808000 0x100>; -+ ddc = <&i2c2>; -+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; -+ clocks = <&cprman BCM2835_PLLH_PIX>, -+ <&cprman BCM2835_CLOCK_HSM>; -+ clock-names = "pixel", "hdmi"; -+ power-domains = <&power RPI_POWER_DOMAIN_HDMI>; -+ status = "disabled"; -+ }; -+ - usb: usb@7e980000 { - compatible = "brcm,bcm2708-usb"; - reg = <0x7e980000 0x10000>, -@@ -269,6 +309,12 @@ - <1 9>; - }; - -+ v3d: v3d@7ec00000 { -+ compatible = "brcm,vc4-v3d"; -+ reg = <0x7ec00000 0x1000>; -+ status = "disabled"; -+ }; -+ - firmware: firmware { - compatible = "raspberrypi,bcm2835-firmware"; - mboxes = <&mailbox>; -@@ -303,6 +349,11 @@ - firmware = <&firmware>; - }; - -+ gpu: gpu { -+ compatible = "brcm,bcm2835-vc4"; -+ status = "disabled"; -+ }; -+ - /* Onboard audio */ - audio: audio { - compatible = "brcm,bcm2835-audio"; ---- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts -+++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts -@@ -5,129 +5,125 @@ - /dts-v1/; - /plugin/; - --#include "dt-bindings/clock/bcm2835.h" --#include "dt-bindings/power/raspberrypi-power.h" --#include "dt-bindings/gpio/gpio.h" -- - / { - compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; - - fragment@0 { -+ target-path = "/chosen"; -+ __overlay__ { -+ bootargs = "cma=256M@256M"; -+ }; -+ }; -+ -+ fragment@1 { -+ target-path = "/chosen"; -+ __dormant__ { -+ bootargs = "cma=192M@256M"; -+ }; -+ }; -+ -+ fragment@2 { -+ target-path = "/chosen"; -+ __dormant__ { -+ bootargs = "cma=128M@128M"; -+ }; -+ }; -+ -+ fragment@3 { -+ target-path = "/chosen"; -+ __dormant__ { -+ bootargs = "cma=96M@128M"; -+ }; -+ }; -+ -+ fragment@4 { -+ target-path = "/chosen"; -+ __dormant__ { -+ bootargs = "cma=64M@64M"; -+ }; -+ }; -+ -+ fragment@5 { - target = <&i2c2>; - __overlay__ { - status = "okay"; - }; - }; - -- fragment@1 { -+ fragment@6 { - target = <&cprman>; - __overlay__ { - status = "okay"; - }; - }; - -- fragment@2 { -+ fragment@7 { - target = <&fb>; - __overlay__ { - status = "disabled"; - }; - }; - -- fragment@3 { -- target = <&soc>; -+ fragment@8 { -+ target = <&pixelvalve0>; - __overlay__ { -- #address-cells = <1>; -- #size-cells = <1>; -+ interrupts = <2 13>; /* pwa0 */ -+ status = "okay"; -+ }; -+ }; - -- pixelvalve@7e206000 { -- compatible = "brcm,bcm2835-pixelvalve0"; -- reg = <0x7e206000 0x100>; -- interrupts = <2 13>; /* pwa0 */ -- }; -- -- pixelvalve@7e207000 { -- compatible = "brcm,bcm2835-pixelvalve1"; -- reg = <0x7e207000 0x100>; -- interrupts = <2 14>; /* pwa1 */ -- }; -- -- hvs@7e400000 { -- compatible = "brcm,bcm2835-hvs"; -- reg = <0x7e400000 0x6000>; -- interrupts = <2 1>; -- }; -- -- pixelvalve@7e807000 { -- compatible = "brcm,bcm2835-pixelvalve2"; -- reg = <0x7e807000 0x100>; -- interrupts = <2 10>; /* pixelvalve */ -- }; -- -- hdmi@7e902000 { -- compatible = "brcm,bcm2835-hdmi"; -- reg = <0x7e902000 0x600>, -- <0x7e808000 0x100>; -- interrupts = <2 8>, <2 9>; -- ddc = <&i2c2>; -- hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; -- clocks = <&cprman BCM2835_PLLH_PIX>, -- <&cprman BCM2835_CLOCK_HSM>; -- clock-names = "pixel", "hdmi"; -- power-domains = <&power RPI_POWER_DOMAIN_HDMI>; -- }; -- -- v3d@7ec00000 { -- compatible = "brcm,vc4-v3d"; -- reg = <0x7ec00000 0x1000>; -- interrupts = <1 10>; -- }; -- -- gpu@7e4c0000 { -- compatible = "brcm,bcm2835-vc4"; -- }; -+ fragment@9 { -+ target = <&pixelvalve1>; -+ __overlay__ { -+ interrupts = <2 14>; /* pwa1 */ -+ status = "okay"; - }; - }; - -- fragment@4 { -- target-path = "/chosen"; -- __overlay__ { -- bootargs = "cma=256M@256M"; -+ fragment@10 { -+ target = <&pixelvalve2>; -+ __overlay__ { -+ interrupts = <2 10>; /* pixelvalve */ -+ status = "okay"; - }; - }; - -- fragment@5 { -- target-path = "/chosen"; -- __dormant__ { -- bootargs = "cma=192M@256M"; -+ fragment@11 { -+ target = <&hvs>; -+ __overlay__ { -+ interrupts = <2 1>; -+ status = "okay"; - }; - }; - -- fragment@6 { -- target-path = "/chosen"; -- __dormant__ { -- bootargs = "cma=128M@128M"; -+ fragment@12 { -+ target = <&hdmi>; -+ __overlay__ { -+ interrupts = <2 8>, <2 9>; -+ status = "okay"; - }; - }; - -- fragment@7 { -- target-path = "/chosen"; -- __dormant__ { -- bootargs = "cma=96M@128M"; -+ fragment@13 { -+ target = <&v3d>; -+ __overlay__ { -+ interrupts = <1 10>; -+ status = "okay"; - }; - }; - -- fragment@8 { -- target-path = "/chosen"; -- __dormant__ { -- bootargs = "cma=64M@64M"; -+ fragment@14 { -+ target = <&gpu>; -+ __overlay__ { -+ status = "okay"; - }; - }; - - __overrides__ { -- cma-256 = <0>,"+4-5-6-7-8"; -- cma-192 = <0>,"-4+5-6-7-8"; -- cma-128 = <0>,"-4-5+6-7-8"; -- cma-96 = <0>,"-4-5-6+7-8"; -- cma-64 = <0>,"-4-5-6-7+8"; -+ cma-256 = <0>,"+0-1-2-3-4"; -+ cma-192 = <0>,"-0+1-2-3-4"; -+ cma-128 = <0>,"-0-1+2-3-4"; -+ cma-96 = <0>,"-0-1-2+3-4"; -+ cma-64 = <0>,"-0-1-2-3+4"; - }; - }; diff --git a/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch b/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch new file mode 100644 index 0000000000..f29a4c9fdf --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0326-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch @@ -0,0 +1,69 @@ +From f8d384eb825833f16db1b410dc7bdb62857bcf54 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 6 May 2016 12:42:26 -0700 +Subject: [PATCH] BCM270X_DT: Set correct HDMI HPD GPIO levels for various + boards. + +The CM is left out, because I haven't found a source for how the CM's +HPD is connected. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 4 ++++ + arch/arm/boot/dts/bcm2708-rpi-b.dts | 4 ++++ + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 4 ++++ + arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 4 ++++ + 4 files changed, 16 insertions(+) + +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -116,6 +116,10 @@ + }; + }; + ++&hdmi { ++ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -110,6 +110,10 @@ + }; + }; + ++&hdmi { ++ hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -116,6 +116,10 @@ + }; + }; + ++&hdmi { ++ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -161,6 +161,10 @@ + }; + }; + ++&hdmi { ++ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; ++}; ++ + / { + chosen { + bootargs = "8250.nr_uarts=1"; diff --git a/target/linux/brcm2708/patches-4.4/0327-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch b/target/linux/brcm2708/patches-4.4/0327-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch deleted file mode 100644 index e05da8d22c..0000000000 --- a/target/linux/brcm2708/patches-4.4/0327-BCM270X_DT-Set-correct-HDMI-HPD-GPIO-levels-for-vari.patch +++ /dev/null @@ -1,69 +0,0 @@ -From da8c5943777182ae813ae0e1332e45ffaec0b7fa Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 6 May 2016 12:42:26 -0700 -Subject: [PATCH 327/423] BCM270X_DT: Set correct HDMI HPD GPIO levels for - various boards. - -The CM is left out, because I haven't found a source for how the CM's -HPD is connected. - -Signed-off-by: Eric Anholt ---- - arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 4 ++++ - arch/arm/boot/dts/bcm2708-rpi-b.dts | 4 ++++ - arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 4 ++++ - arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 4 ++++ - 4 files changed, 16 insertions(+) - ---- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts -+++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts -@@ -116,6 +116,10 @@ - }; - }; - -+&hdmi { -+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; -+}; -+ - / { - __overrides__ { - uart0 = <&uart0>,"status"; ---- a/arch/arm/boot/dts/bcm2708-rpi-b.dts -+++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts -@@ -110,6 +110,10 @@ - }; - }; - -+&hdmi { -+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; -+}; -+ - / { - __overrides__ { - uart0 = <&uart0>,"status"; ---- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts -+++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts -@@ -116,6 +116,10 @@ - }; - }; - -+&hdmi { -+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; -+}; -+ - / { - __overrides__ { - uart0 = <&uart0>,"status"; ---- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -+++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -@@ -161,6 +161,10 @@ - }; - }; - -+&hdmi { -+ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; -+}; -+ - / { - chosen { - bootargs = "8250.nr_uarts=1"; diff --git a/target/linux/brcm2708/patches-4.4/0327-Revert-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0327-Revert-drm-vc4-Force-HDMI-to-connected.patch new file mode 100644 index 0000000000..47b395f3af --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0327-Revert-drm-vc4-Force-HDMI-to-connected.patch @@ -0,0 +1,26 @@ +From bfde336df6d52984f6eef6ad5e4981fe18c0dfcc Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 6 May 2016 12:43:25 -0700 +Subject: [PATCH] Revert "drm/vc4: Force HDMI to connected." + +Now that we have the HDMI HPD GPIOs correctly identified in the DT, we +should be able to successfully detect HDMI. + +This reverts commit fbec01e2d17b924d91850e17eeecf975e74c9ebf. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -166,8 +166,6 @@ vc4_hdmi_connector_detect(struct drm_con + struct drm_device *dev = connector->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); + +- return connector_status_connected; +- + if (vc4->hdmi->hpd_gpio) { + if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^ + vc4->hdmi->hpd_active_low) diff --git a/target/linux/brcm2708/patches-4.4/0328-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch b/target/linux/brcm2708/patches-4.4/0328-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch new file mode 100644 index 0000000000..f054521116 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0328-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch @@ -0,0 +1,33 @@ +From a62182109337f799ee97d1e41fee09be5faa8975 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 6 May 2016 12:59:27 -0700 +Subject: [PATCH] BCM270X: Include DRM_PANEL_SIMPLE in the defconfigs. + +This is going to be required for the Adafruit DPI panel support. + +Signed-off-by: Eric Anholt +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -817,6 +817,7 @@ CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m ++CONFIG_DRM_PANEL_SIMPLE=m + CONFIG_DRM_VC4=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -809,6 +809,7 @@ CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m ++CONFIG_DRM_PANEL_SIMPLE=m + CONFIG_DRM_VC4=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y diff --git a/target/linux/brcm2708/patches-4.4/0328-Revert-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0328-Revert-drm-vc4-Force-HDMI-to-connected.patch deleted file mode 100644 index 14beb8acb9..0000000000 --- a/target/linux/brcm2708/patches-4.4/0328-Revert-drm-vc4-Force-HDMI-to-connected.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 51ee0bd70a886329018e8d22fda1fe4f360a9ff3 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 6 May 2016 12:43:25 -0700 -Subject: [PATCH 328/423] Revert "drm/vc4: Force HDMI to connected." - -Now that we have the HDMI HPD GPIOs correctly identified in the DT, we -should be able to successfully detect HDMI. - -This reverts commit fbec01e2d17b924d91850e17eeecf975e74c9ebf. - -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 2 -- - 1 file changed, 2 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -166,8 +166,6 @@ vc4_hdmi_connector_detect(struct drm_con - struct drm_device *dev = connector->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); - -- return connector_status_connected; -- - if (vc4->hdmi->hpd_gpio) { - if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^ - vc4->hdmi->hpd_active_low) diff --git a/target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch b/target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch deleted file mode 100644 index cedb9b96b2..0000000000 --- a/target/linux/brcm2708/patches-4.4/0329-BCM270X-Include-DRM_PANEL_SIMPLE-in-the-defconfigs.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 9768eff7323ea9e3b663be5e2850fdf87ddfe13f Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 6 May 2016 12:59:27 -0700 -Subject: [PATCH 329/423] BCM270X: Include DRM_PANEL_SIMPLE in the defconfigs. - -This is going to be required for the Adafruit DPI panel support. - -Signed-off-by: Eric Anholt ---- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) - ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -817,6 +817,7 @@ CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m - CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m -+CONFIG_DRM_PANEL_SIMPLE=m - CONFIG_DRM_VC4=m - CONFIG_FB=y - CONFIG_FB_BCM2708=y ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -809,6 +809,7 @@ CONFIG_VIDEO_MT9V011=m - CONFIG_DRM=m - CONFIG_DRM_LOAD_EDID_FIRMWARE=y - CONFIG_DRM_UDL=m -+CONFIG_DRM_PANEL_SIMPLE=m - CONFIG_DRM_VC4=m - CONFIG_FB=y - CONFIG_FB_BCM2708=y diff --git a/target/linux/brcm2708/patches-4.4/0329-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch b/target/linux/brcm2708/patches-4.4/0329-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch new file mode 100644 index 0000000000..9e2da1d655 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0329-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch @@ -0,0 +1,64 @@ +From 870639e585709adc65183d75619fc01e35adb774 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 18 Mar 2016 12:34:59 -0700 +Subject: [PATCH] drm: Add an encoder and connector type enum for DPI. + +Right now exynos is exposing DPI as a TMDS encoder and VGA connector, +which seems rather misleading. This isn't just an internal detail, +since xrandr actually exposes "VGA" as the output name. Define some +new enums so that vc4's DPI can have a more informative name. + +I considered other names for the connector as well. For VC4, the +Adafruit DPI kippah takes the 28 GPIO pins and routes them to a +standard-ish 40-pin FPC connector, but "40-pin FPC" doesn't uniquely +identify an ordering of pins (apparently some other orderings exist), +doesn't explain things as well for the user (who, if anything, knows +their product is a DPI kippah/panel combo), and actually doesn't have +to exist (one could connect the 28 GPIOs directly to something else). +Simply "DPI" seems like a good compromise name to distinguish from the +HDMI, DSI, and TV connectors . + +Signed-off-by: Eric Anholt +Reviewed-by: Daniel Vetter +(cherry picked from commit 0b27c02a7f1c697694f2ad6d6517e7dbf9ecfa39) +--- + drivers/gpu/drm/drm_crtc.c | 2 ++ + include/uapi/drm/drm_mode.h | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/drivers/gpu/drm/drm_crtc.c ++++ b/drivers/gpu/drm/drm_crtc.c +@@ -168,6 +168,7 @@ static struct drm_conn_prop_enum_list dr + { DRM_MODE_CONNECTOR_eDP, "eDP" }, + { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" }, + { DRM_MODE_CONNECTOR_DSI, "DSI" }, ++ { DRM_MODE_CONNECTOR_DPI, "DPI" }, + }; + + static const struct drm_prop_enum_list drm_encoder_enum_list[] = { +@@ -179,6 +180,7 @@ static const struct drm_prop_enum_list d + { DRM_MODE_ENCODER_VIRTUAL, "Virtual" }, + { DRM_MODE_ENCODER_DSI, "DSI" }, + { DRM_MODE_ENCODER_DPMST, "DP MST" }, ++ { DRM_MODE_ENCODER_DPI, "DPI" }, + }; + + static const struct drm_prop_enum_list drm_subpixel_enum_list[] = { +--- a/include/uapi/drm/drm_mode.h ++++ b/include/uapi/drm/drm_mode.h +@@ -202,6 +202,7 @@ struct drm_mode_get_plane_res { + #define DRM_MODE_ENCODER_VIRTUAL 5 + #define DRM_MODE_ENCODER_DSI 6 + #define DRM_MODE_ENCODER_DPMST 7 ++#define DRM_MODE_ENCODER_DPI 8 + + struct drm_mode_get_encoder { + __u32 encoder_id; +@@ -241,6 +242,7 @@ struct drm_mode_get_encoder { + #define DRM_MODE_CONNECTOR_eDP 14 + #define DRM_MODE_CONNECTOR_VIRTUAL 15 + #define DRM_MODE_CONNECTOR_DSI 16 ++#define DRM_MODE_CONNECTOR_DPI 17 + + struct drm_mode_get_connector { + diff --git a/target/linux/brcm2708/patches-4.4/0330-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch b/target/linux/brcm2708/patches-4.4/0330-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch deleted file mode 100644 index 34080978ce..0000000000 --- a/target/linux/brcm2708/patches-4.4/0330-drm-Add-an-encoder-and-connector-type-enum-for-DPI.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 72a4218cce198ffd0a920c98856f1dfecdfac9c9 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 18 Mar 2016 12:34:59 -0700 -Subject: [PATCH 330/423] drm: Add an encoder and connector type enum for DPI. - -Right now exynos is exposing DPI as a TMDS encoder and VGA connector, -which seems rather misleading. This isn't just an internal detail, -since xrandr actually exposes "VGA" as the output name. Define some -new enums so that vc4's DPI can have a more informative name. - -I considered other names for the connector as well. For VC4, the -Adafruit DPI kippah takes the 28 GPIO pins and routes them to a -standard-ish 40-pin FPC connector, but "40-pin FPC" doesn't uniquely -identify an ordering of pins (apparently some other orderings exist), -doesn't explain things as well for the user (who, if anything, knows -their product is a DPI kippah/panel combo), and actually doesn't have -to exist (one could connect the 28 GPIOs directly to something else). -Simply "DPI" seems like a good compromise name to distinguish from the -HDMI, DSI, and TV connectors . - -Signed-off-by: Eric Anholt -Reviewed-by: Daniel Vetter -(cherry picked from commit 0b27c02a7f1c697694f2ad6d6517e7dbf9ecfa39) ---- - drivers/gpu/drm/drm_crtc.c | 2 ++ - include/uapi/drm/drm_mode.h | 2 ++ - 2 files changed, 4 insertions(+) - ---- a/drivers/gpu/drm/drm_crtc.c -+++ b/drivers/gpu/drm/drm_crtc.c -@@ -168,6 +168,7 @@ static struct drm_conn_prop_enum_list dr - { DRM_MODE_CONNECTOR_eDP, "eDP" }, - { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" }, - { DRM_MODE_CONNECTOR_DSI, "DSI" }, -+ { DRM_MODE_CONNECTOR_DPI, "DPI" }, - }; - - static const struct drm_prop_enum_list drm_encoder_enum_list[] = { -@@ -179,6 +180,7 @@ static const struct drm_prop_enum_list d - { DRM_MODE_ENCODER_VIRTUAL, "Virtual" }, - { DRM_MODE_ENCODER_DSI, "DSI" }, - { DRM_MODE_ENCODER_DPMST, "DP MST" }, -+ { DRM_MODE_ENCODER_DPI, "DPI" }, - }; - - static const struct drm_prop_enum_list drm_subpixel_enum_list[] = { ---- a/include/uapi/drm/drm_mode.h -+++ b/include/uapi/drm/drm_mode.h -@@ -202,6 +202,7 @@ struct drm_mode_get_plane_res { - #define DRM_MODE_ENCODER_VIRTUAL 5 - #define DRM_MODE_ENCODER_DSI 6 - #define DRM_MODE_ENCODER_DPMST 7 -+#define DRM_MODE_ENCODER_DPI 8 - - struct drm_mode_get_encoder { - __u32 encoder_id; -@@ -241,6 +242,7 @@ struct drm_mode_get_encoder { - #define DRM_MODE_CONNECTOR_eDP 14 - #define DRM_MODE_CONNECTOR_VIRTUAL 15 - #define DRM_MODE_CONNECTOR_DSI 16 -+#define DRM_MODE_CONNECTOR_DPI 17 - - struct drm_mode_get_connector { - diff --git a/target/linux/brcm2708/patches-4.4/0330-dt-bindings-Add-binding-docs-for-V3D.patch b/target/linux/brcm2708/patches-4.4/0330-dt-bindings-Add-binding-docs-for-V3D.patch new file mode 100644 index 0000000000..cb1fae5deb --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0330-dt-bindings-Add-binding-docs-for-V3D.patch @@ -0,0 +1,42 @@ +From eb2044830badaa2cc277e21920c4d401dde554cd Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 4 Mar 2016 12:32:06 -0800 +Subject: [PATCH] dt-bindings: Add binding docs for V3D. + +This was missed in the upstreaming process. + +Signed-off-by: Eric Anholt +Acked-by: Stephen Warren +(cherry picked from commit 4653f22e9ab08b2b7178b7262a9326eb777e0266) +--- + Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt ++++ b/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt +@@ -35,6 +35,12 @@ Optional properties for HDMI: + as an interrupt/status bit in the HDMI controller + itself). See bindings/pinctrl/brcm,bcm2835-gpio.txt + ++Required properties for V3D: ++- compatible: Should be "brcm,bcm2835-v3d" ++- reg: Physical base address and length of the V3D's registers ++- interrupts: The interrupt number ++ See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt ++ + Example: + pixelvalve@7e807000 { + compatible = "brcm,bcm2835-pixelvalve2"; +@@ -60,6 +66,12 @@ hdmi: hdmi@7e902000 { + clock-names = "pixel", "hdmi"; + }; + ++v3d: v3d@7ec00000 { ++ compatible = "brcm,bcm2835-v3d"; ++ reg = <0x7ec00000 0x1000>; ++ interrupts = <1 10>; ++}; ++ + vc4: gpu { + compatible = "brcm,bcm2835-vc4"; + }; diff --git a/target/linux/brcm2708/patches-4.4/0331-drm-vc4-Add-DPI-driver.patch b/target/linux/brcm2708/patches-4.4/0331-drm-vc4-Add-DPI-driver.patch new file mode 100644 index 0000000000..671c9b2308 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0331-drm-vc4-Add-DPI-driver.patch @@ -0,0 +1,673 @@ +From fe826daeea975dcf3ce3fca6e8a0850e5761f602 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 10 Feb 2016 11:42:32 -0800 +Subject: [PATCH] drm/vc4: Add DPI driver + +The DPI interface involves taking a ton of our GPIOs to be used as +outputs, and routing display signals over them in parallel. + +v2: Use display_info.bus_formats[] to replace our custom DT + properties. +v3: Rebase on V3D documentation changes. +v4: Fix rebase detritus from V3D documentation changes. + +Signed-off-by: Eric Anholt +Acked-by: Rob Herring +(cherry picked from commit 08302c35b59d306ff37b996e56fb2a488c1d2c2e) +--- + .../devicetree/bindings/display/brcm,bcm-vc4.txt | 36 ++ + drivers/gpu/drm/vc4/Kconfig | 1 + + drivers/gpu/drm/vc4/Makefile | 1 + + drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + + drivers/gpu/drm/vc4/vc4_dpi.c | 520 +++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_drv.h | 5 + + 7 files changed, 565 insertions(+) + create mode 100644 drivers/gpu/drm/vc4/vc4_dpi.c + +--- a/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt ++++ b/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt +@@ -35,12 +35,22 @@ Optional properties for HDMI: + as an interrupt/status bit in the HDMI controller + itself). See bindings/pinctrl/brcm,bcm2835-gpio.txt + ++Required properties for DPI: ++- compatible: Should be "brcm,bcm2835-dpi" ++- reg: Physical base address and length of the registers ++- clocks: a) core: The core clock the unit runs on ++ b) pixel: The pixel clock that feeds the pixelvalve ++- port: Port node with a single endpoint connecting to the panel ++ device, as defined in [1] ++ + Required properties for V3D: + - compatible: Should be "brcm,bcm2835-v3d" + - reg: Physical base address and length of the V3D's registers + - interrupts: The interrupt number + See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt + ++[1] Documentation/devicetree/bindings/media/video-interfaces.txt ++ + Example: + pixelvalve@7e807000 { + compatible = "brcm,bcm2835-pixelvalve2"; +@@ -66,6 +76,22 @@ hdmi: hdmi@7e902000 { + clock-names = "pixel", "hdmi"; + }; + ++dpi: dpi@7e208000 { ++ compatible = "brcm,bcm2835-dpi"; ++ reg = <0x7e208000 0x8c>; ++ clocks = <&clocks BCM2835_CLOCK_VPU>, ++ <&clocks BCM2835_CLOCK_DPI>; ++ clock-names = "core", "pixel"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port { ++ dpi_out: endpoint@0 { ++ remote-endpoint = <&panel_in>; ++ }; ++ }; ++}; ++ + v3d: v3d@7ec00000 { + compatible = "brcm,bcm2835-v3d"; + reg = <0x7ec00000 0x1000>; +@@ -75,3 +101,13 @@ v3d: v3d@7ec00000 { + vc4: gpu { + compatible = "brcm,bcm2835-vc4"; + }; ++ ++panel: panel { ++ compatible = "ontat,yx700wv03", "simple-panel"; ++ ++ port { ++ panel_in: endpoint { ++ remote-endpoint = <&dpi_out>; ++ }; ++ }; ++}; +--- a/drivers/gpu/drm/vc4/Kconfig ++++ b/drivers/gpu/drm/vc4/Kconfig +@@ -5,6 +5,7 @@ config DRM_VC4 + select DRM_KMS_HELPER + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER ++ select DRM_PANEL + help + Choose this option if you have a system that has a Broadcom + VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835. +--- a/drivers/gpu/drm/vc4/Makefile ++++ b/drivers/gpu/drm/vc4/Makefile +@@ -7,6 +7,7 @@ vc4-y := \ + vc4_bo.o \ + vc4_crtc.o \ + vc4_drv.o \ ++ vc4_dpi.o \ + vc4_kms.o \ + vc4_gem.o \ + vc4_hdmi.o \ +--- a/drivers/gpu/drm/vc4/vc4_debugfs.c ++++ b/drivers/gpu/drm/vc4/vc4_debugfs.c +@@ -17,6 +17,7 @@ + + static const struct drm_info_list vc4_debugfs_list[] = { + {"bo_stats", vc4_bo_stats_debugfs, 0}, ++ {"dpi_regs", vc4_dpi_debugfs_regs, 0}, + {"gem_exec", vc4_gem_exec_debugfs, 0}, + {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, + {"hvs_regs", vc4_hvs_debugfs_regs, 0}, +--- /dev/null ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -0,0 +1,520 @@ ++/* ++ * Copyright (C) 2016 Broadcom Limited ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published by ++ * the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ++ * more details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program. If not, see . ++ */ ++ ++/** ++ * DOC: VC4 DPI module ++ * ++ * The VC4 DPI hardware supports MIPI DPI type 4 and Nokia ViSSI ++ * signals, which are routed out to GPIO0-27 with the ALT2 function. ++ */ ++ ++#include "drm_atomic_helper.h" ++#include "drm_crtc_helper.h" ++#include "drm_edid.h" ++#include "drm_panel.h" ++#include "linux/clk.h" ++#include "linux/component.h" ++#include "linux/of_graph.h" ++#include "linux/of_platform.h" ++#include "vc4_drv.h" ++#include "vc4_regs.h" ++ ++#define DPI_C 0x00 ++# define DPI_OUTPUT_ENABLE_MODE BIT(16) ++ ++/* The order field takes the incoming 24 bit RGB from the pixel valve ++ * and shuffles the 3 channels. ++ */ ++# define DPI_ORDER_MASK VC4_MASK(15, 14) ++# define DPI_ORDER_SHIFT 14 ++# define DPI_ORDER_RGB 0 ++# define DPI_ORDER_BGR 1 ++# define DPI_ORDER_GRB 2 ++# define DPI_ORDER_BRG 3 ++ ++/* The format field takes the ORDER-shuffled pixel valve data and ++ * formats it onto the output lines. ++ */ ++# define DPI_FORMAT_MASK VC4_MASK(13, 11) ++# define DPI_FORMAT_SHIFT 11 ++/* This define is named in the hardware, but actually just outputs 0. */ ++# define DPI_FORMAT_9BIT_666_RGB 0 ++/* Outputs 00000000rrrrrggggggbbbbb */ ++# define DPI_FORMAT_16BIT_565_RGB_1 1 ++/* Outputs 000rrrrr00gggggg000bbbbb */ ++# define DPI_FORMAT_16BIT_565_RGB_2 2 ++/* Outputs 00rrrrr000gggggg00bbbbb0 */ ++# define DPI_FORMAT_16BIT_565_RGB_3 3 ++/* Outputs 000000rrrrrrggggggbbbbbb */ ++# define DPI_FORMAT_18BIT_666_RGB_1 4 ++/* Outputs 00rrrrrr00gggggg00bbbbbb */ ++# define DPI_FORMAT_18BIT_666_RGB_2 5 ++/* Outputs rrrrrrrrggggggggbbbbbbbb */ ++# define DPI_FORMAT_24BIT_888_RGB 6 ++ ++/* Reverses the polarity of the corresponding signal */ ++# define DPI_PIXEL_CLK_INVERT BIT(10) ++# define DPI_HSYNC_INVERT BIT(9) ++# define DPI_VSYNC_INVERT BIT(8) ++# define DPI_OUTPUT_ENABLE_INVERT BIT(7) ++ ++/* Outputs the signal the falling clock edge instead of rising. */ ++# define DPI_HSYNC_NEGATE BIT(6) ++# define DPI_VSYNC_NEGATE BIT(5) ++# define DPI_OUTPUT_ENABLE_NEGATE BIT(4) ++ ++/* Disables the signal */ ++# define DPI_HSYNC_DISABLE BIT(3) ++# define DPI_VSYNC_DISABLE BIT(2) ++# define DPI_OUTPUT_ENABLE_DISABLE BIT(1) ++ ++/* Power gate to the device, full reset at 0 -> 1 transition */ ++# define DPI_ENABLE BIT(0) ++ ++/* All other registers besides DPI_C return the ID */ ++#define DPI_ID 0x04 ++# define DPI_ID_VALUE 0x00647069 ++ ++/* General DPI hardware state. */ ++struct vc4_dpi { ++ struct platform_device *pdev; ++ ++ struct drm_encoder *encoder; ++ struct drm_connector *connector; ++ struct drm_panel *panel; ++ ++ void __iomem *regs; ++ ++ struct clk *pixel_clock; ++ struct clk *core_clock; ++}; ++ ++#define DPI_READ(offset) readl(dpi->regs + (offset)) ++#define DPI_WRITE(offset, val) writel(val, dpi->regs + (offset)) ++ ++/* VC4 DPI encoder KMS struct */ ++struct vc4_dpi_encoder { ++ struct vc4_encoder base; ++ struct vc4_dpi *dpi; ++}; ++ ++static inline struct vc4_dpi_encoder * ++to_vc4_dpi_encoder(struct drm_encoder *encoder) ++{ ++ return container_of(encoder, struct vc4_dpi_encoder, base.base); ++} ++ ++/* VC4 DPI connector KMS struct */ ++struct vc4_dpi_connector { ++ struct drm_connector base; ++ struct vc4_dpi *dpi; ++ ++ /* Since the connector is attached to just the one encoder, ++ * this is the reference to it so we can do the best_encoder() ++ * hook. ++ */ ++ struct drm_encoder *encoder; ++}; ++ ++static inline struct vc4_dpi_connector * ++to_vc4_dpi_connector(struct drm_connector *connector) ++{ ++ return container_of(connector, struct vc4_dpi_connector, base); ++} ++ ++#define DPI_REG(reg) { reg, #reg } ++static const struct { ++ u32 reg; ++ const char *name; ++} dpi_regs[] = { ++ DPI_REG(DPI_C), ++ DPI_REG(DPI_ID), ++}; ++ ++static void vc4_dpi_dump_regs(struct vc4_dpi *dpi) ++{ ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(dpi_regs); i++) { ++ DRM_INFO("0x%04x (%s): 0x%08x\n", ++ dpi_regs[i].reg, dpi_regs[i].name, ++ DPI_READ(dpi_regs[i].reg)); ++ } ++} ++ ++#ifdef CONFIG_DEBUG_FS ++int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused) ++{ ++ struct drm_info_node *node = (struct drm_info_node *)m->private; ++ struct drm_device *dev = node->minor->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct vc4_dpi *dpi = vc4->dpi; ++ int i; ++ ++ if (!dpi) ++ return 0; ++ ++ for (i = 0; i < ARRAY_SIZE(dpi_regs); i++) { ++ seq_printf(m, "%s (0x%04x): 0x%08x\n", ++ dpi_regs[i].name, dpi_regs[i].reg, ++ DPI_READ(dpi_regs[i].reg)); ++ } ++ ++ return 0; ++} ++#endif ++ ++static enum drm_connector_status ++vc4_dpi_connector_detect(struct drm_connector *connector, bool force) ++{ ++ struct vc4_dpi_connector *vc4_connector = ++ to_vc4_dpi_connector(connector); ++ struct vc4_dpi *dpi = vc4_connector->dpi; ++ ++ if (dpi->panel) ++ return connector_status_connected; ++ else ++ return connector_status_disconnected; ++} ++ ++static void vc4_dpi_connector_destroy(struct drm_connector *connector) ++{ ++ drm_connector_unregister(connector); ++ drm_connector_cleanup(connector); ++} ++ ++static int vc4_dpi_connector_get_modes(struct drm_connector *connector) ++{ ++ struct vc4_dpi_connector *vc4_connector = ++ to_vc4_dpi_connector(connector); ++ struct vc4_dpi *dpi = vc4_connector->dpi; ++ ++ if (dpi->panel) ++ return drm_panel_get_modes(dpi->panel); ++ ++ return 0; ++} ++ ++static struct drm_encoder * ++vc4_dpi_connector_best_encoder(struct drm_connector *connector) ++{ ++ struct vc4_dpi_connector *dpi_connector = ++ to_vc4_dpi_connector(connector); ++ return dpi_connector->encoder; ++} ++ ++static const struct drm_connector_funcs vc4_dpi_connector_funcs = { ++ .dpms = drm_atomic_helper_connector_dpms, ++ .detect = vc4_dpi_connector_detect, ++ .fill_modes = drm_helper_probe_single_connector_modes, ++ .destroy = vc4_dpi_connector_destroy, ++ .reset = drm_atomic_helper_connector_reset, ++ .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, ++}; ++ ++static const struct drm_connector_helper_funcs vc4_dpi_connector_helper_funcs = { ++ .get_modes = vc4_dpi_connector_get_modes, ++ .best_encoder = vc4_dpi_connector_best_encoder, ++}; ++ ++static struct drm_connector *vc4_dpi_connector_init(struct drm_device *dev, ++ struct vc4_dpi *dpi) ++{ ++ struct drm_connector *connector = NULL; ++ struct vc4_dpi_connector *dpi_connector; ++ int ret = 0; ++ ++ dpi_connector = devm_kzalloc(dev->dev, sizeof(*dpi_connector), ++ GFP_KERNEL); ++ if (!dpi_connector) { ++ ret = -ENOMEM; ++ goto fail; ++ } ++ connector = &dpi_connector->base; ++ ++ dpi_connector->encoder = dpi->encoder; ++ dpi_connector->dpi = dpi; ++ ++ drm_connector_init(dev, connector, &vc4_dpi_connector_funcs, ++ DRM_MODE_CONNECTOR_DPI); ++ drm_connector_helper_add(connector, &vc4_dpi_connector_helper_funcs); ++ ++ connector->polled = 0; ++ connector->interlace_allowed = 0; ++ connector->doublescan_allowed = 0; ++ ++ drm_mode_connector_attach_encoder(connector, dpi->encoder); ++ ++ return connector; ++ ++ fail: ++ if (connector) ++ vc4_dpi_connector_destroy(connector); ++ ++ return ERR_PTR(ret); ++} ++ ++static const struct drm_encoder_funcs vc4_dpi_encoder_funcs = { ++ .destroy = drm_encoder_cleanup, ++}; ++ ++static void vc4_dpi_encoder_disable(struct drm_encoder *encoder) ++{ ++ struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); ++ struct vc4_dpi *dpi = vc4_encoder->dpi; ++ ++ drm_panel_disable(dpi->panel); ++ ++ clk_disable_unprepare(dpi->pixel_clock); ++ ++ drm_panel_unprepare(dpi->panel); ++} ++ ++static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) ++{ ++ struct drm_display_mode *mode = &encoder->crtc->mode; ++ struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); ++ struct vc4_dpi *dpi = vc4_encoder->dpi; ++ u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE; ++ int ret; ++ ++ ret = drm_panel_prepare(dpi->panel); ++ if (ret) { ++ DRM_ERROR("Panel failed to prepare\n"); ++ return; ++ } ++ ++ if (dpi->connector->display_info.num_bus_formats) { ++ u32 bus_format = dpi->connector->display_info.bus_formats[0]; ++ ++ switch (bus_format) { ++ case MEDIA_BUS_FMT_RGB888_1X24: ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, ++ DPI_FORMAT); ++ break; ++ case MEDIA_BUS_FMT_BGR888_1X24: ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, ++ DPI_FORMAT); ++ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); ++ break; ++ case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, ++ DPI_FORMAT); ++ break; ++ case MEDIA_BUS_FMT_RGB666_1X18: ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, ++ DPI_FORMAT); ++ break; ++ case MEDIA_BUS_FMT_RGB565_1X16: ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, ++ DPI_FORMAT); ++ break; ++ default: ++ DRM_ERROR("Unknown media bus format %d\n", bus_format); ++ break; ++ } ++ } ++ ++ if (mode->flags & DRM_MODE_FLAG_NHSYNC) ++ dpi_c |= DPI_HSYNC_INVERT; ++ else if (!(mode->flags & DRM_MODE_FLAG_PHSYNC)) ++ dpi_c |= DPI_HSYNC_DISABLE; ++ ++ if (mode->flags & DRM_MODE_FLAG_NVSYNC) ++ dpi_c |= DPI_VSYNC_INVERT; ++ else if (!(mode->flags & DRM_MODE_FLAG_PVSYNC)) ++ dpi_c |= DPI_VSYNC_DISABLE; ++ ++ DPI_WRITE(DPI_C, dpi_c); ++ ++ ret = clk_set_rate(dpi->pixel_clock, mode->clock * 1000); ++ if (ret) ++ DRM_ERROR("Failed to set clock rate: %d\n", ret); ++ ++ ret = clk_prepare_enable(dpi->pixel_clock); ++ if (ret) ++ DRM_ERROR("Failed to set clock rate: %d\n", ret); ++ ++ ret = drm_panel_enable(dpi->panel); ++ if (ret) { ++ DRM_ERROR("Panel failed to enable\n"); ++ drm_panel_unprepare(dpi->panel); ++ return; ++ } ++} ++ ++static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { ++ .disable = vc4_dpi_encoder_disable, ++ .enable = vc4_dpi_encoder_enable, ++}; ++ ++static const struct of_device_id vc4_dpi_dt_match[] = { ++ { .compatible = "brcm,bcm2835-dpi", .data = NULL }, ++ {} ++}; ++ ++/* Walks the OF graph to find the panel node and then asks DRM to look ++ * up the panel. ++ */ ++static struct drm_panel *vc4_dpi_get_panel(struct device *dev) ++{ ++ struct device_node *endpoint, *panel_node; ++ struct device_node *np = dev->of_node; ++ struct drm_panel *panel; ++ ++ endpoint = of_graph_get_next_endpoint(np, NULL); ++ if (!endpoint) { ++ dev_err(dev, "no endpoint to fetch DPI panel\n"); ++ return NULL; ++ } ++ ++ /* don't proceed if we have an endpoint but no panel_node tied to it */ ++ panel_node = of_graph_get_remote_port_parent(endpoint); ++ of_node_put(endpoint); ++ if (!panel_node) { ++ dev_err(dev, "no valid panel node\n"); ++ return NULL; ++ } ++ ++ panel = of_drm_find_panel(panel_node); ++ of_node_put(panel_node); ++ ++ return panel; ++} ++ ++static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct drm_device *drm = dev_get_drvdata(master); ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_dpi *dpi; ++ struct vc4_dpi_encoder *vc4_dpi_encoder; ++ int ret; ++ ++ dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL); ++ if (!dpi) ++ return -ENOMEM; ++ ++ vc4_dpi_encoder = devm_kzalloc(dev, sizeof(*vc4_dpi_encoder), ++ GFP_KERNEL); ++ if (!vc4_dpi_encoder) ++ return -ENOMEM; ++ vc4_dpi_encoder->base.type = VC4_ENCODER_TYPE_DPI; ++ vc4_dpi_encoder->dpi = dpi; ++ dpi->encoder = &vc4_dpi_encoder->base.base; ++ ++ dpi->pdev = pdev; ++ dpi->regs = vc4_ioremap_regs(pdev, 0); ++ if (IS_ERR(dpi->regs)) ++ return PTR_ERR(dpi->regs); ++ ++ vc4_dpi_dump_regs(dpi); ++ ++ if (DPI_READ(DPI_ID) != DPI_ID_VALUE) { ++ dev_err(dev, "Port returned 0x%08x for ID instead of 0x%08x\n", ++ DPI_READ(DPI_ID), DPI_ID_VALUE); ++ return -ENODEV; ++ } ++ ++ dpi->core_clock = devm_clk_get(dev, "core"); ++ if (IS_ERR(dpi->core_clock)) { ++ ret = PTR_ERR(dpi->core_clock); ++ if (ret != -EPROBE_DEFER) ++ DRM_ERROR("Failed to get core clock: %d\n", ret); ++ return ret; ++ } ++ dpi->pixel_clock = devm_clk_get(dev, "pixel"); ++ if (IS_ERR(dpi->pixel_clock)) { ++ ret = PTR_ERR(dpi->pixel_clock); ++ if (ret != -EPROBE_DEFER) ++ DRM_ERROR("Failed to get pixel clock: %d\n", ret); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(dpi->core_clock); ++ if (ret) ++ DRM_ERROR("Failed to turn on core clock: %d\n", ret); ++ ++ dpi->panel = vc4_dpi_get_panel(dev); ++ ++ drm_encoder_init(drm, dpi->encoder, &vc4_dpi_encoder_funcs, ++ DRM_MODE_ENCODER_DPI); ++ drm_encoder_helper_add(dpi->encoder, &vc4_dpi_encoder_helper_funcs); ++ ++ dpi->connector = vc4_dpi_connector_init(drm, dpi); ++ if (IS_ERR(dpi->connector)) { ++ ret = PTR_ERR(dpi->connector); ++ goto err_destroy_encoder; ++ } ++ ++ if (dpi->panel) ++ drm_panel_attach(dpi->panel, dpi->connector); ++ ++ dev_set_drvdata(dev, dpi); ++ ++ vc4->dpi = dpi; ++ ++ return 0; ++ ++err_destroy_encoder: ++ drm_encoder_cleanup(dpi->encoder); ++ clk_disable_unprepare(dpi->core_clock); ++ return ret; ++} ++ ++static void vc4_dpi_unbind(struct device *dev, struct device *master, ++ void *data) ++{ ++ struct drm_device *drm = dev_get_drvdata(master); ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_dpi *dpi = dev_get_drvdata(dev); ++ ++ if (dpi->panel) ++ drm_panel_detach(dpi->panel); ++ ++ vc4_dpi_connector_destroy(dpi->connector); ++ drm_encoder_cleanup(dpi->encoder); ++ ++ clk_disable_unprepare(dpi->core_clock); ++ ++ vc4->dpi = NULL; ++} ++ ++static const struct component_ops vc4_dpi_ops = { ++ .bind = vc4_dpi_bind, ++ .unbind = vc4_dpi_unbind, ++}; ++ ++static int vc4_dpi_dev_probe(struct platform_device *pdev) ++{ ++ return component_add(&pdev->dev, &vc4_dpi_ops); ++} ++ ++static int vc4_dpi_dev_remove(struct platform_device *pdev) ++{ ++ component_del(&pdev->dev, &vc4_dpi_ops); ++ return 0; ++} ++ ++struct platform_driver vc4_dpi_driver = { ++ .probe = vc4_dpi_dev_probe, ++ .remove = vc4_dpi_dev_remove, ++ .driver = { ++ .name = "vc4_dpi", ++ .of_match_table = vc4_dpi_dt_match, ++ }, ++}; +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -259,6 +259,7 @@ static const struct component_master_ops + + static struct platform_driver *const component_drivers[] = { + &vc4_hdmi_driver, ++ &vc4_dpi_driver, + &vc4_crtc_driver, + &vc4_hvs_driver, + &vc4_v3d_driver, +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -16,6 +16,7 @@ struct vc4_dev { + struct vc4_hvs *hvs; + struct vc4_crtc *crtc[3]; + struct vc4_v3d *v3d; ++ struct vc4_dpi *dpi; + + struct drm_fbdev_cma *fbdev; + struct rpi_firmware *firmware; +@@ -418,6 +419,10 @@ void vc4_debugfs_cleanup(struct drm_mino + /* vc4_drv.c */ + void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); + ++/* vc4_dpi.c */ ++extern struct platform_driver vc4_dpi_driver; ++int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); ++ + /* vc4_gem.c */ + void vc4_gem_init(struct drm_device *dev); + void vc4_gem_destroy(struct drm_device *dev); diff --git a/target/linux/brcm2708/patches-4.4/0331-dt-bindings-Add-binding-docs-for-V3D.patch b/target/linux/brcm2708/patches-4.4/0331-dt-bindings-Add-binding-docs-for-V3D.patch deleted file mode 100644 index c46c8432db..0000000000 --- a/target/linux/brcm2708/patches-4.4/0331-dt-bindings-Add-binding-docs-for-V3D.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f0be0cb1bc970ddc67e9194d4d6ca5a3a18cd903 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 4 Mar 2016 12:32:06 -0800 -Subject: [PATCH 331/423] dt-bindings: Add binding docs for V3D. - -This was missed in the upstreaming process. - -Signed-off-by: Eric Anholt -Acked-by: Stephen Warren -(cherry picked from commit 4653f22e9ab08b2b7178b7262a9326eb777e0266) ---- - Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt -+++ b/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt -@@ -35,6 +35,12 @@ Optional properties for HDMI: - as an interrupt/status bit in the HDMI controller - itself). See bindings/pinctrl/brcm,bcm2835-gpio.txt - -+Required properties for V3D: -+- compatible: Should be "brcm,bcm2835-v3d" -+- reg: Physical base address and length of the V3D's registers -+- interrupts: The interrupt number -+ See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt -+ - Example: - pixelvalve@7e807000 { - compatible = "brcm,bcm2835-pixelvalve2"; -@@ -60,6 +66,12 @@ hdmi: hdmi@7e902000 { - clock-names = "pixel", "hdmi"; - }; - -+v3d: v3d@7ec00000 { -+ compatible = "brcm,bcm2835-v3d"; -+ reg = <0x7ec00000 0x1000>; -+ interrupts = <1 10>; -+}; -+ - vc4: gpu { - compatible = "brcm,bcm2835-vc4"; - }; diff --git a/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Add-DPI-driver.patch b/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Add-DPI-driver.patch deleted file mode 100644 index d05c27ecc7..0000000000 --- a/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Add-DPI-driver.patch +++ /dev/null @@ -1,673 +0,0 @@ -From dca9cac2b454a88889adc7befac74090612576ef Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 10 Feb 2016 11:42:32 -0800 -Subject: [PATCH 332/423] drm/vc4: Add DPI driver - -The DPI interface involves taking a ton of our GPIOs to be used as -outputs, and routing display signals over them in parallel. - -v2: Use display_info.bus_formats[] to replace our custom DT - properties. -v3: Rebase on V3D documentation changes. -v4: Fix rebase detritus from V3D documentation changes. - -Signed-off-by: Eric Anholt -Acked-by: Rob Herring -(cherry picked from commit 08302c35b59d306ff37b996e56fb2a488c1d2c2e) ---- - .../devicetree/bindings/display/brcm,bcm-vc4.txt | 36 ++ - drivers/gpu/drm/vc4/Kconfig | 1 + - drivers/gpu/drm/vc4/Makefile | 1 + - drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + - drivers/gpu/drm/vc4/vc4_dpi.c | 520 +++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_drv.c | 1 + - drivers/gpu/drm/vc4/vc4_drv.h | 5 + - 7 files changed, 565 insertions(+) - create mode 100644 drivers/gpu/drm/vc4/vc4_dpi.c - ---- a/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt -+++ b/Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt -@@ -35,12 +35,22 @@ Optional properties for HDMI: - as an interrupt/status bit in the HDMI controller - itself). See bindings/pinctrl/brcm,bcm2835-gpio.txt - -+Required properties for DPI: -+- compatible: Should be "brcm,bcm2835-dpi" -+- reg: Physical base address and length of the registers -+- clocks: a) core: The core clock the unit runs on -+ b) pixel: The pixel clock that feeds the pixelvalve -+- port: Port node with a single endpoint connecting to the panel -+ device, as defined in [1] -+ - Required properties for V3D: - - compatible: Should be "brcm,bcm2835-v3d" - - reg: Physical base address and length of the V3D's registers - - interrupts: The interrupt number - See bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt - -+[1] Documentation/devicetree/bindings/media/video-interfaces.txt -+ - Example: - pixelvalve@7e807000 { - compatible = "brcm,bcm2835-pixelvalve2"; -@@ -66,6 +76,22 @@ hdmi: hdmi@7e902000 { - clock-names = "pixel", "hdmi"; - }; - -+dpi: dpi@7e208000 { -+ compatible = "brcm,bcm2835-dpi"; -+ reg = <0x7e208000 0x8c>; -+ clocks = <&clocks BCM2835_CLOCK_VPU>, -+ <&clocks BCM2835_CLOCK_DPI>; -+ clock-names = "core", "pixel"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port { -+ dpi_out: endpoint@0 { -+ remote-endpoint = <&panel_in>; -+ }; -+ }; -+}; -+ - v3d: v3d@7ec00000 { - compatible = "brcm,bcm2835-v3d"; - reg = <0x7ec00000 0x1000>; -@@ -75,3 +101,13 @@ v3d: v3d@7ec00000 { - vc4: gpu { - compatible = "brcm,bcm2835-vc4"; - }; -+ -+panel: panel { -+ compatible = "ontat,yx700wv03", "simple-panel"; -+ -+ port { -+ panel_in: endpoint { -+ remote-endpoint = <&dpi_out>; -+ }; -+ }; -+}; ---- a/drivers/gpu/drm/vc4/Kconfig -+++ b/drivers/gpu/drm/vc4/Kconfig -@@ -5,6 +5,7 @@ config DRM_VC4 - select DRM_KMS_HELPER - select DRM_KMS_CMA_HELPER - select DRM_GEM_CMA_HELPER -+ select DRM_PANEL - help - Choose this option if you have a system that has a Broadcom - VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835. ---- a/drivers/gpu/drm/vc4/Makefile -+++ b/drivers/gpu/drm/vc4/Makefile -@@ -7,6 +7,7 @@ vc4-y := \ - vc4_bo.o \ - vc4_crtc.o \ - vc4_drv.o \ -+ vc4_dpi.o \ - vc4_kms.o \ - vc4_gem.o \ - vc4_hdmi.o \ ---- a/drivers/gpu/drm/vc4/vc4_debugfs.c -+++ b/drivers/gpu/drm/vc4/vc4_debugfs.c -@@ -17,6 +17,7 @@ - - static const struct drm_info_list vc4_debugfs_list[] = { - {"bo_stats", vc4_bo_stats_debugfs, 0}, -+ {"dpi_regs", vc4_dpi_debugfs_regs, 0}, - {"gem_exec", vc4_gem_exec_debugfs, 0}, - {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, - {"hvs_regs", vc4_hvs_debugfs_regs, 0}, ---- /dev/null -+++ b/drivers/gpu/drm/vc4/vc4_dpi.c -@@ -0,0 +1,520 @@ -+/* -+ * Copyright (C) 2016 Broadcom Limited -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published by -+ * the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -+ * more details. -+ * -+ * You should have received a copy of the GNU General Public License along with -+ * this program. If not, see . -+ */ -+ -+/** -+ * DOC: VC4 DPI module -+ * -+ * The VC4 DPI hardware supports MIPI DPI type 4 and Nokia ViSSI -+ * signals, which are routed out to GPIO0-27 with the ALT2 function. -+ */ -+ -+#include "drm_atomic_helper.h" -+#include "drm_crtc_helper.h" -+#include "drm_edid.h" -+#include "drm_panel.h" -+#include "linux/clk.h" -+#include "linux/component.h" -+#include "linux/of_graph.h" -+#include "linux/of_platform.h" -+#include "vc4_drv.h" -+#include "vc4_regs.h" -+ -+#define DPI_C 0x00 -+# define DPI_OUTPUT_ENABLE_MODE BIT(16) -+ -+/* The order field takes the incoming 24 bit RGB from the pixel valve -+ * and shuffles the 3 channels. -+ */ -+# define DPI_ORDER_MASK VC4_MASK(15, 14) -+# define DPI_ORDER_SHIFT 14 -+# define DPI_ORDER_RGB 0 -+# define DPI_ORDER_BGR 1 -+# define DPI_ORDER_GRB 2 -+# define DPI_ORDER_BRG 3 -+ -+/* The format field takes the ORDER-shuffled pixel valve data and -+ * formats it onto the output lines. -+ */ -+# define DPI_FORMAT_MASK VC4_MASK(13, 11) -+# define DPI_FORMAT_SHIFT 11 -+/* This define is named in the hardware, but actually just outputs 0. */ -+# define DPI_FORMAT_9BIT_666_RGB 0 -+/* Outputs 00000000rrrrrggggggbbbbb */ -+# define DPI_FORMAT_16BIT_565_RGB_1 1 -+/* Outputs 000rrrrr00gggggg000bbbbb */ -+# define DPI_FORMAT_16BIT_565_RGB_2 2 -+/* Outputs 00rrrrr000gggggg00bbbbb0 */ -+# define DPI_FORMAT_16BIT_565_RGB_3 3 -+/* Outputs 000000rrrrrrggggggbbbbbb */ -+# define DPI_FORMAT_18BIT_666_RGB_1 4 -+/* Outputs 00rrrrrr00gggggg00bbbbbb */ -+# define DPI_FORMAT_18BIT_666_RGB_2 5 -+/* Outputs rrrrrrrrggggggggbbbbbbbb */ -+# define DPI_FORMAT_24BIT_888_RGB 6 -+ -+/* Reverses the polarity of the corresponding signal */ -+# define DPI_PIXEL_CLK_INVERT BIT(10) -+# define DPI_HSYNC_INVERT BIT(9) -+# define DPI_VSYNC_INVERT BIT(8) -+# define DPI_OUTPUT_ENABLE_INVERT BIT(7) -+ -+/* Outputs the signal the falling clock edge instead of rising. */ -+# define DPI_HSYNC_NEGATE BIT(6) -+# define DPI_VSYNC_NEGATE BIT(5) -+# define DPI_OUTPUT_ENABLE_NEGATE BIT(4) -+ -+/* Disables the signal */ -+# define DPI_HSYNC_DISABLE BIT(3) -+# define DPI_VSYNC_DISABLE BIT(2) -+# define DPI_OUTPUT_ENABLE_DISABLE BIT(1) -+ -+/* Power gate to the device, full reset at 0 -> 1 transition */ -+# define DPI_ENABLE BIT(0) -+ -+/* All other registers besides DPI_C return the ID */ -+#define DPI_ID 0x04 -+# define DPI_ID_VALUE 0x00647069 -+ -+/* General DPI hardware state. */ -+struct vc4_dpi { -+ struct platform_device *pdev; -+ -+ struct drm_encoder *encoder; -+ struct drm_connector *connector; -+ struct drm_panel *panel; -+ -+ void __iomem *regs; -+ -+ struct clk *pixel_clock; -+ struct clk *core_clock; -+}; -+ -+#define DPI_READ(offset) readl(dpi->regs + (offset)) -+#define DPI_WRITE(offset, val) writel(val, dpi->regs + (offset)) -+ -+/* VC4 DPI encoder KMS struct */ -+struct vc4_dpi_encoder { -+ struct vc4_encoder base; -+ struct vc4_dpi *dpi; -+}; -+ -+static inline struct vc4_dpi_encoder * -+to_vc4_dpi_encoder(struct drm_encoder *encoder) -+{ -+ return container_of(encoder, struct vc4_dpi_encoder, base.base); -+} -+ -+/* VC4 DPI connector KMS struct */ -+struct vc4_dpi_connector { -+ struct drm_connector base; -+ struct vc4_dpi *dpi; -+ -+ /* Since the connector is attached to just the one encoder, -+ * this is the reference to it so we can do the best_encoder() -+ * hook. -+ */ -+ struct drm_encoder *encoder; -+}; -+ -+static inline struct vc4_dpi_connector * -+to_vc4_dpi_connector(struct drm_connector *connector) -+{ -+ return container_of(connector, struct vc4_dpi_connector, base); -+} -+ -+#define DPI_REG(reg) { reg, #reg } -+static const struct { -+ u32 reg; -+ const char *name; -+} dpi_regs[] = { -+ DPI_REG(DPI_C), -+ DPI_REG(DPI_ID), -+}; -+ -+static void vc4_dpi_dump_regs(struct vc4_dpi *dpi) -+{ -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(dpi_regs); i++) { -+ DRM_INFO("0x%04x (%s): 0x%08x\n", -+ dpi_regs[i].reg, dpi_regs[i].name, -+ DPI_READ(dpi_regs[i].reg)); -+ } -+} -+ -+#ifdef CONFIG_DEBUG_FS -+int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused) -+{ -+ struct drm_info_node *node = (struct drm_info_node *)m->private; -+ struct drm_device *dev = node->minor->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); -+ struct vc4_dpi *dpi = vc4->dpi; -+ int i; -+ -+ if (!dpi) -+ return 0; -+ -+ for (i = 0; i < ARRAY_SIZE(dpi_regs); i++) { -+ seq_printf(m, "%s (0x%04x): 0x%08x\n", -+ dpi_regs[i].name, dpi_regs[i].reg, -+ DPI_READ(dpi_regs[i].reg)); -+ } -+ -+ return 0; -+} -+#endif -+ -+static enum drm_connector_status -+vc4_dpi_connector_detect(struct drm_connector *connector, bool force) -+{ -+ struct vc4_dpi_connector *vc4_connector = -+ to_vc4_dpi_connector(connector); -+ struct vc4_dpi *dpi = vc4_connector->dpi; -+ -+ if (dpi->panel) -+ return connector_status_connected; -+ else -+ return connector_status_disconnected; -+} -+ -+static void vc4_dpi_connector_destroy(struct drm_connector *connector) -+{ -+ drm_connector_unregister(connector); -+ drm_connector_cleanup(connector); -+} -+ -+static int vc4_dpi_connector_get_modes(struct drm_connector *connector) -+{ -+ struct vc4_dpi_connector *vc4_connector = -+ to_vc4_dpi_connector(connector); -+ struct vc4_dpi *dpi = vc4_connector->dpi; -+ -+ if (dpi->panel) -+ return drm_panel_get_modes(dpi->panel); -+ -+ return 0; -+} -+ -+static struct drm_encoder * -+vc4_dpi_connector_best_encoder(struct drm_connector *connector) -+{ -+ struct vc4_dpi_connector *dpi_connector = -+ to_vc4_dpi_connector(connector); -+ return dpi_connector->encoder; -+} -+ -+static const struct drm_connector_funcs vc4_dpi_connector_funcs = { -+ .dpms = drm_atomic_helper_connector_dpms, -+ .detect = vc4_dpi_connector_detect, -+ .fill_modes = drm_helper_probe_single_connector_modes, -+ .destroy = vc4_dpi_connector_destroy, -+ .reset = drm_atomic_helper_connector_reset, -+ .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, -+ .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, -+}; -+ -+static const struct drm_connector_helper_funcs vc4_dpi_connector_helper_funcs = { -+ .get_modes = vc4_dpi_connector_get_modes, -+ .best_encoder = vc4_dpi_connector_best_encoder, -+}; -+ -+static struct drm_connector *vc4_dpi_connector_init(struct drm_device *dev, -+ struct vc4_dpi *dpi) -+{ -+ struct drm_connector *connector = NULL; -+ struct vc4_dpi_connector *dpi_connector; -+ int ret = 0; -+ -+ dpi_connector = devm_kzalloc(dev->dev, sizeof(*dpi_connector), -+ GFP_KERNEL); -+ if (!dpi_connector) { -+ ret = -ENOMEM; -+ goto fail; -+ } -+ connector = &dpi_connector->base; -+ -+ dpi_connector->encoder = dpi->encoder; -+ dpi_connector->dpi = dpi; -+ -+ drm_connector_init(dev, connector, &vc4_dpi_connector_funcs, -+ DRM_MODE_CONNECTOR_DPI); -+ drm_connector_helper_add(connector, &vc4_dpi_connector_helper_funcs); -+ -+ connector->polled = 0; -+ connector->interlace_allowed = 0; -+ connector->doublescan_allowed = 0; -+ -+ drm_mode_connector_attach_encoder(connector, dpi->encoder); -+ -+ return connector; -+ -+ fail: -+ if (connector) -+ vc4_dpi_connector_destroy(connector); -+ -+ return ERR_PTR(ret); -+} -+ -+static const struct drm_encoder_funcs vc4_dpi_encoder_funcs = { -+ .destroy = drm_encoder_cleanup, -+}; -+ -+static void vc4_dpi_encoder_disable(struct drm_encoder *encoder) -+{ -+ struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); -+ struct vc4_dpi *dpi = vc4_encoder->dpi; -+ -+ drm_panel_disable(dpi->panel); -+ -+ clk_disable_unprepare(dpi->pixel_clock); -+ -+ drm_panel_unprepare(dpi->panel); -+} -+ -+static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) -+{ -+ struct drm_display_mode *mode = &encoder->crtc->mode; -+ struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); -+ struct vc4_dpi *dpi = vc4_encoder->dpi; -+ u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE; -+ int ret; -+ -+ ret = drm_panel_prepare(dpi->panel); -+ if (ret) { -+ DRM_ERROR("Panel failed to prepare\n"); -+ return; -+ } -+ -+ if (dpi->connector->display_info.num_bus_formats) { -+ u32 bus_format = dpi->connector->display_info.bus_formats[0]; -+ -+ switch (bus_format) { -+ case MEDIA_BUS_FMT_RGB888_1X24: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -+ DPI_FORMAT); -+ break; -+ case MEDIA_BUS_FMT_BGR888_1X24: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -+ DPI_FORMAT); -+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); -+ break; -+ case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -+ DPI_FORMAT); -+ break; -+ case MEDIA_BUS_FMT_RGB666_1X18: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, -+ DPI_FORMAT); -+ break; -+ case MEDIA_BUS_FMT_RGB565_1X16: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, -+ DPI_FORMAT); -+ break; -+ default: -+ DRM_ERROR("Unknown media bus format %d\n", bus_format); -+ break; -+ } -+ } -+ -+ if (mode->flags & DRM_MODE_FLAG_NHSYNC) -+ dpi_c |= DPI_HSYNC_INVERT; -+ else if (!(mode->flags & DRM_MODE_FLAG_PHSYNC)) -+ dpi_c |= DPI_HSYNC_DISABLE; -+ -+ if (mode->flags & DRM_MODE_FLAG_NVSYNC) -+ dpi_c |= DPI_VSYNC_INVERT; -+ else if (!(mode->flags & DRM_MODE_FLAG_PVSYNC)) -+ dpi_c |= DPI_VSYNC_DISABLE; -+ -+ DPI_WRITE(DPI_C, dpi_c); -+ -+ ret = clk_set_rate(dpi->pixel_clock, mode->clock * 1000); -+ if (ret) -+ DRM_ERROR("Failed to set clock rate: %d\n", ret); -+ -+ ret = clk_prepare_enable(dpi->pixel_clock); -+ if (ret) -+ DRM_ERROR("Failed to set clock rate: %d\n", ret); -+ -+ ret = drm_panel_enable(dpi->panel); -+ if (ret) { -+ DRM_ERROR("Panel failed to enable\n"); -+ drm_panel_unprepare(dpi->panel); -+ return; -+ } -+} -+ -+static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { -+ .disable = vc4_dpi_encoder_disable, -+ .enable = vc4_dpi_encoder_enable, -+}; -+ -+static const struct of_device_id vc4_dpi_dt_match[] = { -+ { .compatible = "brcm,bcm2835-dpi", .data = NULL }, -+ {} -+}; -+ -+/* Walks the OF graph to find the panel node and then asks DRM to look -+ * up the panel. -+ */ -+static struct drm_panel *vc4_dpi_get_panel(struct device *dev) -+{ -+ struct device_node *endpoint, *panel_node; -+ struct device_node *np = dev->of_node; -+ struct drm_panel *panel; -+ -+ endpoint = of_graph_get_next_endpoint(np, NULL); -+ if (!endpoint) { -+ dev_err(dev, "no endpoint to fetch DPI panel\n"); -+ return NULL; -+ } -+ -+ /* don't proceed if we have an endpoint but no panel_node tied to it */ -+ panel_node = of_graph_get_remote_port_parent(endpoint); -+ of_node_put(endpoint); -+ if (!panel_node) { -+ dev_err(dev, "no valid panel node\n"); -+ return NULL; -+ } -+ -+ panel = of_drm_find_panel(panel_node); -+ of_node_put(panel_node); -+ -+ return panel; -+} -+ -+static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) -+{ -+ struct platform_device *pdev = to_platform_device(dev); -+ struct drm_device *drm = dev_get_drvdata(master); -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ struct vc4_dpi *dpi; -+ struct vc4_dpi_encoder *vc4_dpi_encoder; -+ int ret; -+ -+ dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL); -+ if (!dpi) -+ return -ENOMEM; -+ -+ vc4_dpi_encoder = devm_kzalloc(dev, sizeof(*vc4_dpi_encoder), -+ GFP_KERNEL); -+ if (!vc4_dpi_encoder) -+ return -ENOMEM; -+ vc4_dpi_encoder->base.type = VC4_ENCODER_TYPE_DPI; -+ vc4_dpi_encoder->dpi = dpi; -+ dpi->encoder = &vc4_dpi_encoder->base.base; -+ -+ dpi->pdev = pdev; -+ dpi->regs = vc4_ioremap_regs(pdev, 0); -+ if (IS_ERR(dpi->regs)) -+ return PTR_ERR(dpi->regs); -+ -+ vc4_dpi_dump_regs(dpi); -+ -+ if (DPI_READ(DPI_ID) != DPI_ID_VALUE) { -+ dev_err(dev, "Port returned 0x%08x for ID instead of 0x%08x\n", -+ DPI_READ(DPI_ID), DPI_ID_VALUE); -+ return -ENODEV; -+ } -+ -+ dpi->core_clock = devm_clk_get(dev, "core"); -+ if (IS_ERR(dpi->core_clock)) { -+ ret = PTR_ERR(dpi->core_clock); -+ if (ret != -EPROBE_DEFER) -+ DRM_ERROR("Failed to get core clock: %d\n", ret); -+ return ret; -+ } -+ dpi->pixel_clock = devm_clk_get(dev, "pixel"); -+ if (IS_ERR(dpi->pixel_clock)) { -+ ret = PTR_ERR(dpi->pixel_clock); -+ if (ret != -EPROBE_DEFER) -+ DRM_ERROR("Failed to get pixel clock: %d\n", ret); -+ return ret; -+ } -+ -+ ret = clk_prepare_enable(dpi->core_clock); -+ if (ret) -+ DRM_ERROR("Failed to turn on core clock: %d\n", ret); -+ -+ dpi->panel = vc4_dpi_get_panel(dev); -+ -+ drm_encoder_init(drm, dpi->encoder, &vc4_dpi_encoder_funcs, -+ DRM_MODE_ENCODER_DPI); -+ drm_encoder_helper_add(dpi->encoder, &vc4_dpi_encoder_helper_funcs); -+ -+ dpi->connector = vc4_dpi_connector_init(drm, dpi); -+ if (IS_ERR(dpi->connector)) { -+ ret = PTR_ERR(dpi->connector); -+ goto err_destroy_encoder; -+ } -+ -+ if (dpi->panel) -+ drm_panel_attach(dpi->panel, dpi->connector); -+ -+ dev_set_drvdata(dev, dpi); -+ -+ vc4->dpi = dpi; -+ -+ return 0; -+ -+err_destroy_encoder: -+ drm_encoder_cleanup(dpi->encoder); -+ clk_disable_unprepare(dpi->core_clock); -+ return ret; -+} -+ -+static void vc4_dpi_unbind(struct device *dev, struct device *master, -+ void *data) -+{ -+ struct drm_device *drm = dev_get_drvdata(master); -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ struct vc4_dpi *dpi = dev_get_drvdata(dev); -+ -+ if (dpi->panel) -+ drm_panel_detach(dpi->panel); -+ -+ vc4_dpi_connector_destroy(dpi->connector); -+ drm_encoder_cleanup(dpi->encoder); -+ -+ clk_disable_unprepare(dpi->core_clock); -+ -+ vc4->dpi = NULL; -+} -+ -+static const struct component_ops vc4_dpi_ops = { -+ .bind = vc4_dpi_bind, -+ .unbind = vc4_dpi_unbind, -+}; -+ -+static int vc4_dpi_dev_probe(struct platform_device *pdev) -+{ -+ return component_add(&pdev->dev, &vc4_dpi_ops); -+} -+ -+static int vc4_dpi_dev_remove(struct platform_device *pdev) -+{ -+ component_del(&pdev->dev, &vc4_dpi_ops); -+ return 0; -+} -+ -+struct platform_driver vc4_dpi_driver = { -+ .probe = vc4_dpi_dev_probe, -+ .remove = vc4_dpi_dev_remove, -+ .driver = { -+ .name = "vc4_dpi", -+ .of_match_table = vc4_dpi_dt_match, -+ }, -+}; ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -259,6 +259,7 @@ static const struct component_master_ops - - static struct platform_driver *const component_drivers[] = { - &vc4_hdmi_driver, -+ &vc4_dpi_driver, - &vc4_crtc_driver, - &vc4_hvs_driver, - &vc4_v3d_driver, ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -16,6 +16,7 @@ struct vc4_dev { - struct vc4_hvs *hvs; - struct vc4_crtc *crtc[3]; - struct vc4_v3d *v3d; -+ struct vc4_dpi *dpi; - - struct drm_fbdev_cma *fbdev; - struct rpi_firmware *firmware; -@@ -418,6 +419,10 @@ void vc4_debugfs_cleanup(struct drm_mino - /* vc4_drv.c */ - void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); - -+/* vc4_dpi.c */ -+extern struct platform_driver vc4_dpi_driver; -+int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); -+ - /* vc4_gem.c */ - void vc4_gem_init(struct drm_device *dev); - void vc4_gem_destroy(struct drm_device *dev); diff --git a/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch b/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch new file mode 100644 index 0000000000..e702146094 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0332-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch @@ -0,0 +1,25 @@ +From 69def03fa1b25514d142397748522e1f88b325cb Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 4 Apr 2016 14:25:59 -0700 +Subject: [PATCH] drm/vc4: Fix NULL deref in HDMI init error path + +If you make it here other than through err_destroy_encoder, vc4->hdmi +is still NULL. + +Signed-off-by: Eric Anholt +(cherry picked from commit 5883980313af70aec0ceebaef6ef0709726e5e63) +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -573,7 +573,7 @@ err_unprepare_hsm: + err_unprepare_pix: + clk_disable_unprepare(hdmi->pixel_clock); + err_put_i2c: +- put_device(&vc4->hdmi->ddc->dev); ++ put_device(&hdmi->ddc->dev); + + return ret; + } diff --git a/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch b/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch deleted file mode 100644 index cf7a647307..0000000000 --- a/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Fix-NULL-deref-in-HDMI-init-error-path.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1d72ad4fa3c57879ab677f66ce957a093eeb577c Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Mon, 4 Apr 2016 14:25:59 -0700 -Subject: [PATCH 333/423] drm/vc4: Fix NULL deref in HDMI init error path - -If you make it here other than through err_destroy_encoder, vc4->hdmi -is still NULL. - -Signed-off-by: Eric Anholt -(cherry picked from commit 5883980313af70aec0ceebaef6ef0709726e5e63) ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -573,7 +573,7 @@ err_unprepare_hsm: - err_unprepare_pix: - clk_disable_unprepare(hdmi->pixel_clock); - err_put_i2c: -- put_device(&vc4->hdmi->ddc->dev); -+ put_device(&hdmi->ddc->dev); - - return ret; - } diff --git a/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch b/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch new file mode 100644 index 0000000000..8347338589 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0333-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch @@ -0,0 +1,53 @@ +From 8fde5a249d84674a92b4732def88cbc47f2bb530 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 19 Apr 2016 13:24:14 -0700 +Subject: [PATCH] drm/vc4: Kick out the simplefb framebuffer before we set up + KMS. + +If we don't, then simplefb stays loaded on /dev/fb0 even though +scanout isn't happening from simplefb's memory area any more, and you +end up with no console. + +Signed-off-by: Eric Anholt +Acked-by: Dave Airlie +(cherry picked from commit b3a15f6d55fb584dd4d8baac5d1b6a398720620c) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -164,6 +164,24 @@ static void vc4_match_add_drivers(struct + } + } + ++static void vc4_kick_out_firmware_fb(void) ++{ ++ struct apertures_struct *ap; ++ ++ ap = alloc_apertures(1); ++ if (!ap) ++ return; ++ ++ /* Since VC4 is a UMA device, the simplefb node may have been ++ * located anywhere in memory. ++ */ ++ ap->ranges[0].base = 0; ++ ap->ranges[0].size = ~0; ++ ++ remove_conflicting_framebuffers(ap, "vc4drmfb", false); ++ kfree(ap); ++} ++ + static int vc4_drm_bind(struct device *dev) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -208,6 +226,8 @@ static int vc4_drm_bind(struct device *d + if (ret) + goto gem_destroy; + ++ vc4_kick_out_firmware_fb(); ++ + ret = drm_dev_register(drm, 0); + if (ret < 0) + goto unbind_all; diff --git a/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch b/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch deleted file mode 100644 index f42eb5b576..0000000000 --- a/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch +++ /dev/null @@ -1,53 +0,0 @@ -From d8bb97aba2a3d6c946b7c176370a71d117dee52c Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 19 Apr 2016 13:24:14 -0700 -Subject: [PATCH 334/423] drm/vc4: Kick out the simplefb framebuffer before we - set up KMS. - -If we don't, then simplefb stays loaded on /dev/fb0 even though -scanout isn't happening from simplefb's memory area any more, and you -end up with no console. - -Signed-off-by: Eric Anholt -Acked-by: Dave Airlie -(cherry picked from commit b3a15f6d55fb584dd4d8baac5d1b6a398720620c) ---- - drivers/gpu/drm/vc4/vc4_drv.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -164,6 +164,24 @@ static void vc4_match_add_drivers(struct - } - } - -+static void vc4_kick_out_firmware_fb(void) -+{ -+ struct apertures_struct *ap; -+ -+ ap = alloc_apertures(1); -+ if (!ap) -+ return; -+ -+ /* Since VC4 is a UMA device, the simplefb node may have been -+ * located anywhere in memory. -+ */ -+ ap->ranges[0].base = 0; -+ ap->ranges[0].size = ~0; -+ -+ remove_conflicting_framebuffers(ap, "vc4drmfb", false); -+ kfree(ap); -+} -+ - static int vc4_drm_bind(struct device *dev) - { - struct platform_device *pdev = to_platform_device(dev); -@@ -208,6 +226,8 @@ static int vc4_drm_bind(struct device *d - if (ret) - goto gem_destroy; - -+ vc4_kick_out_firmware_fb(); -+ - ret = drm_dev_register(drm, 0); - if (ret < 0) - goto unbind_all; diff --git a/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Rename-async-to-nonblock.patch b/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Rename-async-to-nonblock.patch new file mode 100644 index 0000000000..698dd34355 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0334-drm-vc4-Rename-async-to-nonblock.patch @@ -0,0 +1,45 @@ +From db48b84381e9cc7c4cc559bad3e5210db3b13c4e Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Tue, 26 Apr 2016 16:11:44 +0200 +Subject: [PATCH] drm/vc4: Rename async to nonblock. + +The async name is deprecated and should be changed to nonblocking. + +Cc: Eric Anholt +Signed-off-by: Maarten Lankhorst +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1461679905-30177-12-git-send-email-maarten.lankhorst@linux.intel.com +(cherry picked from commit eb63961ba52ba545f5b7ebeeeefe1c98704e1a79) +--- + drivers/gpu/drm/vc4/vc4_kms.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -93,7 +93,7 @@ static struct vc4_commit *commit_init(st + * vc4_atomic_commit - commit validated state object + * @dev: DRM device + * @state: the driver state object +- * @async: asynchronous commit ++ * @nonblock: nonblocking commit + * + * This function commits a with drm_atomic_helper_check() pre-validated state + * object. This can still fail when e.g. the framebuffer reservation fails. For +@@ -104,7 +104,7 @@ static struct vc4_commit *commit_init(st + */ + static int vc4_atomic_commit(struct drm_device *dev, + struct drm_atomic_state *state, +- bool async) ++ bool nonblock) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); + int ret; +@@ -170,7 +170,7 @@ static int vc4_atomic_commit(struct drm_ + * current layout. + */ + +- if (async) { ++ if (nonblock) { + vc4_queue_seqno_cb(dev, &c->cb, wait_seqno, + vc4_atomic_complete_commit_seqno_cb); + } else { diff --git a/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Add-support-for-gamma-ramps.patch b/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Add-support-for-gamma-ramps.patch new file mode 100644 index 0000000000..9168f20d65 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Add-support-for-gamma-ramps.patch @@ -0,0 +1,137 @@ +From 16c6164e2046f7b7bce7c1e028a2f938545f5401 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 31 Mar 2016 18:38:20 -0700 +Subject: [PATCH] drm/vc4: Add support for gamma ramps. + +We could possibly save a bit of power by not requesting gamma +conversion when the ramp happens to be 1:1, but at least if all the +CRTCs are off the SRAM will be disabled. + +This should fix brightness sliders in a lot of fullscreen games. + +Signed-off-by: Eric Anholt +(cherry picked from commit e582b6c7e7f9d0b1e30e8017e4082d3a9ede3310) +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 58 ++++++++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_regs.h | 6 +++++ + 2 files changed, 64 insertions(+) + +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -49,6 +49,10 @@ struct vc4_crtc { + /* Which HVS channel we're using for our CRTC. */ + int channel; + ++ u8 lut_r[256]; ++ u8 lut_g[256]; ++ u8 lut_b[256]; ++ + struct drm_pending_vblank_event *event; + }; + +@@ -147,6 +151,46 @@ static void vc4_crtc_destroy(struct drm_ + drm_crtc_cleanup(crtc); + } + ++static void ++vc4_crtc_lut_load(struct drm_crtc *crtc) ++{ ++ struct drm_device *dev = crtc->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ u32 i; ++ ++ /* The LUT memory is laid out with each HVS channel in order, ++ * each of which takes 256 writes for R, 256 for G, then 256 ++ * for B. ++ */ ++ HVS_WRITE(SCALER_GAMADDR, ++ SCALER_GAMADDR_AUTOINC | ++ (vc4_crtc->channel * 3 * crtc->gamma_size)); ++ ++ for (i = 0; i < crtc->gamma_size; i++) ++ HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_r[i]); ++ for (i = 0; i < crtc->gamma_size; i++) ++ HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_g[i]); ++ for (i = 0; i < crtc->gamma_size; i++) ++ HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_b[i]); ++} ++ ++static void ++vc4_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, ++ uint32_t start, uint32_t size) ++{ ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ u32 i; ++ ++ for (i = start; i < start + size; i++) { ++ vc4_crtc->lut_r[i] = r[i] >> 8; ++ vc4_crtc->lut_g[i] = g[i] >> 8; ++ vc4_crtc->lut_b[i] = b[i] >> 8; ++ } ++ ++ vc4_crtc_lut_load(crtc); ++} ++ + static u32 vc4_get_fifo_full_level(u32 format) + { + static const u32 fifo_len_bytes = 64; +@@ -260,8 +304,14 @@ static void vc4_crtc_mode_set_nofb(struc + + HVS_WRITE(SCALER_DISPBKGNDX(vc4_crtc->channel), + SCALER_DISPBKGND_AUTOHS | ++ SCALER_DISPBKGND_GAMMA | + (interlace ? SCALER_DISPBKGND_INTERLACE : 0)); + ++ /* Reload the LUT, since the SRAMs would have been disabled if ++ * all CRTCs had SCALER_DISPBKGND_GAMMA unset at once. ++ */ ++ vc4_crtc_lut_load(crtc); ++ + if (debug_dump_regs) { + DRM_INFO("CRTC %d regs after:\n", drm_crtc_index(crtc)); + vc4_crtc_dump_regs(vc4_crtc); +@@ -613,6 +663,7 @@ static const struct drm_crtc_funcs vc4_c + .reset = drm_atomic_helper_crtc_reset, + .atomic_duplicate_state = vc4_crtc_duplicate_state, + .atomic_destroy_state = vc4_crtc_destroy_state, ++ .gamma_set = vc4_crtc_gamma_set, + }; + + static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { +@@ -731,6 +782,7 @@ static int vc4_crtc_bind(struct device * + primary_plane->crtc = crtc; + vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; + vc4_crtc->channel = vc4_crtc->data->hvs_channel; ++ drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r)); + + /* Set up some arbitrary number of planes. We're not limited + * by a set number of physical registers, just the space in +@@ -771,6 +823,12 @@ static int vc4_crtc_bind(struct device * + + vc4_set_crtc_possible_masks(drm, crtc); + ++ for (i = 0; i < crtc->gamma_size; i++) { ++ vc4_crtc->lut_r[i] = i; ++ vc4_crtc->lut_g[i] = i; ++ vc4_crtc->lut_b[i] = i; ++ } ++ + platform_set_drvdata(pdev, vc4_crtc); + + return 0; +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -390,6 +390,12 @@ + #define SCALER_DISPBASE2 0x0000006c + #define SCALER_DISPALPHA2 0x00000070 + #define SCALER_GAMADDR 0x00000078 ++# define SCALER_GAMADDR_AUTOINC BIT(31) ++/* Enables all gamma ramp SRAMs, not just those of CRTCs with gamma ++ * enabled. ++ */ ++# define SCALER_GAMADDR_SRAMENB BIT(30) ++ + #define SCALER_GAMDATA 0x000000e0 + #define SCALER_DLIST_START 0x00002000 + #define SCALER_DLIST_SIZE 0x00004000 diff --git a/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Rename-async-to-nonblock.patch b/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Rename-async-to-nonblock.patch deleted file mode 100644 index 572a5b302d..0000000000 --- a/target/linux/brcm2708/patches-4.4/0335-drm-vc4-Rename-async-to-nonblock.patch +++ /dev/null @@ -1,45 +0,0 @@ -From fadf429b758f5a3b6122d73fd1f8551a5f21cf3c Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Tue, 26 Apr 2016 16:11:44 +0200 -Subject: [PATCH 335/423] drm/vc4: Rename async to nonblock. - -The async name is deprecated and should be changed to nonblocking. - -Cc: Eric Anholt -Signed-off-by: Maarten Lankhorst -Signed-off-by: Daniel Vetter -Link: http://patchwork.freedesktop.org/patch/msgid/1461679905-30177-12-git-send-email-maarten.lankhorst@linux.intel.com -(cherry picked from commit eb63961ba52ba545f5b7ebeeeefe1c98704e1a79) ---- - drivers/gpu/drm/vc4/vc4_kms.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -93,7 +93,7 @@ static struct vc4_commit *commit_init(st - * vc4_atomic_commit - commit validated state object - * @dev: DRM device - * @state: the driver state object -- * @async: asynchronous commit -+ * @nonblock: nonblocking commit - * - * This function commits a with drm_atomic_helper_check() pre-validated state - * object. This can still fail when e.g. the framebuffer reservation fails. For -@@ -104,7 +104,7 @@ static struct vc4_commit *commit_init(st - */ - static int vc4_atomic_commit(struct drm_device *dev, - struct drm_atomic_state *state, -- bool async) -+ bool nonblock) - { - struct vc4_dev *vc4 = to_vc4_dev(dev); - int ret; -@@ -170,7 +170,7 @@ static int vc4_atomic_commit(struct drm_ - * current layout. - */ - -- if (async) { -+ if (nonblock) { - vc4_queue_seqno_cb(dev, &c->cb, wait_seqno, - vc4_atomic_complete_commit_seqno_cb); - } else { diff --git a/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-missing-render-node-support.patch b/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-missing-render-node-support.patch new file mode 100644 index 0000000000..e5dd1ae088 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-missing-render-node-support.patch @@ -0,0 +1,26 @@ +From cb3e6f502adebcbddfe15a3479c3e48305717f46 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 14 Apr 2016 23:16:05 -0700 +Subject: [PATCH] drm/vc4: Add missing render node support + +There shouldn't be any other driver support necessary, since none of +the driver-specific ioctls ever required auth, and none of them deal +with modesetting. + +Signed-off-by: Eric Anholt +Reviewed-by: Daniel Vetter +(cherry picked from commit 0cd3e27476620176c19e346f82576c6e139b85a9) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -90,6 +90,7 @@ static struct drm_driver vc4_drm_driver + DRIVER_ATOMIC | + DRIVER_GEM | + DRIVER_HAVE_IRQ | ++ DRIVER_RENDER | + DRIVER_PRIME), + .lastclose = vc4_lastclose, + .preclose = vc4_drm_preclose, diff --git a/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-support-for-gamma-ramps.patch b/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-support-for-gamma-ramps.patch deleted file mode 100644 index fe0567c734..0000000000 --- a/target/linux/brcm2708/patches-4.4/0336-drm-vc4-Add-support-for-gamma-ramps.patch +++ /dev/null @@ -1,137 +0,0 @@ -From ad9de9ffedcbcc35c4fe13cddabda66abc98e3ef Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 31 Mar 2016 18:38:20 -0700 -Subject: [PATCH 336/423] drm/vc4: Add support for gamma ramps. - -We could possibly save a bit of power by not requesting gamma -conversion when the ramp happens to be 1:1, but at least if all the -CRTCs are off the SRAM will be disabled. - -This should fix brightness sliders in a lot of fullscreen games. - -Signed-off-by: Eric Anholt -(cherry picked from commit e582b6c7e7f9d0b1e30e8017e4082d3a9ede3310) ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 58 ++++++++++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_regs.h | 6 +++++ - 2 files changed, 64 insertions(+) - ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -49,6 +49,10 @@ struct vc4_crtc { - /* Which HVS channel we're using for our CRTC. */ - int channel; - -+ u8 lut_r[256]; -+ u8 lut_g[256]; -+ u8 lut_b[256]; -+ - struct drm_pending_vblank_event *event; - }; - -@@ -147,6 +151,46 @@ static void vc4_crtc_destroy(struct drm_ - drm_crtc_cleanup(crtc); - } - -+static void -+vc4_crtc_lut_load(struct drm_crtc *crtc) -+{ -+ struct drm_device *dev = crtc->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); -+ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); -+ u32 i; -+ -+ /* The LUT memory is laid out with each HVS channel in order, -+ * each of which takes 256 writes for R, 256 for G, then 256 -+ * for B. -+ */ -+ HVS_WRITE(SCALER_GAMADDR, -+ SCALER_GAMADDR_AUTOINC | -+ (vc4_crtc->channel * 3 * crtc->gamma_size)); -+ -+ for (i = 0; i < crtc->gamma_size; i++) -+ HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_r[i]); -+ for (i = 0; i < crtc->gamma_size; i++) -+ HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_g[i]); -+ for (i = 0; i < crtc->gamma_size; i++) -+ HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_b[i]); -+} -+ -+static void -+vc4_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, -+ uint32_t start, uint32_t size) -+{ -+ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); -+ u32 i; -+ -+ for (i = start; i < start + size; i++) { -+ vc4_crtc->lut_r[i] = r[i] >> 8; -+ vc4_crtc->lut_g[i] = g[i] >> 8; -+ vc4_crtc->lut_b[i] = b[i] >> 8; -+ } -+ -+ vc4_crtc_lut_load(crtc); -+} -+ - static u32 vc4_get_fifo_full_level(u32 format) - { - static const u32 fifo_len_bytes = 64; -@@ -260,8 +304,14 @@ static void vc4_crtc_mode_set_nofb(struc - - HVS_WRITE(SCALER_DISPBKGNDX(vc4_crtc->channel), - SCALER_DISPBKGND_AUTOHS | -+ SCALER_DISPBKGND_GAMMA | - (interlace ? SCALER_DISPBKGND_INTERLACE : 0)); - -+ /* Reload the LUT, since the SRAMs would have been disabled if -+ * all CRTCs had SCALER_DISPBKGND_GAMMA unset at once. -+ */ -+ vc4_crtc_lut_load(crtc); -+ - if (debug_dump_regs) { - DRM_INFO("CRTC %d regs after:\n", drm_crtc_index(crtc)); - vc4_crtc_dump_regs(vc4_crtc); -@@ -613,6 +663,7 @@ static const struct drm_crtc_funcs vc4_c - .reset = drm_atomic_helper_crtc_reset, - .atomic_duplicate_state = vc4_crtc_duplicate_state, - .atomic_destroy_state = vc4_crtc_destroy_state, -+ .gamma_set = vc4_crtc_gamma_set, - }; - - static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { -@@ -731,6 +782,7 @@ static int vc4_crtc_bind(struct device * - primary_plane->crtc = crtc; - vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; - vc4_crtc->channel = vc4_crtc->data->hvs_channel; -+ drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r)); - - /* Set up some arbitrary number of planes. We're not limited - * by a set number of physical registers, just the space in -@@ -771,6 +823,12 @@ static int vc4_crtc_bind(struct device * - - vc4_set_crtc_possible_masks(drm, crtc); - -+ for (i = 0; i < crtc->gamma_size; i++) { -+ vc4_crtc->lut_r[i] = i; -+ vc4_crtc->lut_g[i] = i; -+ vc4_crtc->lut_b[i] = i; -+ } -+ - platform_set_drvdata(pdev, vc4_crtc); - - return 0; ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -390,6 +390,12 @@ - #define SCALER_DISPBASE2 0x0000006c - #define SCALER_DISPALPHA2 0x00000070 - #define SCALER_GAMADDR 0x00000078 -+# define SCALER_GAMADDR_AUTOINC BIT(31) -+/* Enables all gamma ramp SRAMs, not just those of CRTCs with gamma -+ * enabled. -+ */ -+# define SCALER_GAMADDR_SRAMENB BIT(30) -+ - #define SCALER_GAMDATA 0x000000e0 - #define SCALER_DLIST_START 0x00002000 - #define SCALER_DLIST_SIZE 0x00004000 diff --git a/target/linux/brcm2708/patches-4.4/0337-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch b/target/linux/brcm2708/patches-4.4/0337-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch new file mode 100644 index 0000000000..c62a62170e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0337-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch @@ -0,0 +1,86 @@ +From 59c699fe982aa0df961465654c4d87d109b127e6 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 24 Mar 2016 17:23:48 -0700 +Subject: [PATCH] drm/panel: simple: Add the 7" DPI panel from Adafruit + +This is a basic TFT panel with a 40-pin FPC connector on it. The +specification doesn't define timings, but the Adafruit instructions +were setting up 800x480 CVT. + +v2: Add .bus_format and vsync/hsync flags. + +Signed-off-by: Eric Anholt +Acked-by: Rob Herring +[treding@nvidia.com: keep entries properly sorted] +Signed-off-by: Thierry Reding + +(cherry picked from commit 8070fdbd024727c752f815b18e5339c681a01bbe) +--- + .../bindings/display/panel/ontat,yx700wv03.txt | 7 ++++ + drivers/gpu/drm/panel/panel-simple.c | 37 ++++++++++++++++++++++ + 2 files changed, 44 insertions(+) + create mode 100644 Documentation/devicetree/bindings/display/panel/ontat,yx700wv03.txt + +--- /dev/null ++++ b/Documentation/devicetree/bindings/display/panel/ontat,yx700wv03.txt +@@ -0,0 +1,7 @@ ++On Tat Industrial Company 7" DPI TFT panel. ++ ++Required properties: ++- compatible: should be "ontat,yx700wv03" ++ ++This binding is compatible with the simple-panel binding, which is specified ++in simple-panel.txt in this directory. +--- a/drivers/gpu/drm/panel/panel-simple.c ++++ b/drivers/gpu/drm/panel/panel-simple.c +@@ -1003,6 +1003,40 @@ static const struct panel_desc okaya_rs8 + .bus_format = MEDIA_BUS_FMT_RGB666_1X18, + }; + ++/* ++ * 800x480 CVT. The panel appears to be quite accepting, at least as far as ++ * pixel clocks, but this is the timing that was being used in the Adafruit ++ * installation instructions. ++ */ ++static const struct drm_display_mode ontat_yx700wv03_mode = { ++ .clock = 29500, ++ .hdisplay = 800, ++ .hsync_start = 824, ++ .hsync_end = 896, ++ .htotal = 992, ++ .vdisplay = 480, ++ .vsync_start = 483, ++ .vsync_end = 493, ++ .vtotal = 500, ++ .vrefresh = 60, ++ .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, ++}; ++ ++/* ++ * Specification at: ++ * https://www.adafruit.com/images/product-files/2406/c3163.pdf ++ */ ++static const struct panel_desc ontat_yx700wv03 = { ++ .modes = &ontat_yx700wv03_mode, ++ .num_modes = 1, ++ .bpc = 8, ++ .size = { ++ .width = 154, ++ .height = 83, ++ }, ++ .bus_format = MEDIA_BUS_FMT_RGB888_1X24, ++}; ++ + static const struct drm_display_mode ortustech_com43h4m85ulc_mode = { + .clock = 25000, + .hdisplay = 480, +@@ -1179,6 +1213,9 @@ static const struct of_device_id platfor + .compatible = "okaya,rs800480t-7x0gp", + .data = &okaya_rs800480t_7x0gp, + }, { ++ .compatible = "ontat,yx700wv03", ++ .data = &ontat_yx700wv03, ++ }, { + .compatible = "ortustech,com43h4m85ulc", + .data = &ortustech_com43h4m85ulc, + }, { diff --git a/target/linux/brcm2708/patches-4.4/0337-drm-vc4-Add-missing-render-node-support.patch b/target/linux/brcm2708/patches-4.4/0337-drm-vc4-Add-missing-render-node-support.patch deleted file mode 100644 index a33df8f141..0000000000 --- a/target/linux/brcm2708/patches-4.4/0337-drm-vc4-Add-missing-render-node-support.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 889865acbf4ea68d241448cf413d8667b8abf312 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 14 Apr 2016 23:16:05 -0700 -Subject: [PATCH 337/423] drm/vc4: Add missing render node support - -There shouldn't be any other driver support necessary, since none of -the driver-specific ioctls ever required auth, and none of them deal -with modesetting. - -Signed-off-by: Eric Anholt -Reviewed-by: Daniel Vetter -(cherry picked from commit 0cd3e27476620176c19e346f82576c6e139b85a9) ---- - drivers/gpu/drm/vc4/vc4_drv.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -90,6 +90,7 @@ static struct drm_driver vc4_drm_driver - DRIVER_ATOMIC | - DRIVER_GEM | - DRIVER_HAVE_IRQ | -+ DRIVER_RENDER | - DRIVER_PRIME), - .lastclose = vc4_lastclose, - .preclose = vc4_drm_preclose, diff --git a/target/linux/brcm2708/patches-4.4/0338-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch b/target/linux/brcm2708/patches-4.4/0338-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch new file mode 100644 index 0000000000..fdb3f31bb5 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0338-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch @@ -0,0 +1,33 @@ +From 55387e0dc0e0982f62b1131e79a86e655dcfb3f4 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 6 May 2016 13:18:09 -0700 +Subject: [PATCH] BCM270X_DT: Add the disabled-by-default DPI device node. + +This will be enabled and connected to a particular panel by DT +overlays. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -179,6 +179,17 @@ + status = "disabled"; + }; + ++ dpi: dpi@7e208000 { ++ compatible = "brcm,bcm2835-dpi"; ++ reg = <0x7e208000 0x8c>; ++ clocks = <&cprman BCM2835_CLOCK_VPU>, ++ <&cprman BCM2835_CLOCK_DPI>; ++ clock-names = "core", "pixel"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ }; ++ + pixelvalve1: pixelvalve@7e207000 { + compatible = "brcm,bcm2835-pixelvalve1"; + reg = <0x7e207000 0x100>; diff --git a/target/linux/brcm2708/patches-4.4/0338-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch b/target/linux/brcm2708/patches-4.4/0338-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch deleted file mode 100644 index 0b836dacdb..0000000000 --- a/target/linux/brcm2708/patches-4.4/0338-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 0445e26913d81b7e6cde6202d969e59f25d08fd2 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 24 Mar 2016 17:23:48 -0700 -Subject: [PATCH 338/423] drm/panel: simple: Add the 7" DPI panel from Adafruit - -This is a basic TFT panel with a 40-pin FPC connector on it. The -specification doesn't define timings, but the Adafruit instructions -were setting up 800x480 CVT. - -v2: Add .bus_format and vsync/hsync flags. - -Signed-off-by: Eric Anholt -Acked-by: Rob Herring -[treding@nvidia.com: keep entries properly sorted] -Signed-off-by: Thierry Reding - -(cherry picked from commit 8070fdbd024727c752f815b18e5339c681a01bbe) ---- - .../bindings/display/panel/ontat,yx700wv03.txt | 7 ++++ - drivers/gpu/drm/panel/panel-simple.c | 37 ++++++++++++++++++++++ - 2 files changed, 44 insertions(+) - create mode 100644 Documentation/devicetree/bindings/display/panel/ontat,yx700wv03.txt - ---- /dev/null -+++ b/Documentation/devicetree/bindings/display/panel/ontat,yx700wv03.txt -@@ -0,0 +1,7 @@ -+On Tat Industrial Company 7" DPI TFT panel. -+ -+Required properties: -+- compatible: should be "ontat,yx700wv03" -+ -+This binding is compatible with the simple-panel binding, which is specified -+in simple-panel.txt in this directory. ---- a/drivers/gpu/drm/panel/panel-simple.c -+++ b/drivers/gpu/drm/panel/panel-simple.c -@@ -1003,6 +1003,40 @@ static const struct panel_desc okaya_rs8 - .bus_format = MEDIA_BUS_FMT_RGB666_1X18, - }; - -+/* -+ * 800x480 CVT. The panel appears to be quite accepting, at least as far as -+ * pixel clocks, but this is the timing that was being used in the Adafruit -+ * installation instructions. -+ */ -+static const struct drm_display_mode ontat_yx700wv03_mode = { -+ .clock = 29500, -+ .hdisplay = 800, -+ .hsync_start = 824, -+ .hsync_end = 896, -+ .htotal = 992, -+ .vdisplay = 480, -+ .vsync_start = 483, -+ .vsync_end = 493, -+ .vtotal = 500, -+ .vrefresh = 60, -+ .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, -+}; -+ -+/* -+ * Specification at: -+ * https://www.adafruit.com/images/product-files/2406/c3163.pdf -+ */ -+static const struct panel_desc ontat_yx700wv03 = { -+ .modes = &ontat_yx700wv03_mode, -+ .num_modes = 1, -+ .bpc = 8, -+ .size = { -+ .width = 154, -+ .height = 83, -+ }, -+ .bus_format = MEDIA_BUS_FMT_RGB888_1X24, -+}; -+ - static const struct drm_display_mode ortustech_com43h4m85ulc_mode = { - .clock = 25000, - .hdisplay = 480, -@@ -1179,6 +1213,9 @@ static const struct of_device_id platfor - .compatible = "okaya,rs800480t-7x0gp", - .data = &okaya_rs800480t_7x0gp, - }, { -+ .compatible = "ontat,yx700wv03", -+ .data = &ontat_yx700wv03, -+ }, { - .compatible = "ortustech,com43h4m85ulc", - .data = &ortustech_com43h4m85ulc, - }, { diff --git a/target/linux/brcm2708/patches-4.4/0339-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch b/target/linux/brcm2708/patches-4.4/0339-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch deleted file mode 100644 index 6552186f5f..0000000000 --- a/target/linux/brcm2708/patches-4.4/0339-BCM270X_DT-Add-the-disabled-by-default-DPI-device-no.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 2f2c9d21a772c179638bdcf660ca4559d189c3f4 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 6 May 2016 13:18:09 -0700 -Subject: [PATCH 339/423] BCM270X_DT: Add the disabled-by-default DPI device - node. - -This will be enabled and connected to a particular panel by DT -overlays. - -Signed-off-by: Eric Anholt ---- - arch/arm/boot/dts/bcm2708_common.dtsi | 11 +++++++++++ - 1 file changed, 11 insertions(+) - ---- a/arch/arm/boot/dts/bcm2708_common.dtsi -+++ b/arch/arm/boot/dts/bcm2708_common.dtsi -@@ -179,6 +179,17 @@ - status = "disabled"; - }; - -+ dpi: dpi@7e208000 { -+ compatible = "brcm,bcm2835-dpi"; -+ reg = <0x7e208000 0x8c>; -+ clocks = <&cprman BCM2835_CLOCK_VPU>, -+ <&cprman BCM2835_CLOCK_DPI>; -+ clock-names = "core", "pixel"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "disabled"; -+ }; -+ - pixelvalve1: pixelvalve@7e207000 { - compatible = "brcm,bcm2835-pixelvalve1"; - reg = <0x7e207000 0x100>; diff --git a/target/linux/brcm2708/patches-4.4/0339-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch b/target/linux/brcm2708/patches-4.4/0339-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch new file mode 100644 index 0000000000..031c328bf7 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0339-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch @@ -0,0 +1,31 @@ +From 9684d1176621e7edee8475dbd3ad186591898b21 Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Fri, 6 May 2016 19:26:05 +0200 +Subject: [PATCH] drm/vc4: Fix get_vblank_counter with proper no-op for Linux + 4.4+ + +get_vblank_counter hooked up to drm_vblank_count() which alway was +non-sensical but didn't hurt in the past. Since Linux 4.4 it +triggers a WARN_ON_ONCE in drm_update_vblank_count on first vblank +irq disable, so fix it by hooking to drm_vblank_no_hw_counter(). + +Tested against Raspian kernel 4.4.8 tree on RPi 2B. + +Signed-off-by: Mario Kleiner +Cc: Eric Anholt +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_drv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -102,7 +102,7 @@ static struct drm_driver vc4_drm_driver + + .enable_vblank = vc4_enable_vblank, + .disable_vblank = vc4_disable_vblank, +- .get_vblank_counter = drm_vblank_count, ++ .get_vblank_counter = drm_vblank_no_hw_counter, + + #if defined(CONFIG_DEBUG_FS) + .debugfs_init = vc4_debugfs_init, diff --git a/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch b/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch new file mode 100644 index 0000000000..616ff43786 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch @@ -0,0 +1,47 @@ +From bd3aef6d9474fbb9fe063a2f409f920263c28ff1 Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Fri, 6 May 2016 19:26:06 +0200 +Subject: [PATCH] drm/vc4: Fix drm_vblank_put/get imbalance in page flip path. + +The async page flip path was missing drm_crtc_vblank_get/put +completely. The sync flip path was missing a vblank put, so async +flips only reported proper pageflip completion events by chance, +and vblank irq's never turned off after a first vsync'ed page flip +until system reboot. + +Tested against Raspian kernel 4.4.8 tree on RPi 2B. + +Signed-off-by: Mario Kleiner +Cc: Eric Anholt +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -506,6 +506,7 @@ static void vc4_crtc_handle_page_flip(st + if (vc4_crtc->event) { + drm_crtc_send_vblank_event(crtc, vc4_crtc->event); + vc4_crtc->event = NULL; ++ drm_crtc_vblank_put(crtc); + } + spin_unlock_irqrestore(&dev->event_lock, flags); + } +@@ -556,6 +557,7 @@ vc4_async_page_flip_complete(struct vc4_ + spin_unlock_irqrestore(&dev->event_lock, flags); + } + ++ drm_crtc_vblank_put(crtc); + drm_framebuffer_unreference(flip_state->fb); + kfree(flip_state); + +@@ -598,6 +600,8 @@ static int vc4_async_page_flip(struct dr + return ret; + } + ++ WARN_ON(drm_crtc_vblank_get(crtc) != 0); ++ + /* Immediately update the plane's legacy fb pointer, so that later + * modeset prep sees the state that will be present when the semaphore + * is released. diff --git a/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch b/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch deleted file mode 100644 index ec172d0519..0000000000 --- a/target/linux/brcm2708/patches-4.4/0340-drm-vc4-Fix-get_vblank_counter-with-proper-no-op-for.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 41a242de6e06a106399d2c713dc4114da3532d22 Mon Sep 17 00:00:00 2001 -From: Mario Kleiner -Date: Fri, 6 May 2016 19:26:05 +0200 -Subject: [PATCH 340/423] drm/vc4: Fix get_vblank_counter with proper no-op for - Linux 4.4+ - -get_vblank_counter hooked up to drm_vblank_count() which alway was -non-sensical but didn't hurt in the past. Since Linux 4.4 it -triggers a WARN_ON_ONCE in drm_update_vblank_count on first vblank -irq disable, so fix it by hooking to drm_vblank_no_hw_counter(). - -Tested against Raspian kernel 4.4.8 tree on RPi 2B. - -Signed-off-by: Mario Kleiner -Cc: Eric Anholt -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_drv.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -102,7 +102,7 @@ static struct drm_driver vc4_drm_driver - - .enable_vblank = vc4_enable_vblank, - .disable_vblank = vc4_disable_vblank, -- .get_vblank_counter = drm_vblank_count, -+ .get_vblank_counter = drm_vblank_no_hw_counter, - - #if defined(CONFIG_DEBUG_FS) - .debugfs_init = vc4_debugfs_init, diff --git a/target/linux/brcm2708/patches-4.4/0341-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch b/target/linux/brcm2708/patches-4.4/0341-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch new file mode 100644 index 0000000000..363f0c8f07 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0341-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch @@ -0,0 +1,269 @@ +From ee32bb475a3986f961466e00f5ed0bc1fb708699 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 11 May 2016 15:38:04 +0100 +Subject: [PATCH] BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux + +This overlay supports a range of I2C multiplexers - PCA9542 (2 ports), +PCA9545 (4 ports) and PCA9548 (8 ports). + +Also remove the dedicated i2c-mux-9548a overlays since it is no longer +needed. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 2 +- + arch/arm/boot/dts/overlays/README | 17 ++- + arch/arm/boot/dts/overlays/i2c-mux-overlay.dts | 138 +++++++++++++++++++++ + .../boot/dts/overlays/i2c-mux-pca9548a-overlay.dts | 67 ---------- + 4 files changed, 152 insertions(+), 72 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/i2c-mux-overlay.dts + delete mode 100644 arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -34,7 +34,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo + dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += i2c-mux-pca9548a.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -421,10 +421,19 @@ Params: i2c_gpio_sda GPIO use + (default "2" = ~100kHz) + + +-Name: i2c-mux-pca9548a +-Info: Adds support for an NXP PCA9548A I2C multiplexer on i2c_arm +-Load: dtoverlay=i2c-mux-pca9548a,= +-Params: addr I2C address of PCA9548A (default 0x70) ++Name: i2c-mux ++Info: Adds support for a number of I2C bus multiplexers on i2c_arm ++Load: dtoverlay=i2c-mux,= ++Params: pca9542 Select the NXP PCA9542 device ++ ++ pca9545 Select the NXP PCA9545 device ++ ++ pca9548 Select the NXP PCA9548 device ++ ++ addr Change I2C address of the device (default 0x70) ++ ++ ++[ The i2c-mux-pca9548a overlay has been deleted. See i2c-mux. ] + + + Name: i2c-pwm-pca9685a +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts +@@ -0,0 +1,138 @@ ++// Umbrella I2C Mux overlay ++ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pca9542: mux@70 { ++ compatible = "nxp,pca9542"; ++ reg = <0x70>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ i2c@0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0>; ++ }; ++ i2c@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pca9545: mux@70 { ++ compatible = "nxp,pca9545"; ++ reg = <0x70>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ i2c@0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0>; ++ }; ++ i2c@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ }; ++ i2c@2 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <2>; ++ }; ++ i2c@3 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <3>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pca9548: mux@70 { ++ compatible = "nxp,pca9548"; ++ reg = <0x70>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ i2c@0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0>; ++ }; ++ i2c@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ }; ++ i2c@2 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <2>; ++ }; ++ i2c@3 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <3>; ++ }; ++ i2c@4 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <4>; ++ }; ++ i2c@5 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <5>; ++ }; ++ i2c@6 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <6>; ++ }; ++ i2c@7 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <7>; ++ }; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ pca9542 = <0>, "+0"; ++ pca9545 = <0>, "+1"; ++ pca9548 = <0>, "+2"; ++ ++ addr = <&pca9545>,"reg:0", ++ <&pca9548>,"reg:0"; ++ }; ++}; +--- a/arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts ++++ /dev/null +@@ -1,67 +0,0 @@ +-// Definitions for NXP PCA9548A I2C mux on ARM I2C bus. +-/dts-v1/; +-/plugin/; +- +-/{ +- compatible = "brcm,bcm2708"; +- +- fragment@0 { +- target = <&i2c_arm>; +- __overlay__ { +- #address-cells = <1>; +- #size-cells = <0>; +- status = "okay"; +- +- i2cmux: mux@70 { +- compatible = "nxp,pca9548"; +- reg = <0x70>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- i2c@0 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0>; +- }; +- i2c@1 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <1>; +- }; +- i2c@2 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <2>; +- }; +- i2c@3 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <3>; +- }; +- i2c@4 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <4>; +- }; +- i2c@5 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <5>; +- }; +- i2c@6 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <6>; +- }; +- i2c@7 { +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <7>; +- }; +- }; +- }; +- }; +- __overrides__ { +- addr = <&i2cmux>,"reg:0"; +- }; +-}; diff --git a/target/linux/brcm2708/patches-4.4/0341-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch b/target/linux/brcm2708/patches-4.4/0341-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch deleted file mode 100644 index 77a8f07732..0000000000 --- a/target/linux/brcm2708/patches-4.4/0341-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 4f9f74feec3951986a22aff184d0fa6fb7a47b93 Mon Sep 17 00:00:00 2001 -From: Mario Kleiner -Date: Fri, 6 May 2016 19:26:06 +0200 -Subject: [PATCH 341/423] drm/vc4: Fix drm_vblank_put/get imbalance in page - flip path. - -The async page flip path was missing drm_crtc_vblank_get/put -completely. The sync flip path was missing a vblank put, so async -flips only reported proper pageflip completion events by chance, -and vblank irq's never turned off after a first vsync'ed page flip -until system reboot. - -Tested against Raspian kernel 4.4.8 tree on RPi 2B. - -Signed-off-by: Mario Kleiner -Cc: Eric Anholt -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -506,6 +506,7 @@ static void vc4_crtc_handle_page_flip(st - if (vc4_crtc->event) { - drm_crtc_send_vblank_event(crtc, vc4_crtc->event); - vc4_crtc->event = NULL; -+ drm_crtc_vblank_put(crtc); - } - spin_unlock_irqrestore(&dev->event_lock, flags); - } -@@ -556,6 +557,7 @@ vc4_async_page_flip_complete(struct vc4_ - spin_unlock_irqrestore(&dev->event_lock, flags); - } - -+ drm_crtc_vblank_put(crtc); - drm_framebuffer_unreference(flip_state->fb); - kfree(flip_state); - -@@ -598,6 +600,8 @@ static int vc4_async_page_flip(struct dr - return ret; - } - -+ WARN_ON(drm_crtc_vblank_get(crtc) != 0); -+ - /* Immediately update the plane's legacy fb pointer, so that later - * modeset prep sees the state that will be present when the semaphore - * is released. diff --git a/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch b/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch deleted file mode 100644 index ce65c6ccb7..0000000000 --- a/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Add-umbrella-I2C-Mux-overlay-i2c-mux.patch +++ /dev/null @@ -1,269 +0,0 @@ -From 347b13e71792301011d09442c6150d6aec8d89e0 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 11 May 2016 15:38:04 +0100 -Subject: [PATCH 342/423] BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux - -This overlay supports a range of I2C multiplexers - PCA9542 (2 ports), -PCA9545 (4 ports) and PCA9548 (8 ports). - -Also remove the dedicated i2c-mux-9548a overlays since it is no longer -needed. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/Makefile | 2 +- - arch/arm/boot/dts/overlays/README | 17 ++- - arch/arm/boot/dts/overlays/i2c-mux-overlay.dts | 138 +++++++++++++++++++++ - .../boot/dts/overlays/i2c-mux-pca9548a-overlay.dts | 67 ---------- - 4 files changed, 152 insertions(+), 72 deletions(-) - create mode 100644 arch/arm/boot/dts/overlays/i2c-mux-overlay.dts - delete mode 100644 arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -34,7 +34,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo - dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo --dtbo-$(RPI_DT_OVERLAYS) += i2c-mux-pca9548a.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -421,10 +421,19 @@ Params: i2c_gpio_sda GPIO use - (default "2" = ~100kHz) - - --Name: i2c-mux-pca9548a --Info: Adds support for an NXP PCA9548A I2C multiplexer on i2c_arm --Load: dtoverlay=i2c-mux-pca9548a,= --Params: addr I2C address of PCA9548A (default 0x70) -+Name: i2c-mux -+Info: Adds support for a number of I2C bus multiplexers on i2c_arm -+Load: dtoverlay=i2c-mux,= -+Params: pca9542 Select the NXP PCA9542 device -+ -+ pca9545 Select the NXP PCA9545 device -+ -+ pca9548 Select the NXP PCA9548 device -+ -+ addr Change I2C address of the device (default 0x70) -+ -+ -+[ The i2c-mux-pca9548a overlay has been deleted. See i2c-mux. ] - - - Name: i2c-pwm-pca9685a ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts -@@ -0,0 +1,138 @@ -+// Umbrella I2C Mux overlay -+ -+/dts-v1/; -+/plugin/; -+ -+/{ -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pca9542: mux@70 { -+ compatible = "nxp,pca9542"; -+ reg = <0x70>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ i2c@0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ }; -+ i2c@1 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <1>; -+ }; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pca9545: mux@70 { -+ compatible = "nxp,pca9545"; -+ reg = <0x70>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ i2c@0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ }; -+ i2c@1 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <1>; -+ }; -+ i2c@2 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <2>; -+ }; -+ i2c@3 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <3>; -+ }; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pca9548: mux@70 { -+ compatible = "nxp,pca9548"; -+ reg = <0x70>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ i2c@0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ }; -+ i2c@1 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <1>; -+ }; -+ i2c@2 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <2>; -+ }; -+ i2c@3 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <3>; -+ }; -+ i2c@4 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <4>; -+ }; -+ i2c@5 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <5>; -+ }; -+ i2c@6 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <6>; -+ }; -+ i2c@7 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <7>; -+ }; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ pca9542 = <0>, "+0"; -+ pca9545 = <0>, "+1"; -+ pca9548 = <0>, "+2"; -+ -+ addr = <&pca9545>,"reg:0", -+ <&pca9548>,"reg:0"; -+ }; -+}; ---- a/arch/arm/boot/dts/overlays/i2c-mux-pca9548a-overlay.dts -+++ /dev/null -@@ -1,67 +0,0 @@ --// Definitions for NXP PCA9548A I2C mux on ARM I2C bus. --/dts-v1/; --/plugin/; -- --/{ -- compatible = "brcm,bcm2708"; -- -- fragment@0 { -- target = <&i2c_arm>; -- __overlay__ { -- #address-cells = <1>; -- #size-cells = <0>; -- status = "okay"; -- -- i2cmux: mux@70 { -- compatible = "nxp,pca9548"; -- reg = <0x70>; -- #address-cells = <1>; -- #size-cells = <0>; -- -- i2c@0 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <0>; -- }; -- i2c@1 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <1>; -- }; -- i2c@2 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <2>; -- }; -- i2c@3 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <3>; -- }; -- i2c@4 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <4>; -- }; -- i2c@5 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <5>; -- }; -- i2c@6 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <6>; -- }; -- i2c@7 { -- #address-cells = <1>; -- #size-cells = <0>; -- reg = <7>; -- }; -- }; -- }; -- }; -- __overrides__ { -- addr = <&i2cmux>,"reg:0"; -- }; --}; diff --git a/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Include-address-override-for-pca9542.patch b/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Include-address-override-for-pca9542.patch new file mode 100644 index 0000000000..877d347117 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0342-BCM270X_DT-Include-address-override-for-pca9542.patch @@ -0,0 +1,24 @@ +From 4ba99a9cdd73c1e8f24ac981a7d7af3f440de4f6 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 12 May 2016 08:52:06 +0100 +Subject: [PATCH] BCM270X_DT: Include address override for pca9542 + +Omitted from "BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux". + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/i2c-mux-overlay.dts | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts +@@ -132,7 +132,8 @@ + pca9545 = <0>, "+1"; + pca9548 = <0>, "+2"; + +- addr = <&pca9545>,"reg:0", ++ addr = <&pca9542>,"reg:0", ++ <&pca9545>,"reg:0", + <&pca9548>,"reg:0"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch b/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch new file mode 100644 index 0000000000..cb6f4608b7 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch @@ -0,0 +1,68 @@ +From f2bdc9fa776b22616cb5ec64ae1d027b8c4ca721 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 12 May 2016 09:04:20 +0100 +Subject: [PATCH] BCM270X_DT: Fix the tinylcd35 overlay RTC support + +Now that overlay parameters are applied before the merge (a requirement +for kernel runtime overlays) it is illegal for parameters/overrides to +target nodes in the base DTB. Solve the problem of only enabling I2C +when an RTC option is used by making the RTC fragments conditional, +and including the required status="okay" within the fragments. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/tinylcd35-overlay.dts | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +--- a/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts ++++ b/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts +@@ -132,28 +132,32 @@ + + fragment@5 { + target = <&i2c1>; +- __overlay__ { ++ __dormant__ { + #address-cells = <1>; + #size-cells = <0>; + ++ status = "okay"; ++ + pcf8563: pcf8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; +- status = "disabled"; ++ status = "okay"; + }; + }; + }; + + fragment@6 { + target = <&i2c1>; +- __overlay__ { ++ __dormant__ { + #address-cells = <1>; + #size-cells = <0>; + ++ status = "okay"; ++ + ds1307: ds1307@68 { + compatible = "maxim,ds1307"; + reg = <0x68>; +- status = "disabled"; ++ status = "okay"; + }; + }; + }; +@@ -213,10 +217,8 @@ + <&tinylcd35_ts>,"interrupts:0", + <&tinylcd35_ts>,"pendown-gpio:4"; + xohms = <&tinylcd35_ts>,"ti,x-plate-ohms;0"; +- rtc-pcf = <&i2c1>,"status", +- <&pcf8563>,"status"; +- rtc-ds = <&i2c1>,"status", +- <&ds1307>,"status"; ++ rtc-pcf = <0>,"=5"; ++ rtc-ds = <0>,"=6"; + keypad = <&keypad>,"status"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Include-address-override-for-pca9542.patch b/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Include-address-override-for-pca9542.patch deleted file mode 100644 index c5b7d1a124..0000000000 --- a/target/linux/brcm2708/patches-4.4/0343-BCM270X_DT-Include-address-override-for-pca9542.patch +++ /dev/null @@ -1,24 +0,0 @@ -From d800efe9cfbd2da1f1ee88196a34447ff7fa7461 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 12 May 2016 08:52:06 +0100 -Subject: [PATCH 343/423] BCM270X_DT: Include address override for pca9542 - -Omitted from "BCM270X_DT: Add umbrella I2C Mux overlay i2c-mux". - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/i2c-mux-overlay.dts | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts -@@ -132,7 +132,8 @@ - pca9545 = <0>, "+1"; - pca9548 = <0>, "+2"; - -- addr = <&pca9545>,"reg:0", -+ addr = <&pca9542>,"reg:0", -+ <&pca9545>,"reg:0", - <&pca9548>,"reg:0"; - }; - }; diff --git a/target/linux/brcm2708/patches-4.4/0344-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch b/target/linux/brcm2708/patches-4.4/0344-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch deleted file mode 100644 index 612776983d..0000000000 --- a/target/linux/brcm2708/patches-4.4/0344-BCM270X_DT-Fix-the-tinylcd35-overlay-RTC-support.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 9812988c5073448717f74b5bf9aae9da029fb530 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 12 May 2016 09:04:20 +0100 -Subject: [PATCH 344/423] BCM270X_DT: Fix the tinylcd35 overlay RTC support - -Now that overlay parameters are applied before the merge (a requirement -for kernel runtime overlays) it is illegal for parameters/overrides to -target nodes in the base DTB. Solve the problem of only enabling I2C -when an RTC option is used by making the RTC fragments conditional, -and including the required status="okay" within the fragments. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/tinylcd35-overlay.dts | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - ---- a/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts -+++ b/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts -@@ -132,28 +132,32 @@ - - fragment@5 { - target = <&i2c1>; -- __overlay__ { -+ __dormant__ { - #address-cells = <1>; - #size-cells = <0>; - -+ status = "okay"; -+ - pcf8563: pcf8563@51 { - compatible = "nxp,pcf8563"; - reg = <0x51>; -- status = "disabled"; -+ status = "okay"; - }; - }; - }; - - fragment@6 { - target = <&i2c1>; -- __overlay__ { -+ __dormant__ { - #address-cells = <1>; - #size-cells = <0>; - -+ status = "okay"; -+ - ds1307: ds1307@68 { - compatible = "maxim,ds1307"; - reg = <0x68>; -- status = "disabled"; -+ status = "okay"; - }; - }; - }; -@@ -213,10 +217,8 @@ - <&tinylcd35_ts>,"interrupts:0", - <&tinylcd35_ts>,"pendown-gpio:4"; - xohms = <&tinylcd35_ts>,"ti,x-plate-ohms;0"; -- rtc-pcf = <&i2c1>,"status", -- <&pcf8563>,"status"; -- rtc-ds = <&i2c1>,"status", -- <&ds1307>,"status"; -+ rtc-pcf = <0>,"=5"; -+ rtc-ds = <0>,"=6"; - keypad = <&keypad>,"status"; - }; - }; diff --git a/target/linux/brcm2708/patches-4.4/0344-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch b/target/linux/brcm2708/patches-4.4/0344-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch new file mode 100644 index 0000000000..ca69a6d115 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0344-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch @@ -0,0 +1,43 @@ +From f782ae472861f096fb8b349c3775fbce6316826e Mon Sep 17 00:00:00 2001 +From: Lee Jones +Date: Thu, 11 Feb 2016 13:19:09 -0800 +Subject: [PATCH] clk: Allow clocks to be marked as CRITICAL + +Critical clocks are those which must not be gated, else undefined +or catastrophic failure would occur. Here we have chosen to +ensure the prepare/enable counts are correctly incremented, so as +not to confuse users with enabled clocks with no visible users. + +Signed-off-by: Lee Jones +Signed-off-by: Michael Turquette +Link: lkml.kernel.org/r/1455225554-13267-2-git-send-email-mturquette@baylibre.com +(cherry picked from commit 32b9b10961860860268961d9aad0c56a73018c37) +--- + drivers/clk/clk.c | 5 +++++ + include/linux/clk-provider.h | 1 + + 2 files changed, 6 insertions(+) + +--- a/drivers/clk/clk.c ++++ b/drivers/clk/clk.c +@@ -2466,6 +2466,11 @@ static int __clk_init(struct device *dev + if (core->ops->init) + core->ops->init(core->hw); + ++ if (core->flags & CLK_IS_CRITICAL) { ++ clk_core_prepare(core); ++ clk_core_enable(core); ++ } ++ + kref_init(&core->ref); + out: + clk_prepare_unlock(); +--- a/include/linux/clk-provider.h ++++ b/include/linux/clk-provider.h +@@ -31,6 +31,7 @@ + #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ + #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ + #define CLK_RECALC_NEW_RATES BIT(9) /* recalc rates after notifications */ ++#define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */ + + struct clk; + struct clk_hw; diff --git a/target/linux/brcm2708/patches-4.4/0345-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch b/target/linux/brcm2708/patches-4.4/0345-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch deleted file mode 100644 index 04ccb7058f..0000000000 --- a/target/linux/brcm2708/patches-4.4/0345-clk-Allow-clocks-to-be-marked-as-CRITICAL.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 3832bdcd51bcc95305c6ee0b381ae664d0516ce5 Mon Sep 17 00:00:00 2001 -From: Lee Jones -Date: Thu, 11 Feb 2016 13:19:09 -0800 -Subject: [PATCH 345/423] clk: Allow clocks to be marked as CRITICAL - -Critical clocks are those which must not be gated, else undefined -or catastrophic failure would occur. Here we have chosen to -ensure the prepare/enable counts are correctly incremented, so as -not to confuse users with enabled clocks with no visible users. - -Signed-off-by: Lee Jones -Signed-off-by: Michael Turquette -Link: lkml.kernel.org/r/1455225554-13267-2-git-send-email-mturquette@baylibre.com -(cherry picked from commit 32b9b10961860860268961d9aad0c56a73018c37) ---- - drivers/clk/clk.c | 5 +++++ - include/linux/clk-provider.h | 1 + - 2 files changed, 6 insertions(+) - ---- a/drivers/clk/clk.c -+++ b/drivers/clk/clk.c -@@ -2466,6 +2466,11 @@ static int __clk_init(struct device *dev - if (core->ops->init) - core->ops->init(core->hw); - -+ if (core->flags & CLK_IS_CRITICAL) { -+ clk_core_prepare(core); -+ clk_core_enable(core); -+ } -+ - kref_init(&core->ref); - out: - clk_prepare_unlock(); ---- a/include/linux/clk-provider.h -+++ b/include/linux/clk-provider.h -@@ -31,6 +31,7 @@ - #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */ - #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */ - #define CLK_RECALC_NEW_RATES BIT(9) /* recalc rates after notifications */ -+#define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */ - - struct clk; - struct clk_hw; diff --git a/target/linux/brcm2708/patches-4.4/0345-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch b/target/linux/brcm2708/patches-4.4/0345-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch new file mode 100644 index 0000000000..92b9501a13 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0345-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch @@ -0,0 +1,46 @@ +From 9f73459ac27903bb52d831db29cb70a95189fdba Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 26 Apr 2016 11:44:59 -0700 +Subject: [PATCH] clk: bcm2835: Mark the VPU clock as critical + +The VPU clock is also the clock for our AXI bus, so we really can't +disable it. This might have happened during boot if, for example, +uart1 (aux_uart clock) probed and was then disabled before the other +consumers of the VPU clock had probed. + +v2: Rewrite to use a .flags in bcm2835_clock_data, since other clocks + will need this too. + +Signed-off-by: Eric Anholt +--- + drivers/clk/bcm/clk-bcm2835.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -446,6 +446,8 @@ struct bcm2835_clock_data { + /* Number of fractional bits in the divider */ + u32 frac_bits; + ++ u32 flags; ++ + bool is_vpu_clock; + bool is_mash_clock; + }; +@@ -1242,7 +1244,7 @@ static struct clk *bcm2835_register_cloc + init.parent_names = parents; + init.num_parents = data->num_mux_parents; + init.name = data->name; +- init.flags = CLK_IGNORE_UNUSED; ++ init.flags = data->flags | CLK_IGNORE_UNUSED; + + if (data->is_vpu_clock) { + init.ops = &bcm2835_vpu_clock_clk_ops; +@@ -1661,6 +1663,7 @@ static const struct bcm2835_clk_desc clk + .div_reg = CM_VPUDIV, + .int_bits = 12, + .frac_bits = 8, ++ .flags = CLK_IS_CRITICAL, + .is_vpu_clock = true), + + /* clocks with per parent mux */ diff --git a/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch b/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch new file mode 100644 index 0000000000..60e4dd9e9f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch @@ -0,0 +1,54 @@ +From 832d2f1df231073ac72474743e3d3adbf0540030 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 9 May 2016 17:28:18 -0700 +Subject: [PATCH] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. + +These divide off of PLLD_PER and are used for the ethernet and wifi +PHYs source PLLs. Neither of them is currently represented by a phy +device that would grab the clock for us. + +This keeps other drivers from killing the networking PHYs when they +disable their own clocks and trigger PLLD_PER's refcount going to 0. + +v2: Skip marking as critical if they aren't on at boot. + +Signed-off-by: Eric Anholt +--- + drivers/clk/bcm/clk-bcm2835.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -1246,6 +1246,15 @@ static struct clk *bcm2835_register_cloc + init.name = data->name; + init.flags = data->flags | CLK_IGNORE_UNUSED; + ++ /* ++ * Some GPIO clocks for ethernet/wifi PLLs are marked as ++ * critical (since some platforms use them), but if the ++ * firmware didn't have them turned on then they clearly ++ * aren't actually critical. ++ */ ++ if ((cprman_read(cprman, data->ctl_reg) & CM_ENABLE) == 0) ++ init.flags &= ~CLK_IS_CRITICAL; ++ + if (data->is_vpu_clock) { + init.ops = &bcm2835_vpu_clock_clk_ops; + } else { +@@ -1720,13 +1729,15 @@ static const struct bcm2835_clk_desc clk + .div_reg = CM_GP1DIV, + .int_bits = 12, + .frac_bits = 12, ++ .flags = CLK_IS_CRITICAL, + .is_mash_clock = true), + [BCM2835_CLOCK_GP2] = REGISTER_PER_CLK( + .name = "gp2", + .ctl_reg = CM_GP2CTL, + .div_reg = CM_GP2DIV, + .int_bits = 12, +- .frac_bits = 12), ++ .frac_bits = 12, ++ .flags = CLK_IS_CRITICAL), + + /* HDMI state machine */ + [BCM2835_CLOCK_HSM] = REGISTER_PER_CLK( diff --git a/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch b/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch deleted file mode 100644 index 5e5c02803b..0000000000 --- a/target/linux/brcm2708/patches-4.4/0346-clk-bcm2835-Mark-the-VPU-clock-as-critical.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 644a5704bc14bbdea57fabeed0a5f2eb4e8f7251 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 26 Apr 2016 11:44:59 -0700 -Subject: [PATCH 346/423] clk: bcm2835: Mark the VPU clock as critical - -The VPU clock is also the clock for our AXI bus, so we really can't -disable it. This might have happened during boot if, for example, -uart1 (aux_uart clock) probed and was then disabled before the other -consumers of the VPU clock had probed. - -v2: Rewrite to use a .flags in bcm2835_clock_data, since other clocks - will need this too. - -Signed-off-by: Eric Anholt ---- - drivers/clk/bcm/clk-bcm2835.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -446,6 +446,8 @@ struct bcm2835_clock_data { - /* Number of fractional bits in the divider */ - u32 frac_bits; - -+ u32 flags; -+ - bool is_vpu_clock; - bool is_mash_clock; - }; -@@ -1242,7 +1244,7 @@ static struct clk *bcm2835_register_cloc - init.parent_names = parents; - init.num_parents = data->num_mux_parents; - init.name = data->name; -- init.flags = CLK_IGNORE_UNUSED; -+ init.flags = data->flags | CLK_IGNORE_UNUSED; - - if (data->is_vpu_clock) { - init.ops = &bcm2835_vpu_clock_clk_ops; -@@ -1661,6 +1663,7 @@ static const struct bcm2835_clk_desc clk - .div_reg = CM_VPUDIV, - .int_bits = 12, - .frac_bits = 8, -+ .flags = CLK_IS_CRITICAL, - .is_vpu_clock = true), - - /* clocks with per parent mux */ diff --git a/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch b/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch deleted file mode 100644 index 16e753eee8..0000000000 --- a/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Mark-GPIO-clocks-enabled-at-boot-as-crit.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 9a5319c6915364018e9422b6cef7e63a011b8b57 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 347/423] clk: bcm2835: Mark GPIO clocks enabled at boot as - critical. - -These divide off of PLLD_PER and are used for the ethernet and wifi -PHYs source PLLs. Neither of them is currently represented by a phy -device that would grab the clock for us. - -This keeps other drivers from killing the networking PHYs when they -disable their own clocks and trigger PLLD_PER's refcount going to 0. - -v2: Skip marking as critical if they aren't on at boot. - -Signed-off-by: Eric Anholt ---- - drivers/clk/bcm/clk-bcm2835.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1246,6 +1246,15 @@ static struct clk *bcm2835_register_cloc - init.name = data->name; - init.flags = data->flags | CLK_IGNORE_UNUSED; - -+ /* -+ * Some GPIO clocks for ethernet/wifi PLLs are marked as -+ * critical (since some platforms use them), but if the -+ * firmware didn't have them turned on then they clearly -+ * aren't actually critical. -+ */ -+ if ((cprman_read(cprman, data->ctl_reg) & CM_ENABLE) == 0) -+ init.flags &= ~CLK_IS_CRITICAL; -+ - if (data->is_vpu_clock) { - init.ops = &bcm2835_vpu_clock_clk_ops; - } else { -@@ -1720,13 +1729,15 @@ static const struct bcm2835_clk_desc clk - .div_reg = CM_GP1DIV, - .int_bits = 12, - .frac_bits = 12, -+ .flags = CLK_IS_CRITICAL, - .is_mash_clock = true), - [BCM2835_CLOCK_GP2] = REGISTER_PER_CLK( - .name = "gp2", - .ctl_reg = CM_GP2CTL, - .div_reg = CM_GP2DIV, - .int_bits = 12, -- .frac_bits = 12), -+ .frac_bits = 12, -+ .flags = CLK_IS_CRITICAL), - - /* HDMI state machine */ - [BCM2835_CLOCK_HSM] = REGISTER_PER_CLK( diff --git a/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch b/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch new file mode 100644 index 0000000000..cc90841566 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0347-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch @@ -0,0 +1,71 @@ +From 960587a39d7ca3d5279841218b42e008df7194aa Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 26 Apr 2016 12:39:45 -0700 +Subject: [PATCH] clk: bcm2835: Skip PLLC clocks when deciding on a new clock + parent + +If the firmware had set up a clock to source from PLLC, go along with +it. But if we're looking for a new parent, we don't want to switch it +to PLLC because the firmware will force PLLC (and thus the AXI bus +clock) to different frequencies during over-temp/under-voltage, +without notification to Linux. + +On my system, this moves the Linux-enabled HDMI state machine and DSI1 +escape clock over to plld_per from pllc_per. EMMC still ends up on +pllc_per, because the firmware had set it up to use that. + +Signed-off-by: Eric Anholt +Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks") +--- + drivers/clk/bcm/clk-bcm2835.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -1020,16 +1020,28 @@ static int bcm2835_clock_set_rate(struct + return 0; + } + ++static bool ++bcm2835_clk_is_pllc(struct clk_hw *hw) ++{ ++ if (!hw) ++ return false; ++ ++ return strncmp(clk_hw_get_name(hw), "pllc", 4) == 0; ++} ++ + static int bcm2835_clock_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) + { + struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); + struct clk_hw *parent, *best_parent = NULL; ++ bool current_parent_is_pllc; + unsigned long rate, best_rate = 0; + unsigned long prate, best_prate = 0; + size_t i; + u32 div; + ++ current_parent_is_pllc = bcm2835_clk_is_pllc(clk_hw_get_parent(hw)); ++ + /* + * Select parent clock that results in the closest but lower rate + */ +@@ -1037,6 +1049,17 @@ static int bcm2835_clock_determine_rate( + parent = clk_hw_get_parent_by_index(hw, i); + if (!parent) + continue; ++ ++ /* ++ * Don't choose a PLLC-derived clock as our parent ++ * unless it had been manually set that way. PLLC's ++ * frequency gets adjusted by the firmware due to ++ * over-temp or under-voltage conditions, without ++ * prior notification to our clock consumer. ++ */ ++ if (bcm2835_clk_is_pllc(parent) && !current_parent_is_pllc) ++ continue; ++ + prate = clk_hw_get_rate(parent); + div = bcm2835_clock_choose_div(hw, req->rate, prate, true); + rate = bcm2835_clock_rate_from_divisor(clock, prate, div); diff --git a/target/linux/brcm2708/patches-4.4/0348-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch b/target/linux/brcm2708/patches-4.4/0348-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch deleted file mode 100644 index f9b84cc48c..0000000000 --- a/target/linux/brcm2708/patches-4.4/0348-clk-bcm2835-Skip-PLLC-clocks-when-deciding-on-a-new-.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 58d35c928d3fad63627f4bd84126746a08e6ff6c Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 26 Apr 2016 12:39:45 -0700 -Subject: [PATCH 348/423] clk: bcm2835: Skip PLLC clocks when deciding on a new - clock parent - -If the firmware had set up a clock to source from PLLC, go along with -it. But if we're looking for a new parent, we don't want to switch it -to PLLC because the firmware will force PLLC (and thus the AXI bus -clock) to different frequencies during over-temp/under-voltage, -without notification to Linux. - -On my system, this moves the Linux-enabled HDMI state machine and DSI1 -escape clock over to plld_per from pllc_per. EMMC still ends up on -pllc_per, because the firmware had set it up to use that. - -Signed-off-by: Eric Anholt -Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks") ---- - drivers/clk/bcm/clk-bcm2835.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1020,16 +1020,28 @@ static int bcm2835_clock_set_rate(struct - return 0; - } - -+static bool -+bcm2835_clk_is_pllc(struct clk_hw *hw) -+{ -+ if (!hw) -+ return false; -+ -+ return strncmp(clk_hw_get_name(hw), "pllc", 4) == 0; -+} -+ - static int bcm2835_clock_determine_rate(struct clk_hw *hw, - struct clk_rate_request *req) - { - struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); - struct clk_hw *parent, *best_parent = NULL; -+ bool current_parent_is_pllc; - unsigned long rate, best_rate = 0; - unsigned long prate, best_prate = 0; - size_t i; - u32 div; - -+ current_parent_is_pllc = bcm2835_clk_is_pllc(clk_hw_get_parent(hw)); -+ - /* - * Select parent clock that results in the closest but lower rate - */ -@@ -1037,6 +1049,17 @@ static int bcm2835_clock_determine_rate( - parent = clk_hw_get_parent_by_index(hw, i); - if (!parent) - continue; -+ -+ /* -+ * Don't choose a PLLC-derived clock as our parent -+ * unless it had been manually set that way. PLLC's -+ * frequency gets adjusted by the firmware due to -+ * over-temp or under-voltage conditions, without -+ * prior notification to our clock consumer. -+ */ -+ if (bcm2835_clk_is_pllc(parent) && !current_parent_is_pllc) -+ continue; -+ - prate = clk_hw_get_rate(parent); - div = bcm2835_clock_choose_div(hw, req->rate, prate, true); - rate = bcm2835_clock_rate_from_divisor(clock, prate, div); diff --git a/target/linux/brcm2708/patches-4.4/0348-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch b/target/linux/brcm2708/patches-4.4/0348-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch new file mode 100644 index 0000000000..852f47b2e9 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0348-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch @@ -0,0 +1,56 @@ +From 8b01bab8c89fd4930ad304b5a7b3c1f6016c3743 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 11 May 2016 12:50:33 +0100 +Subject: [PATCH] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards + +Some SD cards have been found that corrupt data when small blocks +are erased. Add a quirk to indicate that ERASE should not be used, +and set it for cards of that type. + +Signed-off-by: Phil Elwell +--- + drivers/mmc/card/block.c | 7 +++++++ + drivers/mmc/core/core.c | 3 ++- + include/linux/mmc/card.h | 3 +++ + 3 files changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -2552,6 +2552,13 @@ static const struct mmc_fixup blk_fixups + MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc, + MMC_QUIRK_TRIM_BROKEN), + ++ /* ++ * On some Kingston SD cards, multiple erases of less than 64 ++ * sectors can cause corruption. ++ */ ++ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, ++ MMC_QUIRK_ERASE_BROKEN), ++ + END_FIXUP + }; + +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -2253,7 +2253,8 @@ EXPORT_SYMBOL(mmc_erase); + int mmc_can_erase(struct mmc_card *card) + { + if ((card->host->caps & MMC_CAP_ERASE) && +- (card->csd.cmdclass & CCC_ERASE) && card->erase_size) ++ (card->csd.cmdclass & CCC_ERASE) && card->erase_size && ++ !(card->quirks & MMC_QUIRK_ERASE_BROKEN)) + return 1; + return 0; + } +--- a/include/linux/mmc/card.h ++++ b/include/linux/mmc/card.h +@@ -281,6 +281,9 @@ struct mmc_card { + #define MMC_QUIRK_TRIM_BROKEN (1<<12) /* Skip trim */ + + ++#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ ++ ++ + unsigned int erase_size; /* erase size in sectors */ + unsigned int erase_shift; /* if erase unit is power 2 */ + unsigned int pref_erase; /* in sectors */ diff --git a/target/linux/brcm2708/patches-4.4/0349-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch b/target/linux/brcm2708/patches-4.4/0349-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch new file mode 100644 index 0000000000..c29bd86667 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0349-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch @@ -0,0 +1,284 @@ +From ae776ef7eb34d99945aadbaa607e1aec66fd04d0 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Mon, 16 May 2016 21:36:31 +1000 +Subject: [PATCH] New AudioInjector.net Pi soundcard with low jitter audio in + and out. + +Contains the sound/soc/bcm ALSA machine driver and necessary alterations to the Kconfig and Makefile. +Adds the dts overlay and updates the Makefile and README. +Updates the relevant defconfig files to enable building for the Raspberry Pi. +Thanks to Phil Elwell (pelwell) for the review, simple-card concepts and discussion. Thanks to Clive Messer for overlay naming suggestions. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../audioinjector-wm8731-audio-overlay.dts | 39 ++++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 3 + + sound/soc/bcm/audioinjector-pi-soundcard.c | 142 +++++++++++++++++++++ + 8 files changed, 200 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/audioinjector-wm8731-audio-overlay.dts + create mode 100644 sound/soc/bcm/audioinjector-pi-soundcard.c + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -16,6 +16,7 @@ dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc. + dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo + dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo + dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo + dtbo-$(RPI_DT_OVERLAYS) += boomberry-dac.dtbo + dtbo-$(RPI_DT_OVERLAYS) += boomberry-digi.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -225,6 +225,12 @@ Params: interrupt GPIO use + arrays (0=+0pF, 15=+4.5pF, default 15) + + ++Name: audioinjector-wm8731-audio ++Info: Configures the audioinjector.net audio add on soundcard ++Load: dtoverlay=audioinjector-wm8731-audio ++Params: ++ ++ + Name: bmp085_i2c-sensor + Info: Configures the BMP085/BMP180 digital barometric pressure and temperature + sensors from Bosch Sensortec +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/audioinjector-wm8731-audio-overlay.dts +@@ -0,0 +1,39 @@ ++// Definitions for audioinjector.net audio add on soundcard ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ wm8731@1a { ++ #sound-dai-cells = <0>; ++ compatible = "wlf,wm8731"; ++ reg = <0x1a>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "ai,audioinjector-pi-soundcard"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -863,6 +863,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m + CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m ++CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -855,6 +855,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m + CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m ++CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -85,3 +85,10 @@ config SND_BCM2708_SOC_ADAU1977_ADC + select SND_SOC_ADAU1977_I2C + help + Say Y or M if you want to add support for ADAU1977 ADC. ++ ++config SND_AUDIOINJECTOR_PI_SOUNDCARD ++ tristate "Support for audioinjector.net Pi add on soundcard" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_WM8731 ++ help ++ Say Y or M if you want to add support for audioinjector.net Pi Hat +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -15,6 +15,7 @@ snd-soc-rpi-dac-objs := rpi-dac.o + snd-soc-rpi-proto-objs := rpi-proto.o + snd-soc-iqaudio-dac-objs := iqaudio-dac.o + snd-soc-raspidac3-objs := raspidac3.o ++snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o + + obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o +@@ -27,3 +28,5 @@ obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += + obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o + obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o ++obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o ++ +--- /dev/null ++++ b/sound/soc/bcm/audioinjector-pi-soundcard.c +@@ -0,0 +1,142 @@ ++/* ++ * ASoC Driver for AudioInjector Pi add on soundcard ++ * ++ * Created on: 13-May-2016 ++ * Author: flatmax@flatmax.org ++ * based on code by Cliff Cai for the ssm2602 machine blackfin. ++ * with help from Lars-Peter Clausen for simplifying the original code to use the dai_fmt field. ++ * i2s_node code taken from the other sound/soc/bcm machine drivers. ++ * ++ * Copyright (C) 2016 Flatmax Pty. Ltd. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "../codecs/wm8731.h" ++ ++static int audioinjector_pi_soundcard_dai_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_dapm_context *dapm = &rtd->card->dapm; ++ ++ // not connected ++ snd_soc_dapm_nc_pin(dapm, "Mic Bias"); ++ snd_soc_dapm_nc_pin(dapm, "MICIN"); ++ snd_soc_dapm_nc_pin(dapm, "RHPOUT"); ++ snd_soc_dapm_nc_pin(dapm, "LHPOUT"); ++ ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, WM8731_SYSCLK_XTAL, 12000000, SND_SOC_CLOCK_IN); ++} ++ ++static struct snd_soc_dai_link audioinjector_pi_soundcard_dai[] = { ++ { ++ .name = "AudioInjector audio", ++ .stream_name = "AudioInjector audio", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "wm8731-hifi", ++ .platform_name = "bcm2835-i2s.0", ++ .codec_name = "wm8731.1-001a", ++ .init = audioinjector_pi_soundcard_dai_init, ++ .dai_fmt = SND_SOC_DAIFMT_CBM_CFM|SND_SOC_DAIFMT_I2S|SND_SOC_DAIFMT_NB_NF, ++ }, ++}; ++ ++static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { ++ SND_SOC_DAPM_SPK("Ext Spk", NULL), ++ SND_SOC_DAPM_LINE("Line In Jacks", NULL), ++}; ++ ++/* Corgi machine connections to the codec pins */ ++static const struct snd_soc_dapm_route audioinjector_audio_map[] = { ++ /* speaker connected to LOUT, ROUT */ ++ {"Ext Spk", NULL, "ROUT"}, ++ {"Ext Spk", NULL, "LOUT"}, ++ ++ /* line inputs */ ++ {"Line In Jacks", NULL, "Line Input"}, ++}; ++ ++static struct snd_soc_card snd_soc_audioinjector = { ++ .name = "audioinjector-pi-soundcard", ++ .dai_link = audioinjector_pi_soundcard_dai, ++ .num_links = 1, ++ ++ .dapm_widgets = wm8731_dapm_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), ++ .dapm_routes = audioinjector_audio_map, ++ .num_dapm_routes = ARRAY_SIZE(audioinjector_audio_map), ++}; ++ ++static int audioinjector_pi_soundcard_probe(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = &snd_soc_audioinjector; ++ int ret; ++ ++ card->dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct snd_soc_dai_link *dai = &audioinjector_pi_soundcard_dai[0]; ++ struct device_node *i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } else ++ if (!dai->cpu_of_node) { ++ dev_err(&pdev->dev, "Property 'i2s-controller' missing or invalid\n"); ++ return -EINVAL; ++ } ++ } ++ ++ if ((ret = snd_soc_register_card(card))) { ++ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); ++ } ++ return ret; ++} ++ ++static int audioinjector_pi_soundcard_remove(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = platform_get_drvdata(pdev); ++ return snd_soc_unregister_card(card); ++ ++} ++ ++static const struct of_device_id audioinjector_pi_soundcard_of_match[] = { ++ { .compatible = "ai,audioinjector-pi-soundcard", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, audioinjector_pi_soundcard_of_match); ++ ++static struct platform_driver audioinjector_pi_soundcard_driver = { ++ .driver = { ++ .name = "audioinjector-audio", ++ .owner = THIS_MODULE, ++ .of_match_table = audioinjector_pi_soundcard_of_match, ++ }, ++ .probe = audioinjector_pi_soundcard_probe, ++ .remove = audioinjector_pi_soundcard_remove, ++}; ++ ++module_platform_driver(audioinjector_pi_soundcard_driver); ++MODULE_AUTHOR("Matt Flax "); ++MODULE_DESCRIPTION("AudioInjector.net Pi Soundcard"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:audioinjector-pi-soundcard"); ++ diff --git a/target/linux/brcm2708/patches-4.4/0349-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch b/target/linux/brcm2708/patches-4.4/0349-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch deleted file mode 100644 index 0058e8a3b5..0000000000 --- a/target/linux/brcm2708/patches-4.4/0349-mmc-Add-MMC_QUIRK_ERASE_BROKEN-for-some-cards.patch +++ /dev/null @@ -1,56 +0,0 @@ -From efba060602bfb54eb1106972360df001bb88ae3b Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 349/423] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards - -Some SD cards have been found that corrupt data when small blocks -are erased. Add a quirk to indicate that ERASE should not be used, -and set it for cards of that type. - -Signed-off-by: Phil Elwell ---- - drivers/mmc/card/block.c | 7 +++++++ - drivers/mmc/core/core.c | 3 ++- - include/linux/mmc/card.h | 3 +++ - 3 files changed, 12 insertions(+), 1 deletion(-) - ---- a/drivers/mmc/card/block.c -+++ b/drivers/mmc/card/block.c -@@ -2552,6 +2552,13 @@ static const struct mmc_fixup blk_fixups - MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc, - MMC_QUIRK_TRIM_BROKEN), - -+ /* -+ * On some Kingston SD cards, multiple erases of less than 64 -+ * sectors can cause corruption. -+ */ -+ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, -+ MMC_QUIRK_ERASE_BROKEN), -+ - END_FIXUP - }; - ---- a/drivers/mmc/core/core.c -+++ b/drivers/mmc/core/core.c -@@ -2253,7 +2253,8 @@ EXPORT_SYMBOL(mmc_erase); - int mmc_can_erase(struct mmc_card *card) - { - if ((card->host->caps & MMC_CAP_ERASE) && -- (card->csd.cmdclass & CCC_ERASE) && card->erase_size) -+ (card->csd.cmdclass & CCC_ERASE) && card->erase_size && -+ !(card->quirks & MMC_QUIRK_ERASE_BROKEN)) - return 1; - return 0; - } ---- a/include/linux/mmc/card.h -+++ b/include/linux/mmc/card.h -@@ -281,6 +281,9 @@ struct mmc_card { - #define MMC_QUIRK_TRIM_BROKEN (1<<12) /* Skip trim */ - - -+#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ -+ -+ - unsigned int erase_size; /* erase size in sectors */ - unsigned int erase_shift; /* if erase unit is power 2 */ - unsigned int pref_erase; /* in sectors */ diff --git a/target/linux/brcm2708/patches-4.4/0350-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch b/target/linux/brcm2708/patches-4.4/0350-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch deleted file mode 100644 index f9f0600fbf..0000000000 --- a/target/linux/brcm2708/patches-4.4/0350-New-AudioInjector.net-Pi-soundcard-with-low-jitter-a.patch +++ /dev/null @@ -1,284 +0,0 @@ -From ea3e9f892437a7afc78ac04e899fa35c155f198e Mon Sep 17 00:00:00 2001 -From: Matt Flax -Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 350/423] New AudioInjector.net Pi soundcard with low jitter - audio in and out. - -Contains the sound/soc/bcm ALSA machine driver and necessary alterations to the Kconfig and Makefile. -Adds the dts overlay and updates the Makefile and README. -Updates the relevant defconfig files to enable building for the Raspberry Pi. -Thanks to Phil Elwell (pelwell) for the review, simple-card concepts and discussion. Thanks to Clive Messer for overlay naming suggestions. ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 + - .../audioinjector-wm8731-audio-overlay.dts | 39 ++++++ - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - sound/soc/bcm/Kconfig | 7 + - sound/soc/bcm/Makefile | 3 + - sound/soc/bcm/audioinjector-pi-soundcard.c | 142 +++++++++++++++++++++ - 8 files changed, 200 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/audioinjector-wm8731-audio-overlay.dts - create mode 100644 sound/soc/bcm/audioinjector-pi-soundcard.c - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -16,6 +16,7 @@ dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc. - dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo - dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo - dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo - dtbo-$(RPI_DT_OVERLAYS) += boomberry-dac.dtbo - dtbo-$(RPI_DT_OVERLAYS) += boomberry-digi.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -225,6 +225,12 @@ Params: interrupt GPIO use - arrays (0=+0pF, 15=+4.5pF, default 15) - - -+Name: audioinjector-wm8731-audio -+Info: Configures the audioinjector.net audio add on soundcard -+Load: dtoverlay=audioinjector-wm8731-audio -+Params: -+ -+ - Name: bmp085_i2c-sensor - Info: Configures the BMP085/BMP180 digital barometric pressure and temperature - sensors from Bosch Sensortec ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/audioinjector-wm8731-audio-overlay.dts -@@ -0,0 +1,39 @@ -+// Definitions for audioinjector.net audio add on soundcard -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ wm8731@1a { -+ #sound-dai-cells = <0>; -+ compatible = "wlf,wm8731"; -+ reg = <0x1a>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ __overlay__ { -+ compatible = "ai,audioinjector-pi-soundcard"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+}; ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -863,6 +863,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m - CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m -+CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -855,6 +855,7 @@ CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m - CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m -+CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -85,3 +85,10 @@ config SND_BCM2708_SOC_ADAU1977_ADC - select SND_SOC_ADAU1977_I2C - help - Say Y or M if you want to add support for ADAU1977 ADC. -+ -+config SND_AUDIOINJECTOR_PI_SOUNDCARD -+ tristate "Support for audioinjector.net Pi add on soundcard" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_WM8731 -+ help -+ Say Y or M if you want to add support for audioinjector.net Pi Hat ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -15,6 +15,7 @@ snd-soc-rpi-dac-objs := rpi-dac.o - snd-soc-rpi-proto-objs := rpi-proto.o - snd-soc-iqaudio-dac-objs := iqaudio-dac.o - snd-soc-raspidac3-objs := raspidac3.o -+snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o - - obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o -@@ -27,3 +28,5 @@ obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += - obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o - obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o -+obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o -+ ---- /dev/null -+++ b/sound/soc/bcm/audioinjector-pi-soundcard.c -@@ -0,0 +1,142 @@ -+/* -+ * ASoC Driver for AudioInjector Pi add on soundcard -+ * -+ * Created on: 13-May-2016 -+ * Author: flatmax@flatmax.org -+ * based on code by Cliff Cai for the ssm2602 machine blackfin. -+ * with help from Lars-Peter Clausen for simplifying the original code to use the dai_fmt field. -+ * i2s_node code taken from the other sound/soc/bcm machine drivers. -+ * -+ * Copyright (C) 2016 Flatmax Pty. Ltd. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "../codecs/wm8731.h" -+ -+static int audioinjector_pi_soundcard_dai_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_dapm_context *dapm = &rtd->card->dapm; -+ -+ // not connected -+ snd_soc_dapm_nc_pin(dapm, "Mic Bias"); -+ snd_soc_dapm_nc_pin(dapm, "MICIN"); -+ snd_soc_dapm_nc_pin(dapm, "RHPOUT"); -+ snd_soc_dapm_nc_pin(dapm, "LHPOUT"); -+ -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, WM8731_SYSCLK_XTAL, 12000000, SND_SOC_CLOCK_IN); -+} -+ -+static struct snd_soc_dai_link audioinjector_pi_soundcard_dai[] = { -+ { -+ .name = "AudioInjector audio", -+ .stream_name = "AudioInjector audio", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "wm8731-hifi", -+ .platform_name = "bcm2835-i2s.0", -+ .codec_name = "wm8731.1-001a", -+ .init = audioinjector_pi_soundcard_dai_init, -+ .dai_fmt = SND_SOC_DAIFMT_CBM_CFM|SND_SOC_DAIFMT_I2S|SND_SOC_DAIFMT_NB_NF, -+ }, -+}; -+ -+static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { -+ SND_SOC_DAPM_SPK("Ext Spk", NULL), -+ SND_SOC_DAPM_LINE("Line In Jacks", NULL), -+}; -+ -+/* Corgi machine connections to the codec pins */ -+static const struct snd_soc_dapm_route audioinjector_audio_map[] = { -+ /* speaker connected to LOUT, ROUT */ -+ {"Ext Spk", NULL, "ROUT"}, -+ {"Ext Spk", NULL, "LOUT"}, -+ -+ /* line inputs */ -+ {"Line In Jacks", NULL, "Line Input"}, -+}; -+ -+static struct snd_soc_card snd_soc_audioinjector = { -+ .name = "audioinjector-pi-soundcard", -+ .dai_link = audioinjector_pi_soundcard_dai, -+ .num_links = 1, -+ -+ .dapm_widgets = wm8731_dapm_widgets, -+ .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), -+ .dapm_routes = audioinjector_audio_map, -+ .num_dapm_routes = ARRAY_SIZE(audioinjector_audio_map), -+}; -+ -+static int audioinjector_pi_soundcard_probe(struct platform_device *pdev) -+{ -+ struct snd_soc_card *card = &snd_soc_audioinjector; -+ int ret; -+ -+ card->dev = &pdev->dev; -+ -+ if (pdev->dev.of_node) { -+ struct snd_soc_dai_link *dai = &audioinjector_pi_soundcard_dai[0]; -+ struct device_node *i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } else -+ if (!dai->cpu_of_node) { -+ dev_err(&pdev->dev, "Property 'i2s-controller' missing or invalid\n"); -+ return -EINVAL; -+ } -+ } -+ -+ if ((ret = snd_soc_register_card(card))) { -+ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); -+ } -+ return ret; -+} -+ -+static int audioinjector_pi_soundcard_remove(struct platform_device *pdev) -+{ -+ struct snd_soc_card *card = platform_get_drvdata(pdev); -+ return snd_soc_unregister_card(card); -+ -+} -+ -+static const struct of_device_id audioinjector_pi_soundcard_of_match[] = { -+ { .compatible = "ai,audioinjector-pi-soundcard", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, audioinjector_pi_soundcard_of_match); -+ -+static struct platform_driver audioinjector_pi_soundcard_driver = { -+ .driver = { -+ .name = "audioinjector-audio", -+ .owner = THIS_MODULE, -+ .of_match_table = audioinjector_pi_soundcard_of_match, -+ }, -+ .probe = audioinjector_pi_soundcard_probe, -+ .remove = audioinjector_pi_soundcard_remove, -+}; -+ -+module_platform_driver(audioinjector_pi_soundcard_driver); -+MODULE_AUTHOR("Matt Flax "); -+MODULE_DESCRIPTION("AudioInjector.net Pi Soundcard"); -+MODULE_LICENSE("GPL v2"); -+MODULE_ALIAS("platform:audioinjector-pi-soundcard"); -+ diff --git a/target/linux/brcm2708/patches-4.4/0350-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch b/target/linux/brcm2708/patches-4.4/0350-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch new file mode 100644 index 0000000000..c75fca605f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0350-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch @@ -0,0 +1,23 @@ +From 2aa9602cca746c3bd2fe664574234adb147e4ba7 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 19 May 2016 14:40:28 +0100 +Subject: [PATCH] mmc: Apply QUIRK_BROKEN_ERASE to other capacities + +Signed-off-by: Phil Elwell +--- + drivers/mmc/card/block.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -2558,6 +2558,10 @@ static const struct mmc_fixup blk_fixups + */ + MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, + MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk_mmc, ++ MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk_mmc, ++ MMC_QUIRK_ERASE_BROKEN), + + END_FIXUP + }; diff --git a/target/linux/brcm2708/patches-4.4/0351-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch b/target/linux/brcm2708/patches-4.4/0351-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch deleted file mode 100644 index 299fdf57af..0000000000 --- a/target/linux/brcm2708/patches-4.4/0351-mmc-Apply-QUIRK_BROKEN_ERASE-to-other-capacities.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 4742aa31f93ae7d222d2564b2258a16fd297659e Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 19 May 2016 14:40:28 +0100 -Subject: [PATCH 351/423] mmc: Apply QUIRK_BROKEN_ERASE to other capacities - -Signed-off-by: Phil Elwell ---- - drivers/mmc/card/block.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/mmc/card/block.c -+++ b/drivers/mmc/card/block.c -@@ -2558,6 +2558,10 @@ static const struct mmc_fixup blk_fixups - */ - MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, - MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk_mmc, -+ MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk_mmc, -+ MMC_QUIRK_ERASE_BROKEN), - - END_FIXUP - }; diff --git a/target/linux/brcm2708/patches-4.4/0352-mmc-Add-card_quirks-module-parameter-log-quirks.patch b/target/linux/brcm2708/patches-4.4/0352-mmc-Add-card_quirks-module-parameter-log-quirks.patch new file mode 100644 index 0000000000..97fe268e18 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0352-mmc-Add-card_quirks-module-parameter-log-quirks.patch @@ -0,0 +1,76 @@ +From 2b859a1735c3113756c172ab8113f3f764c49c38 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 20 May 2016 10:11:43 +0100 +Subject: [PATCH] mmc: Add card_quirks module parameter, log quirks + +Use mmc_block.card_quirks to override the quirks for all SD or MMC +cards. The value is a bitfield using the bit positions defined in +include/linux/mmc/card.h. If the module parameter is placed in the +kernel command line (or bootargs) stored on the card then, assuming the +device only has one SD card interface, the override effectively becomes +card-specific. + +Signed-off-by: Phil Elwell +--- + drivers/mmc/card/block.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -137,6 +137,13 @@ enum { + module_param(perdev_minors, int, 0444); + MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device"); + ++/* ++ * Allow quirks to be overridden for the current card ++ */ ++static char *card_quirks; ++module_param(card_quirks, charp, 0644); ++MODULE_PARM_DESC(card_quirks, "Force the use of the indicated quirks (a bitfield)"); ++ + static inline int mmc_blk_part_switch(struct mmc_card *card, + struct mmc_blk_data *md); + static int get_card_status(struct mmc_card *card, u32 *status, int retries); +@@ -2570,6 +2577,7 @@ static int mmc_blk_probe(struct mmc_card + { + struct mmc_blk_data *md, *part_md; + char cap_str[10]; ++ char quirk_str[24]; + + /* + * Check that the card supports the command class(es) we need. +@@ -2577,7 +2585,16 @@ static int mmc_blk_probe(struct mmc_card + if (!(card->csd.cmdclass & CCC_BLOCK_READ)) + return -ENODEV; + +- mmc_fixup_device(card, blk_fixups); ++ if (card_quirks) { ++ unsigned long quirks; ++ if (kstrtoul(card_quirks, 0, &quirks) == 0) ++ card->quirks = (unsigned int)quirks; ++ else ++ pr_err("mmc_block: Invalid card_quirks parameter '%s'\n", ++ card_quirks); ++ } ++ else ++ mmc_fixup_device(card, blk_fixups); + + md = mmc_blk_alloc(card); + if (IS_ERR(md)) +@@ -2585,9 +2602,14 @@ static int mmc_blk_probe(struct mmc_card + + string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, + cap_str, sizeof(cap_str)); +- pr_info("%s: %s %s %s %s\n", ++ if (card->quirks) ++ snprintf(quirk_str, sizeof(quirk_str), ++ " (quirks 0x%08x)", card->quirks); ++ else ++ quirk_str[0] = '\0'; ++ pr_info("%s: %s %s %s%s%s\n", + md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), +- cap_str, md->read_only ? "(ro)" : ""); ++ cap_str, md->read_only ? " (ro)" : "", quirk_str); + + if (mmc_blk_alloc_parts(card, md)) + goto out; diff --git a/target/linux/brcm2708/patches-4.4/0353-mmc-Add-card_quirks-module-parameter-log-quirks.patch b/target/linux/brcm2708/patches-4.4/0353-mmc-Add-card_quirks-module-parameter-log-quirks.patch deleted file mode 100644 index 4a9a51a328..0000000000 --- a/target/linux/brcm2708/patches-4.4/0353-mmc-Add-card_quirks-module-parameter-log-quirks.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 2c0da5702844c4ec246243634778bd3448100570 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 20 May 2016 10:11:43 +0100 -Subject: [PATCH 353/423] mmc: Add card_quirks module parameter, log quirks - -Use mmc_block.card_quirks to override the quirks for all SD or MMC -cards. The value is a bitfield using the bit positions defined in -include/linux/mmc/card.h. If the module parameter is placed in the -kernel command line (or bootargs) stored on the card then, assuming the -device only has one SD card interface, the override effectively becomes -card-specific. - -Signed-off-by: Phil Elwell ---- - drivers/mmc/card/block.c | 28 +++++++++++++++++++++++++--- - 1 file changed, 25 insertions(+), 3 deletions(-) - ---- a/drivers/mmc/card/block.c -+++ b/drivers/mmc/card/block.c -@@ -137,6 +137,13 @@ enum { - module_param(perdev_minors, int, 0444); - MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device"); - -+/* -+ * Allow quirks to be overridden for the current card -+ */ -+static char *card_quirks; -+module_param(card_quirks, charp, 0644); -+MODULE_PARM_DESC(card_quirks, "Force the use of the indicated quirks (a bitfield)"); -+ - static inline int mmc_blk_part_switch(struct mmc_card *card, - struct mmc_blk_data *md); - static int get_card_status(struct mmc_card *card, u32 *status, int retries); -@@ -2570,6 +2577,7 @@ static int mmc_blk_probe(struct mmc_card - { - struct mmc_blk_data *md, *part_md; - char cap_str[10]; -+ char quirk_str[24]; - - /* - * Check that the card supports the command class(es) we need. -@@ -2577,7 +2585,16 @@ static int mmc_blk_probe(struct mmc_card - if (!(card->csd.cmdclass & CCC_BLOCK_READ)) - return -ENODEV; - -- mmc_fixup_device(card, blk_fixups); -+ if (card_quirks) { -+ unsigned long quirks; -+ if (kstrtoul(card_quirks, 0, &quirks) == 0) -+ card->quirks = (unsigned int)quirks; -+ else -+ pr_err("mmc_block: Invalid card_quirks parameter '%s'\n", -+ card_quirks); -+ } -+ else -+ mmc_fixup_device(card, blk_fixups); - - md = mmc_blk_alloc(card); - if (IS_ERR(md)) -@@ -2585,9 +2602,14 @@ static int mmc_blk_probe(struct mmc_card - - string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, - cap_str, sizeof(cap_str)); -- pr_info("%s: %s %s %s %s\n", -+ if (card->quirks) -+ snprintf(quirk_str, sizeof(quirk_str), -+ " (quirks 0x%08x)", card->quirks); -+ else -+ quirk_str[0] = '\0'; -+ pr_info("%s: %s %s %s%s%s\n", - md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), -- cap_str, md->read_only ? "(ro)" : ""); -+ cap_str, md->read_only ? " (ro)" : "", quirk_str); - - if (mmc_blk_alloc_parts(card, md)) - goto out; diff --git a/target/linux/brcm2708/patches-4.4/0353-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch b/target/linux/brcm2708/patches-4.4/0353-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch new file mode 100644 index 0000000000..1c6c5c9293 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0353-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch @@ -0,0 +1,58 @@ +From dab463aa0dbd5ac45403dade2723046eba214359 Mon Sep 17 00:00:00 2001 +From: Nicolas Boullis +Date: Sun, 10 Apr 2016 13:23:05 +0200 +Subject: [PATCH] rtc: ds1307: ensure that any pending alarm is cleared before + a new alarm is enabled +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If a previously-set alarm was disabled and then triggered, it may still +be pending when a new alarm is configured. + +Then, if the alarm is enabled before the pending alarm is cleared, then +an interrupt is immediately raised. + +Unfortunately, when the alarm is cleared and enabled during the same I²C +block write, the chip (at least the DS1339 I have) considers that the +alarm is enabled before it is cleared, and raises an interrupt. + +This patch ensures that the pending alarm is cleared before the alarm is +enabled. + +Signed-off-by: Nicolas Boullis +Signed-off-by: Alexandre Belloni +--- + drivers/rtc/rtc-ds1307.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/drivers/rtc/rtc-ds1307.c ++++ b/drivers/rtc/rtc-ds1307.c +@@ -540,12 +540,8 @@ static int ds1337_set_alarm(struct devic + buf[5] = 0; + buf[6] = 0; + +- /* optionally enable ALARM1 */ ++ /* disable alarms */ + buf[7] = control & ~(DS1337_BIT_A1IE | DS1337_BIT_A2IE); +- if (t->enabled) { +- dev_dbg(dev, "alarm IRQ armed\n"); +- buf[7] |= DS1337_BIT_A1IE; /* only ALARM1 is used */ +- } + buf[8] = status & ~(DS1337_BIT_A1I | DS1337_BIT_A2I); + + ret = ds1307->write_block_data(client, +@@ -555,6 +551,13 @@ static int ds1337_set_alarm(struct devic + return ret; + } + ++ /* optionally enable ALARM1 */ ++ if (t->enabled) { ++ dev_dbg(dev, "alarm IRQ armed\n"); ++ buf[7] |= DS1337_BIT_A1IE; /* only ALARM1 is used */ ++ i2c_smbus_write_byte_data(client, DS1337_REG_CONTROL, buf[7]); ++ } ++ + return 0; + } + diff --git a/target/linux/brcm2708/patches-4.4/0354-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0354-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch new file mode 100644 index 0000000000..6770f914a1 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0354-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch @@ -0,0 +1,27 @@ +From 01f818eabe959b1d58ad3ef41310e1210b04a9b0 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 23 May 2016 17:06:08 +0100 +Subject: [PATCH] Revert "Revert "drm/vc4: Force HDMI to connected."" + +This reverts commit 7da44d06540b4a191ecc74e943f3203577fce0df. + +This breaks the driver on Pi3 as hotplug is implemented through a +gpio expander owned by the GPU. + +We need to extend the virtual gpio driver to support this, but for +now assume hotplug is always enabled. +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -166,6 +166,8 @@ vc4_hdmi_connector_detect(struct drm_con + struct drm_device *dev = connector->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); + ++ return connector_status_connected; ++ + if (vc4->hdmi->hpd_gpio) { + if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^ + vc4->hdmi->hpd_active_low) diff --git a/target/linux/brcm2708/patches-4.4/0354-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch b/target/linux/brcm2708/patches-4.4/0354-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch deleted file mode 100644 index 49d7b33f83..0000000000 --- a/target/linux/brcm2708/patches-4.4/0354-rtc-ds1307-ensure-that-any-pending-alarm-is-cleared-.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 82be650e97522260a9694ae56dc3475f40c4240e Mon Sep 17 00:00:00 2001 -From: Nicolas Boullis -Date: Sun, 10 Apr 2016 13:23:05 +0200 -Subject: [PATCH 354/423] rtc: ds1307: ensure that any pending alarm is cleared - before a new alarm is enabled -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If a previously-set alarm was disabled and then triggered, it may still -be pending when a new alarm is configured. - -Then, if the alarm is enabled before the pending alarm is cleared, then -an interrupt is immediately raised. - -Unfortunately, when the alarm is cleared and enabled during the same I²C -block write, the chip (at least the DS1339 I have) considers that the -alarm is enabled before it is cleared, and raises an interrupt. - -This patch ensures that the pending alarm is cleared before the alarm is -enabled. - -Signed-off-by: Nicolas Boullis -Signed-off-by: Alexandre Belloni ---- - drivers/rtc/rtc-ds1307.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - ---- a/drivers/rtc/rtc-ds1307.c -+++ b/drivers/rtc/rtc-ds1307.c -@@ -540,12 +540,8 @@ static int ds1337_set_alarm(struct devic - buf[5] = 0; - buf[6] = 0; - -- /* optionally enable ALARM1 */ -+ /* disable alarms */ - buf[7] = control & ~(DS1337_BIT_A1IE | DS1337_BIT_A2IE); -- if (t->enabled) { -- dev_dbg(dev, "alarm IRQ armed\n"); -- buf[7] |= DS1337_BIT_A1IE; /* only ALARM1 is used */ -- } - buf[8] = status & ~(DS1337_BIT_A1I | DS1337_BIT_A2I); - - ret = ds1307->write_block_data(client, -@@ -555,6 +551,13 @@ static int ds1337_set_alarm(struct devic - return ret; - } - -+ /* optionally enable ALARM1 */ -+ if (t->enabled) { -+ dev_dbg(dev, "alarm IRQ armed\n"); -+ buf[7] |= DS1337_BIT_A1IE; /* only ALARM1 is used */ -+ i2c_smbus_write_byte_data(client, DS1337_REG_CONTROL, buf[7]); -+ } -+ - return 0; - } - diff --git a/target/linux/brcm2708/patches-4.4/0355-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0355-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch deleted file mode 100644 index 3d2f489375..0000000000 --- a/target/linux/brcm2708/patches-4.4/0355-Revert-Revert-drm-vc4-Force-HDMI-to-connected.patch +++ /dev/null @@ -1,27 +0,0 @@ -From e1240073ba4bb5f845edc69437d2b638678332f9 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 23 May 2016 17:06:08 +0100 -Subject: [PATCH 355/423] Revert "Revert "drm/vc4: Force HDMI to connected."" - -This reverts commit 7da44d06540b4a191ecc74e943f3203577fce0df. - -This breaks the driver on Pi3 as hotplug is implemented through a -gpio expander owned by the GPU. - -We need to extend the virtual gpio driver to support this, but for -now assume hotplug is always enabled. ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -166,6 +166,8 @@ vc4_hdmi_connector_detect(struct drm_con - struct drm_device *dev = connector->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); - -+ return connector_status_connected; -+ - if (vc4->hdmi->hpd_gpio) { - if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^ - vc4->hdmi->hpd_active_low) diff --git a/target/linux/brcm2708/patches-4.4/0355-config-Add-NF_MATCH_RPFILTER.patch b/target/linux/brcm2708/patches-4.4/0355-config-Add-NF_MATCH_RPFILTER.patch new file mode 100644 index 0000000000..530ad49002 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0355-config-Add-NF_MATCH_RPFILTER.patch @@ -0,0 +1,46 @@ +From 42af2a4e065f71af6505ba6159073a2da28bcc2f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 23 May 2016 18:22:52 +0100 +Subject: [PATCH] config: Add NF_MATCH_RPFILTER + +--- + arch/arm/configs/bcm2709_defconfig | 2 ++ + arch/arm/configs/bcmrpi_defconfig | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -223,6 +223,7 @@ CONFIG_NF_CONNTRACK_IPV4=m + CONFIG_IP_NF_IPTABLES=m + CONFIG_IP_NF_MATCH_AH=m + CONFIG_IP_NF_MATCH_ECN=m ++CONFIG_IP_NF_MATCH_RPFILTER=m + CONFIG_IP_NF_MATCH_TTL=m + CONFIG_IP_NF_FILTER=m + CONFIG_IP_NF_TARGET_REJECT=m +@@ -247,6 +248,7 @@ CONFIG_IP6_NF_MATCH_OPTS=m + CONFIG_IP6_NF_MATCH_HL=m + CONFIG_IP6_NF_MATCH_IPV6HEADER=m + CONFIG_IP6_NF_MATCH_MH=m ++CONFIG_IP6_NF_MATCH_RPFILTER=m + CONFIG_IP6_NF_MATCH_RT=m + CONFIG_IP6_NF_TARGET_HL=m + CONFIG_IP6_NF_FILTER=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -216,6 +216,7 @@ CONFIG_NF_CONNTRACK_IPV4=m + CONFIG_IP_NF_IPTABLES=m + CONFIG_IP_NF_MATCH_AH=m + CONFIG_IP_NF_MATCH_ECN=m ++CONFIG_IP_NF_MATCH_RPFILTER=m + CONFIG_IP_NF_MATCH_TTL=m + CONFIG_IP_NF_FILTER=m + CONFIG_IP_NF_TARGET_REJECT=m +@@ -240,6 +241,7 @@ CONFIG_IP6_NF_MATCH_OPTS=m + CONFIG_IP6_NF_MATCH_HL=m + CONFIG_IP6_NF_MATCH_IPV6HEADER=m + CONFIG_IP6_NF_MATCH_MH=m ++CONFIG_IP6_NF_MATCH_RPFILTER=m + CONFIG_IP6_NF_MATCH_RT=m + CONFIG_IP6_NF_TARGET_HL=m + CONFIG_IP6_NF_FILTER=m diff --git a/target/linux/brcm2708/patches-4.4/0356-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch b/target/linux/brcm2708/patches-4.4/0356-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch new file mode 100644 index 0000000000..122183951c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0356-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch @@ -0,0 +1,86 @@ +From 40609ec9a60194b9f04cf5ee4fbc4ee5a011a7ea Mon Sep 17 00:00:00 2001 +From: Michael Kaplan +Date: Tue, 24 May 2016 10:19:08 +0200 +Subject: [PATCH] Added Overlay for Microchip MCP23017 I2C gpio expander + +--- + arch/arm/boot/dts/overlays/README | 9 +++++ + arch/arm/boot/dts/overlays/mcp23017-overlay.dts | 54 +++++++++++++++++++++++++ + 2 files changed, 63 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/mcp23017-overlay.dts + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -567,6 +567,15 @@ Params: gpio_out_pin GPIO for + (default "off") + + ++Name: mcp23017 ++Info: Configures the MCP23017 I2C port expander ++Load: dtoverlay=mcp23017,= ++Params: gpiopin Gpio pin connected to the INTA output of the ++ MCP23017 (default: 4) ++ ++ addr I2C address of the MCP23017 (default: 0x20) ++ ++ + Name: mcp2515-can0 + Info: Configures the MCP2515 CAN controller on spi0.0 + Load: dtoverlay=mcp2515-can0,= +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts +@@ -0,0 +1,54 @@ ++// Definitions for MCP23017 Gpio Extender from Microchip Semiconductor ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&i2c1>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ mcp23017_pins: mcp23017_pins { ++ brcm,pins = <4>; ++ brcm,function = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mcp23017: mcp@20 { ++ compatible = "microchip,mcp23017"; ++ reg = <0x20>; ++ gpio-controller; ++ #gpio-cells = <2>; ++ #interrupt-cells=<2>; ++ interrupt-parent = <&gpio>; ++ interrupts = <4 2>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ gpiopin = <&mcp23017_pins>,"brcm,pins:0", ++ <&mcp23017>,"interrupts:0"; ++ addr = <&mcp23017>,"reg:0"; ++ }; ++}; ++ diff --git a/target/linux/brcm2708/patches-4.4/0356-config-Add-NF_MATCH_RPFILTER.patch b/target/linux/brcm2708/patches-4.4/0356-config-Add-NF_MATCH_RPFILTER.patch deleted file mode 100644 index 1bc3d85c72..0000000000 --- a/target/linux/brcm2708/patches-4.4/0356-config-Add-NF_MATCH_RPFILTER.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 7c64de28d0552c8240cf79b934b069dd9af24b14 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 23 May 2016 18:22:52 +0100 -Subject: [PATCH 356/423] config: Add NF_MATCH_RPFILTER - ---- - arch/arm/configs/bcm2709_defconfig | 2 ++ - arch/arm/configs/bcmrpi_defconfig | 2 ++ - 2 files changed, 4 insertions(+) - ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -223,6 +223,7 @@ CONFIG_NF_CONNTRACK_IPV4=m - CONFIG_IP_NF_IPTABLES=m - CONFIG_IP_NF_MATCH_AH=m - CONFIG_IP_NF_MATCH_ECN=m -+CONFIG_IP_NF_MATCH_RPFILTER=m - CONFIG_IP_NF_MATCH_TTL=m - CONFIG_IP_NF_FILTER=m - CONFIG_IP_NF_TARGET_REJECT=m -@@ -247,6 +248,7 @@ CONFIG_IP6_NF_MATCH_OPTS=m - CONFIG_IP6_NF_MATCH_HL=m - CONFIG_IP6_NF_MATCH_IPV6HEADER=m - CONFIG_IP6_NF_MATCH_MH=m -+CONFIG_IP6_NF_MATCH_RPFILTER=m - CONFIG_IP6_NF_MATCH_RT=m - CONFIG_IP6_NF_TARGET_HL=m - CONFIG_IP6_NF_FILTER=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -216,6 +216,7 @@ CONFIG_NF_CONNTRACK_IPV4=m - CONFIG_IP_NF_IPTABLES=m - CONFIG_IP_NF_MATCH_AH=m - CONFIG_IP_NF_MATCH_ECN=m -+CONFIG_IP_NF_MATCH_RPFILTER=m - CONFIG_IP_NF_MATCH_TTL=m - CONFIG_IP_NF_FILTER=m - CONFIG_IP_NF_TARGET_REJECT=m -@@ -240,6 +241,7 @@ CONFIG_IP6_NF_MATCH_OPTS=m - CONFIG_IP6_NF_MATCH_HL=m - CONFIG_IP6_NF_MATCH_IPV6HEADER=m - CONFIG_IP6_NF_MATCH_MH=m -+CONFIG_IP6_NF_MATCH_RPFILTER=m - CONFIG_IP6_NF_MATCH_RT=m - CONFIG_IP6_NF_TARGET_HL=m - CONFIG_IP6_NF_FILTER=m diff --git a/target/linux/brcm2708/patches-4.4/0357-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch b/target/linux/brcm2708/patches-4.4/0357-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch deleted file mode 100644 index 35eb321034..0000000000 --- a/target/linux/brcm2708/patches-4.4/0357-Added-Overlay-for-Microchip-MCP23017-I2C-gpio-expand.patch +++ /dev/null @@ -1,87 +0,0 @@ -From d4011a19f3e6a9c6696f0d5498df9c17a1ba2fb3 Mon Sep 17 00:00:00 2001 -From: Michael Kaplan -Date: Tue, 24 May 2016 10:19:08 +0200 -Subject: [PATCH 357/423] Added Overlay for Microchip MCP23017 I2C gpio - expander - ---- - arch/arm/boot/dts/overlays/README | 9 +++++ - arch/arm/boot/dts/overlays/mcp23017-overlay.dts | 54 +++++++++++++++++++++++++ - 2 files changed, 63 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/mcp23017-overlay.dts - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -567,6 +567,15 @@ Params: gpio_out_pin GPIO for - (default "off") - - -+Name: mcp23017 -+Info: Configures the MCP23017 I2C port expander -+Load: dtoverlay=mcp23017,= -+Params: gpiopin Gpio pin connected to the INTA output of the -+ MCP23017 (default: 4) -+ -+ addr I2C address of the MCP23017 (default: 0x20) -+ -+ - Name: mcp2515-can0 - Info: Configures the MCP2515 CAN controller on spi0.0 - Load: dtoverlay=mcp2515-can0,= ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts -@@ -0,0 +1,54 @@ -+// Definitions for MCP23017 Gpio Extender from Microchip Semiconductor -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; -+ -+ fragment@0 { -+ target = <&i2c1>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&gpio>; -+ __overlay__ { -+ mcp23017_pins: mcp23017_pins { -+ brcm,pins = <4>; -+ brcm,function = <0>; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ mcp23017: mcp@20 { -+ compatible = "microchip,mcp23017"; -+ reg = <0x20>; -+ gpio-controller; -+ #gpio-cells = <2>; -+ #interrupt-cells=<2>; -+ interrupt-parent = <&gpio>; -+ interrupts = <4 2>; -+ interrupt-controller; -+ microchip,irq-mirror; -+ -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ gpiopin = <&mcp23017_pins>,"brcm,pins:0", -+ <&mcp23017>,"interrupts:0"; -+ addr = <&mcp23017>,"reg:0"; -+ }; -+}; -+ diff --git a/target/linux/brcm2708/patches-4.4/0363-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch b/target/linux/brcm2708/patches-4.4/0363-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch new file mode 100644 index 0000000000..df6fd7e3bd --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0363-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch @@ -0,0 +1,24 @@ +From bc431816b3277e61807a3c279ae8fe11b1599f67 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 24 May 2016 16:20:09 +0100 +Subject: [PATCH] bcm2835-camera: Fix max/min error when looping over + cameras/resolutions + +See: https://github.com/raspberrypi/linux/issues/1447#issuecomment-221303506 +--- + drivers/media/platform/bcm2835/bcm2835-camera.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/media/platform/bcm2835/bcm2835-camera.c ++++ b/drivers/media/platform/bcm2835/bcm2835-camera.c +@@ -1530,8 +1530,8 @@ static int get_num_cameras(struct vchiq_ + } + for (i = 0; + i < (cam_info.num_cameras > num_resolutions ? +- cam_info.num_cameras : +- num_resolutions); ++ num_resolutions : ++ cam_info.num_cameras); + i++) { + resolutions[i][0] = cam_info.cameras[i].max_width; + resolutions[i][1] = cam_info.cameras[i].max_height; diff --git a/target/linux/brcm2708/patches-4.4/0364-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch b/target/linux/brcm2708/patches-4.4/0364-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch new file mode 100644 index 0000000000..7593544ba5 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0364-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch @@ -0,0 +1,1139 @@ +From 027817e4c01f900824dde9932e1e3fb32575bc9f Mon Sep 17 00:00:00 2001 +From: Aaron Shaw +Date: Thu, 26 May 2016 23:37:11 +0100 +Subject: [PATCH] Change BoomBerry name to JustBoom in all locations due to + legal challenge + +--- + arch/arm/boot/dts/overlays/Makefile | 4 +- + arch/arm/boot/dts/overlays/README | 52 ++--- + .../boot/dts/overlays/boomberry-dac-overlay.dts | 43 ----- + .../boot/dts/overlays/boomberry-digi-overlay.dts | 39 ---- + .../arm/boot/dts/overlays/justboom-dac-overlay.dts | 43 +++++ + .../boot/dts/overlays/justboom-digi-overlay.dts | 39 ++++ + arch/arm/configs/bcm2709_defconfig | 4 +- + arch/arm/configs/bcmrpi_defconfig | 4 +- + sound/soc/bcm/Kconfig | 12 +- + sound/soc/bcm/Makefile | 8 +- + sound/soc/bcm/boomberry-dac.c | 162 ---------------- + sound/soc/bcm/boomberry-digi.c | 215 --------------------- + sound/soc/bcm/justboom-dac.c | 162 ++++++++++++++++ + sound/soc/bcm/justboom-digi.c | 215 +++++++++++++++++++++ + 14 files changed, 501 insertions(+), 501 deletions(-) + delete mode 100644 arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts + delete mode 100644 arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/justboom-dac-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/justboom-digi-overlay.dts + delete mode 100644 sound/soc/bcm/boomberry-dac.c + delete mode 100644 sound/soc/bcm/boomberry-digi.c + create mode 100644 sound/soc/bcm/justboom-dac.c + create mode 100644 sound/soc/bcm/justboom-digi.c + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -18,8 +18,6 @@ dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqd + dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo + dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += boomberry-dac.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += boomberry-digi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo +@@ -43,6 +41,8 @@ dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31 + dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo + dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dac.dtbo + dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacplus.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -238,32 +238,6 @@ Load: dtoverlay=bmp085_i2c-sensor + Params: + + +-Name: boomberry-dac +-Info: Configures the BoomBerry DAC HAT, Amp HAT, DAC Zero and Amp Zero audio +- cards +-Load: dtoverlay=boomberry-dac,= +-Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec +- Digital volume control. Enable with +- "dtoverlay=boomberry-dac,24db_digital_gain" +- (The default behaviour is that the Digital +- volume control is limited to a maximum of +- 0dB. ie. it can attenuate but not provide +- gain. For most users, this will be desired +- as it will prevent clipping. By appending +- the 24dB_digital_gain parameter, the Digital +- volume control will allow up to 24dB of +- gain. If this parameter is enabled, it is the +- responsibility of the user to ensure that +- the Digital volume control is set to a value +- that does not result in clipping/distortion!) +- +- +-Name: boomberry-digi +-Info: Configures the BoomBerry Digi HAT and Digi Zero audio cards +-Load: dtoverlay=boomberry-digi +-Params: +- +- + Name: dht11 + Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors + Also sometimes found with the part number(s) AM230x. +@@ -541,6 +515,32 @@ Params: 24db_digital_gain Allow ga + that does not result in clipping/distortion!) + + ++Name: justboom-dac ++Info: Configures the JustBoom DAC HAT, Amp HAT, DAC Zero and Amp Zero audio ++ cards ++Load: dtoverlay=justboom-dac,= ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. Enable with ++ "dtoverlay=justboom-dac,24db_digital_gain" ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24dB_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) ++ ++ ++Name: justboom-digi ++Info: Configures the JustBoom Digi HAT and Digi Zero audio cards ++Load: dtoverlay=justboom-digi ++Params: ++ ++ + Name: lirc-rpi + Info: Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi) + Consult the module documentation for more details. +--- a/arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts ++++ /dev/null +@@ -1,43 +0,0 @@ +-// Definitions for BoomBerry DAC +-/dts-v1/; +-/plugin/; +- +-/ { +- compatible = "brcm,bcm2708"; +- +- fragment@0 { +- target = <&i2s>; +- __overlay__ { +- status = "okay"; +- }; +- }; +- +- fragment@1 { +- target = <&i2c1>; +- __overlay__ { +- #address-cells = <1>; +- #size-cells = <0>; +- status = "okay"; +- +- pcm5122@4d { +- #sound-dai-cells = <0>; +- compatible = "ti,pcm5122"; +- reg = <0x4d>; +- status = "okay"; +- }; +- }; +- }; +- +- fragment@2 { +- target = <&sound>; +- frag2: __overlay__ { +- compatible = "boomberry,boomberry-dac"; +- i2s-controller = <&i2s>; +- status = "okay"; +- }; +- }; +- +- __overrides__ { +- 24db_digital_gain = <&frag2>,"boomberry,24db_digital_gain?"; +- }; +-}; +--- a/arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts ++++ /dev/null +@@ -1,39 +0,0 @@ +-// Definitions for BoomBerry Digi +-/dts-v1/; +-/plugin/; +- +-/ { +- compatible = "brcm,bcm2708"; +- +- fragment@0 { +- target = <&i2s>; +- __overlay__ { +- status = "okay"; +- }; +- }; +- +- fragment@1 { +- target = <&i2c1>; +- __overlay__ { +- #address-cells = <1>; +- #size-cells = <0>; +- status = "okay"; +- +- wm8804@3b { +- #sound-dai-cells = <0>; +- compatible = "wlf,wm8804"; +- reg = <0x3b>; +- status = "okay"; +- }; +- }; +- }; +- +- fragment@2 { +- target = <&sound>; +- __overlay__ { +- compatible = "boomberry,boomberry-digi"; +- i2s-controller = <&i2s>; +- status = "okay"; +- }; +- }; +-}; +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/justboom-dac-overlay.dts +@@ -0,0 +1,43 @@ ++// Definitions for JustBoom DAC ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcm5122@4d { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ reg = <0x4d>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ frag2: __overlay__ { ++ compatible = "justboom,justboom-dac"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ 24db_digital_gain = <&frag2>,"justboom,24db_digital_gain?"; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/justboom-digi-overlay.dts +@@ -0,0 +1,39 @@ ++// Definitions for JustBoom Digi ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ wm8804@3b { ++ #sound-dai-cells = <0>; ++ compatible = "wlf,wm8804"; ++ reg = <0x3b>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "justboom,justboom-digi"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -861,8 +861,8 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m + CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m + CONFIG_SND_BCM2708_SOC_RPI_DAC=m + CONFIG_SND_BCM2708_SOC_RPI_PROTO=m +-CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m +-CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m ++CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m ++CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -853,8 +853,8 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m + CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m + CONFIG_SND_BCM2708_SOC_RPI_DAC=m + CONFIG_SND_BCM2708_SOC_RPI_PROTO=m +-CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m +-CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m ++CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m ++CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -50,19 +50,19 @@ config SND_BCM2708_SOC_RPI_PROTO + help + Say Y or M if you want to add support for Audio Codec Board PROTO (WM8731). + +-config SND_BCM2708_SOC_BOOMBERRY_DAC +- tristate "Support for BoomBerry DAC" ++config SND_BCM2708_SOC_JUSTBOOM_DAC ++ tristate "Support for JustBoom DAC" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S + select SND_SOC_PCM512x + help +- Say Y or M if you want to add support for BoomBerry DAC. ++ Say Y or M if you want to add support for JustBoom DAC. + +-config SND_BCM2708_SOC_BOOMBERRY_DIGI +- tristate "Support for BoomBerry Digi" ++config SND_BCM2708_SOC_JUSTBOOM_DIGI ++ tristate "Support for JustBoom Digi" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S + select SND_SOC_WM8804 + help +- Say Y or M if you want to add support for BoomBerry Digi. ++ Say Y or M if you want to add support for JustBoom Digi. + + config SND_BCM2708_SOC_IQAUDIO_DAC + tristate "Support for IQaudIO-DAC" +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -9,8 +9,8 @@ snd-soc-hifiberry-dac-objs := hifiberry_ + snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o + snd-soc-hifiberry-digi-objs := hifiberry_digi.o + snd-soc-hifiberry-amp-objs := hifiberry_amp.o +-snd-soc-boomberry-dac-objs := boomberry-dac.o +-snd-soc-boomberry-digi-objs := boomberry-digi.o ++snd-soc-justboom-dac-objs := justboom-dac.o ++snd-soc-justboom-digi-objs := justboom-digi.o + snd-soc-rpi-dac-objs := rpi-dac.o + snd-soc-rpi-proto-objs := rpi-proto.o + snd-soc-iqaudio-dac-objs := iqaudio-dac.o +@@ -22,8 +22,8 @@ obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_D + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o +-obj-$(CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC) += snd-soc-boomberry-dac.o +-obj-$(CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI) += snd-soc-boomberry-digi.o ++obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC) += snd-soc-justboom-dac.o ++obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI) += snd-soc-justboom-digi.o + obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o + obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o +--- a/sound/soc/bcm/boomberry-dac.c ++++ /dev/null +@@ -1,162 +0,0 @@ +-/* +- * ASoC Driver for BoomBerry DAC Raspberry Pi HAT Sound Card +- * +- * Author: Milan Neskovic +- * Copyright 2016 +- * based on code by Daniel Matuschek +- * based on code by Florian Meier +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +- +-#include "../codecs/pcm512x.h" +- +-static bool digital_gain_0db_limit = true; +- +-static int snd_rpi_boomberry_dac_init(struct snd_soc_pcm_runtime *rtd) +-{ +- struct snd_soc_codec *codec = rtd->codec; +- snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); +- snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02); +- snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); +- +- if (digital_gain_0db_limit) +- { +- int ret; +- struct snd_soc_card *card = rtd->card; +- +- ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207); +- if (ret < 0) +- dev_warn(card->dev, "Failed to set volume limit: %d\n", ret); +- } +- +- return 0; +-} +- +-static int snd_rpi_boomberry_dac_hw_params(struct snd_pcm_substream *substream, +- struct snd_pcm_hw_params *params) +-{ +- struct snd_soc_pcm_runtime *rtd = substream->private_data; +- struct snd_soc_dai *cpu_dai = rtd->cpu_dai; +- /*return snd_soc_dai_set_bclk_ratio(cpu_dai, 64);*/ +- unsigned int sample_bits = +- snd_pcm_format_physical_width(params_format(params)); +- return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); +-} +- +-static int snd_rpi_boomberry_dac_startup(struct snd_pcm_substream *substream) { +- struct snd_soc_pcm_runtime *rtd = substream->private_data; +- struct snd_soc_codec *codec = rtd->codec; +- snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); +- return 0; +-} +- +-static void snd_rpi_boomberry_dac_shutdown(struct snd_pcm_substream *substream) { +- struct snd_soc_pcm_runtime *rtd = substream->private_data; +- struct snd_soc_codec *codec = rtd->codec; +- snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00); +-} +- +-/* machine stream operations */ +-static struct snd_soc_ops snd_rpi_boomberry_dac_ops = { +- .hw_params = snd_rpi_boomberry_dac_hw_params, +- .startup = snd_rpi_boomberry_dac_startup, +- .shutdown = snd_rpi_boomberry_dac_shutdown, +-}; +- +-static struct snd_soc_dai_link snd_rpi_boomberry_dac_dai[] = { +-{ +- .name = "BoomBerry DAC", +- .stream_name = "BoomBerry DAC HiFi", +- .cpu_dai_name = "bcm2708-i2s.0", +- .codec_dai_name = "pcm512x-hifi", +- .platform_name = "bcm2708-i2s.0", +- .codec_name = "pcm512x.1-004d", +- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | +- SND_SOC_DAIFMT_CBS_CFS, +- .ops = &snd_rpi_boomberry_dac_ops, +- .init = snd_rpi_boomberry_dac_init, +-}, +-}; +- +-/* audio machine driver */ +-static struct snd_soc_card snd_rpi_boomberry_dac = { +- .name = "snd_rpi_boomberry_dac", +- .owner = THIS_MODULE, +- .dai_link = snd_rpi_boomberry_dac_dai, +- .num_links = ARRAY_SIZE(snd_rpi_boomberry_dac_dai), +-}; +- +-static int snd_rpi_boomberry_dac_probe(struct platform_device *pdev) +-{ +- int ret = 0; +- +- snd_rpi_boomberry_dac.dev = &pdev->dev; +- +- if (pdev->dev.of_node) { +- struct device_node *i2s_node; +- struct snd_soc_dai_link *dai = &snd_rpi_boomberry_dac_dai[0]; +- i2s_node = of_parse_phandle(pdev->dev.of_node, +- "i2s-controller", 0); +- +- if (i2s_node) { +- dai->cpu_dai_name = NULL; +- dai->cpu_of_node = i2s_node; +- dai->platform_name = NULL; +- dai->platform_of_node = i2s_node; +- } +- +- digital_gain_0db_limit = !of_property_read_bool( +- pdev->dev.of_node, "boomberry,24db_digital_gain"); +- } +- +- ret = snd_soc_register_card(&snd_rpi_boomberry_dac); +- if (ret) +- dev_err(&pdev->dev, +- "snd_soc_register_card() failed: %d\n", ret); +- +- return ret; +-} +- +-static int snd_rpi_boomberry_dac_remove(struct platform_device *pdev) +-{ +- return snd_soc_unregister_card(&snd_rpi_boomberry_dac); +-} +- +-static const struct of_device_id snd_rpi_boomberry_dac_of_match[] = { +- { .compatible = "boomberry,boomberry-dac", }, +- {}, +-}; +-MODULE_DEVICE_TABLE(of, snd_rpi_boomberry_dac_of_match); +- +-static struct platform_driver snd_rpi_boomberry_dac_driver = { +- .driver = { +- .name = "snd-rpi-boomberry-dac", +- .owner = THIS_MODULE, +- .of_match_table = snd_rpi_boomberry_dac_of_match, +- }, +- .probe = snd_rpi_boomberry_dac_probe, +- .remove = snd_rpi_boomberry_dac_remove, +-}; +- +-module_platform_driver(snd_rpi_boomberry_dac_driver); +- +-MODULE_AUTHOR("Milan Neskovic "); +-MODULE_DESCRIPTION("ASoC Driver for BoomBerry PI DAC HAT Sound Card"); +-MODULE_LICENSE("GPL v2"); +--- a/sound/soc/bcm/boomberry-digi.c ++++ /dev/null +@@ -1,215 +0,0 @@ +-/* +- * ASoC Driver for BoomBerry Raspberry Pi Digi HAT Sound Card +- * +- * Author: Milan Neskovic +- * Copyright 2016 +- * based on code by Daniel Matuschek +- * based on code by Florian Meier +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License +- * version 2 as published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +- +-#include "../codecs/wm8804.h" +- +-static int snd_rpi_boomberry_digi_init(struct snd_soc_pcm_runtime *rtd) +-{ +- struct snd_soc_codec *codec = rtd->codec; +- +- /* enable TX output */ +- snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); +- +- return 0; +-} +- +-static int snd_rpi_boomberry_digi_startup(struct snd_pcm_substream *substream) { +- /* turn on digital output */ +- struct snd_soc_pcm_runtime *rtd = substream->private_data; +- struct snd_soc_codec *codec = rtd->codec; +- snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); +- return 0; +-} +- +-static void snd_rpi_boomberry_digi_shutdown(struct snd_pcm_substream *substream) { +- /* turn off output */ +- struct snd_soc_pcm_runtime *rtd = substream->private_data; +- struct snd_soc_codec *codec = rtd->codec; +- snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); +-} +- +-static int snd_rpi_boomberry_digi_hw_params(struct snd_pcm_substream *substream, +- struct snd_pcm_hw_params *params) +-{ +- struct snd_soc_pcm_runtime *rtd = substream->private_data; +- struct snd_soc_dai *codec_dai = rtd->codec_dai; +- struct snd_soc_codec *codec = rtd->codec; +- struct snd_soc_dai *cpu_dai = rtd->cpu_dai; +- +- int sysclk = 27000000; /* This is fixed on this board */ +- +- long mclk_freq=0; +- int mclk_div=1; +- int sampling_freq=1; +- +- int ret; +- +- int samplerate = params_rate(params); +- +- if (samplerate<=96000) { +- mclk_freq=samplerate*256; +- mclk_div=WM8804_MCLKDIV_256FS; +- } else { +- mclk_freq=samplerate*128; +- mclk_div=WM8804_MCLKDIV_128FS; +- } +- +- switch (samplerate) { +- case 32000: +- sampling_freq=0x03; +- break; +- case 44100: +- sampling_freq=0x00; +- break; +- case 48000: +- sampling_freq=0x02; +- break; +- case 88200: +- sampling_freq=0x08; +- break; +- case 96000: +- sampling_freq=0x0a; +- break; +- case 176400: +- sampling_freq=0x0c; +- break; +- case 192000: +- sampling_freq=0x0e; +- break; +- default: +- dev_err(codec->dev, +- "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", +- samplerate); +- } +- +- snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); +- snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); +- +- ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, +- sysclk, SND_SOC_CLOCK_OUT); +- if (ret < 0) { +- dev_err(codec->dev, +- "Failed to set WM8804 SYSCLK: %d\n", ret); +- return ret; +- } +- +- /* Enable TX output */ +- snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); +- +- /* Power on */ +- snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); +- +- /* set sampling frequency status bits */ +- snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); +- +- return snd_soc_dai_set_bclk_ratio(cpu_dai,64); +-} +- +-/* machine stream operations */ +-static struct snd_soc_ops snd_rpi_boomberry_digi_ops = { +- .hw_params = snd_rpi_boomberry_digi_hw_params, +- .startup = snd_rpi_boomberry_digi_startup, +- .shutdown = snd_rpi_boomberry_digi_shutdown, +-}; +- +-static struct snd_soc_dai_link snd_rpi_boomberry_digi_dai[] = { +-{ +- .name = "BoomBerry Digi", +- .stream_name = "BoomBerry Digi HiFi", +- .cpu_dai_name = "bcm2708-i2s.0", +- .codec_dai_name = "wm8804-spdif", +- .platform_name = "bcm2708-i2s.0", +- .codec_name = "wm8804.1-003b", +- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | +- SND_SOC_DAIFMT_CBM_CFM, +- .ops = &snd_rpi_boomberry_digi_ops, +- .init = snd_rpi_boomberry_digi_init, +-}, +-}; +- +-/* audio machine driver */ +-static struct snd_soc_card snd_rpi_boomberry_digi = { +- .name = "snd_rpi_boomberry_digi", +- .owner = THIS_MODULE, +- .dai_link = snd_rpi_boomberry_digi_dai, +- .num_links = ARRAY_SIZE(snd_rpi_boomberry_digi_dai), +-}; +- +-static int snd_rpi_boomberry_digi_probe(struct platform_device *pdev) +-{ +- int ret = 0; +- +- snd_rpi_boomberry_digi.dev = &pdev->dev; +- +- if (pdev->dev.of_node) { +- struct device_node *i2s_node; +- struct snd_soc_dai_link *dai = &snd_rpi_boomberry_digi_dai[0]; +- i2s_node = of_parse_phandle(pdev->dev.of_node, +- "i2s-controller", 0); +- +- if (i2s_node) { +- dai->cpu_dai_name = NULL; +- dai->cpu_of_node = i2s_node; +- dai->platform_name = NULL; +- dai->platform_of_node = i2s_node; +- } +- } +- +- ret = snd_soc_register_card(&snd_rpi_boomberry_digi); +- if (ret) +- dev_err(&pdev->dev, +- "snd_soc_register_card() failed: %d\n", ret); +- +- return ret; +-} +- +-static int snd_rpi_boomberry_digi_remove(struct platform_device *pdev) +-{ +- return snd_soc_unregister_card(&snd_rpi_boomberry_digi); +-} +- +-static const struct of_device_id snd_rpi_boomberry_digi_of_match[] = { +- { .compatible = "boomberry,boomberry-digi", }, +- {}, +-}; +-MODULE_DEVICE_TABLE(of, snd_rpi_boomberry_digi_of_match); +- +-static struct platform_driver snd_rpi_boomberry_digi_driver = { +- .driver = { +- .name = "snd-rpi-boomberry-digi", +- .owner = THIS_MODULE, +- .of_match_table = snd_rpi_boomberry_digi_of_match, +- }, +- .probe = snd_rpi_boomberry_digi_probe, +- .remove = snd_rpi_boomberry_digi_remove, +-}; +- +-module_platform_driver(snd_rpi_boomberry_digi_driver); +- +-MODULE_AUTHOR("Milan Neskovic "); +-MODULE_DESCRIPTION("ASoC Driver for BoomBerry PI Digi HAT Sound Card"); +-MODULE_LICENSE("GPL v2"); +--- /dev/null ++++ b/sound/soc/bcm/justboom-dac.c +@@ -0,0 +1,162 @@ ++/* ++ * ASoC Driver for JustBoom DAC Raspberry Pi HAT Sound Card ++ * ++ * Author: Milan Neskovic ++ * Copyright 2016 ++ * based on code by Daniel Matuschek ++ * based on code by Florian Meier ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "../codecs/pcm512x.h" ++ ++static bool digital_gain_0db_limit = true; ++ ++static int snd_rpi_justboom_dac_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02); ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); ++ ++ if (digital_gain_0db_limit) ++ { ++ int ret; ++ struct snd_soc_card *card = rtd->card; ++ ++ ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ret); ++ } ++ ++ return 0; ++} ++ ++static int snd_rpi_justboom_dac_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ /*return snd_soc_dai_set_bclk_ratio(cpu_dai, 64);*/ ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++} ++ ++static int snd_rpi_justboom_dac_startup(struct snd_pcm_substream *substream) { ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); ++ return 0; ++} ++ ++static void snd_rpi_justboom_dac_shutdown(struct snd_pcm_substream *substream) { ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_rpi_justboom_dac_ops = { ++ .hw_params = snd_rpi_justboom_dac_hw_params, ++ .startup = snd_rpi_justboom_dac_startup, ++ .shutdown = snd_rpi_justboom_dac_shutdown, ++}; ++ ++static struct snd_soc_dai_link snd_rpi_justboom_dac_dai[] = { ++{ ++ .name = "JustBoom DAC", ++ .stream_name = "JustBoom DAC HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "pcm512x-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "pcm512x.1-004d", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_rpi_justboom_dac_ops, ++ .init = snd_rpi_justboom_dac_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_rpi_justboom_dac = { ++ .name = "snd_rpi_justboom_dac", ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_justboom_dac_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_justboom_dac_dai), ++}; ++ ++static int snd_rpi_justboom_dac_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_rpi_justboom_dac.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_rpi_justboom_dac_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ digital_gain_0db_limit = !of_property_read_bool( ++ pdev->dev.of_node, "justboom,24db_digital_gain"); ++ } ++ ++ ret = snd_soc_register_card(&snd_rpi_justboom_dac); ++ if (ret) ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_rpi_justboom_dac_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_justboom_dac); ++} ++ ++static const struct of_device_id snd_rpi_justboom_dac_of_match[] = { ++ { .compatible = "justboom,justboom-dac", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_rpi_justboom_dac_of_match); ++ ++static struct platform_driver snd_rpi_justboom_dac_driver = { ++ .driver = { ++ .name = "snd-rpi-justboom-dac", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_rpi_justboom_dac_of_match, ++ }, ++ .probe = snd_rpi_justboom_dac_probe, ++ .remove = snd_rpi_justboom_dac_remove, ++}; ++ ++module_platform_driver(snd_rpi_justboom_dac_driver); ++ ++MODULE_AUTHOR("Milan Neskovic "); ++MODULE_DESCRIPTION("ASoC Driver for JustBoom PI DAC HAT Sound Card"); ++MODULE_LICENSE("GPL v2"); +--- /dev/null ++++ b/sound/soc/bcm/justboom-digi.c +@@ -0,0 +1,215 @@ ++/* ++ * ASoC Driver for JustBoom Raspberry Pi Digi HAT Sound Card ++ * ++ * Author: Milan Neskovic ++ * Copyright 2016 ++ * based on code by Daniel Matuschek ++ * based on code by Florian Meier ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "../codecs/wm8804.h" ++ ++static int snd_rpi_justboom_digi_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ /* enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ return 0; ++} ++ ++static int snd_rpi_justboom_digi_startup(struct snd_pcm_substream *substream) { ++ /* turn on digital output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); ++ return 0; ++} ++ ++static void snd_rpi_justboom_digi_shutdown(struct snd_pcm_substream *substream) { ++ /* turn off output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); ++} ++ ++static int snd_rpi_justboom_digi_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ int sysclk = 27000000; /* This is fixed on this board */ ++ ++ long mclk_freq=0; ++ int mclk_div=1; ++ int sampling_freq=1; ++ ++ int ret; ++ ++ int samplerate = params_rate(params); ++ ++ if (samplerate<=96000) { ++ mclk_freq=samplerate*256; ++ mclk_div=WM8804_MCLKDIV_256FS; ++ } else { ++ mclk_freq=samplerate*128; ++ mclk_div=WM8804_MCLKDIV_128FS; ++ } ++ ++ switch (samplerate) { ++ case 32000: ++ sampling_freq=0x03; ++ break; ++ case 44100: ++ sampling_freq=0x00; ++ break; ++ case 48000: ++ sampling_freq=0x02; ++ break; ++ case 88200: ++ sampling_freq=0x08; ++ break; ++ case 96000: ++ sampling_freq=0x0a; ++ break; ++ case 176400: ++ sampling_freq=0x0c; ++ break; ++ case 192000: ++ sampling_freq=0x0e; ++ break; ++ default: ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", ++ samplerate); ++ } ++ ++ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); ++ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); ++ ++ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, ++ sysclk, SND_SOC_CLOCK_OUT); ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK: %d\n", ret); ++ return ret; ++ } ++ ++ /* Enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ /* Power on */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); ++ ++ /* set sampling frequency status bits */ ++ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai,64); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_rpi_justboom_digi_ops = { ++ .hw_params = snd_rpi_justboom_digi_hw_params, ++ .startup = snd_rpi_justboom_digi_startup, ++ .shutdown = snd_rpi_justboom_digi_shutdown, ++}; ++ ++static struct snd_soc_dai_link snd_rpi_justboom_digi_dai[] = { ++{ ++ .name = "JustBoom Digi", ++ .stream_name = "JustBoom Digi HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "wm8804-spdif", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "wm8804.1-003b", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBM_CFM, ++ .ops = &snd_rpi_justboom_digi_ops, ++ .init = snd_rpi_justboom_digi_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_rpi_justboom_digi = { ++ .name = "snd_rpi_justboom_digi", ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_justboom_digi_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_justboom_digi_dai), ++}; ++ ++static int snd_rpi_justboom_digi_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_rpi_justboom_digi.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_rpi_justboom_digi_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_rpi_justboom_digi); ++ if (ret) ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_rpi_justboom_digi_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_justboom_digi); ++} ++ ++static const struct of_device_id snd_rpi_justboom_digi_of_match[] = { ++ { .compatible = "justboom,justboom-digi", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_rpi_justboom_digi_of_match); ++ ++static struct platform_driver snd_rpi_justboom_digi_driver = { ++ .driver = { ++ .name = "snd-rpi-justboom-digi", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_rpi_justboom_digi_of_match, ++ }, ++ .probe = snd_rpi_justboom_digi_probe, ++ .remove = snd_rpi_justboom_digi_remove, ++}; ++ ++module_platform_driver(snd_rpi_justboom_digi_driver); ++ ++MODULE_AUTHOR("Milan Neskovic "); ++MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0364-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch b/target/linux/brcm2708/patches-4.4/0364-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch deleted file mode 100644 index ba29be21fd..0000000000 --- a/target/linux/brcm2708/patches-4.4/0364-bcm2835-camera-Fix-max-min-error-when-looping-over-c.patch +++ /dev/null @@ -1,24 +0,0 @@ -From d832db5de5893d3d6020a9d3e32aa4cd80490cc9 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 364/423] bcm2835-camera: Fix max/min error when looping over - cameras/resolutions - -See: https://github.com/raspberrypi/linux/issues/1447#issuecomment-221303506 ---- - drivers/media/platform/bcm2835/bcm2835-camera.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/media/platform/bcm2835/bcm2835-camera.c -+++ b/drivers/media/platform/bcm2835/bcm2835-camera.c -@@ -1530,8 +1530,8 @@ static int get_num_cameras(struct vchiq_ - } - for (i = 0; - i < (cam_info.num_cameras > num_resolutions ? -- cam_info.num_cameras : -- num_resolutions); -+ num_resolutions : -+ cam_info.num_cameras); - i++) { - resolutions[i][0] = cam_info.cameras[i].max_width; - resolutions[i][1] = cam_info.cameras[i].max_height; diff --git a/target/linux/brcm2708/patches-4.4/0365-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch b/target/linux/brcm2708/patches-4.4/0365-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch deleted file mode 100644 index faf982fc6a..0000000000 --- a/target/linux/brcm2708/patches-4.4/0365-Change-BoomBerry-name-to-JustBoom-in-all-locations-d.patch +++ /dev/null @@ -1,1139 +0,0 @@ -From 648226e081795be9ebaad2dc14bf768ba785f277 Mon Sep 17 00:00:00 2001 -From: Aaron Shaw -Date: Thu, 26 May 2016 23:37:11 +0100 -Subject: [PATCH 365/423] Change BoomBerry name to JustBoom in all locations - due to legal challenge - ---- - arch/arm/boot/dts/overlays/Makefile | 4 +- - arch/arm/boot/dts/overlays/README | 52 ++--- - .../boot/dts/overlays/boomberry-dac-overlay.dts | 43 ----- - .../boot/dts/overlays/boomberry-digi-overlay.dts | 39 ---- - .../arm/boot/dts/overlays/justboom-dac-overlay.dts | 43 +++++ - .../boot/dts/overlays/justboom-digi-overlay.dts | 39 ++++ - arch/arm/configs/bcm2709_defconfig | 4 +- - arch/arm/configs/bcmrpi_defconfig | 4 +- - sound/soc/bcm/Kconfig | 12 +- - sound/soc/bcm/Makefile | 8 +- - sound/soc/bcm/boomberry-dac.c | 162 ---------------- - sound/soc/bcm/boomberry-digi.c | 215 --------------------- - sound/soc/bcm/justboom-dac.c | 162 ++++++++++++++++ - sound/soc/bcm/justboom-digi.c | 215 +++++++++++++++++++++ - 14 files changed, 501 insertions(+), 501 deletions(-) - delete mode 100644 arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts - delete mode 100644 arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts - create mode 100644 arch/arm/boot/dts/overlays/justboom-dac-overlay.dts - create mode 100644 arch/arm/boot/dts/overlays/justboom-digi-overlay.dts - delete mode 100644 sound/soc/bcm/boomberry-dac.c - delete mode 100644 sound/soc/bcm/boomberry-digi.c - create mode 100644 sound/soc/bcm/justboom-dac.c - create mode 100644 sound/soc/bcm/justboom-digi.c - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -18,8 +18,6 @@ dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqd - dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo - dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo --dtbo-$(RPI_DT_OVERLAYS) += boomberry-dac.dtbo --dtbo-$(RPI_DT_OVERLAYS) += boomberry-digi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo -@@ -43,6 +41,8 @@ dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31 - dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo - dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dac.dtbo - dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacplus.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo - dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -238,32 +238,6 @@ Load: dtoverlay=bmp085_i2c-sensor - Params: - - --Name: boomberry-dac --Info: Configures the BoomBerry DAC HAT, Amp HAT, DAC Zero and Amp Zero audio -- cards --Load: dtoverlay=boomberry-dac,= --Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec -- Digital volume control. Enable with -- "dtoverlay=boomberry-dac,24db_digital_gain" -- (The default behaviour is that the Digital -- volume control is limited to a maximum of -- 0dB. ie. it can attenuate but not provide -- gain. For most users, this will be desired -- as it will prevent clipping. By appending -- the 24dB_digital_gain parameter, the Digital -- volume control will allow up to 24dB of -- gain. If this parameter is enabled, it is the -- responsibility of the user to ensure that -- the Digital volume control is set to a value -- that does not result in clipping/distortion!) -- -- --Name: boomberry-digi --Info: Configures the BoomBerry Digi HAT and Digi Zero audio cards --Load: dtoverlay=boomberry-digi --Params: -- -- - Name: dht11 - Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors - Also sometimes found with the part number(s) AM230x. -@@ -541,6 +515,32 @@ Params: 24db_digital_gain Allow ga - that does not result in clipping/distortion!) - - -+Name: justboom-dac -+Info: Configures the JustBoom DAC HAT, Amp HAT, DAC Zero and Amp Zero audio -+ cards -+Load: dtoverlay=justboom-dac,= -+Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec -+ Digital volume control. Enable with -+ "dtoverlay=justboom-dac,24db_digital_gain" -+ (The default behaviour is that the Digital -+ volume control is limited to a maximum of -+ 0dB. ie. it can attenuate but not provide -+ gain. For most users, this will be desired -+ as it will prevent clipping. By appending -+ the 24dB_digital_gain parameter, the Digital -+ volume control will allow up to 24dB of -+ gain. If this parameter is enabled, it is the -+ responsibility of the user to ensure that -+ the Digital volume control is set to a value -+ that does not result in clipping/distortion!) -+ -+ -+Name: justboom-digi -+Info: Configures the JustBoom Digi HAT and Digi Zero audio cards -+Load: dtoverlay=justboom-digi -+Params: -+ -+ - Name: lirc-rpi - Info: Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi) - Consult the module documentation for more details. ---- a/arch/arm/boot/dts/overlays/boomberry-dac-overlay.dts -+++ /dev/null -@@ -1,43 +0,0 @@ --// Definitions for BoomBerry DAC --/dts-v1/; --/plugin/; -- --/ { -- compatible = "brcm,bcm2708"; -- -- fragment@0 { -- target = <&i2s>; -- __overlay__ { -- status = "okay"; -- }; -- }; -- -- fragment@1 { -- target = <&i2c1>; -- __overlay__ { -- #address-cells = <1>; -- #size-cells = <0>; -- status = "okay"; -- -- pcm5122@4d { -- #sound-dai-cells = <0>; -- compatible = "ti,pcm5122"; -- reg = <0x4d>; -- status = "okay"; -- }; -- }; -- }; -- -- fragment@2 { -- target = <&sound>; -- frag2: __overlay__ { -- compatible = "boomberry,boomberry-dac"; -- i2s-controller = <&i2s>; -- status = "okay"; -- }; -- }; -- -- __overrides__ { -- 24db_digital_gain = <&frag2>,"boomberry,24db_digital_gain?"; -- }; --}; ---- a/arch/arm/boot/dts/overlays/boomberry-digi-overlay.dts -+++ /dev/null -@@ -1,39 +0,0 @@ --// Definitions for BoomBerry Digi --/dts-v1/; --/plugin/; -- --/ { -- compatible = "brcm,bcm2708"; -- -- fragment@0 { -- target = <&i2s>; -- __overlay__ { -- status = "okay"; -- }; -- }; -- -- fragment@1 { -- target = <&i2c1>; -- __overlay__ { -- #address-cells = <1>; -- #size-cells = <0>; -- status = "okay"; -- -- wm8804@3b { -- #sound-dai-cells = <0>; -- compatible = "wlf,wm8804"; -- reg = <0x3b>; -- status = "okay"; -- }; -- }; -- }; -- -- fragment@2 { -- target = <&sound>; -- __overlay__ { -- compatible = "boomberry,boomberry-digi"; -- i2s-controller = <&i2s>; -- status = "okay"; -- }; -- }; --}; ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/justboom-dac-overlay.dts -@@ -0,0 +1,43 @@ -+// Definitions for JustBoom DAC -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pcm5122@4d { -+ #sound-dai-cells = <0>; -+ compatible = "ti,pcm5122"; -+ reg = <0x4d>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ frag2: __overlay__ { -+ compatible = "justboom,justboom-dac"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+ -+ __overrides__ { -+ 24db_digital_gain = <&frag2>,"justboom,24db_digital_gain?"; -+ }; -+}; ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/justboom-digi-overlay.dts -@@ -0,0 +1,39 @@ -+// Definitions for JustBoom Digi -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ wm8804@3b { -+ #sound-dai-cells = <0>; -+ compatible = "wlf,wm8804"; -+ reg = <0x3b>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ __overlay__ { -+ compatible = "justboom,justboom-digi"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+}; ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -861,8 +861,8 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m - CONFIG_SND_BCM2708_SOC_RPI_DAC=m - CONFIG_SND_BCM2708_SOC_RPI_PROTO=m --CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m --CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m -+CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m -+CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -853,8 +853,8 @@ CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP=m - CONFIG_SND_BCM2708_SOC_RPI_DAC=m - CONFIG_SND_BCM2708_SOC_RPI_PROTO=m --CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=m --CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=m -+CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m -+CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -50,19 +50,19 @@ config SND_BCM2708_SOC_RPI_PROTO - help - Say Y or M if you want to add support for Audio Codec Board PROTO (WM8731). - --config SND_BCM2708_SOC_BOOMBERRY_DAC -- tristate "Support for BoomBerry DAC" -+config SND_BCM2708_SOC_JUSTBOOM_DAC -+ tristate "Support for JustBoom DAC" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S - select SND_SOC_PCM512x - help -- Say Y or M if you want to add support for BoomBerry DAC. -+ Say Y or M if you want to add support for JustBoom DAC. - --config SND_BCM2708_SOC_BOOMBERRY_DIGI -- tristate "Support for BoomBerry Digi" -+config SND_BCM2708_SOC_JUSTBOOM_DIGI -+ tristate "Support for JustBoom Digi" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S - select SND_SOC_WM8804 - help -- Say Y or M if you want to add support for BoomBerry Digi. -+ Say Y or M if you want to add support for JustBoom Digi. - - config SND_BCM2708_SOC_IQAUDIO_DAC - tristate "Support for IQaudIO-DAC" ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -9,8 +9,8 @@ snd-soc-hifiberry-dac-objs := hifiberry_ - snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o - snd-soc-hifiberry-digi-objs := hifiberry_digi.o - snd-soc-hifiberry-amp-objs := hifiberry_amp.o --snd-soc-boomberry-dac-objs := boomberry-dac.o --snd-soc-boomberry-digi-objs := boomberry-digi.o -+snd-soc-justboom-dac-objs := justboom-dac.o -+snd-soc-justboom-digi-objs := justboom-digi.o - snd-soc-rpi-dac-objs := rpi-dac.o - snd-soc-rpi-proto-objs := rpi-proto.o - snd-soc-iqaudio-dac-objs := iqaudio-dac.o -@@ -22,8 +22,8 @@ obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_D - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o --obj-$(CONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC) += snd-soc-boomberry-dac.o --obj-$(CONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI) += snd-soc-boomberry-digi.o -+obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC) += snd-soc-justboom-dac.o -+obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI) += snd-soc-justboom-digi.o - obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o - obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o ---- a/sound/soc/bcm/boomberry-dac.c -+++ /dev/null -@@ -1,162 +0,0 @@ --/* -- * ASoC Driver for BoomBerry DAC Raspberry Pi HAT Sound Card -- * -- * Author: Milan Neskovic -- * Copyright 2016 -- * based on code by Daniel Matuschek -- * based on code by Florian Meier -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. -- */ -- --#include --#include -- --#include --#include --#include --#include --#include -- --#include "../codecs/pcm512x.h" -- --static bool digital_gain_0db_limit = true; -- --static int snd_rpi_boomberry_dac_init(struct snd_soc_pcm_runtime *rtd) --{ -- struct snd_soc_codec *codec = rtd->codec; -- snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); -- snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02); -- snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); -- -- if (digital_gain_0db_limit) -- { -- int ret; -- struct snd_soc_card *card = rtd->card; -- -- ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207); -- if (ret < 0) -- dev_warn(card->dev, "Failed to set volume limit: %d\n", ret); -- } -- -- return 0; --} -- --static int snd_rpi_boomberry_dac_hw_params(struct snd_pcm_substream *substream, -- struct snd_pcm_hw_params *params) --{ -- struct snd_soc_pcm_runtime *rtd = substream->private_data; -- struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -- /*return snd_soc_dai_set_bclk_ratio(cpu_dai, 64);*/ -- unsigned int sample_bits = -- snd_pcm_format_physical_width(params_format(params)); -- return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); --} -- --static int snd_rpi_boomberry_dac_startup(struct snd_pcm_substream *substream) { -- struct snd_soc_pcm_runtime *rtd = substream->private_data; -- struct snd_soc_codec *codec = rtd->codec; -- snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); -- return 0; --} -- --static void snd_rpi_boomberry_dac_shutdown(struct snd_pcm_substream *substream) { -- struct snd_soc_pcm_runtime *rtd = substream->private_data; -- struct snd_soc_codec *codec = rtd->codec; -- snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00); --} -- --/* machine stream operations */ --static struct snd_soc_ops snd_rpi_boomberry_dac_ops = { -- .hw_params = snd_rpi_boomberry_dac_hw_params, -- .startup = snd_rpi_boomberry_dac_startup, -- .shutdown = snd_rpi_boomberry_dac_shutdown, --}; -- --static struct snd_soc_dai_link snd_rpi_boomberry_dac_dai[] = { --{ -- .name = "BoomBerry DAC", -- .stream_name = "BoomBerry DAC HiFi", -- .cpu_dai_name = "bcm2708-i2s.0", -- .codec_dai_name = "pcm512x-hifi", -- .platform_name = "bcm2708-i2s.0", -- .codec_name = "pcm512x.1-004d", -- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | -- SND_SOC_DAIFMT_CBS_CFS, -- .ops = &snd_rpi_boomberry_dac_ops, -- .init = snd_rpi_boomberry_dac_init, --}, --}; -- --/* audio machine driver */ --static struct snd_soc_card snd_rpi_boomberry_dac = { -- .name = "snd_rpi_boomberry_dac", -- .owner = THIS_MODULE, -- .dai_link = snd_rpi_boomberry_dac_dai, -- .num_links = ARRAY_SIZE(snd_rpi_boomberry_dac_dai), --}; -- --static int snd_rpi_boomberry_dac_probe(struct platform_device *pdev) --{ -- int ret = 0; -- -- snd_rpi_boomberry_dac.dev = &pdev->dev; -- -- if (pdev->dev.of_node) { -- struct device_node *i2s_node; -- struct snd_soc_dai_link *dai = &snd_rpi_boomberry_dac_dai[0]; -- i2s_node = of_parse_phandle(pdev->dev.of_node, -- "i2s-controller", 0); -- -- if (i2s_node) { -- dai->cpu_dai_name = NULL; -- dai->cpu_of_node = i2s_node; -- dai->platform_name = NULL; -- dai->platform_of_node = i2s_node; -- } -- -- digital_gain_0db_limit = !of_property_read_bool( -- pdev->dev.of_node, "boomberry,24db_digital_gain"); -- } -- -- ret = snd_soc_register_card(&snd_rpi_boomberry_dac); -- if (ret) -- dev_err(&pdev->dev, -- "snd_soc_register_card() failed: %d\n", ret); -- -- return ret; --} -- --static int snd_rpi_boomberry_dac_remove(struct platform_device *pdev) --{ -- return snd_soc_unregister_card(&snd_rpi_boomberry_dac); --} -- --static const struct of_device_id snd_rpi_boomberry_dac_of_match[] = { -- { .compatible = "boomberry,boomberry-dac", }, -- {}, --}; --MODULE_DEVICE_TABLE(of, snd_rpi_boomberry_dac_of_match); -- --static struct platform_driver snd_rpi_boomberry_dac_driver = { -- .driver = { -- .name = "snd-rpi-boomberry-dac", -- .owner = THIS_MODULE, -- .of_match_table = snd_rpi_boomberry_dac_of_match, -- }, -- .probe = snd_rpi_boomberry_dac_probe, -- .remove = snd_rpi_boomberry_dac_remove, --}; -- --module_platform_driver(snd_rpi_boomberry_dac_driver); -- --MODULE_AUTHOR("Milan Neskovic "); --MODULE_DESCRIPTION("ASoC Driver for BoomBerry PI DAC HAT Sound Card"); --MODULE_LICENSE("GPL v2"); ---- a/sound/soc/bcm/boomberry-digi.c -+++ /dev/null -@@ -1,215 +0,0 @@ --/* -- * ASoC Driver for BoomBerry Raspberry Pi Digi HAT Sound Card -- * -- * Author: Milan Neskovic -- * Copyright 2016 -- * based on code by Daniel Matuschek -- * based on code by Florian Meier -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. -- */ -- --#include --#include -- --#include --#include --#include --#include --#include -- --#include "../codecs/wm8804.h" -- --static int snd_rpi_boomberry_digi_init(struct snd_soc_pcm_runtime *rtd) --{ -- struct snd_soc_codec *codec = rtd->codec; -- -- /* enable TX output */ -- snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -- -- return 0; --} -- --static int snd_rpi_boomberry_digi_startup(struct snd_pcm_substream *substream) { -- /* turn on digital output */ -- struct snd_soc_pcm_runtime *rtd = substream->private_data; -- struct snd_soc_codec *codec = rtd->codec; -- snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); -- return 0; --} -- --static void snd_rpi_boomberry_digi_shutdown(struct snd_pcm_substream *substream) { -- /* turn off output */ -- struct snd_soc_pcm_runtime *rtd = substream->private_data; -- struct snd_soc_codec *codec = rtd->codec; -- snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); --} -- --static int snd_rpi_boomberry_digi_hw_params(struct snd_pcm_substream *substream, -- struct snd_pcm_hw_params *params) --{ -- struct snd_soc_pcm_runtime *rtd = substream->private_data; -- struct snd_soc_dai *codec_dai = rtd->codec_dai; -- struct snd_soc_codec *codec = rtd->codec; -- struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -- -- int sysclk = 27000000; /* This is fixed on this board */ -- -- long mclk_freq=0; -- int mclk_div=1; -- int sampling_freq=1; -- -- int ret; -- -- int samplerate = params_rate(params); -- -- if (samplerate<=96000) { -- mclk_freq=samplerate*256; -- mclk_div=WM8804_MCLKDIV_256FS; -- } else { -- mclk_freq=samplerate*128; -- mclk_div=WM8804_MCLKDIV_128FS; -- } -- -- switch (samplerate) { -- case 32000: -- sampling_freq=0x03; -- break; -- case 44100: -- sampling_freq=0x00; -- break; -- case 48000: -- sampling_freq=0x02; -- break; -- case 88200: -- sampling_freq=0x08; -- break; -- case 96000: -- sampling_freq=0x0a; -- break; -- case 176400: -- sampling_freq=0x0c; -- break; -- case 192000: -- sampling_freq=0x0e; -- break; -- default: -- dev_err(codec->dev, -- "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", -- samplerate); -- } -- -- snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); -- snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); -- -- ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, -- sysclk, SND_SOC_CLOCK_OUT); -- if (ret < 0) { -- dev_err(codec->dev, -- "Failed to set WM8804 SYSCLK: %d\n", ret); -- return ret; -- } -- -- /* Enable TX output */ -- snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -- -- /* Power on */ -- snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); -- -- /* set sampling frequency status bits */ -- snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); -- -- return snd_soc_dai_set_bclk_ratio(cpu_dai,64); --} -- --/* machine stream operations */ --static struct snd_soc_ops snd_rpi_boomberry_digi_ops = { -- .hw_params = snd_rpi_boomberry_digi_hw_params, -- .startup = snd_rpi_boomberry_digi_startup, -- .shutdown = snd_rpi_boomberry_digi_shutdown, --}; -- --static struct snd_soc_dai_link snd_rpi_boomberry_digi_dai[] = { --{ -- .name = "BoomBerry Digi", -- .stream_name = "BoomBerry Digi HiFi", -- .cpu_dai_name = "bcm2708-i2s.0", -- .codec_dai_name = "wm8804-spdif", -- .platform_name = "bcm2708-i2s.0", -- .codec_name = "wm8804.1-003b", -- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | -- SND_SOC_DAIFMT_CBM_CFM, -- .ops = &snd_rpi_boomberry_digi_ops, -- .init = snd_rpi_boomberry_digi_init, --}, --}; -- --/* audio machine driver */ --static struct snd_soc_card snd_rpi_boomberry_digi = { -- .name = "snd_rpi_boomberry_digi", -- .owner = THIS_MODULE, -- .dai_link = snd_rpi_boomberry_digi_dai, -- .num_links = ARRAY_SIZE(snd_rpi_boomberry_digi_dai), --}; -- --static int snd_rpi_boomberry_digi_probe(struct platform_device *pdev) --{ -- int ret = 0; -- -- snd_rpi_boomberry_digi.dev = &pdev->dev; -- -- if (pdev->dev.of_node) { -- struct device_node *i2s_node; -- struct snd_soc_dai_link *dai = &snd_rpi_boomberry_digi_dai[0]; -- i2s_node = of_parse_phandle(pdev->dev.of_node, -- "i2s-controller", 0); -- -- if (i2s_node) { -- dai->cpu_dai_name = NULL; -- dai->cpu_of_node = i2s_node; -- dai->platform_name = NULL; -- dai->platform_of_node = i2s_node; -- } -- } -- -- ret = snd_soc_register_card(&snd_rpi_boomberry_digi); -- if (ret) -- dev_err(&pdev->dev, -- "snd_soc_register_card() failed: %d\n", ret); -- -- return ret; --} -- --static int snd_rpi_boomberry_digi_remove(struct platform_device *pdev) --{ -- return snd_soc_unregister_card(&snd_rpi_boomberry_digi); --} -- --static const struct of_device_id snd_rpi_boomberry_digi_of_match[] = { -- { .compatible = "boomberry,boomberry-digi", }, -- {}, --}; --MODULE_DEVICE_TABLE(of, snd_rpi_boomberry_digi_of_match); -- --static struct platform_driver snd_rpi_boomberry_digi_driver = { -- .driver = { -- .name = "snd-rpi-boomberry-digi", -- .owner = THIS_MODULE, -- .of_match_table = snd_rpi_boomberry_digi_of_match, -- }, -- .probe = snd_rpi_boomberry_digi_probe, -- .remove = snd_rpi_boomberry_digi_remove, --}; -- --module_platform_driver(snd_rpi_boomberry_digi_driver); -- --MODULE_AUTHOR("Milan Neskovic "); --MODULE_DESCRIPTION("ASoC Driver for BoomBerry PI Digi HAT Sound Card"); --MODULE_LICENSE("GPL v2"); ---- /dev/null -+++ b/sound/soc/bcm/justboom-dac.c -@@ -0,0 +1,162 @@ -+/* -+ * ASoC Driver for JustBoom DAC Raspberry Pi HAT Sound Card -+ * -+ * Author: Milan Neskovic -+ * Copyright 2016 -+ * based on code by Daniel Matuschek -+ * based on code by Florian Meier -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "../codecs/pcm512x.h" -+ -+static bool digital_gain_0db_limit = true; -+ -+static int snd_rpi_justboom_dac_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_codec *codec = rtd->codec; -+ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); -+ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02); -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); -+ -+ if (digital_gain_0db_limit) -+ { -+ int ret; -+ struct snd_soc_card *card = rtd->card; -+ -+ ret = snd_soc_limit_volume(card, "Digital Playback Volume", 207); -+ if (ret < 0) -+ dev_warn(card->dev, "Failed to set volume limit: %d\n", ret); -+ } -+ -+ return 0; -+} -+ -+static int snd_rpi_justboom_dac_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ /*return snd_soc_dai_set_bclk_ratio(cpu_dai, 64);*/ -+ unsigned int sample_bits = -+ snd_pcm_format_physical_width(params_format(params)); -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); -+} -+ -+static int snd_rpi_justboom_dac_startup(struct snd_pcm_substream *substream) { -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08); -+ return 0; -+} -+ -+static void snd_rpi_justboom_dac_shutdown(struct snd_pcm_substream *substream) { -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00); -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_rpi_justboom_dac_ops = { -+ .hw_params = snd_rpi_justboom_dac_hw_params, -+ .startup = snd_rpi_justboom_dac_startup, -+ .shutdown = snd_rpi_justboom_dac_shutdown, -+}; -+ -+static struct snd_soc_dai_link snd_rpi_justboom_dac_dai[] = { -+{ -+ .name = "JustBoom DAC", -+ .stream_name = "JustBoom DAC HiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "pcm512x-hifi", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "pcm512x.1-004d", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBS_CFS, -+ .ops = &snd_rpi_justboom_dac_ops, -+ .init = snd_rpi_justboom_dac_init, -+}, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_rpi_justboom_dac = { -+ .name = "snd_rpi_justboom_dac", -+ .owner = THIS_MODULE, -+ .dai_link = snd_rpi_justboom_dac_dai, -+ .num_links = ARRAY_SIZE(snd_rpi_justboom_dac_dai), -+}; -+ -+static int snd_rpi_justboom_dac_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ -+ snd_rpi_justboom_dac.dev = &pdev->dev; -+ -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai = &snd_rpi_justboom_dac_dai[0]; -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ -+ digital_gain_0db_limit = !of_property_read_bool( -+ pdev->dev.of_node, "justboom,24db_digital_gain"); -+ } -+ -+ ret = snd_soc_register_card(&snd_rpi_justboom_dac); -+ if (ret) -+ dev_err(&pdev->dev, -+ "snd_soc_register_card() failed: %d\n", ret); -+ -+ return ret; -+} -+ -+static int snd_rpi_justboom_dac_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_rpi_justboom_dac); -+} -+ -+static const struct of_device_id snd_rpi_justboom_dac_of_match[] = { -+ { .compatible = "justboom,justboom-dac", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, snd_rpi_justboom_dac_of_match); -+ -+static struct platform_driver snd_rpi_justboom_dac_driver = { -+ .driver = { -+ .name = "snd-rpi-justboom-dac", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_rpi_justboom_dac_of_match, -+ }, -+ .probe = snd_rpi_justboom_dac_probe, -+ .remove = snd_rpi_justboom_dac_remove, -+}; -+ -+module_platform_driver(snd_rpi_justboom_dac_driver); -+ -+MODULE_AUTHOR("Milan Neskovic "); -+MODULE_DESCRIPTION("ASoC Driver for JustBoom PI DAC HAT Sound Card"); -+MODULE_LICENSE("GPL v2"); ---- /dev/null -+++ b/sound/soc/bcm/justboom-digi.c -@@ -0,0 +1,215 @@ -+/* -+ * ASoC Driver for JustBoom Raspberry Pi Digi HAT Sound Card -+ * -+ * Author: Milan Neskovic -+ * Copyright 2016 -+ * based on code by Daniel Matuschek -+ * based on code by Florian Meier -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "../codecs/wm8804.h" -+ -+static int snd_rpi_justboom_digi_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ /* enable TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ return 0; -+} -+ -+static int snd_rpi_justboom_digi_startup(struct snd_pcm_substream *substream) { -+ /* turn on digital output */ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); -+ return 0; -+} -+ -+static void snd_rpi_justboom_digi_shutdown(struct snd_pcm_substream *substream) { -+ /* turn off output */ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); -+} -+ -+static int snd_rpi_justboom_digi_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *codec_dai = rtd->codec_dai; -+ struct snd_soc_codec *codec = rtd->codec; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ -+ int sysclk = 27000000; /* This is fixed on this board */ -+ -+ long mclk_freq=0; -+ int mclk_div=1; -+ int sampling_freq=1; -+ -+ int ret; -+ -+ int samplerate = params_rate(params); -+ -+ if (samplerate<=96000) { -+ mclk_freq=samplerate*256; -+ mclk_div=WM8804_MCLKDIV_256FS; -+ } else { -+ mclk_freq=samplerate*128; -+ mclk_div=WM8804_MCLKDIV_128FS; -+ } -+ -+ switch (samplerate) { -+ case 32000: -+ sampling_freq=0x03; -+ break; -+ case 44100: -+ sampling_freq=0x00; -+ break; -+ case 48000: -+ sampling_freq=0x02; -+ break; -+ case 88200: -+ sampling_freq=0x08; -+ break; -+ case 96000: -+ sampling_freq=0x0a; -+ break; -+ case 176400: -+ sampling_freq=0x0c; -+ break; -+ case 192000: -+ sampling_freq=0x0e; -+ break; -+ default: -+ dev_err(codec->dev, -+ "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", -+ samplerate); -+ } -+ -+ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); -+ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); -+ -+ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, -+ sysclk, SND_SOC_CLOCK_OUT); -+ if (ret < 0) { -+ dev_err(codec->dev, -+ "Failed to set WM8804 SYSCLK: %d\n", ret); -+ return ret; -+ } -+ -+ /* Enable TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ /* Power on */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); -+ -+ /* set sampling frequency status bits */ -+ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); -+ -+ return snd_soc_dai_set_bclk_ratio(cpu_dai,64); -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_rpi_justboom_digi_ops = { -+ .hw_params = snd_rpi_justboom_digi_hw_params, -+ .startup = snd_rpi_justboom_digi_startup, -+ .shutdown = snd_rpi_justboom_digi_shutdown, -+}; -+ -+static struct snd_soc_dai_link snd_rpi_justboom_digi_dai[] = { -+{ -+ .name = "JustBoom Digi", -+ .stream_name = "JustBoom Digi HiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "wm8804-spdif", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "wm8804.1-003b", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBM_CFM, -+ .ops = &snd_rpi_justboom_digi_ops, -+ .init = snd_rpi_justboom_digi_init, -+}, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_rpi_justboom_digi = { -+ .name = "snd_rpi_justboom_digi", -+ .owner = THIS_MODULE, -+ .dai_link = snd_rpi_justboom_digi_dai, -+ .num_links = ARRAY_SIZE(snd_rpi_justboom_digi_dai), -+}; -+ -+static int snd_rpi_justboom_digi_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ -+ snd_rpi_justboom_digi.dev = &pdev->dev; -+ -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai = &snd_rpi_justboom_digi_dai[0]; -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ } -+ -+ ret = snd_soc_register_card(&snd_rpi_justboom_digi); -+ if (ret) -+ dev_err(&pdev->dev, -+ "snd_soc_register_card() failed: %d\n", ret); -+ -+ return ret; -+} -+ -+static int snd_rpi_justboom_digi_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_rpi_justboom_digi); -+} -+ -+static const struct of_device_id snd_rpi_justboom_digi_of_match[] = { -+ { .compatible = "justboom,justboom-digi", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, snd_rpi_justboom_digi_of_match); -+ -+static struct platform_driver snd_rpi_justboom_digi_driver = { -+ .driver = { -+ .name = "snd-rpi-justboom-digi", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_rpi_justboom_digi_of_match, -+ }, -+ .probe = snd_rpi_justboom_digi_probe, -+ .remove = snd_rpi_justboom_digi_remove, -+}; -+ -+module_platform_driver(snd_rpi_justboom_digi_driver); -+ -+MODULE_AUTHOR("Milan Neskovic "); -+MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0368-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch b/target/linux/brcm2708/patches-4.4/0368-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch new file mode 100644 index 0000000000..11019f2bbc --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0368-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch @@ -0,0 +1,82 @@ +From 23a2a66f68d9cef1664e904b741e074dab5b82d6 Mon Sep 17 00:00:00 2001 +From: DigitalDreamtime +Date: Sun, 29 May 2016 05:22:29 +0100 +Subject: [PATCH] Add dt param to force HiFiBerry DAC+ Pro into slave mode + +"dtoverlay=hifiberry-dacplus,slave" + +Add 'slave' param to use HiFiBerry DAC+ Pro in slave mode, +with Pi as master for bit and frame clock. + +Signed-off-by: DigitalDreamtime +--- + arch/arm/boot/dts/overlays/README | 2 ++ + arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts | 6 ++++-- + sound/soc/bcm/hifiberry_dacplus.c | 10 ++++++++-- + 3 files changed, 14 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -344,6 +344,8 @@ Params: 24db_digital_gain Allow ga + responsibility of the user to ensure that + the Digital volume control is set to a value + that does not result in clipping/distortion!) ++ slave Force DAC+ Pro into slave mode, using Pi as ++ master for bit clock and frame clock. + + + Name: hifiberry-digi +--- a/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts ++++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts +@@ -41,7 +41,7 @@ + + fragment@3 { + target = <&sound>; +- frag3: __overlay__ { ++ hifiberry_dacplus: __overlay__ { + compatible = "hifiberry,hifiberry-dacplus"; + i2s-controller = <&i2s>; + status = "okay"; +@@ -49,6 +49,8 @@ + }; + + __overrides__ { +- 24db_digital_gain = <&frag3>,"hifiberry,24db_digital_gain?"; ++ 24db_digital_gain = ++ <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?"; ++ slave = <&hifiberry_dacplus>,"hifiberry-dacplus,slave?"; + }; + }; +--- a/sound/soc/bcm/hifiberry_dacplus.c ++++ b/sound/soc/bcm/hifiberry_dacplus.c +@@ -47,6 +47,7 @@ struct pcm512x_priv { + /* Clock rate of CLK48EN attached to GPIO3 pin */ + #define CLK_48EN_RATE 24576000UL + ++static bool slave; + static bool snd_rpi_hifiberry_is_dacpro; + static bool digital_gain_0db_limit = true; + +@@ -145,8 +146,11 @@ static int snd_rpi_hifiberry_dacplus_ini + struct snd_soc_codec *codec = rtd->codec; + struct pcm512x_priv *priv; + +- snd_rpi_hifiberry_is_dacpro +- = snd_rpi_hifiberry_dacplus_is_pro_card(codec); ++ if (slave) ++ snd_rpi_hifiberry_is_dacpro = false; ++ else ++ snd_rpi_hifiberry_is_dacpro = ++ snd_rpi_hifiberry_dacplus_is_pro_card(codec); + + if (snd_rpi_hifiberry_is_dacpro) { + struct snd_soc_dai_link *dai = rtd->dai_link; +@@ -314,6 +318,8 @@ static int snd_rpi_hifiberry_dacplus_pro + + digital_gain_0db_limit = !of_property_read_bool( + pdev->dev.of_node, "hifiberry,24db_digital_gain"); ++ slave = of_property_read_bool(pdev->dev.of_node, ++ "hifiberry-dacplus,slave"); + } + + ret = snd_soc_register_card(&snd_rpi_hifiberry_dacplus); diff --git a/target/linux/brcm2708/patches-4.4/0369-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch b/target/linux/brcm2708/patches-4.4/0369-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch deleted file mode 100644 index 920199fea7..0000000000 --- a/target/linux/brcm2708/patches-4.4/0369-Add-dt-param-to-force-HiFiBerry-DAC-Pro-into-slave-m.patch +++ /dev/null @@ -1,83 +0,0 @@ -From e4183dfba92b3adf88a9be7e073cf80c5bda2c69 Mon Sep 17 00:00:00 2001 -From: DigitalDreamtime -Date: Sun, 29 May 2016 05:22:29 +0100 -Subject: [PATCH 369/423] Add dt param to force HiFiBerry DAC+ Pro into slave - mode - -"dtoverlay=hifiberry-dacplus,slave" - -Add 'slave' param to use HiFiBerry DAC+ Pro in slave mode, -with Pi as master for bit and frame clock. - -Signed-off-by: DigitalDreamtime ---- - arch/arm/boot/dts/overlays/README | 2 ++ - arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts | 6 ++++-- - sound/soc/bcm/hifiberry_dacplus.c | 10 ++++++++-- - 3 files changed, 14 insertions(+), 4 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -344,6 +344,8 @@ Params: 24db_digital_gain Allow ga - responsibility of the user to ensure that - the Digital volume control is set to a value - that does not result in clipping/distortion!) -+ slave Force DAC+ Pro into slave mode, using Pi as -+ master for bit clock and frame clock. - - - Name: hifiberry-digi ---- a/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts -+++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts -@@ -41,7 +41,7 @@ - - fragment@3 { - target = <&sound>; -- frag3: __overlay__ { -+ hifiberry_dacplus: __overlay__ { - compatible = "hifiberry,hifiberry-dacplus"; - i2s-controller = <&i2s>; - status = "okay"; -@@ -49,6 +49,8 @@ - }; - - __overrides__ { -- 24db_digital_gain = <&frag3>,"hifiberry,24db_digital_gain?"; -+ 24db_digital_gain = -+ <&hifiberry_dacplus>,"hifiberry,24db_digital_gain?"; -+ slave = <&hifiberry_dacplus>,"hifiberry-dacplus,slave?"; - }; - }; ---- a/sound/soc/bcm/hifiberry_dacplus.c -+++ b/sound/soc/bcm/hifiberry_dacplus.c -@@ -47,6 +47,7 @@ struct pcm512x_priv { - /* Clock rate of CLK48EN attached to GPIO3 pin */ - #define CLK_48EN_RATE 24576000UL - -+static bool slave; - static bool snd_rpi_hifiberry_is_dacpro; - static bool digital_gain_0db_limit = true; - -@@ -145,8 +146,11 @@ static int snd_rpi_hifiberry_dacplus_ini - struct snd_soc_codec *codec = rtd->codec; - struct pcm512x_priv *priv; - -- snd_rpi_hifiberry_is_dacpro -- = snd_rpi_hifiberry_dacplus_is_pro_card(codec); -+ if (slave) -+ snd_rpi_hifiberry_is_dacpro = false; -+ else -+ snd_rpi_hifiberry_is_dacpro = -+ snd_rpi_hifiberry_dacplus_is_pro_card(codec); - - if (snd_rpi_hifiberry_is_dacpro) { - struct snd_soc_dai_link *dai = rtd->dai_link; -@@ -314,6 +318,8 @@ static int snd_rpi_hifiberry_dacplus_pro - - digital_gain_0db_limit = !of_property_read_bool( - pdev->dev.of_node, "hifiberry,24db_digital_gain"); -+ slave = of_property_read_bool(pdev->dev.of_node, -+ "hifiberry-dacplus,slave"); - } - - ret = snd_soc_register_card(&snd_rpi_hifiberry_dacplus); diff --git a/target/linux/brcm2708/patches-4.4/0369-simple-add-sound-dai-cells-to-I2S-def.patch b/target/linux/brcm2708/patches-4.4/0369-simple-add-sound-dai-cells-to-I2S-def.patch new file mode 100644 index 0000000000..464bd2cd2a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0369-simple-add-sound-dai-cells-to-I2S-def.patch @@ -0,0 +1,33 @@ +From 488b8934b1f8c36a86570c6d6215404a2508cf5d Mon Sep 17 00:00:00 2001 +From: DigitalDreamtime +Date: Thu, 19 May 2016 00:00:00 +0100 +Subject: [PATCH] simple: add sound-dai-cells to I2S def + +Add '#sound-dai-cells = <0>;' to the I2S definition in +bcm2708_common.dtsi + +Not having it specified, whilst not causing an issue right now with +rpi-4.4.y, is going to cause an issue going forward with the use of +simple-card driver. So it doesn't fall through the cracks, patch it +in now. + +Hopefully Martin has taken care of getting a patch submitted for the +upstream Pi dts, as it was he who first run into the issue with the +current upstream kernel.... +https://github.com/msperl/linux-rpi/issues/3#issue-154916615 + +Signed-off-by: DigitalDreamtime +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -137,6 +137,7 @@ + + i2s: i2s@7e203000 { + compatible = "brcm,bcm2835-i2s"; ++ #sound-dai-cells = <0>; + reg = <0x7e203000 0x24>, + <0x7e101098 0x08>; + diff --git a/target/linux/brcm2708/patches-4.4/0370-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch b/target/linux/brcm2708/patches-4.4/0370-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch new file mode 100644 index 0000000000..02df95d9d4 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0370-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch @@ -0,0 +1,31 @@ +From 23573e4540b9de3c8506fa26956815fc0d71fb75 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson <6by9@users.noreply.github.com> +Date: Tue, 31 May 2016 10:38:31 +0100 +Subject: [PATCH] BCM2835-V4L2: Increase minimum resolution to 32x32 + +https://github.com/raspberrypi/linux/issues/1498 showed +up that 16x16 is failing to work on the GPU for some reason. + +GPU bug being tracked on +https://github.com/raspberrypi/firmware/issues/607 +Workaround here by increasing minimum resolution via V4L2 +to 32x32. + +Signed-off-by: Dave Stevenson <6by9@users.noreply.github.com> +--- + drivers/media/platform/bcm2835/bcm2835-camera.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/media/platform/bcm2835/bcm2835-camera.c ++++ b/drivers/media/platform/bcm2835/bcm2835-camera.c +@@ -36,8 +36,8 @@ + + #define BM2835_MMAL_VERSION "0.0.2" + #define BM2835_MMAL_MODULE_NAME "bcm2835-v4l2" +-#define MIN_WIDTH 16 +-#define MIN_HEIGHT 16 ++#define MIN_WIDTH 32 ++#define MIN_HEIGHT 32 + #define MIN_BUFFER_SIZE (80*1024) + + #define MAX_VIDEO_MODE_WIDTH 1280 diff --git a/target/linux/brcm2708/patches-4.4/0370-simple-add-sound-dai-cells-to-I2S-def.patch b/target/linux/brcm2708/patches-4.4/0370-simple-add-sound-dai-cells-to-I2S-def.patch deleted file mode 100644 index f84b7b8745..0000000000 --- a/target/linux/brcm2708/patches-4.4/0370-simple-add-sound-dai-cells-to-I2S-def.patch +++ /dev/null @@ -1,33 +0,0 @@ -From b035bb68499b1b100f3f06c76fc1ad7f10953f19 Mon Sep 17 00:00:00 2001 -From: DigitalDreamtime -Date: Thu, 19 May 2016 00:00:00 +0100 -Subject: [PATCH 370/423] simple: add sound-dai-cells to I2S def - -Add '#sound-dai-cells = <0>;' to the I2S definition in -bcm2708_common.dtsi - -Not having it specified, whilst not causing an issue right now with -rpi-4.4.y, is going to cause an issue going forward with the use of -simple-card driver. So it doesn't fall through the cracks, patch it -in now. - -Hopefully Martin has taken care of getting a patch submitted for the -upstream Pi dts, as it was he who first run into the issue with the -current upstream kernel.... -https://github.com/msperl/linux-rpi/issues/3#issue-154916615 - -Signed-off-by: DigitalDreamtime ---- - arch/arm/boot/dts/bcm2708_common.dtsi | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm/boot/dts/bcm2708_common.dtsi -+++ b/arch/arm/boot/dts/bcm2708_common.dtsi -@@ -137,6 +137,7 @@ - - i2s: i2s@7e203000 { - compatible = "brcm,bcm2835-i2s"; -+ #sound-dai-cells = <0>; - reg = <0x7e203000 0x24>, - <0x7e101098 0x08>; - diff --git a/target/linux/brcm2708/patches-4.4/0371-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch b/target/linux/brcm2708/patches-4.4/0371-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch deleted file mode 100644 index 3dfe037f1f..0000000000 --- a/target/linux/brcm2708/patches-4.4/0371-BCM2835-V4L2-Increase-minimum-resolution-to-32x32.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 85e7cbd400714fff019db2d1ec7eb500a6bbc0ba Mon Sep 17 00:00:00 2001 -From: Dave Stevenson <6by9@users.noreply.github.com> -Date: Tue, 31 May 2016 10:38:31 +0100 -Subject: [PATCH 371/423] BCM2835-V4L2: Increase minimum resolution to 32x32 - -https://github.com/raspberrypi/linux/issues/1498 showed -up that 16x16 is failing to work on the GPU for some reason. - -GPU bug being tracked on -https://github.com/raspberrypi/firmware/issues/607 -Workaround here by increasing minimum resolution via V4L2 -to 32x32. - -Signed-off-by: Dave Stevenson <6by9@users.noreply.github.com> ---- - drivers/media/platform/bcm2835/bcm2835-camera.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/media/platform/bcm2835/bcm2835-camera.c -+++ b/drivers/media/platform/bcm2835/bcm2835-camera.c -@@ -36,8 +36,8 @@ - - #define BM2835_MMAL_VERSION "0.0.2" - #define BM2835_MMAL_MODULE_NAME "bcm2835-v4l2" --#define MIN_WIDTH 16 --#define MIN_HEIGHT 16 -+#define MIN_WIDTH 32 -+#define MIN_HEIGHT 32 - #define MIN_BUFFER_SIZE (80*1024) - - #define MAX_VIDEO_MODE_WIDTH 1280 diff --git a/target/linux/brcm2708/patches-4.4/0371-config-Add-support-for-Logitech-Rumblepad.patch b/target/linux/brcm2708/patches-4.4/0371-config-Add-support-for-Logitech-Rumblepad.patch new file mode 100644 index 0000000000..3aa98a433c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0371-config-Add-support-for-Logitech-Rumblepad.patch @@ -0,0 +1,36 @@ +From 339b9cfaae888619c7c84c18c148a48baadddc2d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 27 May 2016 18:23:51 +0100 +Subject: [PATCH] config: Add support for Logitech Rumblepad + +--- + arch/arm/configs/bcm2709_defconfig | 4 ++++ + arch/arm/configs/bcmrpi_defconfig | 4 ++++ + 2 files changed, 8 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -896,6 +896,10 @@ CONFIG_HID_TWINHAN=m + CONFIG_HID_KENSINGTON=m + CONFIG_HID_LCPOWER=m + CONFIG_HID_LOGITECH=m ++CONFIG_HID_LOGITECH_DJ=m ++CONFIG_LOGITECH_FF=y ++CONFIG_LOGIRUMBLEPAD2_FF=y ++CONFIG_LOGIG940_FF=y + CONFIG_HID_MAGICMOUSE=m + CONFIG_HID_MICROSOFT=m + CONFIG_HID_MONTEREY=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -888,6 +888,10 @@ CONFIG_HID_TWINHAN=m + CONFIG_HID_KENSINGTON=m + CONFIG_HID_LCPOWER=m + CONFIG_HID_LOGITECH=m ++CONFIG_HID_LOGITECH_DJ=m ++CONFIG_LOGITECH_FF=y ++CONFIG_LOGIRUMBLEPAD2_FF=y ++CONFIG_LOGIG940_FF=y + CONFIG_HID_MAGICMOUSE=m + CONFIG_HID_MICROSOFT=m + CONFIG_HID_MONTEREY=m diff --git a/target/linux/brcm2708/patches-4.4/0372-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch b/target/linux/brcm2708/patches-4.4/0372-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch new file mode 100644 index 0000000000..303d45d38e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0372-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch @@ -0,0 +1,602 @@ +From bcba10e5c5da279fa57920ee1c08ee1dea84a4f6 Mon Sep 17 00:00:00 2001 +From: escalator2015 +Date: Tue, 24 May 2016 16:20:09 +0100 +Subject: [PATCH] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../overlays/rra-digidac1-wm8741-audio-overlay.dts | 81 ++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 8 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/digidac1-soundcard.c | 422 +++++++++++++++++++++ + 8 files changed, 522 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/rra-digidac1-wm8741-audio-overlay.dts + create mode 100644 sound/soc/bcm/digidac1-soundcard.c + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -67,6 +67,7 @@ dtbo-$(RPI_DT_OVERLAYS) += rpi-display.d + dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dtbo + dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo + dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -842,6 +842,12 @@ Load: dtoverlay=rpi-sense + Params: + + ++Name: rra-digidac1-wm8741-audio ++Info: Configures the Red Rocks Audio DigiDAC1 soundcard ++Load: dtoverlay=rra-digidac1-wm8741-audio ++Params: ++ ++ + Name: sdhost + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock. + N.B. This overlay is designed for situations where the mmc driver is +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rra-digidac1-wm8741-audio-overlay.dts +@@ -0,0 +1,81 @@ ++// Definitions for RRA DigiDAC1 Audio card ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ aliases { ++ ldo0 = &ldo0; ++ ldo1 = &ldo1; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/soc"; ++ __overlay__ { ++ ++ ldo1: ldo1 { ++ compatible = "regulator-fixed"; ++ regulator-name = "DC_5V"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ ++ ldo0: ldo0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "DC_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ wm8804@3b { ++ #sound-dai-cells = <0>; ++ compatible = "wlf,wm8804"; ++ reg = <0x3b>; ++ status = "okay"; ++ PVDD-supply = <&ldo0>; ++ DVDD-supply = <&ldo0>; ++ }; ++ ++ wm8742: wm8741@1a { ++ compatible = "wlf,wm8741"; ++ reg = <0x1a>; ++ status = "okay"; ++ AVDD-supply = <&ldo1>; ++ DVDD-supply = <&ldo0>; ++ }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "rra,digidac1-soundcard"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -866,6 +866,7 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ++CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -858,6 +858,7 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ++CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -92,3 +92,11 @@ config SND_AUDIOINJECTOR_PI_SOUNDCARD + select SND_SOC_WM8731 + help + Say Y or M if you want to add support for audioinjector.net Pi Hat ++ ++config SND_DIGIDAC1_SOUNDCARD ++ tristate "Support for Red Rocks Audio DigiDAC1" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_WM8804 ++ select SND_SOC_WM8741 ++ help ++ Say Y or M if you want to add support for Red Rocks Audio DigiDAC1 board. +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -16,6 +16,7 @@ snd-soc-rpi-proto-objs := rpi-proto.o + snd-soc-iqaudio-dac-objs := iqaudio-dac.o + snd-soc-raspidac3-objs := raspidac3.o + snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o ++snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + + obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o +@@ -29,4 +30,5 @@ obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) + obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o + obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o ++obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + +--- /dev/null ++++ b/sound/soc/bcm/digidac1-soundcard.c +@@ -0,0 +1,422 @@ ++/* ++ * ASoC Driver for RRA DigiDAC1 ++ * Copyright 2016 ++ * Author: José M. Tasende ++ * based on the HifiBerry DAC driver by Florian Meier ++ * and the Wolfson card driver by Nikesh Oswal, ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "../codecs/wm8804.h" ++#include "../codecs/wm8741.h" ++ ++#define WM8741_NUM_SUPPLIES 2 ++ ++/* codec private data */ ++struct wm8741_priv { ++ struct wm8741_platform_data pdata; ++ struct regmap *regmap; ++ struct regulator_bulk_data supplies[WM8741_NUM_SUPPLIES]; ++ unsigned int sysclk; ++ const struct snd_pcm_hw_constraint_list *sysclk_constraints; ++}; ++ ++static int samplerate = 44100; ++ ++/* New Alsa Controls not exposed by original wm8741 codec driver */ ++/* in actual driver the att. adjustment is wrong because */ ++/* this DAC has a coarse attenuation register with 4dB steps */ ++/* and a fine level register with 0.125dB steps */ ++/* each register has 32 steps so combining both we have 1024 steps */ ++/* of 0.125 dB. */ ++/* The original level controls from driver are removed at startup */ ++/* and replaced by the corrected ones. */ ++/* The same wm8741 driver can be used for wm8741 and wm8742 devices */ ++ ++static const DECLARE_TLV_DB_SCALE(dac_tlv_fine, 0, 13, 0); ++static const DECLARE_TLV_DB_SCALE(dac_tlv_coarse, -12700, 400, 1); ++static const char *w8741_dither[4] = {"Off", "RPDF", "TPDF", "HPDF"}; ++static const char *w8741_filter[5] = { ++ "Type 1", "Type 2", "Type 3", "Type 4", "Type 5"}; ++static const char *w8741_switch[2] = {"Off", "On"}; ++static const struct soc_enum w8741_enum[] = { ++SOC_ENUM_SINGLE(WM8741_MODE_CONTROL_2, 0, 4, w8741_dither),/* dithering type */ ++SOC_ENUM_SINGLE(WM8741_FILTER_CONTROL, 0, 5, w8741_filter),/* filter type */ ++SOC_ENUM_SINGLE(WM8741_FORMAT_CONTROL, 6, 2, w8741_switch),/* phase invert */ ++SOC_ENUM_SINGLE(WM8741_VOLUME_CONTROL, 0, 2, w8741_switch),/* volume ramp */ ++SOC_ENUM_SINGLE(WM8741_VOLUME_CONTROL, 3, 2, w8741_switch),/* soft mute */ ++}; ++ ++static const struct snd_kcontrol_new w8741_snd_controls_stereo[] = { ++SOC_DOUBLE_R_TLV("DAC Fine Playback Volume", WM8741_DACLLSB_ATTENUATION, ++ WM8741_DACRLSB_ATTENUATION, 0, 31, 1, dac_tlv_fine), ++SOC_DOUBLE_R_TLV("Digital Playback Volume", WM8741_DACLMSB_ATTENUATION, ++ WM8741_DACRMSB_ATTENUATION, 0, 31, 1, dac_tlv_coarse), ++SOC_ENUM("DAC Dither", w8741_enum[0]), ++SOC_ENUM("DAC Digital Filter", w8741_enum[1]), ++SOC_ENUM("DAC Phase Invert", w8741_enum[2]), ++SOC_ENUM("DAC Volume Ramp", w8741_enum[3]), ++SOC_ENUM("DAC Soft Mute", w8741_enum[4]), ++}; ++ ++static const struct snd_kcontrol_new w8741_snd_controls_mono_left[] = { ++SOC_SINGLE_TLV("DAC Fine Playback Volume", WM8741_DACLLSB_ATTENUATION, ++ 0, 31, 0, dac_tlv_fine), ++SOC_SINGLE_TLV("Digital Playback Volume", WM8741_DACLMSB_ATTENUATION, ++ 0, 31, 1, dac_tlv_coarse), ++SOC_ENUM("DAC Dither", w8741_enum[0]), ++SOC_ENUM("DAC Digital Filter", w8741_enum[1]), ++SOC_ENUM("DAC Phase Invert", w8741_enum[2]), ++SOC_ENUM("DAC Volume Ramp", w8741_enum[3]), ++SOC_ENUM("DAC Soft Mute", w8741_enum[4]), ++}; ++ ++static const struct snd_kcontrol_new w8741_snd_controls_mono_right[] = { ++SOC_SINGLE_TLV("DAC Fine Playback Volume", WM8741_DACRLSB_ATTENUATION, ++ 0, 31, 0, dac_tlv_fine), ++SOC_SINGLE_TLV("Digital Playback Volume", WM8741_DACRMSB_ATTENUATION, ++ 0, 31, 1, dac_tlv_coarse), ++SOC_ENUM("DAC Dither", w8741_enum[0]), ++SOC_ENUM("DAC Digital Filter", w8741_enum[1]), ++SOC_ENUM("DAC Phase Invert", w8741_enum[2]), ++SOC_ENUM("DAC Volume Ramp", w8741_enum[3]), ++SOC_ENUM("DAC Soft Mute", w8741_enum[4]), ++}; ++ ++static int w8741_add_controls(struct snd_soc_codec *codec) ++{ ++ struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec); ++ ++ switch (wm8741->pdata.diff_mode) { ++ case WM8741_DIFF_MODE_STEREO: ++ case WM8741_DIFF_MODE_STEREO_REVERSED: ++ snd_soc_add_codec_controls(codec, ++ w8741_snd_controls_stereo, ++ ARRAY_SIZE(w8741_snd_controls_stereo)); ++ break; ++ case WM8741_DIFF_MODE_MONO_LEFT: ++ snd_soc_add_codec_controls(codec, ++ w8741_snd_controls_mono_left, ++ ARRAY_SIZE(w8741_snd_controls_mono_left)); ++ break; ++ case WM8741_DIFF_MODE_MONO_RIGHT: ++ snd_soc_add_codec_controls(codec, ++ w8741_snd_controls_mono_right, ++ ARRAY_SIZE(w8741_snd_controls_mono_right)); ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static int digidac1_soundcard_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_card *card = rtd->card; ++ struct snd_soc_pcm_runtime *wm8741_rtd; ++ struct snd_soc_codec *wm8741_codec; ++ struct snd_card *sound_card = card->snd_card; ++ struct snd_kcontrol *kctl; ++ int ret; ++ ++ wm8741_rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); ++ if (!wm8741_rtd) { ++ dev_warn(card->dev, "digidac1_soundcard_init: couldn't get wm8741 rtd\n"); ++ return -EFAULT; ++ } ++ wm8741_codec = wm8741_rtd->codec; ++ ret = w8741_add_controls(wm8741_codec); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to add new wm8741 controls: %d\n", ++ ret); ++ ++ /* enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ kctl = snd_soc_card_get_kcontrol(card, ++ "Playback Volume"); ++ if (kctl) { ++ kctl->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE; ++ snd_ctl_remove(sound_card, kctl); ++ } ++ kctl = snd_soc_card_get_kcontrol(card, ++ "Fine Playback Volume"); ++ if (kctl) { ++ kctl->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE; ++ snd_ctl_remove(sound_card, kctl); ++ } ++ return 0; ++} ++ ++static int digidac1_soundcard_startup(struct snd_pcm_substream *substream) ++{ ++ /* turn on wm8804 digital output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_card *card = rtd->card; ++ struct snd_soc_pcm_runtime *wm8741_rtd; ++ struct snd_soc_codec *wm8741_codec; ++ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); ++ wm8741_rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); ++ if (!wm8741_rtd) { ++ dev_warn(card->dev, "digidac1_soundcard_startup: couldn't get WM8741 rtd\n"); ++ return -EFAULT; ++ } ++ wm8741_codec = wm8741_rtd->codec; ++ ++ /* latch wm8741 level */ ++ snd_soc_update_bits(wm8741_codec, WM8741_DACLLSB_ATTENUATION, ++ WM8741_UPDATELL, WM8741_UPDATELL); ++ snd_soc_update_bits(wm8741_codec, WM8741_DACLMSB_ATTENUATION, ++ WM8741_UPDATELM, WM8741_UPDATELM); ++ snd_soc_update_bits(wm8741_codec, WM8741_DACRLSB_ATTENUATION, ++ WM8741_UPDATERL, WM8741_UPDATERL); ++ snd_soc_update_bits(wm8741_codec, WM8741_DACRMSB_ATTENUATION, ++ WM8741_UPDATERM, WM8741_UPDATERM); ++ ++ return 0; ++} ++ ++static void digidac1_soundcard_shutdown(struct snd_pcm_substream *substream) ++{ ++ /* turn off wm8804 digital output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); ++} ++ ++static int digidac1_soundcard_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ struct snd_soc_card *card = rtd->card; ++ struct snd_soc_pcm_runtime *wm8741_rtd; ++ struct snd_soc_codec *wm8741_codec; ++ ++ int sysclk = 27000000; ++ long mclk_freq = 0; ++ int mclk_div = 1; ++ int sampling_freq = 1; ++ int ret; ++ ++ wm8741_rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); ++ if (!wm8741_rtd) { ++ dev_warn(card->dev, "digidac1_soundcard_hw_params: couldn't get WM8741 rtd\n"); ++ return -EFAULT; ++ } ++ wm8741_codec = wm8741_rtd->codec; ++ samplerate = params_rate(params); ++ ++ if (samplerate <= 96000) { ++ mclk_freq = samplerate*256; ++ mclk_div = WM8804_MCLKDIV_256FS; ++ } else { ++ mclk_freq = samplerate*128; ++ mclk_div = WM8804_MCLKDIV_128FS; ++ } ++ ++ switch (samplerate) { ++ case 32000: ++ sampling_freq = 0x03; ++ break; ++ case 44100: ++ sampling_freq = 0x00; ++ break; ++ case 48000: ++ sampling_freq = 0x02; ++ break; ++ case 88200: ++ sampling_freq = 0x08; ++ break; ++ case 96000: ++ sampling_freq = 0x0a; ++ break; ++ case 176400: ++ sampling_freq = 0x0c; ++ break; ++ case 192000: ++ sampling_freq = 0x0e; ++ break; ++ default: ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", ++ samplerate); ++ } ++ ++ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); ++ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); ++ ++ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, ++ sysclk, SND_SOC_CLOCK_OUT); ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK: %d\n", ret); ++ return ret; ++ } ++ /* Enable wm8804 TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ /* wm8804 Power on */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); ++ ++ /* wm8804 set sampling frequency status bits */ ++ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); ++ ++ /* Now update wm8741 registers for the correct oversampling */ ++ if (samplerate <= 48000) ++ snd_soc_update_bits(wm8741_codec, WM8741_MODE_CONTROL_1, ++ WM8741_OSR_MASK, 0x00); ++ else if (samplerate <= 96000) ++ snd_soc_update_bits(wm8741_codec, WM8741_MODE_CONTROL_1, ++ WM8741_OSR_MASK, 0x20); ++ else ++ snd_soc_update_bits(wm8741_codec, WM8741_MODE_CONTROL_1, ++ WM8741_OSR_MASK, 0x40); ++ ++ /* wm8741 bit size */ ++ switch (params_width(params)) { ++ case 16: ++ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, ++ WM8741_IWL_MASK, 0x00); ++ break; ++ case 20: ++ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, ++ WM8741_IWL_MASK, 0x01); ++ break; ++ case 24: ++ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, ++ WM8741_IWL_MASK, 0x02); ++ break; ++ case 32: ++ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, ++ WM8741_IWL_MASK, 0x03); ++ break; ++ default: ++ dev_dbg(codec->dev, "wm8741_hw_params: Unsupported bit size param = %d", ++ params_width(params)); ++ return -EINVAL; ++ } ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); ++} ++/* machine stream operations */ ++static struct snd_soc_ops digidac1_soundcard_ops = { ++ .hw_params = digidac1_soundcard_hw_params, ++ .startup = digidac1_soundcard_startup, ++ .shutdown = digidac1_soundcard_shutdown, ++}; ++ ++static struct snd_soc_dai_link digidac1_soundcard_dai[] = { ++ { ++ .name = "RRA DigiDAC1", ++ .stream_name = "RRA DigiDAC1 HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "wm8804-spdif", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "wm8804.1-003b", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBM_CFM, ++ .ops = &digidac1_soundcard_ops, ++ .init = digidac1_soundcard_init, ++ }, ++ { ++ .name = "RRA DigiDAC11", ++ .stream_name = "RRA DigiDAC11 HiFi", ++ .cpu_dai_name = "wm8804-spdif", ++ .codec_dai_name = "wm8741", ++ .codec_name = "wm8741.1-001a", ++ .dai_fmt = SND_SOC_DAIFMT_I2S ++ | SND_SOC_DAIFMT_NB_NF ++ | SND_SOC_DAIFMT_CBS_CFS, ++ }, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card digidac1_soundcard = { ++ .name = "digidac1-soundcard", ++ .owner = THIS_MODULE, ++ .dai_link = digidac1_soundcard_dai, ++ .num_links = ARRAY_SIZE(digidac1_soundcard_dai), ++}; ++ ++static int digidac1_soundcard_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ digidac1_soundcard.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &digidac1_soundcard_dai[0]; ++ ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ ++ ret = snd_soc_register_card(&digidac1_soundcard); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int digidac1_soundcard_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&digidac1_soundcard); ++} ++ ++static const struct of_device_id digidac1_soundcard_of_match[] = { ++ { .compatible = "rra,digidac1-soundcard", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, digidac1_soundcard_of_match); ++ ++static struct platform_driver digidac1_soundcard_driver = { ++ .driver = { ++ .name = "digidac1-audio", ++ .owner = THIS_MODULE, ++ .of_match_table = digidac1_soundcard_of_match, ++ }, ++ .probe = digidac1_soundcard_probe, ++ .remove = digidac1_soundcard_remove, ++}; ++ ++module_platform_driver(digidac1_soundcard_driver); ++ ++MODULE_AUTHOR("José M. Tasende "); ++MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0372-config-Add-support-for-Logitech-Rumblepad.patch b/target/linux/brcm2708/patches-4.4/0372-config-Add-support-for-Logitech-Rumblepad.patch deleted file mode 100644 index eebb627deb..0000000000 --- a/target/linux/brcm2708/patches-4.4/0372-config-Add-support-for-Logitech-Rumblepad.patch +++ /dev/null @@ -1,36 +0,0 @@ -From f141b0d59a1cc6783462e3b0656527a12e63be4a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 27 May 2016 18:23:51 +0100 -Subject: [PATCH 372/423] config: Add support for Logitech Rumblepad - ---- - arch/arm/configs/bcm2709_defconfig | 4 ++++ - arch/arm/configs/bcmrpi_defconfig | 4 ++++ - 2 files changed, 8 insertions(+) - ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -896,6 +896,10 @@ CONFIG_HID_TWINHAN=m - CONFIG_HID_KENSINGTON=m - CONFIG_HID_LCPOWER=m - CONFIG_HID_LOGITECH=m -+CONFIG_HID_LOGITECH_DJ=m -+CONFIG_LOGITECH_FF=y -+CONFIG_LOGIRUMBLEPAD2_FF=y -+CONFIG_LOGIG940_FF=y - CONFIG_HID_MAGICMOUSE=m - CONFIG_HID_MICROSOFT=m - CONFIG_HID_MONTEREY=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -888,6 +888,10 @@ CONFIG_HID_TWINHAN=m - CONFIG_HID_KENSINGTON=m - CONFIG_HID_LCPOWER=m - CONFIG_HID_LOGITECH=m -+CONFIG_HID_LOGITECH_DJ=m -+CONFIG_LOGITECH_FF=y -+CONFIG_LOGIRUMBLEPAD2_FF=y -+CONFIG_LOGIG940_FF=y - CONFIG_HID_MAGICMOUSE=m - CONFIG_HID_MICROSOFT=m - CONFIG_HID_MONTEREY=m diff --git a/target/linux/brcm2708/patches-4.4/0373-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch b/target/linux/brcm2708/patches-4.4/0373-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch deleted file mode 100644 index 15b6888e83..0000000000 --- a/target/linux/brcm2708/patches-4.4/0373-New-driver-for-RRA-DigiDAC1-soundcard-using-WM8741-W.patch +++ /dev/null @@ -1,603 +0,0 @@ -From 4e543fbd917ecbc07317afa418341bde1c0569b6 Mon Sep 17 00:00:00 2001 -From: escalator2015 -Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 373/423] New driver for RRA DigiDAC1 soundcard using WM8741 + - WM8804 - ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 + - .../overlays/rra-digidac1-wm8741-audio-overlay.dts | 81 ++++ - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - sound/soc/bcm/Kconfig | 8 + - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/digidac1-soundcard.c | 422 +++++++++++++++++++++ - 8 files changed, 522 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/rra-digidac1-wm8741-audio-overlay.dts - create mode 100644 sound/soc/bcm/digidac1-soundcard.c - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -67,6 +67,7 @@ dtbo-$(RPI_DT_OVERLAYS) += rpi-display.d - dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dtbo - dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo - dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -842,6 +842,12 @@ Load: dtoverlay=rpi-sense - Params: - - -+Name: rra-digidac1-wm8741-audio -+Info: Configures the Red Rocks Audio DigiDAC1 soundcard -+Load: dtoverlay=rra-digidac1-wm8741-audio -+Params: -+ -+ - Name: sdhost - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock. - N.B. This overlay is designed for situations where the mmc driver is ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/rra-digidac1-wm8741-audio-overlay.dts -@@ -0,0 +1,81 @@ -+// Definitions for RRA DigiDAC1 Audio card -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target-path = "/"; -+ __overlay__ { -+ aliases { -+ ldo0 = &ldo0; -+ ldo1 = &ldo1; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target-path = "/soc"; -+ __overlay__ { -+ -+ ldo1: ldo1 { -+ compatible = "regulator-fixed"; -+ regulator-name = "DC_5V"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-always-on; -+ }; -+ -+ ldo0: ldo0 { -+ compatible = "regulator-fixed"; -+ regulator-name = "DC_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ wm8804@3b { -+ #sound-dai-cells = <0>; -+ compatible = "wlf,wm8804"; -+ reg = <0x3b>; -+ status = "okay"; -+ PVDD-supply = <&ldo0>; -+ DVDD-supply = <&ldo0>; -+ }; -+ -+ wm8742: wm8741@1a { -+ compatible = "wlf,wm8741"; -+ reg = <0x1a>; -+ status = "okay"; -+ AVDD-supply = <&ldo1>; -+ DVDD-supply = <&ldo0>; -+ }; -+ }; -+ }; -+ -+ fragment@4 { -+ target = <&sound>; -+ __overlay__ { -+ compatible = "rra,digidac1-soundcard"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+}; ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -866,6 +866,7 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m -+CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -858,6 +858,7 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m -+CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -92,3 +92,11 @@ config SND_AUDIOINJECTOR_PI_SOUNDCARD - select SND_SOC_WM8731 - help - Say Y or M if you want to add support for audioinjector.net Pi Hat -+ -+config SND_DIGIDAC1_SOUNDCARD -+ tristate "Support for Red Rocks Audio DigiDAC1" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_WM8804 -+ select SND_SOC_WM8741 -+ help -+ Say Y or M if you want to add support for Red Rocks Audio DigiDAC1 board. ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -16,6 +16,7 @@ snd-soc-rpi-proto-objs := rpi-proto.o - snd-soc-iqaudio-dac-objs := iqaudio-dac.o - snd-soc-raspidac3-objs := raspidac3.o - snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o -+snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o - - obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o -@@ -29,4 +30,5 @@ obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) - obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o - obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o -+obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o - ---- /dev/null -+++ b/sound/soc/bcm/digidac1-soundcard.c -@@ -0,0 +1,422 @@ -+/* -+ * ASoC Driver for RRA DigiDAC1 -+ * Copyright 2016 -+ * Author: José M. Tasende -+ * based on the HifiBerry DAC driver by Florian Meier -+ * and the Wolfson card driver by Nikesh Oswal, -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "../codecs/wm8804.h" -+#include "../codecs/wm8741.h" -+ -+#define WM8741_NUM_SUPPLIES 2 -+ -+/* codec private data */ -+struct wm8741_priv { -+ struct wm8741_platform_data pdata; -+ struct regmap *regmap; -+ struct regulator_bulk_data supplies[WM8741_NUM_SUPPLIES]; -+ unsigned int sysclk; -+ const struct snd_pcm_hw_constraint_list *sysclk_constraints; -+}; -+ -+static int samplerate = 44100; -+ -+/* New Alsa Controls not exposed by original wm8741 codec driver */ -+/* in actual driver the att. adjustment is wrong because */ -+/* this DAC has a coarse attenuation register with 4dB steps */ -+/* and a fine level register with 0.125dB steps */ -+/* each register has 32 steps so combining both we have 1024 steps */ -+/* of 0.125 dB. */ -+/* The original level controls from driver are removed at startup */ -+/* and replaced by the corrected ones. */ -+/* The same wm8741 driver can be used for wm8741 and wm8742 devices */ -+ -+static const DECLARE_TLV_DB_SCALE(dac_tlv_fine, 0, 13, 0); -+static const DECLARE_TLV_DB_SCALE(dac_tlv_coarse, -12700, 400, 1); -+static const char *w8741_dither[4] = {"Off", "RPDF", "TPDF", "HPDF"}; -+static const char *w8741_filter[5] = { -+ "Type 1", "Type 2", "Type 3", "Type 4", "Type 5"}; -+static const char *w8741_switch[2] = {"Off", "On"}; -+static const struct soc_enum w8741_enum[] = { -+SOC_ENUM_SINGLE(WM8741_MODE_CONTROL_2, 0, 4, w8741_dither),/* dithering type */ -+SOC_ENUM_SINGLE(WM8741_FILTER_CONTROL, 0, 5, w8741_filter),/* filter type */ -+SOC_ENUM_SINGLE(WM8741_FORMAT_CONTROL, 6, 2, w8741_switch),/* phase invert */ -+SOC_ENUM_SINGLE(WM8741_VOLUME_CONTROL, 0, 2, w8741_switch),/* volume ramp */ -+SOC_ENUM_SINGLE(WM8741_VOLUME_CONTROL, 3, 2, w8741_switch),/* soft mute */ -+}; -+ -+static const struct snd_kcontrol_new w8741_snd_controls_stereo[] = { -+SOC_DOUBLE_R_TLV("DAC Fine Playback Volume", WM8741_DACLLSB_ATTENUATION, -+ WM8741_DACRLSB_ATTENUATION, 0, 31, 1, dac_tlv_fine), -+SOC_DOUBLE_R_TLV("Digital Playback Volume", WM8741_DACLMSB_ATTENUATION, -+ WM8741_DACRMSB_ATTENUATION, 0, 31, 1, dac_tlv_coarse), -+SOC_ENUM("DAC Dither", w8741_enum[0]), -+SOC_ENUM("DAC Digital Filter", w8741_enum[1]), -+SOC_ENUM("DAC Phase Invert", w8741_enum[2]), -+SOC_ENUM("DAC Volume Ramp", w8741_enum[3]), -+SOC_ENUM("DAC Soft Mute", w8741_enum[4]), -+}; -+ -+static const struct snd_kcontrol_new w8741_snd_controls_mono_left[] = { -+SOC_SINGLE_TLV("DAC Fine Playback Volume", WM8741_DACLLSB_ATTENUATION, -+ 0, 31, 0, dac_tlv_fine), -+SOC_SINGLE_TLV("Digital Playback Volume", WM8741_DACLMSB_ATTENUATION, -+ 0, 31, 1, dac_tlv_coarse), -+SOC_ENUM("DAC Dither", w8741_enum[0]), -+SOC_ENUM("DAC Digital Filter", w8741_enum[1]), -+SOC_ENUM("DAC Phase Invert", w8741_enum[2]), -+SOC_ENUM("DAC Volume Ramp", w8741_enum[3]), -+SOC_ENUM("DAC Soft Mute", w8741_enum[4]), -+}; -+ -+static const struct snd_kcontrol_new w8741_snd_controls_mono_right[] = { -+SOC_SINGLE_TLV("DAC Fine Playback Volume", WM8741_DACRLSB_ATTENUATION, -+ 0, 31, 0, dac_tlv_fine), -+SOC_SINGLE_TLV("Digital Playback Volume", WM8741_DACRMSB_ATTENUATION, -+ 0, 31, 1, dac_tlv_coarse), -+SOC_ENUM("DAC Dither", w8741_enum[0]), -+SOC_ENUM("DAC Digital Filter", w8741_enum[1]), -+SOC_ENUM("DAC Phase Invert", w8741_enum[2]), -+SOC_ENUM("DAC Volume Ramp", w8741_enum[3]), -+SOC_ENUM("DAC Soft Mute", w8741_enum[4]), -+}; -+ -+static int w8741_add_controls(struct snd_soc_codec *codec) -+{ -+ struct wm8741_priv *wm8741 = snd_soc_codec_get_drvdata(codec); -+ -+ switch (wm8741->pdata.diff_mode) { -+ case WM8741_DIFF_MODE_STEREO: -+ case WM8741_DIFF_MODE_STEREO_REVERSED: -+ snd_soc_add_codec_controls(codec, -+ w8741_snd_controls_stereo, -+ ARRAY_SIZE(w8741_snd_controls_stereo)); -+ break; -+ case WM8741_DIFF_MODE_MONO_LEFT: -+ snd_soc_add_codec_controls(codec, -+ w8741_snd_controls_mono_left, -+ ARRAY_SIZE(w8741_snd_controls_mono_left)); -+ break; -+ case WM8741_DIFF_MODE_MONO_RIGHT: -+ snd_soc_add_codec_controls(codec, -+ w8741_snd_controls_mono_right, -+ ARRAY_SIZE(w8741_snd_controls_mono_right)); -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int digidac1_soundcard_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_codec *codec = rtd->codec; -+ struct snd_soc_card *card = rtd->card; -+ struct snd_soc_pcm_runtime *wm8741_rtd; -+ struct snd_soc_codec *wm8741_codec; -+ struct snd_card *sound_card = card->snd_card; -+ struct snd_kcontrol *kctl; -+ int ret; -+ -+ wm8741_rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); -+ if (!wm8741_rtd) { -+ dev_warn(card->dev, "digidac1_soundcard_init: couldn't get wm8741 rtd\n"); -+ return -EFAULT; -+ } -+ wm8741_codec = wm8741_rtd->codec; -+ ret = w8741_add_controls(wm8741_codec); -+ if (ret < 0) -+ dev_warn(card->dev, "Failed to add new wm8741 controls: %d\n", -+ ret); -+ -+ /* enable TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ kctl = snd_soc_card_get_kcontrol(card, -+ "Playback Volume"); -+ if (kctl) { -+ kctl->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE; -+ snd_ctl_remove(sound_card, kctl); -+ } -+ kctl = snd_soc_card_get_kcontrol(card, -+ "Fine Playback Volume"); -+ if (kctl) { -+ kctl->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE; -+ snd_ctl_remove(sound_card, kctl); -+ } -+ return 0; -+} -+ -+static int digidac1_soundcard_startup(struct snd_pcm_substream *substream) -+{ -+ /* turn on wm8804 digital output */ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ struct snd_soc_card *card = rtd->card; -+ struct snd_soc_pcm_runtime *wm8741_rtd; -+ struct snd_soc_codec *wm8741_codec; -+ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); -+ wm8741_rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); -+ if (!wm8741_rtd) { -+ dev_warn(card->dev, "digidac1_soundcard_startup: couldn't get WM8741 rtd\n"); -+ return -EFAULT; -+ } -+ wm8741_codec = wm8741_rtd->codec; -+ -+ /* latch wm8741 level */ -+ snd_soc_update_bits(wm8741_codec, WM8741_DACLLSB_ATTENUATION, -+ WM8741_UPDATELL, WM8741_UPDATELL); -+ snd_soc_update_bits(wm8741_codec, WM8741_DACLMSB_ATTENUATION, -+ WM8741_UPDATELM, WM8741_UPDATELM); -+ snd_soc_update_bits(wm8741_codec, WM8741_DACRLSB_ATTENUATION, -+ WM8741_UPDATERL, WM8741_UPDATERL); -+ snd_soc_update_bits(wm8741_codec, WM8741_DACRMSB_ATTENUATION, -+ WM8741_UPDATERM, WM8741_UPDATERM); -+ -+ return 0; -+} -+ -+static void digidac1_soundcard_shutdown(struct snd_pcm_substream *substream) -+{ -+ /* turn off wm8804 digital output */ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); -+} -+ -+static int digidac1_soundcard_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *codec_dai = rtd->codec_dai; -+ struct snd_soc_codec *codec = rtd->codec; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ struct snd_soc_card *card = rtd->card; -+ struct snd_soc_pcm_runtime *wm8741_rtd; -+ struct snd_soc_codec *wm8741_codec; -+ -+ int sysclk = 27000000; -+ long mclk_freq = 0; -+ int mclk_div = 1; -+ int sampling_freq = 1; -+ int ret; -+ -+ wm8741_rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); -+ if (!wm8741_rtd) { -+ dev_warn(card->dev, "digidac1_soundcard_hw_params: couldn't get WM8741 rtd\n"); -+ return -EFAULT; -+ } -+ wm8741_codec = wm8741_rtd->codec; -+ samplerate = params_rate(params); -+ -+ if (samplerate <= 96000) { -+ mclk_freq = samplerate*256; -+ mclk_div = WM8804_MCLKDIV_256FS; -+ } else { -+ mclk_freq = samplerate*128; -+ mclk_div = WM8804_MCLKDIV_128FS; -+ } -+ -+ switch (samplerate) { -+ case 32000: -+ sampling_freq = 0x03; -+ break; -+ case 44100: -+ sampling_freq = 0x00; -+ break; -+ case 48000: -+ sampling_freq = 0x02; -+ break; -+ case 88200: -+ sampling_freq = 0x08; -+ break; -+ case 96000: -+ sampling_freq = 0x0a; -+ break; -+ case 176400: -+ sampling_freq = 0x0c; -+ break; -+ case 192000: -+ sampling_freq = 0x0e; -+ break; -+ default: -+ dev_err(codec->dev, -+ "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", -+ samplerate); -+ } -+ -+ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); -+ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); -+ -+ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, -+ sysclk, SND_SOC_CLOCK_OUT); -+ if (ret < 0) { -+ dev_err(codec->dev, -+ "Failed to set WM8804 SYSCLK: %d\n", ret); -+ return ret; -+ } -+ /* Enable wm8804 TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ /* wm8804 Power on */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); -+ -+ /* wm8804 set sampling frequency status bits */ -+ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); -+ -+ /* Now update wm8741 registers for the correct oversampling */ -+ if (samplerate <= 48000) -+ snd_soc_update_bits(wm8741_codec, WM8741_MODE_CONTROL_1, -+ WM8741_OSR_MASK, 0x00); -+ else if (samplerate <= 96000) -+ snd_soc_update_bits(wm8741_codec, WM8741_MODE_CONTROL_1, -+ WM8741_OSR_MASK, 0x20); -+ else -+ snd_soc_update_bits(wm8741_codec, WM8741_MODE_CONTROL_1, -+ WM8741_OSR_MASK, 0x40); -+ -+ /* wm8741 bit size */ -+ switch (params_width(params)) { -+ case 16: -+ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, -+ WM8741_IWL_MASK, 0x00); -+ break; -+ case 20: -+ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, -+ WM8741_IWL_MASK, 0x01); -+ break; -+ case 24: -+ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, -+ WM8741_IWL_MASK, 0x02); -+ break; -+ case 32: -+ snd_soc_update_bits(wm8741_codec, WM8741_FORMAT_CONTROL, -+ WM8741_IWL_MASK, 0x03); -+ break; -+ default: -+ dev_dbg(codec->dev, "wm8741_hw_params: Unsupported bit size param = %d", -+ params_width(params)); -+ return -EINVAL; -+ } -+ -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); -+} -+/* machine stream operations */ -+static struct snd_soc_ops digidac1_soundcard_ops = { -+ .hw_params = digidac1_soundcard_hw_params, -+ .startup = digidac1_soundcard_startup, -+ .shutdown = digidac1_soundcard_shutdown, -+}; -+ -+static struct snd_soc_dai_link digidac1_soundcard_dai[] = { -+ { -+ .name = "RRA DigiDAC1", -+ .stream_name = "RRA DigiDAC1 HiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "wm8804-spdif", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "wm8804.1-003b", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBM_CFM, -+ .ops = &digidac1_soundcard_ops, -+ .init = digidac1_soundcard_init, -+ }, -+ { -+ .name = "RRA DigiDAC11", -+ .stream_name = "RRA DigiDAC11 HiFi", -+ .cpu_dai_name = "wm8804-spdif", -+ .codec_dai_name = "wm8741", -+ .codec_name = "wm8741.1-001a", -+ .dai_fmt = SND_SOC_DAIFMT_I2S -+ | SND_SOC_DAIFMT_NB_NF -+ | SND_SOC_DAIFMT_CBS_CFS, -+ }, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card digidac1_soundcard = { -+ .name = "digidac1-soundcard", -+ .owner = THIS_MODULE, -+ .dai_link = digidac1_soundcard_dai, -+ .num_links = ARRAY_SIZE(digidac1_soundcard_dai), -+}; -+ -+static int digidac1_soundcard_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ -+ digidac1_soundcard.dev = &pdev->dev; -+ -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai = &digidac1_soundcard_dai[0]; -+ -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ } -+ -+ ret = snd_soc_register_card(&digidac1_soundcard); -+ if (ret) -+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", -+ ret); -+ -+ return ret; -+} -+ -+static int digidac1_soundcard_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&digidac1_soundcard); -+} -+ -+static const struct of_device_id digidac1_soundcard_of_match[] = { -+ { .compatible = "rra,digidac1-soundcard", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, digidac1_soundcard_of_match); -+ -+static struct platform_driver digidac1_soundcard_driver = { -+ .driver = { -+ .name = "digidac1-audio", -+ .owner = THIS_MODULE, -+ .of_match_table = digidac1_soundcard_of_match, -+ }, -+ .probe = digidac1_soundcard_probe, -+ .remove = digidac1_soundcard_remove, -+}; -+ -+module_platform_driver(digidac1_soundcard_driver); -+ -+MODULE_AUTHOR("José M. Tasende "); -+MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0374-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch b/target/linux/brcm2708/patches-4.4/0374-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch new file mode 100644 index 0000000000..2b262f27f1 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0374-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch @@ -0,0 +1,170 @@ +From 1fa221e0909bc0052bdc8b458fb31e8a088e7723 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson <6by9@users.noreply.github.com> +Date: Wed, 25 May 2016 23:25:36 +0100 +Subject: [PATCH] BCM2835-V4L2: Correct handling for BGR24 vs RGB24. + +There was a bug in the GPU firmware that had reversed these +two formats. +Detect the old firmware, and reverse the formats if necessary. + +Signed-off-by: Dave Stevenson <6by9@users.noreply.github.com> +--- + drivers/media/platform/bcm2835/bcm2835-camera.c | 69 ++++++++++++++++++------- + drivers/media/platform/bcm2835/bcm2835-camera.h | 1 + + 2 files changed, 52 insertions(+), 18 deletions(-) + +--- a/drivers/media/platform/bcm2835/bcm2835-camera.c ++++ b/drivers/media/platform/bcm2835/bcm2835-camera.c +@@ -115,7 +115,7 @@ static struct mmal_fmt formats[] = { + .name = "RGB24 (LE)", + .fourcc = V4L2_PIX_FMT_RGB24, + .flags = 0, +- .mmal = MMAL_ENCODING_BGR24, ++ .mmal = MMAL_ENCODING_RGB24, + .depth = 24, + .mmal_component = MMAL_COMPONENT_CAMERA, + .ybbp = 3, +@@ -187,7 +187,7 @@ static struct mmal_fmt formats[] = { + .name = "RGB24 (BE)", + .fourcc = V4L2_PIX_FMT_BGR24, + .flags = 0, +- .mmal = MMAL_ENCODING_RGB24, ++ .mmal = MMAL_ENCODING_BGR24, + .depth = 24, + .mmal_component = MMAL_COMPONENT_CAMERA, + .ybbp = 3, +@@ -1059,6 +1059,13 @@ static int mmal_setup_components(struct + else + camera_port->format.encoding = mfmt->mmal; + ++ if (dev->rgb_bgr_swapped) { ++ if (camera_port->format.encoding == MMAL_ENCODING_RGB24) ++ camera_port->format.encoding = MMAL_ENCODING_BGR24; ++ else if (camera_port->format.encoding == MMAL_ENCODING_BGR24) ++ camera_port->format.encoding = MMAL_ENCODING_RGB24; ++ } ++ + camera_port->format.encoding_variant = 0; + camera_port->es.video.width = f->fmt.pix.width; + camera_port->es.video.height = f->fmt.pix.height; +@@ -1569,12 +1576,17 @@ static int set_camera_parameters(struct + return ret; + } + ++#define MAX_SUPPORTED_ENCODINGS 20 ++ + /* MMAL instance and component init */ + static int __init mmal_init(struct bm2835_mmal_dev *dev) + { + int ret; + struct mmal_es_format *format; + u32 bool_true = 1; ++ u32 supported_encodings[MAX_SUPPORTED_ENCODINGS]; ++ int param_size; ++ struct vchiq_mmal_component *camera; + + ret = vchiq_mmal_init(&dev->instance); + if (ret < 0) +@@ -1586,21 +1598,48 @@ static int __init mmal_init(struct bm283 + if (ret < 0) + goto unreg_mmal; + +- if (dev->component[MMAL_COMPONENT_CAMERA]->outputs < +- MMAL_CAMERA_PORT_COUNT) { ++ camera = dev->component[MMAL_COMPONENT_CAMERA]; ++ if (camera->outputs < MMAL_CAMERA_PORT_COUNT) { + ret = -EINVAL; + goto unreg_camera; + } + + ret = set_camera_parameters(dev->instance, +- dev->component[MMAL_COMPONENT_CAMERA], ++ camera, + dev); + if (ret < 0) + goto unreg_camera; + +- format = +- &dev->component[MMAL_COMPONENT_CAMERA]-> +- output[MMAL_CAMERA_PORT_PREVIEW].format; ++ /* There was an error in the firmware that meant the camera component ++ * produced BGR instead of RGB. ++ * This is now fixed, but in order to support the old firmwares, we ++ * have to check. ++ */ ++ dev->rgb_bgr_swapped = true; ++ param_size = sizeof(supported_encodings); ++ ret = vchiq_mmal_port_parameter_get(dev->instance, ++ &camera->output[MMAL_CAMERA_PORT_CAPTURE], ++ MMAL_PARAMETER_SUPPORTED_ENCODINGS, ++ &supported_encodings, ++ ¶m_size); ++ if (ret == 0) { ++ int i; ++ ++ for (i = 0; i < param_size/sizeof(u32); i++) { ++ if (supported_encodings[i] == MMAL_ENCODING_BGR24) { ++ /* Found BGR24 first - old firmware. */ ++ break; ++ } ++ if (supported_encodings[i] == MMAL_ENCODING_RGB24) { ++ /* Found RGB24 first ++ * new firmware, so use RGB24. ++ */ ++ dev->rgb_bgr_swapped = false; ++ break; ++ } ++ } ++ } ++ format = &camera->output[MMAL_CAMERA_PORT_PREVIEW].format; + + format->encoding = MMAL_ENCODING_OPAQUE; + format->encoding_variant = MMAL_ENCODING_I420; +@@ -1614,9 +1653,7 @@ static int __init mmal_init(struct bm283 + format->es->video.frame_rate.num = 0; /* Rely on fps_range */ + format->es->video.frame_rate.den = 1; + +- format = +- &dev->component[MMAL_COMPONENT_CAMERA]-> +- output[MMAL_CAMERA_PORT_VIDEO].format; ++ format = &camera->output[MMAL_CAMERA_PORT_VIDEO].format; + + format->encoding = MMAL_ENCODING_OPAQUE; + format->encoding_variant = MMAL_ENCODING_I420; +@@ -1631,14 +1668,11 @@ static int __init mmal_init(struct bm283 + format->es->video.frame_rate.den = 1; + + vchiq_mmal_port_parameter_set(dev->instance, +- &dev->component[MMAL_COMPONENT_CAMERA]-> +- output[MMAL_CAMERA_PORT_VIDEO], ++ &camera->output[MMAL_CAMERA_PORT_VIDEO], + MMAL_PARAMETER_NO_IMAGE_PADDING, + &bool_true, sizeof(bool_true)); + +- format = +- &dev->component[MMAL_COMPONENT_CAMERA]-> +- output[MMAL_CAMERA_PORT_CAPTURE].format; ++ format = &camera->output[MMAL_CAMERA_PORT_CAPTURE].format; + + format->encoding = MMAL_ENCODING_OPAQUE; + +@@ -1660,8 +1694,7 @@ static int __init mmal_init(struct bm283 + dev->capture.enc_level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0; + + vchiq_mmal_port_parameter_set(dev->instance, +- &dev->component[MMAL_COMPONENT_CAMERA]-> +- output[MMAL_CAMERA_PORT_CAPTURE], ++ &camera->output[MMAL_CAMERA_PORT_CAPTURE], + MMAL_PARAMETER_NO_IMAGE_PADDING, + &bool_true, sizeof(bool_true)); + +--- a/drivers/media/platform/bcm2835/bcm2835-camera.h ++++ b/drivers/media/platform/bcm2835/bcm2835-camera.h +@@ -109,6 +109,7 @@ struct bm2835_mmal_dev { + unsigned int camera_num; + unsigned int max_width; + unsigned int max_height; ++ unsigned int rgb_bgr_swapped; + }; + + int bm2835_mmal_init_controls( diff --git a/target/linux/brcm2708/patches-4.4/0375-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch b/target/linux/brcm2708/patches-4.4/0375-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch new file mode 100644 index 0000000000..40dc09686d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0375-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch @@ -0,0 +1,20 @@ +From b7cd83145ba0f51721715034135a6c396dff9522 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Jun 2016 22:21:47 +0100 +Subject: [PATCH] BCM270X_DT: Add mcp23017 to the overlay Makefile + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -44,6 +44,7 @@ dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacpl + dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo + dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += mcp23017.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mmc.dtbo diff --git a/target/linux/brcm2708/patches-4.4/0375-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch b/target/linux/brcm2708/patches-4.4/0375-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch deleted file mode 100644 index 8e6f2fea5b..0000000000 --- a/target/linux/brcm2708/patches-4.4/0375-BCM2835-V4L2-Correct-handling-for-BGR24-vs-RGB24.patch +++ /dev/null @@ -1,170 +0,0 @@ -From e773144578da8e21392ce8b6e99cfcd313779da9 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson <6by9@users.noreply.github.com> -Date: Wed, 25 May 2016 23:25:36 +0100 -Subject: [PATCH 375/423] BCM2835-V4L2: Correct handling for BGR24 vs RGB24. - -There was a bug in the GPU firmware that had reversed these -two formats. -Detect the old firmware, and reverse the formats if necessary. - -Signed-off-by: Dave Stevenson <6by9@users.noreply.github.com> ---- - drivers/media/platform/bcm2835/bcm2835-camera.c | 69 ++++++++++++++++++------- - drivers/media/platform/bcm2835/bcm2835-camera.h | 1 + - 2 files changed, 52 insertions(+), 18 deletions(-) - ---- a/drivers/media/platform/bcm2835/bcm2835-camera.c -+++ b/drivers/media/platform/bcm2835/bcm2835-camera.c -@@ -115,7 +115,7 @@ static struct mmal_fmt formats[] = { - .name = "RGB24 (LE)", - .fourcc = V4L2_PIX_FMT_RGB24, - .flags = 0, -- .mmal = MMAL_ENCODING_BGR24, -+ .mmal = MMAL_ENCODING_RGB24, - .depth = 24, - .mmal_component = MMAL_COMPONENT_CAMERA, - .ybbp = 3, -@@ -187,7 +187,7 @@ static struct mmal_fmt formats[] = { - .name = "RGB24 (BE)", - .fourcc = V4L2_PIX_FMT_BGR24, - .flags = 0, -- .mmal = MMAL_ENCODING_RGB24, -+ .mmal = MMAL_ENCODING_BGR24, - .depth = 24, - .mmal_component = MMAL_COMPONENT_CAMERA, - .ybbp = 3, -@@ -1059,6 +1059,13 @@ static int mmal_setup_components(struct - else - camera_port->format.encoding = mfmt->mmal; - -+ if (dev->rgb_bgr_swapped) { -+ if (camera_port->format.encoding == MMAL_ENCODING_RGB24) -+ camera_port->format.encoding = MMAL_ENCODING_BGR24; -+ else if (camera_port->format.encoding == MMAL_ENCODING_BGR24) -+ camera_port->format.encoding = MMAL_ENCODING_RGB24; -+ } -+ - camera_port->format.encoding_variant = 0; - camera_port->es.video.width = f->fmt.pix.width; - camera_port->es.video.height = f->fmt.pix.height; -@@ -1569,12 +1576,17 @@ static int set_camera_parameters(struct - return ret; - } - -+#define MAX_SUPPORTED_ENCODINGS 20 -+ - /* MMAL instance and component init */ - static int __init mmal_init(struct bm2835_mmal_dev *dev) - { - int ret; - struct mmal_es_format *format; - u32 bool_true = 1; -+ u32 supported_encodings[MAX_SUPPORTED_ENCODINGS]; -+ int param_size; -+ struct vchiq_mmal_component *camera; - - ret = vchiq_mmal_init(&dev->instance); - if (ret < 0) -@@ -1586,21 +1598,48 @@ static int __init mmal_init(struct bm283 - if (ret < 0) - goto unreg_mmal; - -- if (dev->component[MMAL_COMPONENT_CAMERA]->outputs < -- MMAL_CAMERA_PORT_COUNT) { -+ camera = dev->component[MMAL_COMPONENT_CAMERA]; -+ if (camera->outputs < MMAL_CAMERA_PORT_COUNT) { - ret = -EINVAL; - goto unreg_camera; - } - - ret = set_camera_parameters(dev->instance, -- dev->component[MMAL_COMPONENT_CAMERA], -+ camera, - dev); - if (ret < 0) - goto unreg_camera; - -- format = -- &dev->component[MMAL_COMPONENT_CAMERA]-> -- output[MMAL_CAMERA_PORT_PREVIEW].format; -+ /* There was an error in the firmware that meant the camera component -+ * produced BGR instead of RGB. -+ * This is now fixed, but in order to support the old firmwares, we -+ * have to check. -+ */ -+ dev->rgb_bgr_swapped = true; -+ param_size = sizeof(supported_encodings); -+ ret = vchiq_mmal_port_parameter_get(dev->instance, -+ &camera->output[MMAL_CAMERA_PORT_CAPTURE], -+ MMAL_PARAMETER_SUPPORTED_ENCODINGS, -+ &supported_encodings, -+ ¶m_size); -+ if (ret == 0) { -+ int i; -+ -+ for (i = 0; i < param_size/sizeof(u32); i++) { -+ if (supported_encodings[i] == MMAL_ENCODING_BGR24) { -+ /* Found BGR24 first - old firmware. */ -+ break; -+ } -+ if (supported_encodings[i] == MMAL_ENCODING_RGB24) { -+ /* Found RGB24 first -+ * new firmware, so use RGB24. -+ */ -+ dev->rgb_bgr_swapped = false; -+ break; -+ } -+ } -+ } -+ format = &camera->output[MMAL_CAMERA_PORT_PREVIEW].format; - - format->encoding = MMAL_ENCODING_OPAQUE; - format->encoding_variant = MMAL_ENCODING_I420; -@@ -1614,9 +1653,7 @@ static int __init mmal_init(struct bm283 - format->es->video.frame_rate.num = 0; /* Rely on fps_range */ - format->es->video.frame_rate.den = 1; - -- format = -- &dev->component[MMAL_COMPONENT_CAMERA]-> -- output[MMAL_CAMERA_PORT_VIDEO].format; -+ format = &camera->output[MMAL_CAMERA_PORT_VIDEO].format; - - format->encoding = MMAL_ENCODING_OPAQUE; - format->encoding_variant = MMAL_ENCODING_I420; -@@ -1631,14 +1668,11 @@ static int __init mmal_init(struct bm283 - format->es->video.frame_rate.den = 1; - - vchiq_mmal_port_parameter_set(dev->instance, -- &dev->component[MMAL_COMPONENT_CAMERA]-> -- output[MMAL_CAMERA_PORT_VIDEO], -+ &camera->output[MMAL_CAMERA_PORT_VIDEO], - MMAL_PARAMETER_NO_IMAGE_PADDING, - &bool_true, sizeof(bool_true)); - -- format = -- &dev->component[MMAL_COMPONENT_CAMERA]-> -- output[MMAL_CAMERA_PORT_CAPTURE].format; -+ format = &camera->output[MMAL_CAMERA_PORT_CAPTURE].format; - - format->encoding = MMAL_ENCODING_OPAQUE; - -@@ -1660,8 +1694,7 @@ static int __init mmal_init(struct bm283 - dev->capture.enc_level = V4L2_MPEG_VIDEO_H264_LEVEL_4_0; - - vchiq_mmal_port_parameter_set(dev->instance, -- &dev->component[MMAL_COMPONENT_CAMERA]-> -- output[MMAL_CAMERA_PORT_CAPTURE], -+ &camera->output[MMAL_CAMERA_PORT_CAPTURE], - MMAL_PARAMETER_NO_IMAGE_PADDING, - &bool_true, sizeof(bool_true)); - ---- a/drivers/media/platform/bcm2835/bcm2835-camera.h -+++ b/drivers/media/platform/bcm2835/bcm2835-camera.h -@@ -109,6 +109,7 @@ struct bm2835_mmal_dev { - unsigned int camera_num; - unsigned int max_width; - unsigned int max_height; -+ unsigned int rgb_bgr_swapped; - }; - - int bm2835_mmal_init_controls( diff --git a/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch b/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch deleted file mode 100644 index 34698abbe9..0000000000 --- a/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Add-mcp23017-to-the-overlay-Makefile.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 9bfe3611959168e5d1035bafc8917340bc1e9791 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 3 Jun 2016 22:21:47 +0100 -Subject: [PATCH 376/423] BCM270X_DT: Add mcp23017 to the overlay Makefile - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -44,6 +44,7 @@ dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacpl - dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo - dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += mcp23017.dtbo - dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo - dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo - dtbo-$(RPI_DT_OVERLAYS) += mmc.dtbo diff --git a/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Sort-entries-to-placate-check-script.patch b/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Sort-entries-to-placate-check-script.patch new file mode 100644 index 0000000000..3614b93ff9 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0376-BCM270X_DT-Sort-entries-to-placate-check-script.patch @@ -0,0 +1,56 @@ +From 847d6f110dcd6b95120fc224cd71151464990f56 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Jun 2016 23:01:01 +0100 +Subject: [PATCH] BCM270X_DT: Sort entries to placate check script + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -18,10 +18,10 @@ dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqd + dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo + dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo + dtbo-$(RPI_DT_OVERLAYS) += enc28j60.dtbo + dtbo-$(RPI_DT_OVERLAYS) += gpio-ir.dtbo + dtbo-$(RPI_DT_OVERLAYS) += gpio-poweroff.dtbo +@@ -31,10 +31,10 @@ dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dac + dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo + dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31.dtbo +@@ -73,16 +73,16 @@ dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdtweak.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo + dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi2-1cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi2-2cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi2-3cs.dtbo +-dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo + dtbo-$(RPI_DT_OVERLAYS) += tinylcd35.dtbo + dtbo-$(RPI_DT_OVERLAYS) += uart1.dtbo + dtbo-$(RPI_DT_OVERLAYS) += vc4-kms-v3d.dtbo diff --git a/target/linux/brcm2708/patches-4.4/0377-BCM270X_DT-Sort-entries-to-placate-check-script.patch b/target/linux/brcm2708/patches-4.4/0377-BCM270X_DT-Sort-entries-to-placate-check-script.patch deleted file mode 100644 index d40328958e..0000000000 --- a/target/linux/brcm2708/patches-4.4/0377-BCM270X_DT-Sort-entries-to-placate-check-script.patch +++ /dev/null @@ -1,56 +0,0 @@ -From e5dfd4f6544c0bc78d3d5b4158ad0f3660a244d4 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 3 Jun 2016 23:01:01 +0100 -Subject: [PATCH 377/423] BCM270X_DT: Sort entries to placate check script - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/Makefile | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -18,10 +18,10 @@ dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqd - dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo - dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo --dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo --dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo - dtbo-$(RPI_DT_OVERLAYS) += enc28j60.dtbo - dtbo-$(RPI_DT_OVERLAYS) += gpio-ir.dtbo - dtbo-$(RPI_DT_OVERLAYS) += gpio-poweroff.dtbo -@@ -31,10 +31,10 @@ dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dac - dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo - dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo --dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c-mux.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo - dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31.dtbo -@@ -73,16 +73,16 @@ dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdtweak.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo - dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo --dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi2-1cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi2-2cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi2-3cs.dtbo --dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo - dtbo-$(RPI_DT_OVERLAYS) += tinylcd35.dtbo - dtbo-$(RPI_DT_OVERLAYS) += uart1.dtbo - dtbo-$(RPI_DT_OVERLAYS) += vc4-kms-v3d.dtbo diff --git a/target/linux/brcm2708/patches-4.4/0377-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch b/target/linux/brcm2708/patches-4.4/0377-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch new file mode 100644 index 0000000000..1d8ec84376 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0377-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch @@ -0,0 +1,22 @@ +From 61702c8c68510797341356d03cf63380190afea9 Mon Sep 17 00:00:00 2001 +From: Matthias Reichl +Date: Sat, 4 Jun 2016 11:30:48 +0200 +Subject: [PATCH] gpio-ir overlay: gpio_pin shouldn't change pull setting + +Signed-off-by: Matthias Reichl +--- + arch/arm/boot/dts/overlays/gpio-ir-overlay.dts | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/overlays/gpio-ir-overlay.dts ++++ b/arch/arm/boot/dts/overlays/gpio-ir-overlay.dts +@@ -36,8 +36,7 @@ + __overrides__ { + // parameters + gpio_pin = <&gpio_ir>,"gpios:4", +- <&gpio_ir_pins>,"brcm,pins:0", +- <&gpio_ir_pins>,"brcm,pull:0"; // pin number ++ <&gpio_ir_pins>,"brcm,pins:0"; // pin number + gpio_pull = <&gpio_ir_pins>,"brcm,pull:0"; // pull-up/down state + + rc-map-name = <&gpio_ir>,"linux,rc-map-name"; // default rc map diff --git a/target/linux/brcm2708/patches-4.4/0378-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch b/target/linux/brcm2708/patches-4.4/0378-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch deleted file mode 100644 index 2b7368f49a..0000000000 --- a/target/linux/brcm2708/patches-4.4/0378-gpio-ir-overlay-gpio_pin-shouldn-t-change-pull-setti.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 5ae23709f303503c983cc3658a95ade9573c2540 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Sat, 4 Jun 2016 11:30:48 +0200 -Subject: [PATCH 378/423] gpio-ir overlay: gpio_pin shouldn't change pull - setting - -Signed-off-by: Matthias Reichl ---- - arch/arm/boot/dts/overlays/gpio-ir-overlay.dts | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/overlays/gpio-ir-overlay.dts -+++ b/arch/arm/boot/dts/overlays/gpio-ir-overlay.dts -@@ -36,8 +36,7 @@ - __overrides__ { - // parameters - gpio_pin = <&gpio_ir>,"gpios:4", -- <&gpio_ir_pins>,"brcm,pins:0", -- <&gpio_ir_pins>,"brcm,pull:0"; // pin number -+ <&gpio_ir_pins>,"brcm,pins:0"; // pin number - gpio_pull = <&gpio_ir_pins>,"brcm,pull:0"; // pull-up/down state - - rc-map-name = <&gpio_ir>,"linux,rc-map-name"; // default rc map diff --git a/target/linux/brcm2708/patches-4.4/0378-media-rc-core-define-a-default-timeout-for-drivers.patch b/target/linux/brcm2708/patches-4.4/0378-media-rc-core-define-a-default-timeout-for-drivers.patch new file mode 100644 index 0000000000..77967a2d25 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0378-media-rc-core-define-a-default-timeout-for-drivers.patch @@ -0,0 +1,25 @@ +From 3d63c720f92caf1f3870154739bf9770eab06b9a Mon Sep 17 00:00:00 2001 +From: Eric Nelson +Date: Sat, 3 Oct 2015 08:18:50 -0700 +Subject: [PATCH] [media] rc-core: define a default timeout for drivers + +A default timeout value of 125 ms should work for all decoders. + +Declare a constant to help standardize its' use. + +Signed-off-by: Eric Nelson +Signed-off-by: Mauro Carvalho Chehab +--- + include/media/rc-core.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/media/rc-core.h ++++ b/include/media/rc-core.h +@@ -239,6 +239,7 @@ static inline void init_ir_raw_event(str + memset(ev, 0, sizeof(*ev)); + } + ++#define IR_DEFAULT_TIMEOUT MS_TO_NS(125) + #define IR_MAX_DURATION 500000000 /* 500 ms */ + #define US_TO_NS(usec) ((usec) * 1000) + #define MS_TO_US(msec) ((msec) * 1000) diff --git a/target/linux/brcm2708/patches-4.4/0379-media-rc-core-define-a-default-timeout-for-drivers.patch b/target/linux/brcm2708/patches-4.4/0379-media-rc-core-define-a-default-timeout-for-drivers.patch deleted file mode 100644 index 130afb592e..0000000000 --- a/target/linux/brcm2708/patches-4.4/0379-media-rc-core-define-a-default-timeout-for-drivers.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 17d27b2171c997d5803172e7a9fa4f474f9687c1 Mon Sep 17 00:00:00 2001 -From: Eric Nelson -Date: Sat, 3 Oct 2015 08:18:50 -0700 -Subject: [PATCH 379/423] [media] rc-core: define a default timeout for drivers - -A default timeout value of 125 ms should work for all decoders. - -Declare a constant to help standardize its' use. - -Signed-off-by: Eric Nelson -Signed-off-by: Mauro Carvalho Chehab ---- - include/media/rc-core.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/media/rc-core.h -+++ b/include/media/rc-core.h -@@ -239,6 +239,7 @@ static inline void init_ir_raw_event(str - memset(ev, 0, sizeof(*ev)); - } - -+#define IR_DEFAULT_TIMEOUT MS_TO_NS(125) - #define IR_MAX_DURATION 500000000 /* 500 ms */ - #define US_TO_NS(usec) ((usec) * 1000) - #define MS_TO_US(msec) ((msec) * 1000) diff --git a/target/linux/brcm2708/patches-4.4/0379-media-rc-gpio-ir-recv-add-timeout-on-idle.patch b/target/linux/brcm2708/patches-4.4/0379-media-rc-gpio-ir-recv-add-timeout-on-idle.patch new file mode 100644 index 0000000000..1436803e8f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0379-media-rc-gpio-ir-recv-add-timeout-on-idle.patch @@ -0,0 +1,91 @@ +From ae20f89a35806322a318195e1067ddd9ca8b7eb8 Mon Sep 17 00:00:00 2001 +From: Eric Nelson +Date: Wed, 23 Sep 2015 11:07:08 -0300 +Subject: [PATCH] [media] rc: gpio-ir-recv: add timeout on idle + +Many decoders require a trailing space (period without IR illumination) +to be delivered before completing a decode. + +Since the gpio-ir-recv driver only delivers events on gpio transitions, +a single IR symbol (caused by a quick touch on an IR remote) will not +be properly decoded without the use of a timer to flush the tail end +state of the IR receiver. + +This patch initializes and uses a timer and the timeout field of rcdev +to complete the stream and allow decode. + +The timeout can be overridden through the use of the LIRC_SET_REC_TIMEOUT +ioctl. + +Signed-off-by: Eric Nelson +Acked-by: Sean Young +Signed-off-by: Mauro Carvalho Chehab +--- + drivers/media/rc/gpio-ir-recv.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/drivers/media/rc/gpio-ir-recv.c ++++ b/drivers/media/rc/gpio-ir-recv.c +@@ -30,6 +30,7 @@ struct gpio_rc_dev { + struct rc_dev *rcdev; + int gpio_nr; + bool active_low; ++ struct timer_list flush_timer; + }; + + #ifdef CONFIG_OF +@@ -93,12 +94,26 @@ static irqreturn_t gpio_ir_recv_irq(int + if (rc < 0) + goto err_get_value; + ++ mod_timer(&gpio_dev->flush_timer, ++ jiffies + nsecs_to_jiffies(gpio_dev->rcdev->timeout)); ++ + ir_raw_event_handle(gpio_dev->rcdev); + + err_get_value: + return IRQ_HANDLED; + } + ++static void flush_timer(unsigned long arg) ++{ ++ struct gpio_rc_dev *gpio_dev = (struct gpio_rc_dev *)arg; ++ DEFINE_IR_RAW_EVENT(ev); ++ ++ ev.timeout = true; ++ ev.duration = gpio_dev->rcdev->timeout; ++ ir_raw_event_store(gpio_dev->rcdev, &ev); ++ ir_raw_event_handle(gpio_dev->rcdev); ++} ++ + static int gpio_ir_recv_probe(struct platform_device *pdev) + { + struct gpio_rc_dev *gpio_dev; +@@ -144,6 +159,9 @@ static int gpio_ir_recv_probe(struct pla + rcdev->input_id.version = 0x0100; + rcdev->dev.parent = &pdev->dev; + rcdev->driver_name = GPIO_IR_DRIVER_NAME; ++ rcdev->min_timeout = 0; ++ rcdev->timeout = IR_DEFAULT_TIMEOUT; ++ rcdev->max_timeout = 10 * IR_DEFAULT_TIMEOUT; + if (pdata->allowed_protos) + rcdev->allowed_protocols = pdata->allowed_protos; + else +@@ -154,6 +172,9 @@ static int gpio_ir_recv_probe(struct pla + gpio_dev->gpio_nr = pdata->gpio_nr; + gpio_dev->active_low = pdata->active_low; + ++ setup_timer(&gpio_dev->flush_timer, flush_timer, ++ (unsigned long)gpio_dev); ++ + rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv"); + if (rc < 0) + goto err_gpio_request; +@@ -196,6 +217,7 @@ static int gpio_ir_recv_remove(struct pl + struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); + + free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev); ++ del_timer_sync(&gpio_dev->flush_timer); + rc_unregister_device(gpio_dev->rcdev); + gpio_free(gpio_dev->gpio_nr); + kfree(gpio_dev); diff --git a/target/linux/brcm2708/patches-4.4/0380-media-rc-gpio-ir-recv-add-timeout-on-idle.patch b/target/linux/brcm2708/patches-4.4/0380-media-rc-gpio-ir-recv-add-timeout-on-idle.patch deleted file mode 100644 index 02514cba59..0000000000 --- a/target/linux/brcm2708/patches-4.4/0380-media-rc-gpio-ir-recv-add-timeout-on-idle.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 87909c64d14dc0f907ebe95f77874075a75e7f66 Mon Sep 17 00:00:00 2001 -From: Eric Nelson -Date: Wed, 23 Sep 2015 11:07:08 -0300 -Subject: [PATCH 380/423] [media] rc: gpio-ir-recv: add timeout on idle - -Many decoders require a trailing space (period without IR illumination) -to be delivered before completing a decode. - -Since the gpio-ir-recv driver only delivers events on gpio transitions, -a single IR symbol (caused by a quick touch on an IR remote) will not -be properly decoded without the use of a timer to flush the tail end -state of the IR receiver. - -This patch initializes and uses a timer and the timeout field of rcdev -to complete the stream and allow decode. - -The timeout can be overridden through the use of the LIRC_SET_REC_TIMEOUT -ioctl. - -Signed-off-by: Eric Nelson -Acked-by: Sean Young -Signed-off-by: Mauro Carvalho Chehab ---- - drivers/media/rc/gpio-ir-recv.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - ---- a/drivers/media/rc/gpio-ir-recv.c -+++ b/drivers/media/rc/gpio-ir-recv.c -@@ -30,6 +30,7 @@ struct gpio_rc_dev { - struct rc_dev *rcdev; - int gpio_nr; - bool active_low; -+ struct timer_list flush_timer; - }; - - #ifdef CONFIG_OF -@@ -93,12 +94,26 @@ static irqreturn_t gpio_ir_recv_irq(int - if (rc < 0) - goto err_get_value; - -+ mod_timer(&gpio_dev->flush_timer, -+ jiffies + nsecs_to_jiffies(gpio_dev->rcdev->timeout)); -+ - ir_raw_event_handle(gpio_dev->rcdev); - - err_get_value: - return IRQ_HANDLED; - } - -+static void flush_timer(unsigned long arg) -+{ -+ struct gpio_rc_dev *gpio_dev = (struct gpio_rc_dev *)arg; -+ DEFINE_IR_RAW_EVENT(ev); -+ -+ ev.timeout = true; -+ ev.duration = gpio_dev->rcdev->timeout; -+ ir_raw_event_store(gpio_dev->rcdev, &ev); -+ ir_raw_event_handle(gpio_dev->rcdev); -+} -+ - static int gpio_ir_recv_probe(struct platform_device *pdev) - { - struct gpio_rc_dev *gpio_dev; -@@ -144,6 +159,9 @@ static int gpio_ir_recv_probe(struct pla - rcdev->input_id.version = 0x0100; - rcdev->dev.parent = &pdev->dev; - rcdev->driver_name = GPIO_IR_DRIVER_NAME; -+ rcdev->min_timeout = 0; -+ rcdev->timeout = IR_DEFAULT_TIMEOUT; -+ rcdev->max_timeout = 10 * IR_DEFAULT_TIMEOUT; - if (pdata->allowed_protos) - rcdev->allowed_protocols = pdata->allowed_protos; - else -@@ -154,6 +172,9 @@ static int gpio_ir_recv_probe(struct pla - gpio_dev->gpio_nr = pdata->gpio_nr; - gpio_dev->active_low = pdata->active_low; - -+ setup_timer(&gpio_dev->flush_timer, flush_timer, -+ (unsigned long)gpio_dev); -+ - rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv"); - if (rc < 0) - goto err_gpio_request; -@@ -196,6 +217,7 @@ static int gpio_ir_recv_remove(struct pl - struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); - - free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev); -+ del_timer_sync(&gpio_dev->flush_timer); - rc_unregister_device(gpio_dev->rcdev); - gpio_free(gpio_dev->gpio_nr); - kfree(gpio_dev); diff --git a/target/linux/brcm2708/patches-4.4/0380-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch b/target/linux/brcm2708/patches-4.4/0380-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch new file mode 100644 index 0000000000..53d338bcc9 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0380-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch @@ -0,0 +1,24 @@ +From 0f922daa23beb3c3f591d61824a2e4a2031559a3 Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Thu, 19 Nov 2015 11:41:36 -0200 +Subject: [PATCH] smsir.h: remove a now duplicated definition + (IR_DEFAULT_TIMEOUT) + +This macro is now part of the core. Remove from Siano driver. + +Signed-off-by: Mauro Carvalho Chehab +--- + drivers/media/common/siano/smsir.h | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/media/common/siano/smsir.h ++++ b/drivers/media/common/siano/smsir.h +@@ -30,8 +30,6 @@ along with this program. If not, see + #include + +-#define IR_DEFAULT_TIMEOUT 100 +- + struct smscore_device_t; + + struct ir_t { diff --git a/target/linux/brcm2708/patches-4.4/0381-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch b/target/linux/brcm2708/patches-4.4/0381-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch new file mode 100644 index 0000000000..7108614074 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0381-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch @@ -0,0 +1,36 @@ +From 23a16f885df81479a81bc6ba3ebbb4a25716ca6c Mon Sep 17 00:00:00 2001 +From: Nicolas Boullis +Date: Sat, 4 Jun 2016 00:57:06 +0200 +Subject: [PATCH] Implement a "wakeup-source" option for the i2c-rtc DeviceTree + overlay. + +See: https://github.com/raspberrypi/linux/pull/1511 +--- + arch/arm/boot/dts/overlays/README | 3 +++ + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 4 ++++ + 2 files changed, 7 insertions(+) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -445,6 +445,9 @@ Params: ds1307 Select t + + trickle-resistor-ohms Resistor value for trickle charge (DS1339-only) + ++ wakeup-source Specify that the RTC can be used as a wakeup ++ source ++ + + Name: i2c0-bcm2708 + Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -65,5 +65,9 @@ + pcf8523 = <&pcf8523>,"status"; + pcf8563 = <&pcf8563>,"status"; + trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0"; ++ wakeup-source = <&ds1339>,"wakeup-source?", ++ <&ds3231>,"wakeup-source?", ++ <&mcp7940x>,"wakeup-source?", ++ <&mcp7941x>,"wakeup-source?"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0381-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch b/target/linux/brcm2708/patches-4.4/0381-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch deleted file mode 100644 index b4cd66e319..0000000000 --- a/target/linux/brcm2708/patches-4.4/0381-smsir.h-remove-a-now-duplicated-definition-IR_DEFAUL.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 3818b6877b525824f6fff4c9ede5f768ce55aac6 Mon Sep 17 00:00:00 2001 -From: Mauro Carvalho Chehab -Date: Thu, 19 Nov 2015 11:41:36 -0200 -Subject: [PATCH 381/423] smsir.h: remove a now duplicated definition - (IR_DEFAULT_TIMEOUT) - -This macro is now part of the core. Remove from Siano driver. - -Signed-off-by: Mauro Carvalho Chehab ---- - drivers/media/common/siano/smsir.h | 2 -- - 1 file changed, 2 deletions(-) - ---- a/drivers/media/common/siano/smsir.h -+++ b/drivers/media/common/siano/smsir.h -@@ -30,8 +30,6 @@ along with this program. If not, see - #include - --#define IR_DEFAULT_TIMEOUT 100 -- - struct smscore_device_t; - - struct ir_t { diff --git a/target/linux/brcm2708/patches-4.4/0382-BCM270X_DT-Fix-rpi-dac-overlay.patch b/target/linux/brcm2708/patches-4.4/0382-BCM270X_DT-Fix-rpi-dac-overlay.patch new file mode 100644 index 0000000000..760359c9bc --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0382-BCM270X_DT-Fix-rpi-dac-overlay.patch @@ -0,0 +1,34 @@ +From d6b1e376414ff77bcfc449e7dcc0f1ee7b91a888 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 3 Jun 2016 21:56:40 +0100 +Subject: [PATCH] BCM270X_DT: Fix rpi-dac overlay + +The rpi-dac overlay is almost identical to the hifiberry-dac overlay - +the codec used is different but it also doesn't sit on the I2C bus. As +a result, when the overlays were modified for dynamic loading and it +was discovered that the hifiberry-dac overlay didn't work any more, the +the rpi-dac overlay was also broken. + +The failure was caused by the fact that outside a bus, device names are +constructed from the concatenation of the path elements leading to it, +so moving the codec instantiation inside /soc caused the device name +to get a "soc" added, breaking ALSA's naming. + +See: http://forum.kodi.tv/showthread.php?tid=269814&pid=2349776#pid2349776 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/rpi-dac-overlay.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts ++++ b/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts +@@ -13,7 +13,7 @@ + }; + + fragment@1 { +- target = <&soc>; ++ target-path = "/"; + __overlay__ { + pcm1794a-codec { + #sound-dai-cells = <0>; diff --git a/target/linux/brcm2708/patches-4.4/0382-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch b/target/linux/brcm2708/patches-4.4/0382-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch deleted file mode 100644 index 571c66bca9..0000000000 --- a/target/linux/brcm2708/patches-4.4/0382-Implement-a-wakeup-source-option-for-the-i2c-rtc-Dev.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0b0219c615f8715c180e0c20bbecb97ae2c49f45 Mon Sep 17 00:00:00 2001 -From: Nicolas Boullis -Date: Sat, 4 Jun 2016 00:57:06 +0200 -Subject: [PATCH 382/423] Implement a "wakeup-source" option for the i2c-rtc - DeviceTree overlay. - -See: https://github.com/raspberrypi/linux/pull/1511 ---- - arch/arm/boot/dts/overlays/README | 3 +++ - arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 4 ++++ - 2 files changed, 7 insertions(+) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -445,6 +445,9 @@ Params: ds1307 Select t - - trickle-resistor-ohms Resistor value for trickle charge (DS1339-only) - -+ wakeup-source Specify that the RTC can be used as a wakeup -+ source -+ - - Name: i2c0-bcm2708 - Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations ---- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts -@@ -65,5 +65,9 @@ - pcf8523 = <&pcf8523>,"status"; - pcf8563 = <&pcf8563>,"status"; - trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0"; -+ wakeup-source = <&ds1339>,"wakeup-source?", -+ <&ds3231>,"wakeup-source?", -+ <&mcp7940x>,"wakeup-source?", -+ <&mcp7941x>,"wakeup-source?"; - }; - }; diff --git a/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Fix-rpi-dac-overlay.patch b/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Fix-rpi-dac-overlay.patch deleted file mode 100644 index 1f04d53a74..0000000000 --- a/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Fix-rpi-dac-overlay.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5524577be75ee648266c47fe6d4a9be80411827f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 3 Jun 2016 21:56:40 +0100 -Subject: [PATCH 383/423] BCM270X_DT: Fix rpi-dac overlay - -The rpi-dac overlay is almost identical to the hifiberry-dac overlay - -the codec used is different but it also doesn't sit on the I2C bus. As -a result, when the overlays were modified for dynamic loading and it -was discovered that the hifiberry-dac overlay didn't work any more, the -the rpi-dac overlay was also broken. - -The failure was caused by the fact that outside a bus, device names are -constructed from the concatenation of the path elements leading to it, -so moving the codec instantiation inside /soc caused the device name -to get a "soc" added, breaking ALSA's naming. - -See: http://forum.kodi.tv/showthread.php?tid=269814&pid=2349776#pid2349776 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/rpi-dac-overlay.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts -+++ b/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts -@@ -13,7 +13,7 @@ - }; - - fragment@1 { -- target = <&soc>; -+ target-path = "/"; - __overlay__ { - pcm1794a-codec { - #sound-dai-cells = <0>; diff --git a/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch b/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch new file mode 100644 index 0000000000..6671b69d4f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0383-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch @@ -0,0 +1,37 @@ +From 5e5cb8f76037673c14925324606738587f65427c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 6 Jun 2016 09:23:37 +0100 +Subject: [PATCH] BCM270X_DT: Make i2c-gpio usable by other overlays + +Modify the i2c-gpio overlay to export symbol i2c-gpio for use by other +overlays. Export the alias as well for good measure. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts +@@ -19,6 +19,21 @@ + }; + }; + }; ++ ++ fragment@1 { ++ target-path = "/aliases"; ++ __overlay__ { ++ i2c_gpio = "/i2c@0"; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/__symbols__"; ++ __overlay__ { ++ i2c_gpio = "/i2c@0"; ++ }; ++ }; ++ + __overrides__ { + i2c_gpio_sda = <&i2c_gpio>,"gpios:4"; + i2c_gpio_scl = <&i2c_gpio>,"gpios:16"; diff --git a/target/linux/brcm2708/patches-4.4/0384-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch b/target/linux/brcm2708/patches-4.4/0384-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch deleted file mode 100644 index 81e4ed4590..0000000000 --- a/target/linux/brcm2708/patches-4.4/0384-BCM270X_DT-Make-i2c-gpio-usable-by-other-overlays.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 1ea97f82e7a653ad18f39f9de5ea34f182650d70 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 6 Jun 2016 09:23:37 +0100 -Subject: [PATCH 384/423] BCM270X_DT: Make i2c-gpio usable by other overlays - -Modify the i2c-gpio overlay to export symbol i2c-gpio for use by other -overlays. Export the alias as well for good measure. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - ---- a/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts -@@ -19,6 +19,21 @@ - }; - }; - }; -+ -+ fragment@1 { -+ target-path = "/aliases"; -+ __overlay__ { -+ i2c_gpio = "/i2c@0"; -+ }; -+ }; -+ -+ fragment@2 { -+ target-path = "/__symbols__"; -+ __overlay__ { -+ i2c_gpio = "/i2c@0"; -+ }; -+ }; -+ - __overrides__ { - i2c_gpio_sda = <&i2c_gpio>,"gpios:4"; - i2c_gpio_scl = <&i2c_gpio>,"gpios:16"; diff --git a/target/linux/brcm2708/patches-4.4/0387-Add-ads1015-overlay.patch b/target/linux/brcm2708/patches-4.4/0387-Add-ads1015-overlay.patch new file mode 100644 index 0000000000..80c663e677 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0387-Add-ads1015-overlay.patch @@ -0,0 +1,155 @@ +From adce42f39f75ac5d479d2b4caff73723107e0539 Mon Sep 17 00:00:00 2001 +From: Erik Sejr +Date: Tue, 7 Jun 2016 20:58:17 -0400 +Subject: [PATCH] Add ads1015 overlay + +See: https://github.com/raspberrypi/linux/pull/1520 +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 22 ++++++ + arch/arm/boot/dts/overlays/ads1015-overlay.dts | 98 ++++++++++++++++++++++++++ + 3 files changed, 121 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/ads1015-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -13,6 +13,7 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) + endif + + dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += ads1015.dtbo + dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo + dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo + dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -168,6 +168,28 @@ Load: dtoverlay=adau1977-adc + Params: + + ++Name: ads1015 ++Info: Overlay for activation of Texas Instruments ADS1015 ADC over I2C ++Load: dtoverlay=ads1015,= ++Params: addr I2C bus address of device. Set based on how the ++ addr pin is wired. (default=0x48 assumes addr ++ is pulled to GND) ++ cha_enable Enable virtual channel a. (default=true) ++ cha_cfg Set the configuration for virtual channel a. ++ (default=4 configures this channel for the ++ voltage at A0 with respect to GND) ++ cha_datarate Set the datarate (samples/sec) for this channel. ++ (default=4 sets 1600 sps) ++ cha_gain Set the gain of the Programmable Gain ++ Amplifier for this channel. (default=2 sets the ++ full scale of the channel to 2.048 Volts) ++ ++ Channel (ch) parameters can be set for each enabled channel. ++ A maximum of 4 channels can be enabled (letters a thru d). ++ For more information refer to the device datasheet at: ++ http://www.ti.com/lit/ds/symlink/ads1015.pdf ++ ++ + Name: ads7846 + Info: ADS7846 Touch controller + Load: dtoverlay=ads7846,= +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/ads1015-overlay.dts +@@ -0,0 +1,98 @@ ++/* ++ * 2016 - Erik Sejr ++ */ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ /* ----------- ADS1015 ------------ */ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ads1015: ads1015 { ++ compatible = "ti,ads1015"; ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x48>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "i2c_arm/ads1015"; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ channel_a: channel_a { ++ reg = <4>; ++ ti,gain = <2>; ++ ti,datarate = <4>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "i2c_arm/ads1015"; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ channel_b: channel_b { ++ reg = <5>; ++ ti,gain = <2>; ++ ti,datarate = <4>; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target-path = "i2c_arm/ads1015"; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ channel_c: channel_c { ++ reg = <6>; ++ ti,gain = <2>; ++ ti,datarate = <4>; ++ }; ++ }; ++ }; ++ ++ fragment@4 { ++ target-path = "i2c_arm/ads1015"; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ channel_d: channel_d { ++ reg = <7>; ++ ti,gain = <2>; ++ ti,datarate = <4>; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ addr = <&ads1015>,"reg:0"; ++ cha_enable = <0>,"=1"; ++ cha_cfg = <&channel_a>,"reg:0"; ++ cha_gain = <&channel_a>,"ti,gain:0"; ++ cha_datarate = <&channel_a>,"ti,datarate:0"; ++ chb_enable = <0>,"=2"; ++ chb_cfg = <&channel_b>,"reg:0"; ++ chb_gain = <&channel_b>,"ti,gain:0"; ++ chb_datarate = <&channel_b>,"ti,datarate:0"; ++ chc_enable = <0>,"=3"; ++ chc_cfg = <&channel_c>,"reg:0"; ++ chc_gain = <&channel_c>,"ti,gain:0"; ++ chc_datarate = <&channel_c>,"ti,datarate:0"; ++ chd_enable = <0>,"=4"; ++ chd_cfg = <&channel_d>,"reg:0"; ++ chd_gain = <&channel_d>,"ti,gain:0"; ++ chd_datarate = <&channel_d>,"ti,datarate:0"; ++ }; ++ ++}; diff --git a/target/linux/brcm2708/patches-4.4/0388-Add-ads1015-overlay.patch b/target/linux/brcm2708/patches-4.4/0388-Add-ads1015-overlay.patch deleted file mode 100644 index 1aece824d4..0000000000 --- a/target/linux/brcm2708/patches-4.4/0388-Add-ads1015-overlay.patch +++ /dev/null @@ -1,155 +0,0 @@ -From a16a1b167229779e3e417a1f63eeb176048ef6e0 Mon Sep 17 00:00:00 2001 -From: Erik Sejr -Date: Tue, 7 Jun 2016 20:58:17 -0400 -Subject: [PATCH 388/423] Add ads1015 overlay - -See: https://github.com/raspberrypi/linux/pull/1520 ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 22 ++++++ - arch/arm/boot/dts/overlays/ads1015-overlay.dts | 98 ++++++++++++++++++++++++++ - 3 files changed, 121 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/ads1015-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -13,6 +13,7 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) - endif - - dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += ads1015.dtbo - dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo - dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo - dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -168,6 +168,28 @@ Load: dtoverlay=adau1977-adc - Params: - - -+Name: ads1015 -+Info: Overlay for activation of Texas Instruments ADS1015 ADC over I2C -+Load: dtoverlay=ads1015,= -+Params: addr I2C bus address of device. Set based on how the -+ addr pin is wired. (default=0x48 assumes addr -+ is pulled to GND) -+ cha_enable Enable virtual channel a. (default=true) -+ cha_cfg Set the configuration for virtual channel a. -+ (default=4 configures this channel for the -+ voltage at A0 with respect to GND) -+ cha_datarate Set the datarate (samples/sec) for this channel. -+ (default=4 sets 1600 sps) -+ cha_gain Set the gain of the Programmable Gain -+ Amplifier for this channel. (default=2 sets the -+ full scale of the channel to 2.048 Volts) -+ -+ Channel (ch) parameters can be set for each enabled channel. -+ A maximum of 4 channels can be enabled (letters a thru d). -+ For more information refer to the device datasheet at: -+ http://www.ti.com/lit/ds/symlink/ads1015.pdf -+ -+ - Name: ads7846 - Info: ADS7846 Touch controller - Load: dtoverlay=ads7846,= ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/ads1015-overlay.dts -@@ -0,0 +1,98 @@ -+/* -+ * 2016 - Erik Sejr -+ */ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ /* ----------- ADS1015 ------------ */ -+ fragment@0 { -+ target = <&i2c_arm>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ ads1015: ads1015 { -+ compatible = "ti,ads1015"; -+ status = "okay"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0x48>; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target-path = "i2c_arm/ads1015"; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ channel_a: channel_a { -+ reg = <4>; -+ ti,gain = <2>; -+ ti,datarate = <4>; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target-path = "i2c_arm/ads1015"; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ channel_b: channel_b { -+ reg = <5>; -+ ti,gain = <2>; -+ ti,datarate = <4>; -+ }; -+ }; -+ }; -+ -+ fragment@3 { -+ target-path = "i2c_arm/ads1015"; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ channel_c: channel_c { -+ reg = <6>; -+ ti,gain = <2>; -+ ti,datarate = <4>; -+ }; -+ }; -+ }; -+ -+ fragment@4 { -+ target-path = "i2c_arm/ads1015"; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ channel_d: channel_d { -+ reg = <7>; -+ ti,gain = <2>; -+ ti,datarate = <4>; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ addr = <&ads1015>,"reg:0"; -+ cha_enable = <0>,"=1"; -+ cha_cfg = <&channel_a>,"reg:0"; -+ cha_gain = <&channel_a>,"ti,gain:0"; -+ cha_datarate = <&channel_a>,"ti,datarate:0"; -+ chb_enable = <0>,"=2"; -+ chb_cfg = <&channel_b>,"reg:0"; -+ chb_gain = <&channel_b>,"ti,gain:0"; -+ chb_datarate = <&channel_b>,"ti,datarate:0"; -+ chc_enable = <0>,"=3"; -+ chc_cfg = <&channel_c>,"reg:0"; -+ chc_gain = <&channel_c>,"ti,gain:0"; -+ chc_datarate = <&channel_c>,"ti,datarate:0"; -+ chd_enable = <0>,"=4"; -+ chd_cfg = <&channel_d>,"reg:0"; -+ chd_gain = <&channel_d>,"ti,gain:0"; -+ chd_datarate = <&channel_d>,"ti,datarate:0"; -+ }; -+ -+}; diff --git a/target/linux/brcm2708/patches-4.4/0388-Fixed-MCP23017-section-in-overlay-README.patch b/target/linux/brcm2708/patches-4.4/0388-Fixed-MCP23017-section-in-overlay-README.patch new file mode 100644 index 0000000000..a120f14089 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0388-Fixed-MCP23017-section-in-overlay-README.patch @@ -0,0 +1,22 @@ +From 83ee5f5d26599a914e05a9eac8250029a4410969 Mon Sep 17 00:00:00 2001 +From: Michael Kaplan +Date: Wed, 8 Jun 2016 15:14:11 +0200 +Subject: [PATCH] Fixed MCP23017 section in overlay README + +Old description could have led to the misunderstanding that it is an +i2c port expander, but in fact it is a gpio expander. +--- + arch/arm/boot/dts/overlays/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -595,7 +595,7 @@ Params: gpio_out_pin GPIO for + + + Name: mcp23017 +-Info: Configures the MCP23017 I2C port expander ++Info: Configures the MCP23017 I2C GPIO expander + Load: dtoverlay=mcp23017,= + Params: gpiopin Gpio pin connected to the INTA output of the + MCP23017 (default: 4) diff --git a/target/linux/brcm2708/patches-4.4/0389-Fixed-MCP23017-section-in-overlay-README.patch b/target/linux/brcm2708/patches-4.4/0389-Fixed-MCP23017-section-in-overlay-README.patch deleted file mode 100644 index 21676a8d53..0000000000 --- a/target/linux/brcm2708/patches-4.4/0389-Fixed-MCP23017-section-in-overlay-README.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 863ab87efa682d499ed1bfaeae1753e4a86b392d Mon Sep 17 00:00:00 2001 -From: Michael Kaplan -Date: Wed, 8 Jun 2016 15:14:11 +0200 -Subject: [PATCH 389/423] Fixed MCP23017 section in overlay README - -Old description could have led to the misunderstanding that it is an -i2c port expander, but in fact it is a gpio expander. ---- - arch/arm/boot/dts/overlays/README | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -595,7 +595,7 @@ Params: gpio_out_pin GPIO for - - - Name: mcp23017 --Info: Configures the MCP23017 I2C port expander -+Info: Configures the MCP23017 I2C GPIO expander - Load: dtoverlay=mcp23017,= - Params: gpiopin Gpio pin connected to the INTA output of the - MCP23017 (default: 4) diff --git a/target/linux/brcm2708/patches-4.4/0389-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch b/target/linux/brcm2708/patches-4.4/0389-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch new file mode 100644 index 0000000000..3cbcba079e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0389-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch @@ -0,0 +1,86 @@ +From a236ecec838c8cf9928e9d2b8dc03346276627a1 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Fri, 22 Apr 2016 17:17:13 +0000 +Subject: [PATCH] Revert "bcm2835-dma: Fix up convert to DMA pool" + +This reverts commit ec2e48fda22c57cab56a4332d1a095f91c919493. +--- + drivers/dma/bcm2835-dma.c | 36 ++++++++++-------------------------- + 1 file changed, 10 insertions(+), 26 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -488,17 +488,6 @@ static struct dma_async_tx_descriptor *b + c->cyclic = true; + + return vchan_tx_prep(&c->vc, &d->vd, flags); +-error_cb: +- i--; +- for (; i >= 0; i--) { +- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; +- +- dma_pool_free(c->cb_pool, cb_entry->cb, cb_entry->paddr); +- } +- +- kfree(d->cb_list); +- kfree(d); +- return NULL; + } + + static struct dma_async_tx_descriptor * +@@ -545,7 +534,6 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + if (!d) + return NULL; + +- d->c = c; + d->dir = direction; + + if (c->ch >= 8) /* LITE channel */ +@@ -565,21 +553,15 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + d->frames += len / max_size + 1; + } + +- d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); +- if (!d->cb_list) { ++ /* Allocate memory for control blocks */ ++ d->control_block_size = d->frames * sizeof(struct bcm2835_dma_cb); ++ d->control_block_base = dma_zalloc_coherent(chan->device->dev, ++ d->control_block_size, &d->control_block_base_phys, ++ GFP_NOWAIT); ++ if (!d->control_block_base) { + kfree(d); + return NULL; + } +- /* Allocate memory for control blocks */ +- for (i = 0; i < d->frames; i++) { +- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; +- +- cb_entry->cb = dma_pool_zalloc(c->cb_pool, GFP_ATOMIC, +- &cb_entry->paddr); +- +- if (!cb_entry->cb) +- goto error_cb; +- } + + /* + * Iterate over all SG entries, create a control block +@@ -596,7 +578,7 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + + for (j = 0; j < len; j += max_size) { + struct bcm2835_dma_cb *control_block = +- d->cb_list[i + split_cnt].cb; ++ &d->control_block_base[i + split_cnt]; + + /* Setup addresses */ + if (d->dir == DMA_DEV_TO_MEM) { +@@ -638,7 +620,9 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + if (i < sg_len - 1 || len - j > max_size) { + /* Next block is the next frame. */ + control_block->next = +- d->cb_list[i + split_cnt + 1].paddr; ++ d->control_block_base_phys + ++ sizeof(struct bcm2835_dma_cb) * ++ (i + split_cnt + 1); + } else { + /* Next block is empty. */ + control_block->next = 0; diff --git a/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch b/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch deleted file mode 100644 index 97a16a2847..0000000000 --- a/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch +++ /dev/null @@ -1,86 +0,0 @@ -From d9c36fdc44cdf154a0849b03e94b0a6b6f86defb Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Fri, 22 Apr 2016 17:17:13 +0000 -Subject: [PATCH 390/423] Revert "bcm2835-dma: Fix up convert to DMA pool" - -This reverts commit ec2e48fda22c57cab56a4332d1a095f91c919493. ---- - drivers/dma/bcm2835-dma.c | 36 ++++++++++-------------------------- - 1 file changed, 10 insertions(+), 26 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -488,17 +488,6 @@ static struct dma_async_tx_descriptor *b - c->cyclic = true; - - return vchan_tx_prep(&c->vc, &d->vd, flags); --error_cb: -- i--; -- for (; i >= 0; i--) { -- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; -- -- dma_pool_free(c->cb_pool, cb_entry->cb, cb_entry->paddr); -- } -- -- kfree(d->cb_list); -- kfree(d); -- return NULL; - } - - static struct dma_async_tx_descriptor * -@@ -545,7 +534,6 @@ bcm2835_dma_prep_slave_sg(struct dma_cha - if (!d) - return NULL; - -- d->c = c; - d->dir = direction; - - if (c->ch >= 8) /* LITE channel */ -@@ -565,21 +553,15 @@ bcm2835_dma_prep_slave_sg(struct dma_cha - d->frames += len / max_size + 1; - } - -- d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); -- if (!d->cb_list) { -+ /* Allocate memory for control blocks */ -+ d->control_block_size = d->frames * sizeof(struct bcm2835_dma_cb); -+ d->control_block_base = dma_zalloc_coherent(chan->device->dev, -+ d->control_block_size, &d->control_block_base_phys, -+ GFP_NOWAIT); -+ if (!d->control_block_base) { - kfree(d); - return NULL; - } -- /* Allocate memory for control blocks */ -- for (i = 0; i < d->frames; i++) { -- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; -- -- cb_entry->cb = dma_pool_zalloc(c->cb_pool, GFP_ATOMIC, -- &cb_entry->paddr); -- -- if (!cb_entry->cb) -- goto error_cb; -- } - - /* - * Iterate over all SG entries, create a control block -@@ -596,7 +578,7 @@ bcm2835_dma_prep_slave_sg(struct dma_cha - - for (j = 0; j < len; j += max_size) { - struct bcm2835_dma_cb *control_block = -- d->cb_list[i + split_cnt].cb; -+ &d->control_block_base[i + split_cnt]; - - /* Setup addresses */ - if (d->dir == DMA_DEV_TO_MEM) { -@@ -638,7 +620,9 @@ bcm2835_dma_prep_slave_sg(struct dma_cha - if (i < sg_len - 1 || len - j > max_size) { - /* Next block is the next frame. */ - control_block->next = -- d->cb_list[i + split_cnt + 1].paddr; -+ d->control_block_base_phys + -+ sizeof(struct bcm2835_dma_cb) * -+ (i + split_cnt + 1); - } else { - /* Next block is empty. */ - control_block->next = 0; diff --git a/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch b/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch new file mode 100644 index 0000000000..d99355d17b --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0390-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch @@ -0,0 +1,35 @@ +From 31c4d45f25abd0680e05775f3166ec6066e39a2a Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Fri, 22 Apr 2016 17:17:22 +0000 +Subject: [PATCH] Revert "bcm2835-dma: Limit cyclic transfers on lite channels + to 32k" + +This reverts commit 052c2005b6ecedc5abad86632f5781adda310aa7. +--- + drivers/dma/bcm2835-dma.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -144,12 +144,6 @@ struct bcm2835_desc { + */ + #define MAX_LITE_TRANSFER (SZ_64K - 4) + +-/* +- * Transfers larger than 32k cause issues with the bcm2708-i2s driver, +- * so limit transfer size to 32k as bcm2708-dmaengine did. +- */ +-#define MAX_CYCLIC_LITE_TRANSFER SZ_32K +- + static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d) + { + return container_of(d, struct bcm2835_dmadev, ddev); +@@ -418,7 +412,7 @@ static struct dma_async_tx_descriptor *b + d->c = c; + d->dir = direction; + if (c->ch >= 8) /* LITE channel */ +- max_size = MAX_CYCLIC_LITE_TRANSFER; ++ max_size = MAX_LITE_TRANSFER; + else + max_size = MAX_NORMAL_TRANSFER; + period_len = min(period_len, max_size); diff --git a/target/linux/brcm2708/patches-4.4/0391-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch b/target/linux/brcm2708/patches-4.4/0391-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch deleted file mode 100644 index 1fd6fb22f8..0000000000 --- a/target/linux/brcm2708/patches-4.4/0391-Revert-bcm2835-dma-Limit-cyclic-transfers-on-lite-ch.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0bdc822d579b856a40a24f8c58765d2200f15099 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Fri, 22 Apr 2016 17:17:22 +0000 -Subject: [PATCH 391/423] Revert "bcm2835-dma: Limit cyclic transfers on lite - channels to 32k" - -This reverts commit 052c2005b6ecedc5abad86632f5781adda310aa7. ---- - drivers/dma/bcm2835-dma.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -144,12 +144,6 @@ struct bcm2835_desc { - */ - #define MAX_LITE_TRANSFER (SZ_64K - 4) - --/* -- * Transfers larger than 32k cause issues with the bcm2708-i2s driver, -- * so limit transfer size to 32k as bcm2708-dmaengine did. -- */ --#define MAX_CYCLIC_LITE_TRANSFER SZ_32K -- - static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d) - { - return container_of(d, struct bcm2835_dmadev, ddev); -@@ -418,7 +412,7 @@ static struct dma_async_tx_descriptor *b - d->c = c; - d->dir = direction; - if (c->ch >= 8) /* LITE channel */ -- max_size = MAX_CYCLIC_LITE_TRANSFER; -+ max_size = MAX_LITE_TRANSFER; - else - max_size = MAX_NORMAL_TRANSFER; - period_len = min(period_len, max_size); diff --git a/target/linux/brcm2708/patches-4.4/0391-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch b/target/linux/brcm2708/patches-4.4/0391-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch new file mode 100644 index 0000000000..b7fdb9e989 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0391-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch @@ -0,0 +1,90 @@ +From 7d58feb7f06a5e05aa3b99b32b4bba4b927b7b3f Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Fri, 22 Apr 2016 17:17:30 +0000 +Subject: [PATCH] Revert "dmaengine: bcm2835: Load driver early and support + legacy API" + +This reverts commit 6f56fff39c811953809b011f59c49a2122c4d173. +--- + drivers/dma/Kconfig | 2 +- + drivers/dma/bcm2835-dma.c | 30 ++++++------------------------ + 2 files changed, 7 insertions(+), 25 deletions(-) + +--- a/drivers/dma/Kconfig ++++ b/drivers/dma/Kconfig +@@ -108,7 +108,7 @@ config COH901318 + + config DMA_BCM2835 + tristate "BCM2835 DMA engine support" +- depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 ++ depends on ARCH_BCM2835 + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -36,7 +36,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -787,10 +786,6 @@ static int bcm2835_dma_probe(struct plat + if (IS_ERR(base)) + return PTR_ERR(base); + +- rc = bcm_dmaman_probe(pdev, base, BCM2835_DMA_BULK_MASK); +- if (rc) +- dev_err(&pdev->dev, "Failed to initialize the legacy API\n"); +- + od->base = base; + + dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); +@@ -823,8 +818,11 @@ static int bcm2835_dma_probe(struct plat + goto err_no_dma; + } + +- /* Channel 0 is used by the legacy API */ +- chans_available &= ~BCM2835_DMA_BULK_MASK; ++ /* ++ * Do not use the FIQ and BULK channels, ++ * because they are used by the GPU. ++ */ ++ chans_available &= ~(BCM2835_DMA_FIQ_MASK | BCM2835_DMA_BULK_MASK); + + for (i = 0; i < pdev->num_resources; i++) { + irq = platform_get_irq(pdev, i); +@@ -868,7 +866,6 @@ static int bcm2835_dma_remove(struct pla + { + struct bcm2835_dmadev *od = platform_get_drvdata(pdev); + +- bcm_dmaman_remove(pdev); + dma_async_device_unregister(&od->ddev); + bcm2835_dma_free(od); + +@@ -884,22 +881,7 @@ static struct platform_driver bcm2835_dm + }, + }; + +-static int bcm2835_dma_init(void) +-{ +- return platform_driver_register(&bcm2835_dma_driver); +-} +- +-static void bcm2835_dma_exit(void) +-{ +- platform_driver_unregister(&bcm2835_dma_driver); +-} +- +-/* +- * Load after serial driver (arch_initcall) so we see the messages if it fails, +- * but before drivers (module_init) that need a DMA channel. +- */ +-subsys_initcall(bcm2835_dma_init); +-module_exit(bcm2835_dma_exit); ++module_platform_driver(bcm2835_dma_driver); + + MODULE_ALIAS("platform:bcm2835-dma"); + MODULE_DESCRIPTION("BCM2835 DMA engine driver"); diff --git a/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch b/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch new file mode 100644 index 0000000000..7cac679ee9 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch @@ -0,0 +1,312 @@ +From b80a19b329a3fcbb74490a4b8d86055ee7d40c13 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Fri, 22 Apr 2016 17:17:37 +0000 +Subject: [PATCH] Revert "dmaengine: bcm2835: Add slave dma support" + +This reverts commit 8a349301238aabb40c9da5ca8c8492b6b8d146f6. +--- + drivers/dma/bcm2835-dma.c | 206 ++++------------------------------------------ + 1 file changed, 14 insertions(+), 192 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -1,10 +1,11 @@ + /* + * BCM2835 DMA engine support + * ++ * This driver only supports cyclic DMA transfers ++ * as needed for the I2S module. ++ * + * Author: Florian Meier + * Copyright 2013 +- * Gellert Weisz +- * Copyright 2013-2014 + * + * Based on + * OMAP DMAengine support by Russell King +@@ -94,8 +95,6 @@ struct bcm2835_desc { + size_t size; + }; + +-#define BCM2835_DMA_WAIT_CYCLES 0 /* Slow down DMA transfers: 0-31 */ +- + #define BCM2835_DMA_CS 0x00 + #define BCM2835_DMA_ADDR 0x04 + #define BCM2835_DMA_SOURCE_AD 0x0c +@@ -112,16 +111,12 @@ struct bcm2835_desc { + #define BCM2835_DMA_RESET BIT(31) /* WO, self clearing */ + + #define BCM2835_DMA_INT_EN BIT(0) +-#define BCM2835_DMA_WAIT_RESP BIT(3) + #define BCM2835_DMA_D_INC BIT(4) +-#define BCM2835_DMA_D_WIDTH BIT(5) + #define BCM2835_DMA_D_DREQ BIT(6) + #define BCM2835_DMA_S_INC BIT(8) +-#define BCM2835_DMA_S_WIDTH BIT(9) + #define BCM2835_DMA_S_DREQ BIT(10) + + #define BCM2835_DMA_PER_MAP(x) ((x) << 16) +-#define BCM2835_DMA_WAITS(x) (((x) & 0x1f) << 21) + + #define BCM2835_DMA_DATA_TYPE_S8 1 + #define BCM2835_DMA_DATA_TYPE_S16 2 +@@ -135,14 +130,6 @@ struct bcm2835_desc { + #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ + #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) + +-#define MAX_NORMAL_TRANSFER SZ_1G +-/* +- * Max length on a Lite channel is 65535 bytes. +- * DMA handles byte-enables on SDRAM reads and writes even on 128-bit accesses, +- * but byte-enables don't exist on peripheral addresses, so align to 32-bit. +- */ +-#define MAX_LITE_TRANSFER (SZ_64K - 4) +- + static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d) + { + return container_of(d, struct bcm2835_dmadev, ddev); +@@ -239,19 +226,13 @@ static irqreturn_t bcm2835_dma_callback( + d = c->desc; + + if (d) { +- if (c->cyclic) { +- vchan_cyclic_callback(&d->vd); +- +- /* Keep the DMA engine running */ +- writel(BCM2835_DMA_ACTIVE, +- c->chan_base + BCM2835_DMA_CS); +- +- } else { +- vchan_cookie_complete(&c->desc->vd); +- bcm2835_dma_start_desc(c); +- } ++ /* TODO Only works for cyclic DMA */ ++ vchan_cyclic_callback(&d->vd); + } + ++ /* Keep the DMA engine running */ ++ writel(BCM2835_DMA_ACTIVE, c->chan_base + BCM2835_DMA_CS); ++ + spin_unlock_irqrestore(&c->vc.lock, flags); + + return IRQ_HANDLED; +@@ -358,6 +339,8 @@ static void bcm2835_dma_issue_pending(st + struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); + unsigned long flags; + ++ c->cyclic = true; /* Nothing else is implemented */ ++ + spin_lock_irqsave(&c->vc.lock, flags); + if (vchan_issue_pending(&c->vc) && !c->desc) + bcm2835_dma_start_desc(c); +@@ -375,7 +358,7 @@ static struct dma_async_tx_descriptor *b + struct bcm2835_desc *d; + dma_addr_t dev_addr; + unsigned int es, sync_type; +- unsigned int frame, max_size; ++ unsigned int frame; + int i; + + /* Grab configuration */ +@@ -410,12 +393,7 @@ static struct dma_async_tx_descriptor *b + + d->c = c; + d->dir = direction; +- if (c->ch >= 8) /* LITE channel */ +- max_size = MAX_LITE_TRANSFER; +- else +- max_size = MAX_NORMAL_TRANSFER; +- period_len = min(period_len, max_size); +- d->frames = (buf_len - 1) / (period_len + 1); ++ d->frames = buf_len / period_len; + + d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); + if (!d->cb_list) { +@@ -463,171 +441,17 @@ static struct dma_async_tx_descriptor *b + BCM2835_DMA_PER_MAP(c->dreq); + + /* Length of a frame */ +- if (frame != d->frames - 1) +- control_block->length = period_len; +- else +- control_block->length = buf_len - (d->frames - 1) * +- period_len; ++ control_block->length = period_len; + d->size += control_block->length; + + /* + * Next block is the next frame. +- * This function is called on cyclic DMA transfers. ++ * This DMA engine driver currently only supports cyclic DMA. + * Therefore, wrap around at number of frames. + */ + control_block->next = d->cb_list[((frame + 1) % d->frames)].paddr; + } + +- c->cyclic = true; +- +- return vchan_tx_prep(&c->vc, &d->vd, flags); +-} +- +-static struct dma_async_tx_descriptor * +-bcm2835_dma_prep_slave_sg(struct dma_chan *chan, +- struct scatterlist *sgl, +- unsigned int sg_len, +- enum dma_transfer_direction direction, +- unsigned long flags, void *context) +-{ +- struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); +- enum dma_slave_buswidth dev_width; +- struct bcm2835_desc *d; +- dma_addr_t dev_addr; +- struct scatterlist *sgent; +- unsigned int i, sync_type, split_cnt, max_size; +- +- if (!is_slave_direction(direction)) { +- dev_err(chan->device->dev, "direction not supported\n"); +- return NULL; +- } +- +- if (direction == DMA_DEV_TO_MEM) { +- dev_addr = c->cfg.src_addr; +- dev_width = c->cfg.src_addr_width; +- sync_type = BCM2835_DMA_S_DREQ; +- } else { +- dev_addr = c->cfg.dst_addr; +- dev_width = c->cfg.dst_addr_width; +- sync_type = BCM2835_DMA_D_DREQ; +- } +- +- /* Bus width translates to the element size (ES) */ +- switch (dev_width) { +- case DMA_SLAVE_BUSWIDTH_4_BYTES: +- break; +- default: +- dev_err(chan->device->dev, "buswidth not supported: %i\n", +- dev_width); +- return NULL; +- } +- +- /* Allocate and setup the descriptor. */ +- d = kzalloc(sizeof(*d), GFP_NOWAIT); +- if (!d) +- return NULL; +- +- d->dir = direction; +- +- if (c->ch >= 8) /* LITE channel */ +- max_size = MAX_LITE_TRANSFER; +- else +- max_size = MAX_NORMAL_TRANSFER; +- +- /* +- * Store the length of the SG list in d->frames +- * taking care to account for splitting up transfers +- * too large for a LITE channel +- */ +- d->frames = 0; +- for_each_sg(sgl, sgent, sg_len, i) { +- unsigned int len = sg_dma_len(sgent); +- +- d->frames += len / max_size + 1; +- } +- +- /* Allocate memory for control blocks */ +- d->control_block_size = d->frames * sizeof(struct bcm2835_dma_cb); +- d->control_block_base = dma_zalloc_coherent(chan->device->dev, +- d->control_block_size, &d->control_block_base_phys, +- GFP_NOWAIT); +- if (!d->control_block_base) { +- kfree(d); +- return NULL; +- } +- +- /* +- * Iterate over all SG entries, create a control block +- * for each frame and link them together. +- * Count the number of times an SG entry had to be split +- * as a result of using a LITE channel +- */ +- split_cnt = 0; +- +- for_each_sg(sgl, sgent, sg_len, i) { +- unsigned int j; +- dma_addr_t addr = sg_dma_address(sgent); +- unsigned int len = sg_dma_len(sgent); +- +- for (j = 0; j < len; j += max_size) { +- struct bcm2835_dma_cb *control_block = +- &d->control_block_base[i + split_cnt]; +- +- /* Setup addresses */ +- if (d->dir == DMA_DEV_TO_MEM) { +- control_block->info = BCM2835_DMA_D_INC | +- BCM2835_DMA_D_WIDTH | +- BCM2835_DMA_S_DREQ; +- control_block->src = dev_addr; +- control_block->dst = addr + (dma_addr_t)j; +- } else { +- control_block->info = BCM2835_DMA_S_INC | +- BCM2835_DMA_S_WIDTH | +- BCM2835_DMA_D_DREQ; +- control_block->src = addr + (dma_addr_t)j; +- control_block->dst = dev_addr; +- } +- +- /* Common part */ +- control_block->info |= +- BCM2835_DMA_WAITS(BCM2835_DMA_WAIT_CYCLES); +- control_block->info |= BCM2835_DMA_WAIT_RESP; +- +- /* Enable */ +- if (i == sg_len - 1 && len - j <= max_size) +- control_block->info |= BCM2835_DMA_INT_EN; +- +- /* Setup synchronization */ +- if (sync_type) +- control_block->info |= sync_type; +- +- /* Setup DREQ channel */ +- if (c->dreq) +- control_block->info |= +- BCM2835_DMA_PER_MAP(c->dreq); +- +- /* Length of a frame */ +- control_block->length = min(len - j, max_size); +- d->size += control_block->length; +- +- if (i < sg_len - 1 || len - j > max_size) { +- /* Next block is the next frame. */ +- control_block->next = +- d->control_block_base_phys + +- sizeof(struct bcm2835_dma_cb) * +- (i + split_cnt + 1); +- } else { +- /* Next block is empty. */ +- control_block->next = 0; +- } +- +- if (len - j > max_size) +- split_cnt++; +- } +- } +- +- c->cyclic = false; +- + return vchan_tx_prep(&c->vc, &d->vd, flags); + error_cb: + i--; +@@ -796,7 +620,6 @@ static int bcm2835_dma_probe(struct plat + od->ddev.device_tx_status = bcm2835_dma_tx_status; + od->ddev.device_issue_pending = bcm2835_dma_issue_pending; + od->ddev.device_prep_dma_cyclic = bcm2835_dma_prep_dma_cyclic; +- od->ddev.device_prep_slave_sg = bcm2835_dma_prep_slave_sg; + od->ddev.device_config = bcm2835_dma_slave_config; + od->ddev.device_terminate_all = bcm2835_dma_terminate_all; + od->ddev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); +@@ -886,5 +709,4 @@ module_platform_driver(bcm2835_dma_drive + MODULE_ALIAS("platform:bcm2835-dma"); + MODULE_DESCRIPTION("BCM2835 DMA engine driver"); + MODULE_AUTHOR("Florian Meier "); +-MODULE_AUTHOR("Gellert Weisz "); + MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch b/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch deleted file mode 100644 index 5ad5ffa41e..0000000000 --- a/target/linux/brcm2708/patches-4.4/0392-Revert-dmaengine-bcm2835-Load-driver-early-and-suppo.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 7550c11bac6c1990f2e4a583c99e211cb402782b Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Fri, 22 Apr 2016 17:17:30 +0000 -Subject: [PATCH 392/423] Revert "dmaengine: bcm2835: Load driver early and - support legacy API" - -This reverts commit 6f56fff39c811953809b011f59c49a2122c4d173. ---- - drivers/dma/Kconfig | 2 +- - drivers/dma/bcm2835-dma.c | 30 ++++++------------------------ - 2 files changed, 7 insertions(+), 25 deletions(-) - ---- a/drivers/dma/Kconfig -+++ b/drivers/dma/Kconfig -@@ -108,7 +108,7 @@ config COH901318 - - config DMA_BCM2835 - tristate "BCM2835 DMA engine support" -- depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 -+ depends on ARCH_BCM2835 - select DMA_ENGINE - select DMA_VIRTUAL_CHANNELS - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -36,7 +36,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -787,10 +786,6 @@ static int bcm2835_dma_probe(struct plat - if (IS_ERR(base)) - return PTR_ERR(base); - -- rc = bcm_dmaman_probe(pdev, base, BCM2835_DMA_BULK_MASK); -- if (rc) -- dev_err(&pdev->dev, "Failed to initialize the legacy API\n"); -- - od->base = base; - - dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); -@@ -823,8 +818,11 @@ static int bcm2835_dma_probe(struct plat - goto err_no_dma; - } - -- /* Channel 0 is used by the legacy API */ -- chans_available &= ~BCM2835_DMA_BULK_MASK; -+ /* -+ * Do not use the FIQ and BULK channels, -+ * because they are used by the GPU. -+ */ -+ chans_available &= ~(BCM2835_DMA_FIQ_MASK | BCM2835_DMA_BULK_MASK); - - for (i = 0; i < pdev->num_resources; i++) { - irq = platform_get_irq(pdev, i); -@@ -868,7 +866,6 @@ static int bcm2835_dma_remove(struct pla - { - struct bcm2835_dmadev *od = platform_get_drvdata(pdev); - -- bcm_dmaman_remove(pdev); - dma_async_device_unregister(&od->ddev); - bcm2835_dma_free(od); - -@@ -884,22 +881,7 @@ static struct platform_driver bcm2835_dm - }, - }; - --static int bcm2835_dma_init(void) --{ -- return platform_driver_register(&bcm2835_dma_driver); --} -- --static void bcm2835_dma_exit(void) --{ -- platform_driver_unregister(&bcm2835_dma_driver); --} -- --/* -- * Load after serial driver (arch_initcall) so we see the messages if it fails, -- * but before drivers (module_init) that need a DMA channel. -- */ --subsys_initcall(bcm2835_dma_init); --module_exit(bcm2835_dma_exit); -+module_platform_driver(bcm2835_dma_driver); - - MODULE_ALIAS("platform:bcm2835-dma"); - MODULE_DESCRIPTION("BCM2835 DMA engine driver"); diff --git a/target/linux/brcm2708/patches-4.4/0393-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch b/target/linux/brcm2708/patches-4.4/0393-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch deleted file mode 100644 index 890ebb8340..0000000000 --- a/target/linux/brcm2708/patches-4.4/0393-Revert-dmaengine-bcm2835-Add-slave-dma-support.patch +++ /dev/null @@ -1,312 +0,0 @@ -From c748f44b0b10023e4207cb288ce9c169e390fbaf Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Fri, 22 Apr 2016 17:17:37 +0000 -Subject: [PATCH 393/423] Revert "dmaengine: bcm2835: Add slave dma support" - -This reverts commit 8a349301238aabb40c9da5ca8c8492b6b8d146f6. ---- - drivers/dma/bcm2835-dma.c | 206 ++++------------------------------------------ - 1 file changed, 14 insertions(+), 192 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -1,10 +1,11 @@ - /* - * BCM2835 DMA engine support - * -+ * This driver only supports cyclic DMA transfers -+ * as needed for the I2S module. -+ * - * Author: Florian Meier - * Copyright 2013 -- * Gellert Weisz -- * Copyright 2013-2014 - * - * Based on - * OMAP DMAengine support by Russell King -@@ -94,8 +95,6 @@ struct bcm2835_desc { - size_t size; - }; - --#define BCM2835_DMA_WAIT_CYCLES 0 /* Slow down DMA transfers: 0-31 */ -- - #define BCM2835_DMA_CS 0x00 - #define BCM2835_DMA_ADDR 0x04 - #define BCM2835_DMA_SOURCE_AD 0x0c -@@ -112,16 +111,12 @@ struct bcm2835_desc { - #define BCM2835_DMA_RESET BIT(31) /* WO, self clearing */ - - #define BCM2835_DMA_INT_EN BIT(0) --#define BCM2835_DMA_WAIT_RESP BIT(3) - #define BCM2835_DMA_D_INC BIT(4) --#define BCM2835_DMA_D_WIDTH BIT(5) - #define BCM2835_DMA_D_DREQ BIT(6) - #define BCM2835_DMA_S_INC BIT(8) --#define BCM2835_DMA_S_WIDTH BIT(9) - #define BCM2835_DMA_S_DREQ BIT(10) - - #define BCM2835_DMA_PER_MAP(x) ((x) << 16) --#define BCM2835_DMA_WAITS(x) (((x) & 0x1f) << 21) - - #define BCM2835_DMA_DATA_TYPE_S8 1 - #define BCM2835_DMA_DATA_TYPE_S16 2 -@@ -135,14 +130,6 @@ struct bcm2835_desc { - #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ - #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) - --#define MAX_NORMAL_TRANSFER SZ_1G --/* -- * Max length on a Lite channel is 65535 bytes. -- * DMA handles byte-enables on SDRAM reads and writes even on 128-bit accesses, -- * but byte-enables don't exist on peripheral addresses, so align to 32-bit. -- */ --#define MAX_LITE_TRANSFER (SZ_64K - 4) -- - static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d) - { - return container_of(d, struct bcm2835_dmadev, ddev); -@@ -239,19 +226,13 @@ static irqreturn_t bcm2835_dma_callback( - d = c->desc; - - if (d) { -- if (c->cyclic) { -- vchan_cyclic_callback(&d->vd); -- -- /* Keep the DMA engine running */ -- writel(BCM2835_DMA_ACTIVE, -- c->chan_base + BCM2835_DMA_CS); -- -- } else { -- vchan_cookie_complete(&c->desc->vd); -- bcm2835_dma_start_desc(c); -- } -+ /* TODO Only works for cyclic DMA */ -+ vchan_cyclic_callback(&d->vd); - } - -+ /* Keep the DMA engine running */ -+ writel(BCM2835_DMA_ACTIVE, c->chan_base + BCM2835_DMA_CS); -+ - spin_unlock_irqrestore(&c->vc.lock, flags); - - return IRQ_HANDLED; -@@ -358,6 +339,8 @@ static void bcm2835_dma_issue_pending(st - struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); - unsigned long flags; - -+ c->cyclic = true; /* Nothing else is implemented */ -+ - spin_lock_irqsave(&c->vc.lock, flags); - if (vchan_issue_pending(&c->vc) && !c->desc) - bcm2835_dma_start_desc(c); -@@ -375,7 +358,7 @@ static struct dma_async_tx_descriptor *b - struct bcm2835_desc *d; - dma_addr_t dev_addr; - unsigned int es, sync_type; -- unsigned int frame, max_size; -+ unsigned int frame; - int i; - - /* Grab configuration */ -@@ -410,12 +393,7 @@ static struct dma_async_tx_descriptor *b - - d->c = c; - d->dir = direction; -- if (c->ch >= 8) /* LITE channel */ -- max_size = MAX_LITE_TRANSFER; -- else -- max_size = MAX_NORMAL_TRANSFER; -- period_len = min(period_len, max_size); -- d->frames = (buf_len - 1) / (period_len + 1); -+ d->frames = buf_len / period_len; - - d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); - if (!d->cb_list) { -@@ -463,171 +441,17 @@ static struct dma_async_tx_descriptor *b - BCM2835_DMA_PER_MAP(c->dreq); - - /* Length of a frame */ -- if (frame != d->frames - 1) -- control_block->length = period_len; -- else -- control_block->length = buf_len - (d->frames - 1) * -- period_len; -+ control_block->length = period_len; - d->size += control_block->length; - - /* - * Next block is the next frame. -- * This function is called on cyclic DMA transfers. -+ * This DMA engine driver currently only supports cyclic DMA. - * Therefore, wrap around at number of frames. - */ - control_block->next = d->cb_list[((frame + 1) % d->frames)].paddr; - } - -- c->cyclic = true; -- -- return vchan_tx_prep(&c->vc, &d->vd, flags); --} -- --static struct dma_async_tx_descriptor * --bcm2835_dma_prep_slave_sg(struct dma_chan *chan, -- struct scatterlist *sgl, -- unsigned int sg_len, -- enum dma_transfer_direction direction, -- unsigned long flags, void *context) --{ -- struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); -- enum dma_slave_buswidth dev_width; -- struct bcm2835_desc *d; -- dma_addr_t dev_addr; -- struct scatterlist *sgent; -- unsigned int i, sync_type, split_cnt, max_size; -- -- if (!is_slave_direction(direction)) { -- dev_err(chan->device->dev, "direction not supported\n"); -- return NULL; -- } -- -- if (direction == DMA_DEV_TO_MEM) { -- dev_addr = c->cfg.src_addr; -- dev_width = c->cfg.src_addr_width; -- sync_type = BCM2835_DMA_S_DREQ; -- } else { -- dev_addr = c->cfg.dst_addr; -- dev_width = c->cfg.dst_addr_width; -- sync_type = BCM2835_DMA_D_DREQ; -- } -- -- /* Bus width translates to the element size (ES) */ -- switch (dev_width) { -- case DMA_SLAVE_BUSWIDTH_4_BYTES: -- break; -- default: -- dev_err(chan->device->dev, "buswidth not supported: %i\n", -- dev_width); -- return NULL; -- } -- -- /* Allocate and setup the descriptor. */ -- d = kzalloc(sizeof(*d), GFP_NOWAIT); -- if (!d) -- return NULL; -- -- d->dir = direction; -- -- if (c->ch >= 8) /* LITE channel */ -- max_size = MAX_LITE_TRANSFER; -- else -- max_size = MAX_NORMAL_TRANSFER; -- -- /* -- * Store the length of the SG list in d->frames -- * taking care to account for splitting up transfers -- * too large for a LITE channel -- */ -- d->frames = 0; -- for_each_sg(sgl, sgent, sg_len, i) { -- unsigned int len = sg_dma_len(sgent); -- -- d->frames += len / max_size + 1; -- } -- -- /* Allocate memory for control blocks */ -- d->control_block_size = d->frames * sizeof(struct bcm2835_dma_cb); -- d->control_block_base = dma_zalloc_coherent(chan->device->dev, -- d->control_block_size, &d->control_block_base_phys, -- GFP_NOWAIT); -- if (!d->control_block_base) { -- kfree(d); -- return NULL; -- } -- -- /* -- * Iterate over all SG entries, create a control block -- * for each frame and link them together. -- * Count the number of times an SG entry had to be split -- * as a result of using a LITE channel -- */ -- split_cnt = 0; -- -- for_each_sg(sgl, sgent, sg_len, i) { -- unsigned int j; -- dma_addr_t addr = sg_dma_address(sgent); -- unsigned int len = sg_dma_len(sgent); -- -- for (j = 0; j < len; j += max_size) { -- struct bcm2835_dma_cb *control_block = -- &d->control_block_base[i + split_cnt]; -- -- /* Setup addresses */ -- if (d->dir == DMA_DEV_TO_MEM) { -- control_block->info = BCM2835_DMA_D_INC | -- BCM2835_DMA_D_WIDTH | -- BCM2835_DMA_S_DREQ; -- control_block->src = dev_addr; -- control_block->dst = addr + (dma_addr_t)j; -- } else { -- control_block->info = BCM2835_DMA_S_INC | -- BCM2835_DMA_S_WIDTH | -- BCM2835_DMA_D_DREQ; -- control_block->src = addr + (dma_addr_t)j; -- control_block->dst = dev_addr; -- } -- -- /* Common part */ -- control_block->info |= -- BCM2835_DMA_WAITS(BCM2835_DMA_WAIT_CYCLES); -- control_block->info |= BCM2835_DMA_WAIT_RESP; -- -- /* Enable */ -- if (i == sg_len - 1 && len - j <= max_size) -- control_block->info |= BCM2835_DMA_INT_EN; -- -- /* Setup synchronization */ -- if (sync_type) -- control_block->info |= sync_type; -- -- /* Setup DREQ channel */ -- if (c->dreq) -- control_block->info |= -- BCM2835_DMA_PER_MAP(c->dreq); -- -- /* Length of a frame */ -- control_block->length = min(len - j, max_size); -- d->size += control_block->length; -- -- if (i < sg_len - 1 || len - j > max_size) { -- /* Next block is the next frame. */ -- control_block->next = -- d->control_block_base_phys + -- sizeof(struct bcm2835_dma_cb) * -- (i + split_cnt + 1); -- } else { -- /* Next block is empty. */ -- control_block->next = 0; -- } -- -- if (len - j > max_size) -- split_cnt++; -- } -- } -- -- c->cyclic = false; -- - return vchan_tx_prep(&c->vc, &d->vd, flags); - error_cb: - i--; -@@ -796,7 +620,6 @@ static int bcm2835_dma_probe(struct plat - od->ddev.device_tx_status = bcm2835_dma_tx_status; - od->ddev.device_issue_pending = bcm2835_dma_issue_pending; - od->ddev.device_prep_dma_cyclic = bcm2835_dma_prep_dma_cyclic; -- od->ddev.device_prep_slave_sg = bcm2835_dma_prep_slave_sg; - od->ddev.device_config = bcm2835_dma_slave_config; - od->ddev.device_terminate_all = bcm2835_dma_terminate_all; - od->ddev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); -@@ -886,5 +709,4 @@ module_platform_driver(bcm2835_dma_drive - MODULE_ALIAS("platform:bcm2835-dma"); - MODULE_DESCRIPTION("BCM2835 DMA engine driver"); - MODULE_AUTHOR("Florian Meier "); --MODULE_AUTHOR("Gellert Weisz "); - MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0393-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch b/target/linux/brcm2708/patches-4.4/0393-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch new file mode 100644 index 0000000000..5254a2a62e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0393-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch @@ -0,0 +1,56 @@ +From 0f65c306a55ab6a8e8148b6d9c966a1d214ae3c9 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Wed, 16 Mar 2016 12:24:56 -0700 +Subject: [PATCH] dmaengine: bcm2835: remove unnecessary masking of dma + channels + +The original patch contained 3 dma channels that were masked out. + +These - as far as research and discussions show - are a +artefacts remaining from the downstream legacy dma-api. + +Right now down-stream still includes a legacy api used only +in a single (downstream only) driver (bcm2708_fb) that requires +2D DMA for speedup (DMA-channel 0). +Formerly the sd-card support driver also was using this legacy +api (DMA-channel 2), but since has been moved over to use +dmaengine directly. + +The DMA-channel 3 is already masked out in the devicetree in +the default property "brcm,dma-channel-mask = <0x7f35>;" + +So we can remove the whole masking of DMA channels. + +Signed-off-by: Martin Sperl +Reviewed-by: Eric Anholt +Signed-off-by: Eric Anholt +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 9 --------- + 1 file changed, 9 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -123,9 +123,6 @@ struct bcm2835_desc { + #define BCM2835_DMA_DATA_TYPE_S32 4 + #define BCM2835_DMA_DATA_TYPE_S128 16 + +-#define BCM2835_DMA_BULK_MASK BIT(0) +-#define BCM2835_DMA_FIQ_MASK (BIT(2) | BIT(3)) +- + /* Valid only for channels 0 - 14, 15 has its own base address */ + #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ + #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) +@@ -641,12 +638,6 @@ static int bcm2835_dma_probe(struct plat + goto err_no_dma; + } + +- /* +- * Do not use the FIQ and BULK channels, +- * because they are used by the GPU. +- */ +- chans_available &= ~(BCM2835_DMA_FIQ_MASK | BCM2835_DMA_BULK_MASK); +- + for (i = 0; i < pdev->num_resources; i++) { + irq = platform_get_irq(pdev, i); + if (irq < 0) diff --git a/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch b/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch new file mode 100644 index 0000000000..6f300a280c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch @@ -0,0 +1,93 @@ +From 2e9daa8fabdef7a31da63f9a532105d94ade48ae Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Wed, 16 Mar 2016 12:24:57 -0700 +Subject: [PATCH] dmaengine: bcm2835: add additional defines for DMA-registers + +Add additional defines describing the DMA registers +as well as adding some more documentation to those registers. + +Signed-off-by: Martin Sperl +Reviewed-by: Eric Anholt +Signed-off-by: Eric Anholt +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 57 ++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 49 insertions(+), 8 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -97,26 +97,67 @@ struct bcm2835_desc { + + #define BCM2835_DMA_CS 0x00 + #define BCM2835_DMA_ADDR 0x04 ++#define BCM2835_DMA_TI 0x08 + #define BCM2835_DMA_SOURCE_AD 0x0c + #define BCM2835_DMA_DEST_AD 0x10 +-#define BCM2835_DMA_NEXTCB 0x1C ++#define BCM2835_DMA_LEN 0x14 ++#define BCM2835_DMA_STRIDE 0x18 ++#define BCM2835_DMA_NEXTCB 0x1c ++#define BCM2835_DMA_DEBUG 0x20 + + /* DMA CS Control and Status bits */ +-#define BCM2835_DMA_ACTIVE BIT(0) +-#define BCM2835_DMA_INT BIT(2) ++#define BCM2835_DMA_ACTIVE BIT(0) /* activate the DMA */ ++#define BCM2835_DMA_END BIT(1) /* current CB has ended */ ++#define BCM2835_DMA_INT BIT(2) /* interrupt status */ ++#define BCM2835_DMA_DREQ BIT(3) /* DREQ state */ + #define BCM2835_DMA_ISPAUSED BIT(4) /* Pause requested or not active */ + #define BCM2835_DMA_ISHELD BIT(5) /* Is held by DREQ flow control */ +-#define BCM2835_DMA_ERR BIT(8) ++#define BCM2835_DMA_WAITING_FOR_WRITES BIT(6) /* waiting for last ++ * AXI-write to ack ++ */ ++#define BCM2835_DMA_ERR BIT(8) ++#define BCM2835_DMA_PRIORITY(x) ((x & 15) << 16) /* AXI priority */ ++#define BCM2835_DMA_PANIC_PRIORITY(x) ((x & 15) << 20) /* panic priority */ ++/* current value of TI.BCM2835_DMA_WAIT_RESP */ ++#define BCM2835_DMA_WAIT_FOR_WRITES BIT(28) ++#define BCM2835_DMA_DIS_DEBUG BIT(29) /* disable debug pause signal */ + #define BCM2835_DMA_ABORT BIT(30) /* Stop current CB, go to next, WO */ + #define BCM2835_DMA_RESET BIT(31) /* WO, self clearing */ + ++/* Transfer information bits - also bcm2835_cb.info field */ + #define BCM2835_DMA_INT_EN BIT(0) ++#define BCM2835_DMA_TDMODE BIT(1) /* 2D-Mode */ ++#define BCM2835_DMA_WAIT_RESP BIT(3) /* wait for AXI-write to be acked */ + #define BCM2835_DMA_D_INC BIT(4) +-#define BCM2835_DMA_D_DREQ BIT(6) ++#define BCM2835_DMA_D_WIDTH BIT(5) /* 128bit writes if set */ ++#define BCM2835_DMA_D_DREQ BIT(6) /* enable DREQ for destination */ ++#define BCM2835_DMA_D_IGNORE BIT(7) /* ignore destination writes */ + #define BCM2835_DMA_S_INC BIT(8) +-#define BCM2835_DMA_S_DREQ BIT(10) ++#define BCM2835_DMA_S_WIDTH BIT(9) /* 128bit writes if set */ ++#define BCM2835_DMA_S_DREQ BIT(10) /* enable SREQ for source */ ++#define BCM2835_DMA_S_IGNORE BIT(11) /* ignore source reads - read 0 */ ++#define BCM2835_DMA_BURST_LENGTH(x) ((x & 15) << 12) ++#define BCM2835_DMA_PER_MAP(x) ((x & 31) << 16) /* REQ source */ ++#define BCM2835_DMA_WAIT(x) ((x & 31) << 21) /* add DMA-wait cycles */ ++#define BCM2835_DMA_NO_WIDE_BURSTS BIT(26) /* no 2 beat write bursts */ + +-#define BCM2835_DMA_PER_MAP(x) ((x) << 16) ++/* debug register bits */ ++#define BCM2835_DMA_DEBUG_LAST_NOT_SET_ERR BIT(0) ++#define BCM2835_DMA_DEBUG_FIFO_ERR BIT(1) ++#define BCM2835_DMA_DEBUG_READ_ERR BIT(2) ++#define BCM2835_DMA_DEBUG_OUTSTANDING_WRITES_SHIFT 4 ++#define BCM2835_DMA_DEBUG_OUTSTANDING_WRITES_BITS 4 ++#define BCM2835_DMA_DEBUG_ID_SHIFT 16 ++#define BCM2835_DMA_DEBUG_ID_BITS 9 ++#define BCM2835_DMA_DEBUG_STATE_SHIFT 16 ++#define BCM2835_DMA_DEBUG_STATE_BITS 9 ++#define BCM2835_DMA_DEBUG_VERSION_SHIFT 25 ++#define BCM2835_DMA_DEBUG_VERSION_BITS 3 ++#define BCM2835_DMA_DEBUG_LITE BIT(28) ++ ++/* shared registers for all dma channels */ ++#define BCM2835_DMA_INT_STATUS 0xfe0 ++#define BCM2835_DMA_ENABLE 0xff0 + + #define BCM2835_DMA_DATA_TYPE_S8 1 + #define BCM2835_DMA_DATA_TYPE_S16 2 diff --git a/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch b/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch deleted file mode 100644 index 63a232a114..0000000000 --- a/target/linux/brcm2708/patches-4.4/0394-dmaengine-bcm2835-remove-unnecessary-masking-of-dma-.patch +++ /dev/null @@ -1,56 +0,0 @@ -From dd06728c740cdeb3346a7b74d8a5924672ed6da1 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 16 Mar 2016 12:24:56 -0700 -Subject: [PATCH 394/423] dmaengine: bcm2835: remove unnecessary masking of dma - channels - -The original patch contained 3 dma channels that were masked out. - -These - as far as research and discussions show - are a -artefacts remaining from the downstream legacy dma-api. - -Right now down-stream still includes a legacy api used only -in a single (downstream only) driver (bcm2708_fb) that requires -2D DMA for speedup (DMA-channel 0). -Formerly the sd-card support driver also was using this legacy -api (DMA-channel 2), but since has been moved over to use -dmaengine directly. - -The DMA-channel 3 is already masked out in the devicetree in -the default property "brcm,dma-channel-mask = <0x7f35>;" - -So we can remove the whole masking of DMA channels. - -Signed-off-by: Martin Sperl -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 9 --------- - 1 file changed, 9 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -123,9 +123,6 @@ struct bcm2835_desc { - #define BCM2835_DMA_DATA_TYPE_S32 4 - #define BCM2835_DMA_DATA_TYPE_S128 16 - --#define BCM2835_DMA_BULK_MASK BIT(0) --#define BCM2835_DMA_FIQ_MASK (BIT(2) | BIT(3)) -- - /* Valid only for channels 0 - 14, 15 has its own base address */ - #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ - #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) -@@ -641,12 +638,6 @@ static int bcm2835_dma_probe(struct plat - goto err_no_dma; - } - -- /* -- * Do not use the FIQ and BULK channels, -- * because they are used by the GPU. -- */ -- chans_available &= ~(BCM2835_DMA_FIQ_MASK | BCM2835_DMA_BULK_MASK); -- - for (i = 0; i < pdev->num_resources; i++) { - irq = platform_get_irq(pdev, i); - if (irq < 0) diff --git a/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch b/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch deleted file mode 100644 index f2cc0e37b6..0000000000 --- a/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-add-additional-defines-for-DMA-reg.patch +++ /dev/null @@ -1,94 +0,0 @@ -From b1f4d42406261ed1ddffbbf0582ebbfaf6c0a73b Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 16 Mar 2016 12:24:57 -0700 -Subject: [PATCH 395/423] dmaengine: bcm2835: add additional defines for - DMA-registers - -Add additional defines describing the DMA registers -as well as adding some more documentation to those registers. - -Signed-off-by: Martin Sperl -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 57 ++++++++++++++++++++++++++++++++++++++++------- - 1 file changed, 49 insertions(+), 8 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -97,26 +97,67 @@ struct bcm2835_desc { - - #define BCM2835_DMA_CS 0x00 - #define BCM2835_DMA_ADDR 0x04 -+#define BCM2835_DMA_TI 0x08 - #define BCM2835_DMA_SOURCE_AD 0x0c - #define BCM2835_DMA_DEST_AD 0x10 --#define BCM2835_DMA_NEXTCB 0x1C -+#define BCM2835_DMA_LEN 0x14 -+#define BCM2835_DMA_STRIDE 0x18 -+#define BCM2835_DMA_NEXTCB 0x1c -+#define BCM2835_DMA_DEBUG 0x20 - - /* DMA CS Control and Status bits */ --#define BCM2835_DMA_ACTIVE BIT(0) --#define BCM2835_DMA_INT BIT(2) -+#define BCM2835_DMA_ACTIVE BIT(0) /* activate the DMA */ -+#define BCM2835_DMA_END BIT(1) /* current CB has ended */ -+#define BCM2835_DMA_INT BIT(2) /* interrupt status */ -+#define BCM2835_DMA_DREQ BIT(3) /* DREQ state */ - #define BCM2835_DMA_ISPAUSED BIT(4) /* Pause requested or not active */ - #define BCM2835_DMA_ISHELD BIT(5) /* Is held by DREQ flow control */ --#define BCM2835_DMA_ERR BIT(8) -+#define BCM2835_DMA_WAITING_FOR_WRITES BIT(6) /* waiting for last -+ * AXI-write to ack -+ */ -+#define BCM2835_DMA_ERR BIT(8) -+#define BCM2835_DMA_PRIORITY(x) ((x & 15) << 16) /* AXI priority */ -+#define BCM2835_DMA_PANIC_PRIORITY(x) ((x & 15) << 20) /* panic priority */ -+/* current value of TI.BCM2835_DMA_WAIT_RESP */ -+#define BCM2835_DMA_WAIT_FOR_WRITES BIT(28) -+#define BCM2835_DMA_DIS_DEBUG BIT(29) /* disable debug pause signal */ - #define BCM2835_DMA_ABORT BIT(30) /* Stop current CB, go to next, WO */ - #define BCM2835_DMA_RESET BIT(31) /* WO, self clearing */ - -+/* Transfer information bits - also bcm2835_cb.info field */ - #define BCM2835_DMA_INT_EN BIT(0) -+#define BCM2835_DMA_TDMODE BIT(1) /* 2D-Mode */ -+#define BCM2835_DMA_WAIT_RESP BIT(3) /* wait for AXI-write to be acked */ - #define BCM2835_DMA_D_INC BIT(4) --#define BCM2835_DMA_D_DREQ BIT(6) -+#define BCM2835_DMA_D_WIDTH BIT(5) /* 128bit writes if set */ -+#define BCM2835_DMA_D_DREQ BIT(6) /* enable DREQ for destination */ -+#define BCM2835_DMA_D_IGNORE BIT(7) /* ignore destination writes */ - #define BCM2835_DMA_S_INC BIT(8) --#define BCM2835_DMA_S_DREQ BIT(10) -+#define BCM2835_DMA_S_WIDTH BIT(9) /* 128bit writes if set */ -+#define BCM2835_DMA_S_DREQ BIT(10) /* enable SREQ for source */ -+#define BCM2835_DMA_S_IGNORE BIT(11) /* ignore source reads - read 0 */ -+#define BCM2835_DMA_BURST_LENGTH(x) ((x & 15) << 12) -+#define BCM2835_DMA_PER_MAP(x) ((x & 31) << 16) /* REQ source */ -+#define BCM2835_DMA_WAIT(x) ((x & 31) << 21) /* add DMA-wait cycles */ -+#define BCM2835_DMA_NO_WIDE_BURSTS BIT(26) /* no 2 beat write bursts */ - --#define BCM2835_DMA_PER_MAP(x) ((x) << 16) -+/* debug register bits */ -+#define BCM2835_DMA_DEBUG_LAST_NOT_SET_ERR BIT(0) -+#define BCM2835_DMA_DEBUG_FIFO_ERR BIT(1) -+#define BCM2835_DMA_DEBUG_READ_ERR BIT(2) -+#define BCM2835_DMA_DEBUG_OUTSTANDING_WRITES_SHIFT 4 -+#define BCM2835_DMA_DEBUG_OUTSTANDING_WRITES_BITS 4 -+#define BCM2835_DMA_DEBUG_ID_SHIFT 16 -+#define BCM2835_DMA_DEBUG_ID_BITS 9 -+#define BCM2835_DMA_DEBUG_STATE_SHIFT 16 -+#define BCM2835_DMA_DEBUG_STATE_BITS 9 -+#define BCM2835_DMA_DEBUG_VERSION_SHIFT 25 -+#define BCM2835_DMA_DEBUG_VERSION_BITS 3 -+#define BCM2835_DMA_DEBUG_LITE BIT(28) -+ -+/* shared registers for all dma channels */ -+#define BCM2835_DMA_INT_STATUS 0xfe0 -+#define BCM2835_DMA_ENABLE 0xff0 - - #define BCM2835_DMA_DATA_TYPE_S8 1 - #define BCM2835_DMA_DATA_TYPE_S16 2 diff --git a/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch b/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch new file mode 100644 index 0000000000..831928ca32 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0395-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch @@ -0,0 +1,53 @@ +From 45a5aa455ea243c3daf0d1bdbfdb83787ae95249 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Wed, 16 Mar 2016 12:24:58 -0700 +Subject: [PATCH] dmaengine: bcm2835: move cyclic member from bcm2835_chan into + bcm2835_desc + +In preparation to consolidating code we move the cyclic member +into the bcm_2835_desc structure. + +Signed-off-by: Martin Sperl +Reviewed-by: Eric Anholt +Signed-off-by: Eric Anholt +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -73,7 +73,6 @@ struct bcm2835_chan { + struct list_head node; + + struct dma_slave_config cfg; +- bool cyclic; + unsigned int dreq; + + int ch; +@@ -93,6 +92,8 @@ struct bcm2835_desc { + + unsigned int frames; + size_t size; ++ ++ bool cyclic; + }; + + #define BCM2835_DMA_CS 0x00 +@@ -377,8 +378,6 @@ static void bcm2835_dma_issue_pending(st + struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); + unsigned long flags; + +- c->cyclic = true; /* Nothing else is implemented */ +- + spin_lock_irqsave(&c->vc.lock, flags); + if (vchan_issue_pending(&c->vc) && !c->desc) + bcm2835_dma_start_desc(c); +@@ -432,6 +431,7 @@ static struct dma_async_tx_descriptor *b + d->c = c; + d->dir = direction; + d->frames = buf_len / period_len; ++ d->cyclic = true; + + d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); + if (!d->cb_list) { diff --git a/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-controlblock-chain-generation.patch b/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-controlblock-chain-generation.patch new file mode 100644 index 0000000000..1507d6be47 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-controlblock-chain-generation.patch @@ -0,0 +1,378 @@ +From a41b5c7005c6880ac91b9e08062c6b6813df758e Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Wed, 16 Mar 2016 12:24:59 -0700 +Subject: [PATCH] dmaengine: bcm2835: move controlblock chain generation into + separate method + +In preparation of adding slave_sg functionality this patch moves the +generation/allocation of bcm2835_desc and the building of +the corresponding DMA-control-block chain from bcm2835_dma_prep_dma_cyclic +into the newly created method bcm2835_dma_create_cb_chain. + +Signed-off-by: Martin Sperl +Reviewed-by: Eric Anholt +Signed-off-by: Eric Anholt +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 294 +++++++++++++++++++++++++++++++--------------- + 1 file changed, 198 insertions(+), 96 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -88,12 +88,12 @@ struct bcm2835_desc { + struct virt_dma_desc vd; + enum dma_transfer_direction dir; + +- struct bcm2835_cb_entry *cb_list; +- + unsigned int frames; + size_t size; + + bool cyclic; ++ ++ struct bcm2835_cb_entry cb_list[]; + }; + + #define BCM2835_DMA_CS 0x00 +@@ -169,6 +169,13 @@ struct bcm2835_desc { + #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ + #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) + ++/* how many frames of max_len size do we need to transfer len bytes */ ++static inline size_t bcm2835_dma_frames_for_length(size_t len, ++ size_t max_len) ++{ ++ return DIV_ROUND_UP(len, max_len); ++} ++ + static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d) + { + return container_of(d, struct bcm2835_dmadev, ddev); +@@ -185,19 +192,161 @@ static inline struct bcm2835_desc *to_bc + return container_of(t, struct bcm2835_desc, vd.tx); + } + +-static void bcm2835_dma_desc_free(struct virt_dma_desc *vd) ++static void bcm2835_dma_free_cb_chain(struct bcm2835_desc *desc) + { +- struct bcm2835_desc *desc = container_of(vd, struct bcm2835_desc, vd); +- int i; ++ size_t i; + + for (i = 0; i < desc->frames; i++) + dma_pool_free(desc->c->cb_pool, desc->cb_list[i].cb, + desc->cb_list[i].paddr); + +- kfree(desc->cb_list); + kfree(desc); + } + ++static void bcm2835_dma_desc_free(struct virt_dma_desc *vd) ++{ ++ bcm2835_dma_free_cb_chain( ++ container_of(vd, struct bcm2835_desc, vd)); ++} ++ ++static void bcm2835_dma_create_cb_set_length( ++ struct bcm2835_chan *chan, ++ struct bcm2835_dma_cb *control_block, ++ size_t len, ++ size_t period_len, ++ size_t *total_len, ++ u32 finalextrainfo) ++{ ++ /* set the length */ ++ control_block->length = len; ++ ++ /* finished if we have no period_length */ ++ if (!period_len) ++ return; ++ ++ /* ++ * period_len means: that we need to generate ++ * transfers that are terminating at every ++ * multiple of period_len - this is typically ++ * used to set the interrupt flag in info ++ * which is required during cyclic transfers ++ */ ++ ++ /* have we filled in period_length yet? */ ++ if (*total_len + control_block->length < period_len) ++ return; ++ ++ /* calculate the length that remains to reach period_length */ ++ control_block->length = period_len - *total_len; ++ ++ /* reset total_length for next period */ ++ *total_len = 0; ++ ++ /* add extrainfo bits in info */ ++ control_block->info |= finalextrainfo; ++} ++ ++/** ++ * bcm2835_dma_create_cb_chain - create a control block and fills data in ++ * ++ * @chan: the @dma_chan for which we run this ++ * @direction: the direction in which we transfer ++ * @cyclic: it is a cyclic transfer ++ * @info: the default info bits to apply per controlblock ++ * @frames: number of controlblocks to allocate ++ * @src: the src address to assign (if the S_INC bit is set ++ * in @info, then it gets incremented) ++ * @dst: the dst address to assign (if the D_INC bit is set ++ * in @info, then it gets incremented) ++ * @buf_len: the full buffer length (may also be 0) ++ * @period_len: the period length when to apply @finalextrainfo ++ * in addition to the last transfer ++ * this will also break some control-blocks early ++ * @finalextrainfo: additional bits in last controlblock ++ * (or when period_len is reached in case of cyclic) ++ * @gfp: the GFP flag to use for allocation ++ */ ++static struct bcm2835_desc *bcm2835_dma_create_cb_chain( ++ struct dma_chan *chan, enum dma_transfer_direction direction, ++ bool cyclic, u32 info, u32 finalextrainfo, size_t frames, ++ dma_addr_t src, dma_addr_t dst, size_t buf_len, ++ size_t period_len, gfp_t gfp) ++{ ++ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); ++ size_t len = buf_len, total_len; ++ size_t frame; ++ struct bcm2835_desc *d; ++ struct bcm2835_cb_entry *cb_entry; ++ struct bcm2835_dma_cb *control_block; ++ ++ /* allocate and setup the descriptor. */ ++ d = kzalloc(sizeof(*d) + frames * sizeof(struct bcm2835_cb_entry), ++ gfp); ++ if (!d) ++ return NULL; ++ ++ d->c = c; ++ d->dir = direction; ++ d->cyclic = cyclic; ++ ++ /* ++ * Iterate over all frames, create a control block ++ * for each frame and link them together. ++ */ ++ for (frame = 0, total_len = 0; frame < frames; d->frames++, frame++) { ++ cb_entry = &d->cb_list[frame]; ++ cb_entry->cb = dma_pool_alloc(c->cb_pool, gfp, ++ &cb_entry->paddr); ++ if (!cb_entry->cb) ++ goto error_cb; ++ ++ /* fill in the control block */ ++ control_block = cb_entry->cb; ++ control_block->info = info; ++ control_block->src = src; ++ control_block->dst = dst; ++ control_block->stride = 0; ++ control_block->next = 0; ++ /* set up length in control_block if requested */ ++ if (buf_len) { ++ /* calculate length honoring period_length */ ++ bcm2835_dma_create_cb_set_length( ++ c, control_block, ++ len, period_len, &total_len, ++ cyclic ? finalextrainfo : 0); ++ ++ /* calculate new remaining length */ ++ len -= control_block->length; ++ } ++ ++ /* link this the last controlblock */ ++ if (frame) ++ d->cb_list[frame - 1].cb->next = cb_entry->paddr; ++ ++ /* update src and dst and length */ ++ if (src && (info & BCM2835_DMA_S_INC)) ++ src += control_block->length; ++ if (dst && (info & BCM2835_DMA_D_INC)) ++ dst += control_block->length; ++ ++ /* Length of total transfer */ ++ d->size += control_block->length; ++ } ++ ++ /* the last frame requires extra flags */ ++ d->cb_list[d->frames - 1].cb->info |= finalextrainfo; ++ ++ /* detect a size missmatch */ ++ if (buf_len && (d->size != buf_len)) ++ goto error_cb; ++ ++ return d; ++error_cb: ++ bcm2835_dma_free_cb_chain(d); ++ ++ return NULL; ++} ++ + static int bcm2835_dma_abort(void __iomem *chan_base) + { + unsigned long cs; +@@ -391,12 +540,11 @@ static struct dma_async_tx_descriptor *b + unsigned long flags) + { + struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); +- enum dma_slave_buswidth dev_width; + struct bcm2835_desc *d; +- dma_addr_t dev_addr; +- unsigned int es, sync_type; +- unsigned int frame; +- int i; ++ dma_addr_t src, dst; ++ u32 info = BCM2835_DMA_WAIT_RESP; ++ u32 extra = BCM2835_DMA_INT_EN; ++ size_t frames; + + /* Grab configuration */ + if (!is_slave_direction(direction)) { +@@ -404,104 +552,58 @@ static struct dma_async_tx_descriptor *b + return NULL; + } + +- if (direction == DMA_DEV_TO_MEM) { +- dev_addr = c->cfg.src_addr; +- dev_width = c->cfg.src_addr_width; +- sync_type = BCM2835_DMA_S_DREQ; +- } else { +- dev_addr = c->cfg.dst_addr; +- dev_width = c->cfg.dst_addr_width; +- sync_type = BCM2835_DMA_D_DREQ; +- } +- +- /* Bus width translates to the element size (ES) */ +- switch (dev_width) { +- case DMA_SLAVE_BUSWIDTH_4_BYTES: +- es = BCM2835_DMA_DATA_TYPE_S32; +- break; +- default: ++ if (!buf_len) { ++ dev_err(chan->device->dev, ++ "%s: bad buffer length (= 0)\n", __func__); + return NULL; + } + +- /* Now allocate and setup the descriptor. */ +- d = kzalloc(sizeof(*d), GFP_NOWAIT); +- if (!d) +- return NULL; +- +- d->c = c; +- d->dir = direction; +- d->frames = buf_len / period_len; +- d->cyclic = true; ++ /* ++ * warn if buf_len is not a multiple of period_len - this may leed ++ * to unexpected latencies for interrupts and thus audiable clicks ++ */ ++ if (buf_len % period_len) ++ dev_warn_once(chan->device->dev, ++ "%s: buffer_length (%zd) is not a multiple of period_len (%zd)\n", ++ __func__, buf_len, period_len); ++ ++ /* Setup DREQ channel */ ++ if (c->dreq != 0) ++ info |= BCM2835_DMA_PER_MAP(c->dreq); + +- d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); +- if (!d->cb_list) { +- kfree(d); +- return NULL; ++ if (direction == DMA_DEV_TO_MEM) { ++ if (c->cfg.src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) ++ return NULL; ++ src = c->cfg.src_addr; ++ dst = buf_addr; ++ info |= BCM2835_DMA_S_DREQ | BCM2835_DMA_D_INC; ++ } else { ++ if (c->cfg.dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) ++ return NULL; ++ dst = c->cfg.dst_addr; ++ src = buf_addr; ++ info |= BCM2835_DMA_D_DREQ | BCM2835_DMA_S_INC; + } +- /* Allocate memory for control blocks */ +- for (i = 0; i < d->frames; i++) { +- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; + +- cb_entry->cb = dma_pool_zalloc(c->cb_pool, GFP_ATOMIC, +- &cb_entry->paddr); +- if (!cb_entry->cb) +- goto error_cb; +- } ++ /* calculate number of frames */ ++ frames = DIV_ROUND_UP(buf_len, period_len); + + /* +- * Iterate over all frames, create a control block +- * for each frame and link them together. ++ * allocate the CB chain ++ * note that we need to use GFP_NOWAIT, as the ALSA i2s dmaengine ++ * implementation calls prep_dma_cyclic with interrupts disabled. + */ +- for (frame = 0; frame < d->frames; frame++) { +- struct bcm2835_dma_cb *control_block = d->cb_list[frame].cb; +- +- /* Setup adresses */ +- if (d->dir == DMA_DEV_TO_MEM) { +- control_block->info = BCM2835_DMA_D_INC; +- control_block->src = dev_addr; +- control_block->dst = buf_addr + frame * period_len; +- } else { +- control_block->info = BCM2835_DMA_S_INC; +- control_block->src = buf_addr + frame * period_len; +- control_block->dst = dev_addr; +- } +- +- /* Enable interrupt */ +- control_block->info |= BCM2835_DMA_INT_EN; +- +- /* Setup synchronization */ +- if (sync_type != 0) +- control_block->info |= sync_type; +- +- /* Setup DREQ channel */ +- if (c->dreq != 0) +- control_block->info |= +- BCM2835_DMA_PER_MAP(c->dreq); +- +- /* Length of a frame */ +- control_block->length = period_len; +- d->size += control_block->length; ++ d = bcm2835_dma_create_cb_chain(chan, direction, true, ++ info, extra, ++ frames, src, dst, buf_len, ++ period_len, GFP_NOWAIT); ++ if (!d) ++ return NULL; + +- /* +- * Next block is the next frame. +- * This DMA engine driver currently only supports cyclic DMA. +- * Therefore, wrap around at number of frames. +- */ +- control_block->next = d->cb_list[((frame + 1) % d->frames)].paddr; +- } ++ /* wrap around into a loop */ ++ d->cb_list[d->frames - 1].cb->next = d->cb_list[0].paddr; + + return vchan_tx_prep(&c->vc, &d->vd, flags); +-error_cb: +- i--; +- for (; i >= 0; i--) { +- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; +- +- dma_pool_free(c->cb_pool, cb_entry->cb, cb_entry->paddr); +- } +- +- kfree(d->cb_list); +- kfree(d); +- return NULL; + } + + static int bcm2835_dma_slave_config(struct dma_chan *chan, diff --git a/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch b/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch deleted file mode 100644 index 8b97f112be..0000000000 --- a/target/linux/brcm2708/patches-4.4/0396-dmaengine-bcm2835-move-cyclic-member-from-bcm2835_ch.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 51fa7004613fc6a4567938f0a8358346ca602b5f Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 16 Mar 2016 12:24:58 -0700 -Subject: [PATCH 396/423] dmaengine: bcm2835: move cyclic member from - bcm2835_chan into bcm2835_desc - -In preparation to consolidating code we move the cyclic member -into the bcm_2835_desc structure. - -Signed-off-by: Martin Sperl -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -73,7 +73,6 @@ struct bcm2835_chan { - struct list_head node; - - struct dma_slave_config cfg; -- bool cyclic; - unsigned int dreq; - - int ch; -@@ -93,6 +92,8 @@ struct bcm2835_desc { - - unsigned int frames; - size_t size; -+ -+ bool cyclic; - }; - - #define BCM2835_DMA_CS 0x00 -@@ -377,8 +378,6 @@ static void bcm2835_dma_issue_pending(st - struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); - unsigned long flags; - -- c->cyclic = true; /* Nothing else is implemented */ -- - spin_lock_irqsave(&c->vc.lock, flags); - if (vchan_issue_pending(&c->vc) && !c->desc) - bcm2835_dma_start_desc(c); -@@ -432,6 +431,7 @@ static struct dma_async_tx_descriptor *b - d->c = c; - d->dir = direction; - d->frames = buf_len / period_len; -+ d->cyclic = true; - - d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); - if (!d->cb_list) { diff --git a/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch b/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch new file mode 100644 index 0000000000..65b402a86e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch @@ -0,0 +1,114 @@ +From 350247e0611f171a3372386e389e24746daff84f Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Wed, 16 Mar 2016 12:25:00 -0700 +Subject: [PATCH] dmaengine: bcm2835: limit max length based on channel type + +The bcm2835 dma system has 2 basic types of dma-channels: +* "normal" channels +* "light" channels + +Lite channels are limited in several aspects: +* internal data-structure is 128 bit (not 256) +* does not support BCM2835_DMA_TDMODE (2D) +* DMA length register is limited to 16 bit. + so 0-65535 (not 0-65536 as mentioned in the official datasheet) +* BCM2835_DMA_S/D_IGNORE are not supported + +The detection of the type of mode is implemented by looking at +the LITE bit in the DEBUG register for each channel. +This allows automatic detection. + +Based on this the maximum block size is set to (64K - 4) or to 1G +and this limit is honored during generation of control block +chains. The effect is that when a LITE channel is used more +control blocks are used to do the same transfer (compared +to a normal channel). + +As there are several sources/target DREQS that are 32 bit wide +we need to have the transfer to be a multiple of 4 as this would +break the transfer otherwise. + +This is why the limit of (64K - 4) was chosen over the +alternative of (64K - 4K). + +Signed-off-by: Martin Sperl +Reviewed-by: Eric Anholt +Signed-off-by: Eric Anholt +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 29 ++++++++++++++++++++++++++--- + 1 file changed, 26 insertions(+), 3 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -81,6 +81,8 @@ struct bcm2835_chan { + + void __iomem *chan_base; + int irq_number; ++ ++ bool is_lite_channel; + }; + + struct bcm2835_desc { +@@ -169,6 +171,16 @@ struct bcm2835_desc { + #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ + #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) + ++/* the max dma length for different channels */ ++#define MAX_DMA_LEN SZ_1G ++#define MAX_LITE_DMA_LEN (SZ_64K - 4) ++ ++static inline size_t bcm2835_dma_max_frame_length(struct bcm2835_chan *c) ++{ ++ /* lite and normal channels have different max frame length */ ++ return c->is_lite_channel ? MAX_LITE_DMA_LEN : MAX_DMA_LEN; ++} ++ + /* how many frames of max_len size do we need to transfer len bytes */ + static inline size_t bcm2835_dma_frames_for_length(size_t len, + size_t max_len) +@@ -217,8 +229,10 @@ static void bcm2835_dma_create_cb_set_le + size_t *total_len, + u32 finalextrainfo) + { +- /* set the length */ +- control_block->length = len; ++ size_t max_len = bcm2835_dma_max_frame_length(chan); ++ ++ /* set the length taking lite-channel limitations into account */ ++ control_block->length = min_t(u32, len, max_len); + + /* finished if we have no period_length */ + if (!period_len) +@@ -544,6 +558,7 @@ static struct dma_async_tx_descriptor *b + dma_addr_t src, dst; + u32 info = BCM2835_DMA_WAIT_RESP; + u32 extra = BCM2835_DMA_INT_EN; ++ size_t max_len = bcm2835_dma_max_frame_length(c); + size_t frames; + + /* Grab configuration */ +@@ -586,7 +601,10 @@ static struct dma_async_tx_descriptor *b + } + + /* calculate number of frames */ +- frames = DIV_ROUND_UP(buf_len, period_len); ++ frames = /* number of periods */ ++ DIV_ROUND_UP(buf_len, period_len) * ++ /* number of frames per period */ ++ bcm2835_dma_frames_for_length(period_len, max_len); + + /* + * allocate the CB chain +@@ -685,6 +703,11 @@ static int bcm2835_dma_chan_init(struct + c->ch = chan_id; + c->irq_number = irq; + ++ /* check in DEBUG register if this is a LITE channel */ ++ if (readl(c->chan_base + BCM2835_DMA_DEBUG) & ++ BCM2835_DMA_DEBUG_LITE) ++ c->is_lite_channel = true; ++ + return 0; + } + diff --git a/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-move-controlblock-chain-generation.patch b/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-move-controlblock-chain-generation.patch deleted file mode 100644 index f998a880f2..0000000000 --- a/target/linux/brcm2708/patches-4.4/0397-dmaengine-bcm2835-move-controlblock-chain-generation.patch +++ /dev/null @@ -1,378 +0,0 @@ -From b181092e7661f90e4777e0b858e601a33c1e5af9 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 16 Mar 2016 12:24:59 -0700 -Subject: [PATCH 397/423] dmaengine: bcm2835: move controlblock chain - generation into separate method - -In preparation of adding slave_sg functionality this patch moves the -generation/allocation of bcm2835_desc and the building of -the corresponding DMA-control-block chain from bcm2835_dma_prep_dma_cyclic -into the newly created method bcm2835_dma_create_cb_chain. - -Signed-off-by: Martin Sperl -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 294 +++++++++++++++++++++++++++++++--------------- - 1 file changed, 198 insertions(+), 96 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -88,12 +88,12 @@ struct bcm2835_desc { - struct virt_dma_desc vd; - enum dma_transfer_direction dir; - -- struct bcm2835_cb_entry *cb_list; -- - unsigned int frames; - size_t size; - - bool cyclic; -+ -+ struct bcm2835_cb_entry cb_list[]; - }; - - #define BCM2835_DMA_CS 0x00 -@@ -169,6 +169,13 @@ struct bcm2835_desc { - #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ - #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) - -+/* how many frames of max_len size do we need to transfer len bytes */ -+static inline size_t bcm2835_dma_frames_for_length(size_t len, -+ size_t max_len) -+{ -+ return DIV_ROUND_UP(len, max_len); -+} -+ - static inline struct bcm2835_dmadev *to_bcm2835_dma_dev(struct dma_device *d) - { - return container_of(d, struct bcm2835_dmadev, ddev); -@@ -185,19 +192,161 @@ static inline struct bcm2835_desc *to_bc - return container_of(t, struct bcm2835_desc, vd.tx); - } - --static void bcm2835_dma_desc_free(struct virt_dma_desc *vd) -+static void bcm2835_dma_free_cb_chain(struct bcm2835_desc *desc) - { -- struct bcm2835_desc *desc = container_of(vd, struct bcm2835_desc, vd); -- int i; -+ size_t i; - - for (i = 0; i < desc->frames; i++) - dma_pool_free(desc->c->cb_pool, desc->cb_list[i].cb, - desc->cb_list[i].paddr); - -- kfree(desc->cb_list); - kfree(desc); - } - -+static void bcm2835_dma_desc_free(struct virt_dma_desc *vd) -+{ -+ bcm2835_dma_free_cb_chain( -+ container_of(vd, struct bcm2835_desc, vd)); -+} -+ -+static void bcm2835_dma_create_cb_set_length( -+ struct bcm2835_chan *chan, -+ struct bcm2835_dma_cb *control_block, -+ size_t len, -+ size_t period_len, -+ size_t *total_len, -+ u32 finalextrainfo) -+{ -+ /* set the length */ -+ control_block->length = len; -+ -+ /* finished if we have no period_length */ -+ if (!period_len) -+ return; -+ -+ /* -+ * period_len means: that we need to generate -+ * transfers that are terminating at every -+ * multiple of period_len - this is typically -+ * used to set the interrupt flag in info -+ * which is required during cyclic transfers -+ */ -+ -+ /* have we filled in period_length yet? */ -+ if (*total_len + control_block->length < period_len) -+ return; -+ -+ /* calculate the length that remains to reach period_length */ -+ control_block->length = period_len - *total_len; -+ -+ /* reset total_length for next period */ -+ *total_len = 0; -+ -+ /* add extrainfo bits in info */ -+ control_block->info |= finalextrainfo; -+} -+ -+/** -+ * bcm2835_dma_create_cb_chain - create a control block and fills data in -+ * -+ * @chan: the @dma_chan for which we run this -+ * @direction: the direction in which we transfer -+ * @cyclic: it is a cyclic transfer -+ * @info: the default info bits to apply per controlblock -+ * @frames: number of controlblocks to allocate -+ * @src: the src address to assign (if the S_INC bit is set -+ * in @info, then it gets incremented) -+ * @dst: the dst address to assign (if the D_INC bit is set -+ * in @info, then it gets incremented) -+ * @buf_len: the full buffer length (may also be 0) -+ * @period_len: the period length when to apply @finalextrainfo -+ * in addition to the last transfer -+ * this will also break some control-blocks early -+ * @finalextrainfo: additional bits in last controlblock -+ * (or when period_len is reached in case of cyclic) -+ * @gfp: the GFP flag to use for allocation -+ */ -+static struct bcm2835_desc *bcm2835_dma_create_cb_chain( -+ struct dma_chan *chan, enum dma_transfer_direction direction, -+ bool cyclic, u32 info, u32 finalextrainfo, size_t frames, -+ dma_addr_t src, dma_addr_t dst, size_t buf_len, -+ size_t period_len, gfp_t gfp) -+{ -+ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); -+ size_t len = buf_len, total_len; -+ size_t frame; -+ struct bcm2835_desc *d; -+ struct bcm2835_cb_entry *cb_entry; -+ struct bcm2835_dma_cb *control_block; -+ -+ /* allocate and setup the descriptor. */ -+ d = kzalloc(sizeof(*d) + frames * sizeof(struct bcm2835_cb_entry), -+ gfp); -+ if (!d) -+ return NULL; -+ -+ d->c = c; -+ d->dir = direction; -+ d->cyclic = cyclic; -+ -+ /* -+ * Iterate over all frames, create a control block -+ * for each frame and link them together. -+ */ -+ for (frame = 0, total_len = 0; frame < frames; d->frames++, frame++) { -+ cb_entry = &d->cb_list[frame]; -+ cb_entry->cb = dma_pool_alloc(c->cb_pool, gfp, -+ &cb_entry->paddr); -+ if (!cb_entry->cb) -+ goto error_cb; -+ -+ /* fill in the control block */ -+ control_block = cb_entry->cb; -+ control_block->info = info; -+ control_block->src = src; -+ control_block->dst = dst; -+ control_block->stride = 0; -+ control_block->next = 0; -+ /* set up length in control_block if requested */ -+ if (buf_len) { -+ /* calculate length honoring period_length */ -+ bcm2835_dma_create_cb_set_length( -+ c, control_block, -+ len, period_len, &total_len, -+ cyclic ? finalextrainfo : 0); -+ -+ /* calculate new remaining length */ -+ len -= control_block->length; -+ } -+ -+ /* link this the last controlblock */ -+ if (frame) -+ d->cb_list[frame - 1].cb->next = cb_entry->paddr; -+ -+ /* update src and dst and length */ -+ if (src && (info & BCM2835_DMA_S_INC)) -+ src += control_block->length; -+ if (dst && (info & BCM2835_DMA_D_INC)) -+ dst += control_block->length; -+ -+ /* Length of total transfer */ -+ d->size += control_block->length; -+ } -+ -+ /* the last frame requires extra flags */ -+ d->cb_list[d->frames - 1].cb->info |= finalextrainfo; -+ -+ /* detect a size missmatch */ -+ if (buf_len && (d->size != buf_len)) -+ goto error_cb; -+ -+ return d; -+error_cb: -+ bcm2835_dma_free_cb_chain(d); -+ -+ return NULL; -+} -+ - static int bcm2835_dma_abort(void __iomem *chan_base) - { - unsigned long cs; -@@ -391,12 +540,11 @@ static struct dma_async_tx_descriptor *b - unsigned long flags) - { - struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); -- enum dma_slave_buswidth dev_width; - struct bcm2835_desc *d; -- dma_addr_t dev_addr; -- unsigned int es, sync_type; -- unsigned int frame; -- int i; -+ dma_addr_t src, dst; -+ u32 info = BCM2835_DMA_WAIT_RESP; -+ u32 extra = BCM2835_DMA_INT_EN; -+ size_t frames; - - /* Grab configuration */ - if (!is_slave_direction(direction)) { -@@ -404,104 +552,58 @@ static struct dma_async_tx_descriptor *b - return NULL; - } - -- if (direction == DMA_DEV_TO_MEM) { -- dev_addr = c->cfg.src_addr; -- dev_width = c->cfg.src_addr_width; -- sync_type = BCM2835_DMA_S_DREQ; -- } else { -- dev_addr = c->cfg.dst_addr; -- dev_width = c->cfg.dst_addr_width; -- sync_type = BCM2835_DMA_D_DREQ; -- } -- -- /* Bus width translates to the element size (ES) */ -- switch (dev_width) { -- case DMA_SLAVE_BUSWIDTH_4_BYTES: -- es = BCM2835_DMA_DATA_TYPE_S32; -- break; -- default: -+ if (!buf_len) { -+ dev_err(chan->device->dev, -+ "%s: bad buffer length (= 0)\n", __func__); - return NULL; - } - -- /* Now allocate and setup the descriptor. */ -- d = kzalloc(sizeof(*d), GFP_NOWAIT); -- if (!d) -- return NULL; -- -- d->c = c; -- d->dir = direction; -- d->frames = buf_len / period_len; -- d->cyclic = true; -+ /* -+ * warn if buf_len is not a multiple of period_len - this may leed -+ * to unexpected latencies for interrupts and thus audiable clicks -+ */ -+ if (buf_len % period_len) -+ dev_warn_once(chan->device->dev, -+ "%s: buffer_length (%zd) is not a multiple of period_len (%zd)\n", -+ __func__, buf_len, period_len); -+ -+ /* Setup DREQ channel */ -+ if (c->dreq != 0) -+ info |= BCM2835_DMA_PER_MAP(c->dreq); - -- d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); -- if (!d->cb_list) { -- kfree(d); -- return NULL; -+ if (direction == DMA_DEV_TO_MEM) { -+ if (c->cfg.src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) -+ return NULL; -+ src = c->cfg.src_addr; -+ dst = buf_addr; -+ info |= BCM2835_DMA_S_DREQ | BCM2835_DMA_D_INC; -+ } else { -+ if (c->cfg.dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) -+ return NULL; -+ dst = c->cfg.dst_addr; -+ src = buf_addr; -+ info |= BCM2835_DMA_D_DREQ | BCM2835_DMA_S_INC; - } -- /* Allocate memory for control blocks */ -- for (i = 0; i < d->frames; i++) { -- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; - -- cb_entry->cb = dma_pool_zalloc(c->cb_pool, GFP_ATOMIC, -- &cb_entry->paddr); -- if (!cb_entry->cb) -- goto error_cb; -- } -+ /* calculate number of frames */ -+ frames = DIV_ROUND_UP(buf_len, period_len); - - /* -- * Iterate over all frames, create a control block -- * for each frame and link them together. -+ * allocate the CB chain -+ * note that we need to use GFP_NOWAIT, as the ALSA i2s dmaengine -+ * implementation calls prep_dma_cyclic with interrupts disabled. - */ -- for (frame = 0; frame < d->frames; frame++) { -- struct bcm2835_dma_cb *control_block = d->cb_list[frame].cb; -- -- /* Setup adresses */ -- if (d->dir == DMA_DEV_TO_MEM) { -- control_block->info = BCM2835_DMA_D_INC; -- control_block->src = dev_addr; -- control_block->dst = buf_addr + frame * period_len; -- } else { -- control_block->info = BCM2835_DMA_S_INC; -- control_block->src = buf_addr + frame * period_len; -- control_block->dst = dev_addr; -- } -- -- /* Enable interrupt */ -- control_block->info |= BCM2835_DMA_INT_EN; -- -- /* Setup synchronization */ -- if (sync_type != 0) -- control_block->info |= sync_type; -- -- /* Setup DREQ channel */ -- if (c->dreq != 0) -- control_block->info |= -- BCM2835_DMA_PER_MAP(c->dreq); -- -- /* Length of a frame */ -- control_block->length = period_len; -- d->size += control_block->length; -+ d = bcm2835_dma_create_cb_chain(chan, direction, true, -+ info, extra, -+ frames, src, dst, buf_len, -+ period_len, GFP_NOWAIT); -+ if (!d) -+ return NULL; - -- /* -- * Next block is the next frame. -- * This DMA engine driver currently only supports cyclic DMA. -- * Therefore, wrap around at number of frames. -- */ -- control_block->next = d->cb_list[((frame + 1) % d->frames)].paddr; -- } -+ /* wrap around into a loop */ -+ d->cb_list[d->frames - 1].cb->next = d->cb_list[0].paddr; - - return vchan_tx_prep(&c->vc, &d->vd, flags); --error_cb: -- i--; -- for (; i >= 0; i--) { -- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; -- -- dma_pool_free(c->cb_pool, cb_entry->cb, cb_entry->paddr); -- } -- -- kfree(d->cb_list); -- kfree(d); -- return NULL; - } - - static int bcm2835_dma_slave_config(struct dma_chan *chan, diff --git a/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch b/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch new file mode 100644 index 0000000000..ef1b43357e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch @@ -0,0 +1,182 @@ +From 9026efd53eae4b320941e581f141ddc87f2adc20 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Wed, 16 Mar 2016 12:25:01 -0700 +Subject: [PATCH] dmaengine: bcm2835: add slave_sg support to bcm2835-dma + +Add slave_sg support to bcm2835-dma using shared allocation +code for bcm2835_desc and DMA-control blocks already used by +dma_cyclic. + +Note that bcm2835_dma_callback had to get modified to support +both modes of operation (cyclic and non-cyclic). + +Tested using: +* Hifiberry I2S card (using cyclic DMA) +* fb_st7735r SPI-framebuffer (using slave_sg DMA via spi-bcm2835) +playing BigBuckBunny for audio and video. + +Signed-off-by: Martin Sperl +Reviewed-by: Eric Anholt +Signed-off-by: Eric Anholt +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 113 ++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 108 insertions(+), 5 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -260,6 +260,23 @@ static void bcm2835_dma_create_cb_set_le + control_block->info |= finalextrainfo; + } + ++static inline size_t bcm2835_dma_count_frames_for_sg( ++ struct bcm2835_chan *c, ++ struct scatterlist *sgl, ++ unsigned int sg_len) ++{ ++ size_t frames = 0; ++ struct scatterlist *sgent; ++ unsigned int i; ++ size_t plength = bcm2835_dma_max_frame_length(c); ++ ++ for_each_sg(sgl, sgent, sg_len, i) ++ frames += bcm2835_dma_frames_for_length( ++ sg_dma_len(sgent), plength); ++ ++ return frames; ++} ++ + /** + * bcm2835_dma_create_cb_chain - create a control block and fills data in + * +@@ -361,6 +378,32 @@ error_cb: + return NULL; + } + ++static void bcm2835_dma_fill_cb_chain_with_sg( ++ struct dma_chan *chan, ++ enum dma_transfer_direction direction, ++ struct bcm2835_cb_entry *cb, ++ struct scatterlist *sgl, ++ unsigned int sg_len) ++{ ++ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); ++ size_t max_len = bcm2835_dma_max_frame_length(c); ++ unsigned int i, len; ++ dma_addr_t addr; ++ struct scatterlist *sgent; ++ ++ for_each_sg(sgl, sgent, sg_len, i) { ++ for (addr = sg_dma_address(sgent), len = sg_dma_len(sgent); ++ len > 0; ++ addr += cb->cb->length, len -= cb->cb->length, cb++) { ++ if (direction == DMA_DEV_TO_MEM) ++ cb->cb->dst = addr; ++ else ++ cb->cb->src = addr; ++ cb->cb->length = min(len, max_len); ++ } ++ } ++} ++ + static int bcm2835_dma_abort(void __iomem *chan_base) + { + unsigned long cs; +@@ -428,13 +471,19 @@ static irqreturn_t bcm2835_dma_callback( + d = c->desc; + + if (d) { +- /* TODO Only works for cyclic DMA */ +- vchan_cyclic_callback(&d->vd); ++ if (d->cyclic) { ++ /* call the cyclic callback */ ++ vchan_cyclic_callback(&d->vd); ++ ++ /* Keep the DMA engine running */ ++ writel(BCM2835_DMA_ACTIVE, ++ c->chan_base + BCM2835_DMA_CS); ++ } else { ++ vchan_cookie_complete(&c->desc->vd); ++ bcm2835_dma_start_desc(c); ++ } + } + +- /* Keep the DMA engine running */ +- writel(BCM2835_DMA_ACTIVE, c->chan_base + BCM2835_DMA_CS); +- + spin_unlock_irqrestore(&c->vc.lock, flags); + + return IRQ_HANDLED; +@@ -548,6 +597,58 @@ static void bcm2835_dma_issue_pending(st + spin_unlock_irqrestore(&c->vc.lock, flags); + } + ++static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( ++ struct dma_chan *chan, ++ struct scatterlist *sgl, unsigned int sg_len, ++ enum dma_transfer_direction direction, ++ unsigned long flags, void *context) ++{ ++ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); ++ struct bcm2835_desc *d; ++ dma_addr_t src = 0, dst = 0; ++ u32 info = BCM2835_DMA_WAIT_RESP; ++ u32 extra = BCM2835_DMA_INT_EN; ++ size_t frames; ++ ++ if (!is_slave_direction(direction)) { ++ dev_err(chan->device->dev, ++ "%s: bad direction?\n", __func__); ++ return NULL; ++ } ++ ++ if (c->dreq != 0) ++ info |= BCM2835_DMA_PER_MAP(c->dreq); ++ ++ if (direction == DMA_DEV_TO_MEM) { ++ if (c->cfg.src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) ++ return NULL; ++ src = c->cfg.src_addr; ++ info |= BCM2835_DMA_S_DREQ | BCM2835_DMA_D_INC; ++ } else { ++ if (c->cfg.dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) ++ return NULL; ++ dst = c->cfg.dst_addr; ++ info |= BCM2835_DMA_D_DREQ | BCM2835_DMA_S_INC; ++ } ++ ++ /* count frames in sg list */ ++ frames = bcm2835_dma_count_frames_for_sg(c, sgl, sg_len); ++ ++ /* allocate the CB chain */ ++ d = bcm2835_dma_create_cb_chain(chan, direction, false, ++ info, extra, ++ frames, src, dst, 0, 0, ++ GFP_KERNEL); ++ if (!d) ++ return NULL; ++ ++ /* fill in frames with scatterlist pointers */ ++ bcm2835_dma_fill_cb_chain_with_sg(chan, direction, d->cb_list, ++ sgl, sg_len); ++ ++ return vchan_tx_prep(&c->vc, &d->vd, flags); ++} ++ + static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic( + struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, + size_t period_len, enum dma_transfer_direction direction, +@@ -778,11 +879,13 @@ static int bcm2835_dma_probe(struct plat + dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); + dma_cap_set(DMA_PRIVATE, od->ddev.cap_mask); + dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask); ++ dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); + od->ddev.device_alloc_chan_resources = bcm2835_dma_alloc_chan_resources; + od->ddev.device_free_chan_resources = bcm2835_dma_free_chan_resources; + od->ddev.device_tx_status = bcm2835_dma_tx_status; + od->ddev.device_issue_pending = bcm2835_dma_issue_pending; + od->ddev.device_prep_dma_cyclic = bcm2835_dma_prep_dma_cyclic; ++ od->ddev.device_prep_slave_sg = bcm2835_dma_prep_slave_sg; + od->ddev.device_config = bcm2835_dma_slave_config; + od->ddev.device_terminate_all = bcm2835_dma_terminate_all; + od->ddev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); diff --git a/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch b/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch deleted file mode 100644 index e679850e5a..0000000000 --- a/target/linux/brcm2708/patches-4.4/0398-dmaengine-bcm2835-limit-max-length-based-on-channel-.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 930015dce415e4203daeafb09c24759ac883613e Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 16 Mar 2016 12:25:00 -0700 -Subject: [PATCH 398/423] dmaengine: bcm2835: limit max length based on channel - type - -The bcm2835 dma system has 2 basic types of dma-channels: -* "normal" channels -* "light" channels - -Lite channels are limited in several aspects: -* internal data-structure is 128 bit (not 256) -* does not support BCM2835_DMA_TDMODE (2D) -* DMA length register is limited to 16 bit. - so 0-65535 (not 0-65536 as mentioned in the official datasheet) -* BCM2835_DMA_S/D_IGNORE are not supported - -The detection of the type of mode is implemented by looking at -the LITE bit in the DEBUG register for each channel. -This allows automatic detection. - -Based on this the maximum block size is set to (64K - 4) or to 1G -and this limit is honored during generation of control block -chains. The effect is that when a LITE channel is used more -control blocks are used to do the same transfer (compared -to a normal channel). - -As there are several sources/target DREQS that are 32 bit wide -we need to have the transfer to be a multiple of 4 as this would -break the transfer otherwise. - -This is why the limit of (64K - 4) was chosen over the -alternative of (64K - 4K). - -Signed-off-by: Martin Sperl -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 29 ++++++++++++++++++++++++++--- - 1 file changed, 26 insertions(+), 3 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -81,6 +81,8 @@ struct bcm2835_chan { - - void __iomem *chan_base; - int irq_number; -+ -+ bool is_lite_channel; - }; - - struct bcm2835_desc { -@@ -169,6 +171,16 @@ struct bcm2835_desc { - #define BCM2835_DMA_CHAN(n) ((n) << 8) /* Base address */ - #define BCM2835_DMA_CHANIO(base, n) ((base) + BCM2835_DMA_CHAN(n)) - -+/* the max dma length for different channels */ -+#define MAX_DMA_LEN SZ_1G -+#define MAX_LITE_DMA_LEN (SZ_64K - 4) -+ -+static inline size_t bcm2835_dma_max_frame_length(struct bcm2835_chan *c) -+{ -+ /* lite and normal channels have different max frame length */ -+ return c->is_lite_channel ? MAX_LITE_DMA_LEN : MAX_DMA_LEN; -+} -+ - /* how many frames of max_len size do we need to transfer len bytes */ - static inline size_t bcm2835_dma_frames_for_length(size_t len, - size_t max_len) -@@ -217,8 +229,10 @@ static void bcm2835_dma_create_cb_set_le - size_t *total_len, - u32 finalextrainfo) - { -- /* set the length */ -- control_block->length = len; -+ size_t max_len = bcm2835_dma_max_frame_length(chan); -+ -+ /* set the length taking lite-channel limitations into account */ -+ control_block->length = min_t(u32, len, max_len); - - /* finished if we have no period_length */ - if (!period_len) -@@ -544,6 +558,7 @@ static struct dma_async_tx_descriptor *b - dma_addr_t src, dst; - u32 info = BCM2835_DMA_WAIT_RESP; - u32 extra = BCM2835_DMA_INT_EN; -+ size_t max_len = bcm2835_dma_max_frame_length(c); - size_t frames; - - /* Grab configuration */ -@@ -586,7 +601,10 @@ static struct dma_async_tx_descriptor *b - } - - /* calculate number of frames */ -- frames = DIV_ROUND_UP(buf_len, period_len); -+ frames = /* number of periods */ -+ DIV_ROUND_UP(buf_len, period_len) * -+ /* number of frames per period */ -+ bcm2835_dma_frames_for_length(period_len, max_len); - - /* - * allocate the CB chain -@@ -685,6 +703,11 @@ static int bcm2835_dma_chan_init(struct - c->ch = chan_id; - c->irq_number = irq; - -+ /* check in DEBUG register if this is a LITE channel */ -+ if (readl(c->chan_base + BCM2835_DMA_DEBUG) & -+ BCM2835_DMA_DEBUG_LITE) -+ c->is_lite_channel = true; -+ - return 0; - } - diff --git a/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch b/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch new file mode 100644 index 0000000000..a7b50a5261 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch @@ -0,0 +1,87 @@ +From 24392a5f014f3106442cef99e9956d0f826337e3 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Wed, 16 Mar 2016 12:25:02 -0700 +Subject: [PATCH] dmaengine: bcm2835: add dma_memcopy support to bcm2835-dma + +Also added check for an error condition in bcm2835_dma_create_cb_chain +that showed up during development of this patch. + +Tested using dmatest for all enabled channels. + +Signed-off-by: Martin Sperl +Reviewed-by: Eric Anholt +Signed-off-by: Eric Anholt +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 36 +++++++++++++++++++++++++++++++++++- + 1 file changed, 35 insertions(+), 1 deletion(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -310,6 +310,9 @@ static struct bcm2835_desc *bcm2835_dma_ + struct bcm2835_cb_entry *cb_entry; + struct bcm2835_dma_cb *control_block; + ++ if (!frames) ++ return NULL; ++ + /* allocate and setup the descriptor. */ + d = kzalloc(sizeof(*d) + frames * sizeof(struct bcm2835_cb_entry), + gfp); +@@ -597,6 +600,34 @@ static void bcm2835_dma_issue_pending(st + spin_unlock_irqrestore(&c->vc.lock, flags); + } + ++struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_memcpy( ++ struct dma_chan *chan, dma_addr_t dst, dma_addr_t src, ++ size_t len, unsigned long flags) ++{ ++ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); ++ struct bcm2835_desc *d; ++ u32 info = BCM2835_DMA_D_INC | BCM2835_DMA_S_INC; ++ u32 extra = BCM2835_DMA_INT_EN | BCM2835_DMA_WAIT_RESP; ++ size_t max_len = bcm2835_dma_max_frame_length(c); ++ size_t frames; ++ ++ /* if src, dst or len is not given return with an error */ ++ if (!src || !dst || !len) ++ return NULL; ++ ++ /* calculate number of frames */ ++ frames = bcm2835_dma_frames_for_length(len, max_len); ++ ++ /* allocate the CB chain - this also fills in the pointers */ ++ d = bcm2835_dma_create_cb_chain(chan, DMA_MEM_TO_MEM, false, ++ info, extra, frames, ++ src, dst, len, 0, GFP_KERNEL); ++ if (!d) ++ return NULL; ++ ++ return vchan_tx_prep(&c->vc, &d->vd, flags); ++} ++ + static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( + struct dma_chan *chan, + struct scatterlist *sgl, unsigned int sg_len, +@@ -880,17 +911,20 @@ static int bcm2835_dma_probe(struct plat + dma_cap_set(DMA_PRIVATE, od->ddev.cap_mask); + dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask); + dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); ++ dma_cap_set(DMA_MEMCPY, od->ddev.cap_mask); + od->ddev.device_alloc_chan_resources = bcm2835_dma_alloc_chan_resources; + od->ddev.device_free_chan_resources = bcm2835_dma_free_chan_resources; + od->ddev.device_tx_status = bcm2835_dma_tx_status; + od->ddev.device_issue_pending = bcm2835_dma_issue_pending; + od->ddev.device_prep_dma_cyclic = bcm2835_dma_prep_dma_cyclic; + od->ddev.device_prep_slave_sg = bcm2835_dma_prep_slave_sg; ++ od->ddev.device_prep_dma_memcpy = bcm2835_dma_prep_dma_memcpy; + od->ddev.device_config = bcm2835_dma_slave_config; + od->ddev.device_terminate_all = bcm2835_dma_terminate_all; + od->ddev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); + od->ddev.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); +- od->ddev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); ++ od->ddev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV) | ++ BIT(DMA_MEM_TO_MEM); + od->ddev.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; + od->ddev.dev = &pdev->dev; + INIT_LIST_HEAD(&od->ddev.channels); diff --git a/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch b/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch deleted file mode 100644 index ad1a0f8ab3..0000000000 --- a/target/linux/brcm2708/patches-4.4/0399-dmaengine-bcm2835-add-slave_sg-support-to-bcm2835-dm.patch +++ /dev/null @@ -1,183 +0,0 @@ -From 7cd84b455f4681e4db6cd9e3cd628bcd06df0978 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 16 Mar 2016 12:25:01 -0700 -Subject: [PATCH 399/423] dmaengine: bcm2835: add slave_sg support to - bcm2835-dma - -Add slave_sg support to bcm2835-dma using shared allocation -code for bcm2835_desc and DMA-control blocks already used by -dma_cyclic. - -Note that bcm2835_dma_callback had to get modified to support -both modes of operation (cyclic and non-cyclic). - -Tested using: -* Hifiberry I2S card (using cyclic DMA) -* fb_st7735r SPI-framebuffer (using slave_sg DMA via spi-bcm2835) -playing BigBuckBunny for audio and video. - -Signed-off-by: Martin Sperl -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 113 ++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 108 insertions(+), 5 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -260,6 +260,23 @@ static void bcm2835_dma_create_cb_set_le - control_block->info |= finalextrainfo; - } - -+static inline size_t bcm2835_dma_count_frames_for_sg( -+ struct bcm2835_chan *c, -+ struct scatterlist *sgl, -+ unsigned int sg_len) -+{ -+ size_t frames = 0; -+ struct scatterlist *sgent; -+ unsigned int i; -+ size_t plength = bcm2835_dma_max_frame_length(c); -+ -+ for_each_sg(sgl, sgent, sg_len, i) -+ frames += bcm2835_dma_frames_for_length( -+ sg_dma_len(sgent), plength); -+ -+ return frames; -+} -+ - /** - * bcm2835_dma_create_cb_chain - create a control block and fills data in - * -@@ -361,6 +378,32 @@ error_cb: - return NULL; - } - -+static void bcm2835_dma_fill_cb_chain_with_sg( -+ struct dma_chan *chan, -+ enum dma_transfer_direction direction, -+ struct bcm2835_cb_entry *cb, -+ struct scatterlist *sgl, -+ unsigned int sg_len) -+{ -+ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); -+ size_t max_len = bcm2835_dma_max_frame_length(c); -+ unsigned int i, len; -+ dma_addr_t addr; -+ struct scatterlist *sgent; -+ -+ for_each_sg(sgl, sgent, sg_len, i) { -+ for (addr = sg_dma_address(sgent), len = sg_dma_len(sgent); -+ len > 0; -+ addr += cb->cb->length, len -= cb->cb->length, cb++) { -+ if (direction == DMA_DEV_TO_MEM) -+ cb->cb->dst = addr; -+ else -+ cb->cb->src = addr; -+ cb->cb->length = min(len, max_len); -+ } -+ } -+} -+ - static int bcm2835_dma_abort(void __iomem *chan_base) - { - unsigned long cs; -@@ -428,13 +471,19 @@ static irqreturn_t bcm2835_dma_callback( - d = c->desc; - - if (d) { -- /* TODO Only works for cyclic DMA */ -- vchan_cyclic_callback(&d->vd); -+ if (d->cyclic) { -+ /* call the cyclic callback */ -+ vchan_cyclic_callback(&d->vd); -+ -+ /* Keep the DMA engine running */ -+ writel(BCM2835_DMA_ACTIVE, -+ c->chan_base + BCM2835_DMA_CS); -+ } else { -+ vchan_cookie_complete(&c->desc->vd); -+ bcm2835_dma_start_desc(c); -+ } - } - -- /* Keep the DMA engine running */ -- writel(BCM2835_DMA_ACTIVE, c->chan_base + BCM2835_DMA_CS); -- - spin_unlock_irqrestore(&c->vc.lock, flags); - - return IRQ_HANDLED; -@@ -548,6 +597,58 @@ static void bcm2835_dma_issue_pending(st - spin_unlock_irqrestore(&c->vc.lock, flags); - } - -+static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( -+ struct dma_chan *chan, -+ struct scatterlist *sgl, unsigned int sg_len, -+ enum dma_transfer_direction direction, -+ unsigned long flags, void *context) -+{ -+ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); -+ struct bcm2835_desc *d; -+ dma_addr_t src = 0, dst = 0; -+ u32 info = BCM2835_DMA_WAIT_RESP; -+ u32 extra = BCM2835_DMA_INT_EN; -+ size_t frames; -+ -+ if (!is_slave_direction(direction)) { -+ dev_err(chan->device->dev, -+ "%s: bad direction?\n", __func__); -+ return NULL; -+ } -+ -+ if (c->dreq != 0) -+ info |= BCM2835_DMA_PER_MAP(c->dreq); -+ -+ if (direction == DMA_DEV_TO_MEM) { -+ if (c->cfg.src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) -+ return NULL; -+ src = c->cfg.src_addr; -+ info |= BCM2835_DMA_S_DREQ | BCM2835_DMA_D_INC; -+ } else { -+ if (c->cfg.dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) -+ return NULL; -+ dst = c->cfg.dst_addr; -+ info |= BCM2835_DMA_D_DREQ | BCM2835_DMA_S_INC; -+ } -+ -+ /* count frames in sg list */ -+ frames = bcm2835_dma_count_frames_for_sg(c, sgl, sg_len); -+ -+ /* allocate the CB chain */ -+ d = bcm2835_dma_create_cb_chain(chan, direction, false, -+ info, extra, -+ frames, src, dst, 0, 0, -+ GFP_KERNEL); -+ if (!d) -+ return NULL; -+ -+ /* fill in frames with scatterlist pointers */ -+ bcm2835_dma_fill_cb_chain_with_sg(chan, direction, d->cb_list, -+ sgl, sg_len); -+ -+ return vchan_tx_prep(&c->vc, &d->vd, flags); -+} -+ - static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic( - struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, - size_t period_len, enum dma_transfer_direction direction, -@@ -778,11 +879,13 @@ static int bcm2835_dma_probe(struct plat - dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); - dma_cap_set(DMA_PRIVATE, od->ddev.cap_mask); - dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask); -+ dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); - od->ddev.device_alloc_chan_resources = bcm2835_dma_alloc_chan_resources; - od->ddev.device_free_chan_resources = bcm2835_dma_free_chan_resources; - od->ddev.device_tx_status = bcm2835_dma_tx_status; - od->ddev.device_issue_pending = bcm2835_dma_issue_pending; - od->ddev.device_prep_dma_cyclic = bcm2835_dma_prep_dma_cyclic; -+ od->ddev.device_prep_slave_sg = bcm2835_dma_prep_slave_sg; - od->ddev.device_config = bcm2835_dma_slave_config; - od->ddev.device_terminate_all = bcm2835_dma_terminate_all; - od->ddev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); diff --git a/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch b/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch deleted file mode 100644 index 829f9c20a2..0000000000 --- a/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-add-dma_memcopy-support-to-bcm2835.patch +++ /dev/null @@ -1,88 +0,0 @@ -From ce27d8ba202467a2b811de711ed95d17b2bb27e5 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 16 Mar 2016 12:25:02 -0700 -Subject: [PATCH 400/423] dmaengine: bcm2835: add dma_memcopy support to - bcm2835-dma - -Also added check for an error condition in bcm2835_dma_create_cb_chain -that showed up during development of this patch. - -Tested using dmatest for all enabled channels. - -Signed-off-by: Martin Sperl -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 36 +++++++++++++++++++++++++++++++++++- - 1 file changed, 35 insertions(+), 1 deletion(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -310,6 +310,9 @@ static struct bcm2835_desc *bcm2835_dma_ - struct bcm2835_cb_entry *cb_entry; - struct bcm2835_dma_cb *control_block; - -+ if (!frames) -+ return NULL; -+ - /* allocate and setup the descriptor. */ - d = kzalloc(sizeof(*d) + frames * sizeof(struct bcm2835_cb_entry), - gfp); -@@ -597,6 +600,34 @@ static void bcm2835_dma_issue_pending(st - spin_unlock_irqrestore(&c->vc.lock, flags); - } - -+struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_memcpy( -+ struct dma_chan *chan, dma_addr_t dst, dma_addr_t src, -+ size_t len, unsigned long flags) -+{ -+ struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); -+ struct bcm2835_desc *d; -+ u32 info = BCM2835_DMA_D_INC | BCM2835_DMA_S_INC; -+ u32 extra = BCM2835_DMA_INT_EN | BCM2835_DMA_WAIT_RESP; -+ size_t max_len = bcm2835_dma_max_frame_length(c); -+ size_t frames; -+ -+ /* if src, dst or len is not given return with an error */ -+ if (!src || !dst || !len) -+ return NULL; -+ -+ /* calculate number of frames */ -+ frames = bcm2835_dma_frames_for_length(len, max_len); -+ -+ /* allocate the CB chain - this also fills in the pointers */ -+ d = bcm2835_dma_create_cb_chain(chan, DMA_MEM_TO_MEM, false, -+ info, extra, frames, -+ src, dst, len, 0, GFP_KERNEL); -+ if (!d) -+ return NULL; -+ -+ return vchan_tx_prep(&c->vc, &d->vd, flags); -+} -+ - static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( - struct dma_chan *chan, - struct scatterlist *sgl, unsigned int sg_len, -@@ -880,17 +911,20 @@ static int bcm2835_dma_probe(struct plat - dma_cap_set(DMA_PRIVATE, od->ddev.cap_mask); - dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask); - dma_cap_set(DMA_SLAVE, od->ddev.cap_mask); -+ dma_cap_set(DMA_MEMCPY, od->ddev.cap_mask); - od->ddev.device_alloc_chan_resources = bcm2835_dma_alloc_chan_resources; - od->ddev.device_free_chan_resources = bcm2835_dma_free_chan_resources; - od->ddev.device_tx_status = bcm2835_dma_tx_status; - od->ddev.device_issue_pending = bcm2835_dma_issue_pending; - od->ddev.device_prep_dma_cyclic = bcm2835_dma_prep_dma_cyclic; - od->ddev.device_prep_slave_sg = bcm2835_dma_prep_slave_sg; -+ od->ddev.device_prep_dma_memcpy = bcm2835_dma_prep_dma_memcpy; - od->ddev.device_config = bcm2835_dma_slave_config; - od->ddev.device_terminate_all = bcm2835_dma_terminate_all; - od->ddev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); - od->ddev.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); -- od->ddev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); -+ od->ddev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV) | -+ BIT(DMA_MEM_TO_MEM); - od->ddev.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; - od->ddev.dev = &pdev->dev; - INIT_LIST_HEAD(&od->ddev.channels); diff --git a/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-use-platform_get_irq_byname.patch b/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-use-platform_get_irq_byname.patch new file mode 100644 index 0000000000..b8eecaf4e0 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0400-dmaengine-bcm2835-use-platform_get_irq_byname.patch @@ -0,0 +1,170 @@ +From 27a895c19212e695f70bd4860d4420f70f915fe1 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Mon, 11 Apr 2016 13:29:08 +0000 +Subject: [PATCH] dmaengine: bcm2835: use platform_get_irq_byname + +Use platform_get_irq_byname to allow for correct mapping of +interrupts to dma channels. + +The currently implemented device tree is unfortunately +implemented with the wrong assumption, that each dma-channel +has its own dma channel, but dma-irq 11 is handling +dma-channel 11-14 and dma-irq 12 is actually a "catch all" +interrupt. + +So here we use the byname variant and require that interrupts +are explicitly named via the interrupts-name property in the +device tree. + +The use of shared interrupts is also implemented. + +As a side-effect this means we can now use dma channels 12, 13 and 14 +in a correct manner - also testing shows that onl using +channels 11 to 14 for spi and i2s works perfectly (when playing +some video) + +Signed-off-by: Martin Sperl +Acked-by: Eric Anholt +Acked-by: Mark Rutland +Signed-off-by: Vinod Koul +--- + drivers/dma/bcm2835-dma.c | 77 ++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 63 insertions(+), 14 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -46,6 +46,9 @@ + + #include "virt-dma.h" + ++#define BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED 14 ++#define BCM2835_DMA_CHAN_NAME_SIZE 8 ++ + struct bcm2835_dmadev { + struct dma_device ddev; + spinlock_t lock; +@@ -81,6 +84,7 @@ struct bcm2835_chan { + + void __iomem *chan_base; + int irq_number; ++ unsigned int irq_flags; + + bool is_lite_channel; + }; +@@ -466,6 +470,15 @@ static irqreturn_t bcm2835_dma_callback( + struct bcm2835_desc *d; + unsigned long flags; + ++ /* check the shared interrupt */ ++ if (c->irq_flags & IRQF_SHARED) { ++ /* check if the interrupt is enabled */ ++ flags = readl(c->chan_base + BCM2835_DMA_CS); ++ /* if not set then we are not the reason for the irq */ ++ if (!(flags & BCM2835_DMA_INT)) ++ return IRQ_NONE; ++ } ++ + spin_lock_irqsave(&c->vc.lock, flags); + + /* Acknowledge interrupt */ +@@ -506,8 +519,8 @@ static int bcm2835_dma_alloc_chan_resour + return -ENOMEM; + } + +- return request_irq(c->irq_number, +- bcm2835_dma_callback, 0, "DMA IRQ", c); ++ return request_irq(c->irq_number, bcm2835_dma_callback, ++ c->irq_flags, "DMA IRQ", c); + } + + static void bcm2835_dma_free_chan_resources(struct dma_chan *chan) +@@ -819,7 +832,8 @@ static int bcm2835_dma_terminate_all(str + return 0; + } + +-static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id, int irq) ++static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id, ++ int irq, unsigned int irq_flags) + { + struct bcm2835_chan *c; + +@@ -834,6 +848,7 @@ static int bcm2835_dma_chan_init(struct + c->chan_base = BCM2835_DMA_CHANIO(d->base, chan_id); + c->ch = chan_id; + c->irq_number = irq; ++ c->irq_flags = irq_flags; + + /* check in DEBUG register if this is a LITE channel */ + if (readl(c->chan_base + BCM2835_DMA_DEBUG) & +@@ -882,9 +897,11 @@ static int bcm2835_dma_probe(struct plat + struct resource *res; + void __iomem *base; + int rc; +- int i; +- int irq; ++ int i, j; ++ int irq[BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED + 1]; ++ int irq_flags; + uint32_t chans_available; ++ char chan_name[BCM2835_DMA_CHAN_NAME_SIZE]; + + if (!pdev->dev.dma_mask) + pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; +@@ -941,16 +958,48 @@ static int bcm2835_dma_probe(struct plat + goto err_no_dma; + } + +- for (i = 0; i < pdev->num_resources; i++) { +- irq = platform_get_irq(pdev, i); +- if (irq < 0) +- break; +- +- if (chans_available & (1 << i)) { +- rc = bcm2835_dma_chan_init(od, i, irq); +- if (rc) +- goto err_no_dma; ++ /* get irqs for each channel that we support */ ++ for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) { ++ /* skip masked out channels */ ++ if (!(chans_available & (1 << i))) { ++ irq[i] = -1; ++ continue; + } ++ ++ /* get the named irq */ ++ snprintf(chan_name, sizeof(chan_name), "dma%i", i); ++ irq[i] = platform_get_irq_byname(pdev, chan_name); ++ if (irq[i] >= 0) ++ continue; ++ ++ /* legacy device tree case handling */ ++ dev_warn_once(&pdev->dev, ++ "missing interrupts-names property in device tree - legacy interpretation is used"); ++ /* ++ * in case of channel >= 11 ++ * use the 11th interrupt and that is shared ++ */ ++ irq[i] = platform_get_irq(pdev, i < 11 ? i : 11); ++ } ++ ++ /* get irqs for each channel */ ++ for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) { ++ /* skip channels without irq */ ++ if (irq[i] < 0) ++ continue; ++ ++ /* check if there are other channels that also use this irq */ ++ irq_flags = 0; ++ for (j = 0; j <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; j++) ++ if ((i != j) && (irq[j] == irq[i])) { ++ irq_flags = IRQF_SHARED; ++ break; ++ } ++ ++ /* initialize the channel */ ++ rc = bcm2835_dma_chan_init(od, i, irq[i], irq_flags); ++ if (rc) ++ goto err_no_dma; + } + + dev_dbg(&pdev->dev, "Initialized %i DMA channels\n", i); diff --git a/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch new file mode 100644 index 0000000000..f8ad8f3229 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch @@ -0,0 +1,89 @@ +From 479b918cb9511d5044cc660f0c74d42952a87910 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Sat, 3 Oct 2015 22:22:55 +0200 +Subject: [PATCH] dmaengine: bcm2835: Load driver early and support legacy API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Load driver early since at least bcm2708_fb doesn't support deferred +probing and even if it did, we don't want the video driver deferred. + +Support the legacy DMA API which is needed by bcm2708_fb +(but only using the dedicated dma channel 0). + +Signed-off-by: Noralf Trønnes +Signed-off-by: Martin Sperl +--- + drivers/dma/Kconfig | 2 +- + drivers/dma/bcm2835-dma.c | 27 ++++++++++++++++++++++++++- + 2 files changed, 27 insertions(+), 2 deletions(-) + +--- a/drivers/dma/Kconfig ++++ b/drivers/dma/Kconfig +@@ -108,7 +108,7 @@ config COH901318 + + config DMA_BCM2835 + tristate "BCM2835 DMA engine support" +- depends on ARCH_BCM2835 ++ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1021,6 +1022,14 @@ static int bcm2835_dma_probe(struct plat + + dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n"); + ++ /* load the legacy api if bit 0 in the mask is cleared */ ++ if ((chans_available & BIT(0)) == 0) { ++ rc = bcm_dmaman_probe(pdev, base, BIT(0)); ++ if (rc) ++ dev_err(&pdev->dev, ++ "Failed to initialize the legacy API\n"); ++ } ++ + return 0; + + err_no_dma: +@@ -1032,6 +1041,7 @@ static int bcm2835_dma_remove(struct pla + { + struct bcm2835_dmadev *od = platform_get_drvdata(pdev); + ++ bcm_dmaman_remove(pdev); + dma_async_device_unregister(&od->ddev); + bcm2835_dma_free(od); + +@@ -1047,7 +1057,22 @@ static struct platform_driver bcm2835_dm + }, + }; + +-module_platform_driver(bcm2835_dma_driver); ++static int bcm2835_dma_init(void) ++{ ++ return platform_driver_register(&bcm2835_dma_driver); ++} ++ ++static void bcm2835_dma_exit(void) ++{ ++ platform_driver_unregister(&bcm2835_dma_driver); ++} ++ ++/* ++ * Load after serial driver (arch_initcall) so we see the messages if it fails, ++ * but before drivers (module_init) that need a DMA channel. ++ */ ++subsys_initcall(bcm2835_dma_init); ++module_exit(bcm2835_dma_exit); + + MODULE_ALIAS("platform:bcm2835-dma"); + MODULE_DESCRIPTION("BCM2835 DMA engine driver"); diff --git a/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-use-platform_get_irq_byname.patch b/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-use-platform_get_irq_byname.patch deleted file mode 100644 index 4ac145d172..0000000000 --- a/target/linux/brcm2708/patches-4.4/0401-dmaengine-bcm2835-use-platform_get_irq_byname.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 1e4008ef44653e552ce20969322fc271a2b52fe4 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Mon, 11 Apr 2016 13:29:08 +0000 -Subject: [PATCH 401/423] dmaengine: bcm2835: use platform_get_irq_byname - -Use platform_get_irq_byname to allow for correct mapping of -interrupts to dma channels. - -The currently implemented device tree is unfortunately -implemented with the wrong assumption, that each dma-channel -has its own dma channel, but dma-irq 11 is handling -dma-channel 11-14 and dma-irq 12 is actually a "catch all" -interrupt. - -So here we use the byname variant and require that interrupts -are explicitly named via the interrupts-name property in the -device tree. - -The use of shared interrupts is also implemented. - -As a side-effect this means we can now use dma channels 12, 13 and 14 -in a correct manner - also testing shows that onl using -channels 11 to 14 for spi and i2s works perfectly (when playing -some video) - -Signed-off-by: Martin Sperl -Acked-by: Eric Anholt -Acked-by: Mark Rutland -Signed-off-by: Vinod Koul ---- - drivers/dma/bcm2835-dma.c | 77 ++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 63 insertions(+), 14 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -46,6 +46,9 @@ - - #include "virt-dma.h" - -+#define BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED 14 -+#define BCM2835_DMA_CHAN_NAME_SIZE 8 -+ - struct bcm2835_dmadev { - struct dma_device ddev; - spinlock_t lock; -@@ -81,6 +84,7 @@ struct bcm2835_chan { - - void __iomem *chan_base; - int irq_number; -+ unsigned int irq_flags; - - bool is_lite_channel; - }; -@@ -466,6 +470,15 @@ static irqreturn_t bcm2835_dma_callback( - struct bcm2835_desc *d; - unsigned long flags; - -+ /* check the shared interrupt */ -+ if (c->irq_flags & IRQF_SHARED) { -+ /* check if the interrupt is enabled */ -+ flags = readl(c->chan_base + BCM2835_DMA_CS); -+ /* if not set then we are not the reason for the irq */ -+ if (!(flags & BCM2835_DMA_INT)) -+ return IRQ_NONE; -+ } -+ - spin_lock_irqsave(&c->vc.lock, flags); - - /* Acknowledge interrupt */ -@@ -506,8 +519,8 @@ static int bcm2835_dma_alloc_chan_resour - return -ENOMEM; - } - -- return request_irq(c->irq_number, -- bcm2835_dma_callback, 0, "DMA IRQ", c); -+ return request_irq(c->irq_number, bcm2835_dma_callback, -+ c->irq_flags, "DMA IRQ", c); - } - - static void bcm2835_dma_free_chan_resources(struct dma_chan *chan) -@@ -819,7 +832,8 @@ static int bcm2835_dma_terminate_all(str - return 0; - } - --static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id, int irq) -+static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id, -+ int irq, unsigned int irq_flags) - { - struct bcm2835_chan *c; - -@@ -834,6 +848,7 @@ static int bcm2835_dma_chan_init(struct - c->chan_base = BCM2835_DMA_CHANIO(d->base, chan_id); - c->ch = chan_id; - c->irq_number = irq; -+ c->irq_flags = irq_flags; - - /* check in DEBUG register if this is a LITE channel */ - if (readl(c->chan_base + BCM2835_DMA_DEBUG) & -@@ -882,9 +897,11 @@ static int bcm2835_dma_probe(struct plat - struct resource *res; - void __iomem *base; - int rc; -- int i; -- int irq; -+ int i, j; -+ int irq[BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED + 1]; -+ int irq_flags; - uint32_t chans_available; -+ char chan_name[BCM2835_DMA_CHAN_NAME_SIZE]; - - if (!pdev->dev.dma_mask) - pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; -@@ -941,16 +958,48 @@ static int bcm2835_dma_probe(struct plat - goto err_no_dma; - } - -- for (i = 0; i < pdev->num_resources; i++) { -- irq = platform_get_irq(pdev, i); -- if (irq < 0) -- break; -- -- if (chans_available & (1 << i)) { -- rc = bcm2835_dma_chan_init(od, i, irq); -- if (rc) -- goto err_no_dma; -+ /* get irqs for each channel that we support */ -+ for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) { -+ /* skip masked out channels */ -+ if (!(chans_available & (1 << i))) { -+ irq[i] = -1; -+ continue; - } -+ -+ /* get the named irq */ -+ snprintf(chan_name, sizeof(chan_name), "dma%i", i); -+ irq[i] = platform_get_irq_byname(pdev, chan_name); -+ if (irq[i] >= 0) -+ continue; -+ -+ /* legacy device tree case handling */ -+ dev_warn_once(&pdev->dev, -+ "missing interrupts-names property in device tree - legacy interpretation is used"); -+ /* -+ * in case of channel >= 11 -+ * use the 11th interrupt and that is shared -+ */ -+ irq[i] = platform_get_irq(pdev, i < 11 ? i : 11); -+ } -+ -+ /* get irqs for each channel */ -+ for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) { -+ /* skip channels without irq */ -+ if (irq[i] < 0) -+ continue; -+ -+ /* check if there are other channels that also use this irq */ -+ irq_flags = 0; -+ for (j = 0; j <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; j++) -+ if ((i != j) && (irq[j] == irq[i])) { -+ irq_flags = IRQF_SHARED; -+ break; -+ } -+ -+ /* initialize the channel */ -+ rc = bcm2835_dma_chan_init(od, i, irq[i], irq_flags); -+ if (rc) -+ goto err_no_dma; - } - - dev_dbg(&pdev->dev, "Initialized %i DMA channels\n", i); diff --git a/target/linux/brcm2708/patches-4.4/0402-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch b/target/linux/brcm2708/patches-4.4/0402-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch new file mode 100644 index 0000000000..1bcdd93627 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0402-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch @@ -0,0 +1,26 @@ +From fa1852176e0d03be5650aa88a6e051541fa3da7a Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Fri, 22 Apr 2016 16:13:59 +0000 +Subject: [PATCH] ARM: bcm270x: changed bcrm,dma-channel-mask to mask out the + used channel + +Dma channel0 is used by the legacy api - to avoid confilcts this +needs to get masked out in the device-tree instead of hardcoding it +in the driver. + +Signed-off-by: Martin Sperl +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -59,7 +59,7 @@ + <1 27>; + + #dma-cells = <1>; +- brcm,dma-channel-mask = <0x0f35>; ++ brcm,dma-channel-mask = <0x0f34>; + }; + + intc: interrupt-controller@7e00b200 { diff --git a/target/linux/brcm2708/patches-4.4/0402-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/brcm2708/patches-4.4/0402-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch deleted file mode 100644 index 5d21ffda2f..0000000000 --- a/target/linux/brcm2708/patches-4.4/0402-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch +++ /dev/null @@ -1,90 +0,0 @@ -From b0ad872cdb56e3dfd36ec2fbd0aad0375609bb0f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= -Date: Sat, 3 Oct 2015 22:22:55 +0200 -Subject: [PATCH 402/423] dmaengine: bcm2835: Load driver early and support - legacy API -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Load driver early since at least bcm2708_fb doesn't support deferred -probing and even if it did, we don't want the video driver deferred. - -Support the legacy DMA API which is needed by bcm2708_fb -(but only using the dedicated dma channel 0). - -Signed-off-by: Noralf Trønnes -Signed-off-by: Martin Sperl ---- - drivers/dma/Kconfig | 2 +- - drivers/dma/bcm2835-dma.c | 27 ++++++++++++++++++++++++++- - 2 files changed, 27 insertions(+), 2 deletions(-) - ---- a/drivers/dma/Kconfig -+++ b/drivers/dma/Kconfig -@@ -108,7 +108,7 @@ config COH901318 - - config DMA_BCM2835 - tristate "BCM2835 DMA engine support" -- depends on ARCH_BCM2835 -+ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709 - select DMA_ENGINE - select DMA_VIRTUAL_CHANNELS - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1021,6 +1022,14 @@ static int bcm2835_dma_probe(struct plat - - dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n"); - -+ /* load the legacy api if bit 0 in the mask is cleared */ -+ if ((chans_available & BIT(0)) == 0) { -+ rc = bcm_dmaman_probe(pdev, base, BIT(0)); -+ if (rc) -+ dev_err(&pdev->dev, -+ "Failed to initialize the legacy API\n"); -+ } -+ - return 0; - - err_no_dma: -@@ -1032,6 +1041,7 @@ static int bcm2835_dma_remove(struct pla - { - struct bcm2835_dmadev *od = platform_get_drvdata(pdev); - -+ bcm_dmaman_remove(pdev); - dma_async_device_unregister(&od->ddev); - bcm2835_dma_free(od); - -@@ -1047,7 +1057,22 @@ static struct platform_driver bcm2835_dm - }, - }; - --module_platform_driver(bcm2835_dma_driver); -+static int bcm2835_dma_init(void) -+{ -+ return platform_driver_register(&bcm2835_dma_driver); -+} -+ -+static void bcm2835_dma_exit(void) -+{ -+ platform_driver_unregister(&bcm2835_dma_driver); -+} -+ -+/* -+ * Load after serial driver (arch_initcall) so we see the messages if it fails, -+ * but before drivers (module_init) that need a DMA channel. -+ */ -+subsys_initcall(bcm2835_dma_init); -+module_exit(bcm2835_dma_exit); - - MODULE_ALIAS("platform:bcm2835-dma"); - MODULE_DESCRIPTION("BCM2835 DMA engine driver"); diff --git a/target/linux/brcm2708/patches-4.4/0403-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch b/target/linux/brcm2708/patches-4.4/0403-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch deleted file mode 100644 index 84d24c03eb..0000000000 --- a/target/linux/brcm2708/patches-4.4/0403-ARM-bcm270x-changed-bcrm-dma-channel-mask-to-mask-ou.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 397377a39914146b6c7ac085436fbc948c39b0ff Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Fri, 22 Apr 2016 16:13:59 +0000 -Subject: [PATCH 403/423] ARM: bcm270x: changed bcrm,dma-channel-mask to mask - out the used channel - -Dma channel0 is used by the legacy api - to avoid confilcts this -needs to get masked out in the device-tree instead of hardcoding it -in the driver. - -Signed-off-by: Martin Sperl ---- - arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/bcm2708_common.dtsi -+++ b/arch/arm/boot/dts/bcm2708_common.dtsi -@@ -59,7 +59,7 @@ - <1 27>; - - #dma-cells = <1>; -- brcm,dma-channel-mask = <0x0f35>; -+ brcm,dma-channel-mask = <0x0f34>; - }; - - intc: interrupt-controller@7e00b200 { diff --git a/target/linux/brcm2708/patches-4.4/0403-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch b/target/linux/brcm2708/patches-4.4/0403-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch new file mode 100644 index 0000000000..eb5a6cdb16 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0403-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch @@ -0,0 +1,50 @@ +From c4eb741282cc9300119adaa4d6d3a278b9cd5f15 Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Sat, 23 Apr 2016 14:07:03 +0000 +Subject: [PATCH] ARM: bcm2835: add interrupt-names and apply correct mapping + +Add interrupt-names properties to dt and apply the correct +mapping between irq and dma channels. + +Signed-off-by: Martin Sperl +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 26 ++++++++++++++++++++++++-- + 1 file changed, 24 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -56,10 +56,32 @@ + <1 24>, + <1 25>, + <1 26>, +- <1 27>; ++ /* dma channel 11-14 share one irq */ ++ <1 27>, ++ <1 27>, ++ <1 27>, ++ <1 27>, ++ /* unused shared irq for all channels */ ++ <1 28>; ++ interrupt-names = "dma0", ++ "dma1", ++ "dma2", ++ "dma3", ++ "dma4", ++ "dma5", ++ "dma6", ++ "dma7", ++ "dma8", ++ "dma9", ++ "dma10", ++ "dma11", ++ "dma12", ++ "dma13", ++ "dma14", ++ "dma-shared-all"; + + #dma-cells = <1>; +- brcm,dma-channel-mask = <0x0f34>; ++ brcm,dma-channel-mask = <0x7f34>; + }; + + intc: interrupt-controller@7e00b200 { diff --git a/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch b/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch deleted file mode 100644 index 0710286c34..0000000000 --- a/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-add-interrupt-names-and-apply-correct-ma.patch +++ /dev/null @@ -1,51 +0,0 @@ -From b11585bc1bd969c750b3f02fd15a584b463602f8 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Sat, 23 Apr 2016 14:07:03 +0000 -Subject: [PATCH 404/423] ARM: bcm2835: add interrupt-names and apply correct - mapping - -Add interrupt-names properties to dt and apply the correct -mapping between irq and dma channels. - -Signed-off-by: Martin Sperl ---- - arch/arm/boot/dts/bcm2708_common.dtsi | 26 ++++++++++++++++++++++++-- - 1 file changed, 24 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/bcm2708_common.dtsi -+++ b/arch/arm/boot/dts/bcm2708_common.dtsi -@@ -56,10 +56,32 @@ - <1 24>, - <1 25>, - <1 26>, -- <1 27>; -+ /* dma channel 11-14 share one irq */ -+ <1 27>, -+ <1 27>, -+ <1 27>, -+ <1 27>, -+ /* unused shared irq for all channels */ -+ <1 28>; -+ interrupt-names = "dma0", -+ "dma1", -+ "dma2", -+ "dma3", -+ "dma4", -+ "dma5", -+ "dma6", -+ "dma7", -+ "dma8", -+ "dma9", -+ "dma10", -+ "dma11", -+ "dma12", -+ "dma13", -+ "dma14", -+ "dma-shared-all"; - - #dma-cells = <1>; -- brcm,dma-channel-mask = <0x0f34>; -+ brcm,dma-channel-mask = <0x7f34>; - }; - - intc: interrupt-controller@7e00b200 { diff --git a/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch b/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch new file mode 100644 index 0000000000..d00a19b5de --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0404-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch @@ -0,0 +1,28 @@ +From 0cbf2a548657ddbeb0b7b7d144cc4f46f477b2fc Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Sat, 23 Apr 2016 14:20:41 +0000 +Subject: [PATCH] ARM: bcm2835: make dma-channel-0 available for kms setups + +Enable the use of dma-channel 0 when using the vc4-kms-v3d overlay. + +Signed-off-by: Martin Sperl +--- + arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts ++++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts +@@ -119,6 +119,13 @@ + }; + }; + ++ fragment@15 { ++ target-path = "/soc/dma"; ++ __overlay__ { ++ brcm,dma-channel-mask = <0x7f35>; ++ }; ++ }; ++ + __overrides__ { + cma-256 = <0>,"+0-1-2-3-4"; + cma-192 = <0>,"-0+1-2-3-4"; diff --git a/target/linux/brcm2708/patches-4.4/0405-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch b/target/linux/brcm2708/patches-4.4/0405-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch deleted file mode 100644 index 94d559c377..0000000000 --- a/target/linux/brcm2708/patches-4.4/0405-ARM-bcm2835-make-dma-channel-0-available-for-kms-set.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 2ebd83e6f79690289068f691c2ad67db4e40deca Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Sat, 23 Apr 2016 14:20:41 +0000 -Subject: [PATCH 405/423] ARM: bcm2835: make dma-channel-0 available for kms - setups - -Enable the use of dma-channel 0 when using the vc4-kms-v3d overlay. - -Signed-off-by: Martin Sperl ---- - arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts -+++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts -@@ -119,6 +119,13 @@ - }; - }; - -+ fragment@15 { -+ target-path = "/soc/dma"; -+ __overlay__ { -+ brcm,dma-channel-mask = <0x7f35>; -+ }; -+ }; -+ - __overrides__ { - cma-256 = <0>,"+0-1-2-3-4"; - cma-192 = <0>,"-0+1-2-3-4"; diff --git a/target/linux/brcm2708/patches-4.4/0405-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch b/target/linux/brcm2708/patches-4.4/0405-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch new file mode 100644 index 0000000000..e76c99b14b --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0405-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch @@ -0,0 +1,38 @@ +From aaf4cb4fda9ed5c19f0db02023c5c11f51a23aaf Mon Sep 17 00:00:00 2001 +From: Matthias Reichl +Date: Tue, 7 Jun 2016 19:37:10 +0200 +Subject: [PATCH] dmaengine: bcm2835: Fix cyclic DMA period splitting + +The code responsible for splitting periods into chunks that +can be handled by the DMA controller missed to update total_len, +the number of bytes processed in the current period, when there +are more chunks to follow. + +Therefore total_len was stuck at 0 and the code didn't work at all. +This resulted in a wrong control block layout and audio issues because +the cyclic DMA callback wasn't executing on period boundaries. + +Fix this by adding the missing total_len update. + +Signed-off-by: Matthias Reichl +Signed-off-by: Martin Sperl +Tested-by: Clive Messer +--- + drivers/dma/bcm2835-dma.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -252,8 +252,11 @@ static void bcm2835_dma_create_cb_set_le + */ + + /* have we filled in period_length yet? */ +- if (*total_len + control_block->length < period_len) ++ if (*total_len + control_block->length < period_len) { ++ /* update number of bytes in this period so far */ ++ *total_len += control_block->length; + return; ++ } + + /* calculate the length that remains to reach period_length */ + control_block->length = period_len - *total_len; diff --git a/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch b/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch new file mode 100644 index 0000000000..265ee10f45 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch @@ -0,0 +1,56 @@ +From 47b93cc5b706cb592f924199f00d5adbb66bd3ca Mon Sep 17 00:00:00 2001 +From: Matthias Reichl +Date: Wed, 8 Jun 2016 13:09:56 +0200 +Subject: [PATCH] dmaengine: bcm2835: Avoid splitting periods into very small + chunks + +The current cyclic DMA period splitting implementation can generate +very small chunks at the end of each period. For example a 65536 byte +period will be split into a 65532 byte chunk and a 4 byte chunk on +the "lite" DMA channels. + +This increases pressure on the RAM controller as the DMA controller +needs to fetch two control blocks from RAM in quick succession and +could potentially cause latency issues if the RAM is tied up by other +devices. + +We can easily avoid these situations by distributing the remaining +length evenly between the last-but-one and the last chunk, making +sure that split chunks will be at least half the maximum length the +DMA controller can handle. + +This patch checks if the last chunk would be less than half of +the maximum DMA length and if yes distributes the max len+4...max_len*1.5 +bytes evenly between the last 2 chunks. This results in chunk sizes +between max_len/2 and max_len*0.75 bytes. + +Signed-off-by: Matthias Reichl +Signed-off-by: Martin Sperl +Tested-by: Clive Messer +--- + drivers/dma/bcm2835-dma.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -253,6 +253,20 @@ static void bcm2835_dma_create_cb_set_le + + /* have we filled in period_length yet? */ + if (*total_len + control_block->length < period_len) { ++ /* ++ * If the next control block is the last in the period ++ * and it's length would be less than half of max_len ++ * change it so that both control blocks are (almost) ++ * equally long. This avoids generating very short ++ * control blocks (worst case would be 4 bytes) which ++ * might be problematic. We also have to make sure the ++ * new length is a multiple of 4 bytes. ++ */ ++ if (*total_len + control_block->length + max_len / 2 > ++ period_len) { ++ control_block->length = ++ DIV_ROUND_UP(period_len - *total_len, 8) * 4; ++ } + /* update number of bytes in this period so far */ + *total_len += control_block->length; + return; diff --git a/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch b/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch deleted file mode 100644 index 56cceb04f3..0000000000 --- a/target/linux/brcm2708/patches-4.4/0406-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 74d0d3161d711b51be692cf1750b6eb60719f782 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Tue, 7 Jun 2016 19:37:10 +0200 -Subject: [PATCH 406/423] dmaengine: bcm2835: Fix cyclic DMA period splitting - -The code responsible for splitting periods into chunks that -can be handled by the DMA controller missed to update total_len, -the number of bytes processed in the current period, when there -are more chunks to follow. - -Therefore total_len was stuck at 0 and the code didn't work at all. -This resulted in a wrong control block layout and audio issues because -the cyclic DMA callback wasn't executing on period boundaries. - -Fix this by adding the missing total_len update. - -Signed-off-by: Matthias Reichl -Signed-off-by: Martin Sperl -Tested-by: Clive Messer ---- - drivers/dma/bcm2835-dma.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -252,8 +252,11 @@ static void bcm2835_dma_create_cb_set_le - */ - - /* have we filled in period_length yet? */ -- if (*total_len + control_block->length < period_len) -+ if (*total_len + control_block->length < period_len) { -+ /* update number of bytes in this period so far */ -+ *total_len += control_block->length; - return; -+ } - - /* calculate the length that remains to reach period_length */ - control_block->length = period_len - *total_len; diff --git a/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch b/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch deleted file mode 100644 index 2e827e273a..0000000000 --- a/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Avoid-splitting-periods-into-very-.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 6bcfb541bbf5398f91d426c9e6c0e3817d18bb8e Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Wed, 8 Jun 2016 13:09:56 +0200 -Subject: [PATCH 407/423] dmaengine: bcm2835: Avoid splitting periods into very - small chunks - -The current cyclic DMA period splitting implementation can generate -very small chunks at the end of each period. For example a 65536 byte -period will be split into a 65532 byte chunk and a 4 byte chunk on -the "lite" DMA channels. - -This increases pressure on the RAM controller as the DMA controller -needs to fetch two control blocks from RAM in quick succession and -could potentially cause latency issues if the RAM is tied up by other -devices. - -We can easily avoid these situations by distributing the remaining -length evenly between the last-but-one and the last chunk, making -sure that split chunks will be at least half the maximum length the -DMA controller can handle. - -This patch checks if the last chunk would be less than half of -the maximum DMA length and if yes distributes the max len+4...max_len*1.5 -bytes evenly between the last 2 chunks. This results in chunk sizes -between max_len/2 and max_len*0.75 bytes. - -Signed-off-by: Matthias Reichl -Signed-off-by: Martin Sperl -Tested-by: Clive Messer ---- - drivers/dma/bcm2835-dma.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -253,6 +253,20 @@ static void bcm2835_dma_create_cb_set_le - - /* have we filled in period_length yet? */ - if (*total_len + control_block->length < period_len) { -+ /* -+ * If the next control block is the last in the period -+ * and it's length would be less than half of max_len -+ * change it so that both control blocks are (almost) -+ * equally long. This avoids generating very short -+ * control blocks (worst case would be 4 bytes) which -+ * might be problematic. We also have to make sure the -+ * new length is a multiple of 4 bytes. -+ */ -+ if (*total_len + control_block->length + max_len / 2 > -+ period_len) { -+ control_block->length = -+ DIV_ROUND_UP(period_len - *total_len, 8) * 4; -+ } - /* update number of bytes in this period so far */ - *total_len += control_block->length; - return; diff --git a/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch b/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch new file mode 100644 index 0000000000..7ff0ab1dec --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0407-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch @@ -0,0 +1,68 @@ +From 3288dc56cae869c8c49202f36669ea64d568407f Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 3 Jun 2016 19:29:11 -0700 +Subject: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with + interrupts masked. + +The tx_status hook is supposed to be safe to call from interrupt +context, but it wouldn't ever return completion for the last transfer, +meaning you couldn't poll for DMA completion with interrupts masked. + +This fixes IRQ handling for bcm2835's DSI1, which requires using the +DMA engine to write its registers due to a bug in the AXI bridge. + +Signed-off-by: Eric Anholt +--- + drivers/dma/bcm2835-dma.c | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -588,16 +588,16 @@ static enum dma_status bcm2835_dma_tx_st + struct virt_dma_desc *vd; + enum dma_status ret; + unsigned long flags; ++ u32 residue; + + ret = dma_cookie_status(chan, cookie, txstate); +- if (ret == DMA_COMPLETE || !txstate) ++ if (ret == DMA_COMPLETE) + return ret; + + spin_lock_irqsave(&c->vc.lock, flags); + vd = vchan_find_desc(&c->vc, cookie); + if (vd) { +- txstate->residue = +- bcm2835_dma_desc_size(to_bcm2835_dma_desc(&vd->tx)); ++ residue = bcm2835_dma_desc_size(to_bcm2835_dma_desc(&vd->tx)); + } else if (c->desc && c->desc->vd.tx.cookie == cookie) { + struct bcm2835_desc *d = c->desc; + dma_addr_t pos; +@@ -609,11 +609,25 @@ static enum dma_status bcm2835_dma_tx_st + else + pos = 0; + +- txstate->residue = bcm2835_dma_desc_size_pos(d, pos); ++ residue = bcm2835_dma_desc_size_pos(d, pos); ++ ++ /* ++ * If our non-cyclic transfer is done, then report ++ * complete and trigger the next tx now. This lets ++ * the dmaengine API be used synchronously from an IRQ ++ * handler. ++ */ ++ if (!d->cyclic && residue == 0) { ++ vchan_cookie_complete(&c->desc->vd); ++ bcm2835_dma_start_desc(c); ++ ret = dma_cookie_status(chan, cookie, txstate); ++ } + } else { +- txstate->residue = 0; ++ residue = 0; + } + ++ dma_set_residue(txstate, residue); ++ + spin_unlock_irqrestore(&c->vc.lock, flags); + + return ret; diff --git a/target/linux/brcm2708/patches-4.4/0408-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch b/target/linux/brcm2708/patches-4.4/0408-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch deleted file mode 100644 index 7229a5cf05..0000000000 --- a/target/linux/brcm2708/patches-4.4/0408-dmaengine-bcm2835-Fix-polling-for-completion-of-DMA-.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 467c8219ee56e75ab53f29b569f9fb5d033f57d4 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 3 Jun 2016 19:29:11 -0700 -Subject: [PATCH 408/423] dmaengine: bcm2835: Fix polling for completion of DMA - with interrupts masked. - -The tx_status hook is supposed to be safe to call from interrupt -context, but it wouldn't ever return completion for the last transfer, -meaning you couldn't poll for DMA completion with interrupts masked. - -This fixes IRQ handling for bcm2835's DSI1, which requires using the -DMA engine to write its registers due to a bug in the AXI bridge. - -Signed-off-by: Eric Anholt ---- - drivers/dma/bcm2835-dma.c | 24 +++++++++++++++++++----- - 1 file changed, 19 insertions(+), 5 deletions(-) - ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -588,16 +588,16 @@ static enum dma_status bcm2835_dma_tx_st - struct virt_dma_desc *vd; - enum dma_status ret; - unsigned long flags; -+ u32 residue; - - ret = dma_cookie_status(chan, cookie, txstate); -- if (ret == DMA_COMPLETE || !txstate) -+ if (ret == DMA_COMPLETE) - return ret; - - spin_lock_irqsave(&c->vc.lock, flags); - vd = vchan_find_desc(&c->vc, cookie); - if (vd) { -- txstate->residue = -- bcm2835_dma_desc_size(to_bcm2835_dma_desc(&vd->tx)); -+ residue = bcm2835_dma_desc_size(to_bcm2835_dma_desc(&vd->tx)); - } else if (c->desc && c->desc->vd.tx.cookie == cookie) { - struct bcm2835_desc *d = c->desc; - dma_addr_t pos; -@@ -609,11 +609,25 @@ static enum dma_status bcm2835_dma_tx_st - else - pos = 0; - -- txstate->residue = bcm2835_dma_desc_size_pos(d, pos); -+ residue = bcm2835_dma_desc_size_pos(d, pos); -+ -+ /* -+ * If our non-cyclic transfer is done, then report -+ * complete and trigger the next tx now. This lets -+ * the dmaengine API be used synchronously from an IRQ -+ * handler. -+ */ -+ if (!d->cyclic && residue == 0) { -+ vchan_cookie_complete(&c->desc->vd); -+ bcm2835_dma_start_desc(c); -+ ret = dma_cookie_status(chan, cookie, txstate); -+ } - } else { -- txstate->residue = 0; -+ residue = 0; - } - -+ dma_set_residue(txstate, residue); -+ - spin_unlock_irqrestore(&c->vc.lock, flags); - - return ret; diff --git a/target/linux/brcm2708/patches-4.4/0409-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch b/target/linux/brcm2708/patches-4.4/0409-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch new file mode 100644 index 0000000000..b4ca047df7 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0409-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch @@ -0,0 +1,76 @@ +From a008938ed54a702e72a8421776c1d3f97b79a97b Mon Sep 17 00:00:00 2001 +From: Thomas Kriechbaumer +Date: Fri, 3 Jun 2016 09:40:44 +0200 +Subject: [PATCH] BCM270X_DT: Add spi-rtc overlay on SPI0.0 + +Initial version only supports PCF2123 RTC. + +See: https://github.com/raspberrypi/linux/pull/1510 +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 +++++ + arch/arm/boot/dts/overlays/spi-rtc-overlay.dts | 33 ++++++++++++++++++++++++++ + 3 files changed, 40 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/spi-rtc-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -78,6 +78,7 @@ dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo + dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += spi-rtc.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -975,6 +975,12 @@ Load: dtoverlay=spi-gpio35-39 + Params: + + ++Name: spi-rtc ++Info: Adds support for a number of SPI Real Time Clock devices ++Load: dtoverlay=spi-rtc,= ++Params: pcf2123 Select the PCF2123 device ++ ++ + Name: spi1-1cs + Info: Enables spi1 with a single chip select (CS) line and associated spidev + dev node. The gpio pin number for the CS line and spidev device node +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/spi-rtc-overlay.dts +@@ -0,0 +1,33 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&spidev0>; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&spi0>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ rtc-pcf2123@0 { ++ compatible = "nxp,rtc-pcf2123"; ++ spi-max-frequency = <5000000>; ++ spi-cs-high = <1>; ++ reg = <0>; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ pcf2123 = <0>, "=0=1"; ++ }; ++}; diff --git a/target/linux/brcm2708/patches-4.4/0410-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch b/target/linux/brcm2708/patches-4.4/0410-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch deleted file mode 100644 index 235879725a..0000000000 --- a/target/linux/brcm2708/patches-4.4/0410-BCM270X_DT-Add-spi-rtc-overlay-on-SPI0.0.patch +++ /dev/null @@ -1,76 +0,0 @@ -From ae24592f7b8e0af654a25d18a8d26cd0e5799fdb Mon Sep 17 00:00:00 2001 -From: Thomas Kriechbaumer -Date: Fri, 3 Jun 2016 09:40:44 +0200 -Subject: [PATCH 410/423] BCM270X_DT: Add spi-rtc overlay on SPI0.0 - -Initial version only supports PCF2123 RTC. - -See: https://github.com/raspberrypi/linux/pull/1510 ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 +++++ - arch/arm/boot/dts/overlays/spi-rtc-overlay.dts | 33 ++++++++++++++++++++++++++ - 3 files changed, 40 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/spi-rtc-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -78,6 +78,7 @@ dtbo-$(RPI_DT_OVERLAYS) += smi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo - dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += spi-rtc.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -975,6 +975,12 @@ Load: dtoverlay=spi-gpio35-39 - Params: - - -+Name: spi-rtc -+Info: Adds support for a number of SPI Real Time Clock devices -+Load: dtoverlay=spi-rtc,= -+Params: pcf2123 Select the PCF2123 device -+ -+ - Name: spi1-1cs - Info: Enables spi1 with a single chip select (CS) line and associated spidev - dev node. The gpio pin number for the CS line and spidev device node ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/spi-rtc-overlay.dts -@@ -0,0 +1,33 @@ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&spidev0>; -+ __dormant__ { -+ status = "disabled"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&spi0>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ rtc-pcf2123@0 { -+ compatible = "nxp,rtc-pcf2123"; -+ spi-max-frequency = <5000000>; -+ spi-cs-high = <1>; -+ reg = <0>; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ pcf2123 = <0>, "=0=1"; -+ }; -+}; diff --git a/target/linux/brcm2708/patches-4.4/0410-rtc-Add-SPI-alias-for-pcf2123-driver.patch b/target/linux/brcm2708/patches-4.4/0410-rtc-Add-SPI-alias-for-pcf2123-driver.patch new file mode 100644 index 0000000000..574f3de8ef --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0410-rtc-Add-SPI-alias-for-pcf2123-driver.patch @@ -0,0 +1,20 @@ +From 2fbf5d24ff1f88d0aa977089549056cf4863f0de Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 15 Jun 2016 16:48:41 +0100 +Subject: [PATCH] rtc: Add SPI alias for pcf2123 driver + +Without this alias, Device Tree won't cause the driver +to be loaded. + +See: https://github.com/raspberrypi/linux/pull/1510 +--- + drivers/rtc/rtc-pcf2123.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/rtc/rtc-pcf2123.c ++++ b/drivers/rtc/rtc-pcf2123.c +@@ -358,3 +358,4 @@ MODULE_AUTHOR("Chris Verges +Date: Fri, 17 Jun 2016 12:03:39 +1000 +Subject: [PATCH] Added support for headphones, microphone and bclk_ratio + settings. + +This patch adds headphone and microphone capability to the Audio Injector sound card. The patch also sets the bit clock ratio for use in the bcm2835-i2s driver. The bcm2835-i2s can't handle an 8 kHz sample rate when the bit clock is at 12 MHz because its register is only 10 bits wide which can't represent the ch2 offset of 1508. For that reason, the rate constraint is added. +--- + sound/soc/bcm/audioinjector-pi-soundcard.c | 67 ++++++++++++++++++++++++++---- + 1 file changed, 58 insertions(+), 9 deletions(-) + +--- a/sound/soc/bcm/audioinjector-pi-soundcard.c ++++ b/sound/soc/bcm/audioinjector-pi-soundcard.c +@@ -29,16 +29,56 @@ + + #include "../codecs/wm8731.h" + +-static int audioinjector_pi_soundcard_dai_init(struct snd_soc_pcm_runtime *rtd) ++static const unsigned int bcm2835_rates_12000000[] = { ++ 32000, 44100, 48000, 96000, 88200, ++}; ++ ++static struct snd_pcm_hw_constraint_list bcm2835_constraints_12000000 = { ++ .list = bcm2835_rates_12000000, ++ .count = ARRAY_SIZE(bcm2835_rates_12000000), ++}; ++ ++static int snd_audioinjector_pi_soundcard_startup(struct snd_pcm_substream *substream) + { +- struct snd_soc_dapm_context *dapm = &rtd->card->dapm; ++ /* Setup constraints, because there is a 12 MHz XTAL on the board */ ++ snd_pcm_hw_constraint_list(substream->runtime, 0, ++ SNDRV_PCM_HW_PARAM_RATE, ++ &bcm2835_constraints_12000000); ++ return 0; ++} + +- // not connected +- snd_soc_dapm_nc_pin(dapm, "Mic Bias"); +- snd_soc_dapm_nc_pin(dapm, "MICIN"); +- snd_soc_dapm_nc_pin(dapm, "RHPOUT"); +- snd_soc_dapm_nc_pin(dapm, "LHPOUT"); ++static int snd_audioinjector_pi_soundcard_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + ++ switch (params_rate(params)){ ++ case 8000: ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 1508); ++ case 32000: ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 378); ++ case 44100: ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 274); ++ case 48000: ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 252); ++ case 88200: ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 136); ++ case 96000: ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 126); ++ default: ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 126); ++ } ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_audioinjector_pi_soundcard_ops = { ++ .startup = snd_audioinjector_pi_soundcard_startup, ++ .hw_params = snd_audioinjector_pi_soundcard_hw_params, ++}; ++ ++static int audioinjector_pi_soundcard_dai_init(struct snd_soc_pcm_runtime *rtd) ++{ + return snd_soc_dai_set_sysclk(rtd->codec_dai, WM8731_SYSCLK_XTAL, 12000000, SND_SOC_CLOCK_IN); + } + +@@ -50,30 +90,39 @@ static struct snd_soc_dai_link audioinje + .codec_dai_name = "wm8731-hifi", + .platform_name = "bcm2835-i2s.0", + .codec_name = "wm8731.1-001a", ++ .ops = &snd_audioinjector_pi_soundcard_ops, + .init = audioinjector_pi_soundcard_dai_init, + .dai_fmt = SND_SOC_DAIFMT_CBM_CFM|SND_SOC_DAIFMT_I2S|SND_SOC_DAIFMT_NB_NF, + }, + }; + + static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { ++ SND_SOC_DAPM_HP("Headphone Jack", NULL), + SND_SOC_DAPM_SPK("Ext Spk", NULL), + SND_SOC_DAPM_LINE("Line In Jacks", NULL), ++ SND_SOC_DAPM_MIC("Microphone", NULL), + }; + +-/* Corgi machine connections to the codec pins */ + static const struct snd_soc_dapm_route audioinjector_audio_map[] = { ++ /* headphone connected to LHPOUT, RHPOUT */ ++ {"Headphone Jack", NULL, "LHPOUT"}, ++ {"Headphone Jack", NULL, "RHPOUT"}, ++ + /* speaker connected to LOUT, ROUT */ + {"Ext Spk", NULL, "ROUT"}, + {"Ext Spk", NULL, "LOUT"}, + + /* line inputs */ + {"Line In Jacks", NULL, "Line Input"}, ++ ++ /* mic is connected to Mic Jack, with WM8731 Mic Bias */ ++ {"Microphone", NULL, "Mic Bias"}, + }; + + static struct snd_soc_card snd_soc_audioinjector = { + .name = "audioinjector-pi-soundcard", + .dai_link = audioinjector_pi_soundcard_dai, +- .num_links = 1, ++ .num_links = ARRAY_SIZE(audioinjector_pi_soundcard_dai), + + .dapm_widgets = wm8731_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), diff --git a/target/linux/brcm2708/patches-4.4/0411-rtc-Add-SPI-alias-for-pcf2123-driver.patch b/target/linux/brcm2708/patches-4.4/0411-rtc-Add-SPI-alias-for-pcf2123-driver.patch deleted file mode 100644 index c5dda321c3..0000000000 --- a/target/linux/brcm2708/patches-4.4/0411-rtc-Add-SPI-alias-for-pcf2123-driver.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 2306db770d37cfaa8fe2805febe84a504709fac8 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 411/423] rtc: Add SPI alias for pcf2123 driver - -Without this alias, Device Tree won't cause the driver -to be loaded. - -See: https://github.com/raspberrypi/linux/pull/1510 ---- - drivers/rtc/rtc-pcf2123.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/rtc/rtc-pcf2123.c -+++ b/drivers/rtc/rtc-pcf2123.c -@@ -358,3 +358,4 @@ MODULE_AUTHOR("Chris Verges -Date: Fri, 17 Jun 2016 12:03:39 +1000 -Subject: [PATCH 412/423] Added support for headphones, microphone and - bclk_ratio settings. - -This patch adds headphone and microphone capability to the Audio Injector sound card. The patch also sets the bit clock ratio for use in the bcm2835-i2s driver. The bcm2835-i2s can't handle an 8 kHz sample rate when the bit clock is at 12 MHz because its register is only 10 bits wide which can't represent the ch2 offset of 1508. For that reason, the rate constraint is added. ---- - sound/soc/bcm/audioinjector-pi-soundcard.c | 67 ++++++++++++++++++++++++++---- - 1 file changed, 58 insertions(+), 9 deletions(-) - ---- a/sound/soc/bcm/audioinjector-pi-soundcard.c -+++ b/sound/soc/bcm/audioinjector-pi-soundcard.c -@@ -29,16 +29,56 @@ - - #include "../codecs/wm8731.h" - --static int audioinjector_pi_soundcard_dai_init(struct snd_soc_pcm_runtime *rtd) -+static const unsigned int bcm2835_rates_12000000[] = { -+ 32000, 44100, 48000, 96000, 88200, -+}; -+ -+static struct snd_pcm_hw_constraint_list bcm2835_constraints_12000000 = { -+ .list = bcm2835_rates_12000000, -+ .count = ARRAY_SIZE(bcm2835_rates_12000000), -+}; -+ -+static int snd_audioinjector_pi_soundcard_startup(struct snd_pcm_substream *substream) - { -- struct snd_soc_dapm_context *dapm = &rtd->card->dapm; -+ /* Setup constraints, because there is a 12 MHz XTAL on the board */ -+ snd_pcm_hw_constraint_list(substream->runtime, 0, -+ SNDRV_PCM_HW_PARAM_RATE, -+ &bcm2835_constraints_12000000); -+ return 0; -+} - -- // not connected -- snd_soc_dapm_nc_pin(dapm, "Mic Bias"); -- snd_soc_dapm_nc_pin(dapm, "MICIN"); -- snd_soc_dapm_nc_pin(dapm, "RHPOUT"); -- snd_soc_dapm_nc_pin(dapm, "LHPOUT"); -+static int snd_audioinjector_pi_soundcard_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - -+ switch (params_rate(params)){ -+ case 8000: -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 1508); -+ case 32000: -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 378); -+ case 44100: -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 274); -+ case 48000: -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 252); -+ case 88200: -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 136); -+ case 96000: -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 126); -+ default: -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 126); -+ } -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_audioinjector_pi_soundcard_ops = { -+ .startup = snd_audioinjector_pi_soundcard_startup, -+ .hw_params = snd_audioinjector_pi_soundcard_hw_params, -+}; -+ -+static int audioinjector_pi_soundcard_dai_init(struct snd_soc_pcm_runtime *rtd) -+{ - return snd_soc_dai_set_sysclk(rtd->codec_dai, WM8731_SYSCLK_XTAL, 12000000, SND_SOC_CLOCK_IN); - } - -@@ -50,30 +90,39 @@ static struct snd_soc_dai_link audioinje - .codec_dai_name = "wm8731-hifi", - .platform_name = "bcm2835-i2s.0", - .codec_name = "wm8731.1-001a", -+ .ops = &snd_audioinjector_pi_soundcard_ops, - .init = audioinjector_pi_soundcard_dai_init, - .dai_fmt = SND_SOC_DAIFMT_CBM_CFM|SND_SOC_DAIFMT_I2S|SND_SOC_DAIFMT_NB_NF, - }, - }; - - static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = { -+ SND_SOC_DAPM_HP("Headphone Jack", NULL), - SND_SOC_DAPM_SPK("Ext Spk", NULL), - SND_SOC_DAPM_LINE("Line In Jacks", NULL), -+ SND_SOC_DAPM_MIC("Microphone", NULL), - }; - --/* Corgi machine connections to the codec pins */ - static const struct snd_soc_dapm_route audioinjector_audio_map[] = { -+ /* headphone connected to LHPOUT, RHPOUT */ -+ {"Headphone Jack", NULL, "LHPOUT"}, -+ {"Headphone Jack", NULL, "RHPOUT"}, -+ - /* speaker connected to LOUT, ROUT */ - {"Ext Spk", NULL, "ROUT"}, - {"Ext Spk", NULL, "LOUT"}, - - /* line inputs */ - {"Line In Jacks", NULL, "Line Input"}, -+ -+ /* mic is connected to Mic Jack, with WM8731 Mic Bias */ -+ {"Microphone", NULL, "Mic Bias"}, - }; - - static struct snd_soc_card snd_soc_audioinjector = { - .name = "audioinjector-pi-soundcard", - .dai_link = audioinjector_pi_soundcard_dai, -- .num_links = 1, -+ .num_links = ARRAY_SIZE(audioinjector_pi_soundcard_dai), - - .dapm_widgets = wm8731_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), diff --git a/target/linux/brcm2708/patches-4.4/0412-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch b/target/linux/brcm2708/patches-4.4/0412-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch new file mode 100644 index 0000000000..763688304f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0412-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch @@ -0,0 +1,272 @@ +From 98f0214603229df4038cc0d318111a37b10078a1 Mon Sep 17 00:00:00 2001 +From: DigitalDreamtime +Date: Mon, 9 May 2016 20:38:08 +0100 +Subject: [PATCH] IQaudIO: auto-mute for AMP+ and DigiAMP+ + +IQAudIO amplifier mute via GPIO22. Add dt params for "one-shot" unmute +and auto mute. + +Revision 2, auto mute implementing HiassofT suggestion to mute/unmute +using set_bias_level, rather than startup/shutdown.... +"By default DAPM waits 5 seconds (pmdown_time) before shutting down +playback streams so a close/stop immediately followed by open/start +doesn't trigger an amp mute+unmute." + +Tested on both AMP+ (via DAC+) and DigiAMP+, with both options... + +dtoverlay=iqaudio-dacplus,unmute_amp + "one-shot" unmute when kernel module loads. + +dtoverlay=iqaudio-dacplus,auto_mute_amp + Unmute amp when ALSA device opened by a client. Mute, with 5 second delay + when ALSA device closed. (Re-opening the device within the 5 second close + window, will cancel mute.) + +Revision 4, using gpiod. + +Revision 5, clean-up formatting before adding mute code. + - Convert tab plus 4 space formatting to 2x tab + - Remove '// NOT USED' commented code + +Revision 6, don't attempt to "one-shot" unmute amp, unless card is +successfully registered. + +Signed-off-by: DigitalDreamtime +--- + arch/arm/boot/dts/overlays/README | 4 + + .../boot/dts/overlays/iqaudio-dacplus-overlay.dts | 7 +- + sound/soc/bcm/iqaudio-dac.c | 144 ++++++++++++++++----- + 3 files changed, 124 insertions(+), 31 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -540,6 +540,10 @@ Params: 24db_digital_gain Allow ga + responsibility of the user to ensure that + the Digital volume control is set to a value + that does not result in clipping/distortion!) ++ auto_mute_amp If specified, unmute/mute the IQaudIO amp when ++ starting/stopping audio playback. ++ unmute_amp If specified, unmute the IQaudIO amp once when ++ the DAC driver module loads. + + + Name: justboom-dac +--- a/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts ++++ b/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts +@@ -30,14 +30,17 @@ + + fragment@2 { + target = <&sound>; +- frag2: __overlay__ { ++ iqaudio_dac: __overlay__ { + compatible = "iqaudio,iqaudio-dac"; + i2s-controller = <&i2s>; ++ mute-gpios = <&gpio 22 0>; + status = "okay"; + }; + }; + + __overrides__ { +- 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?"; ++ 24db_digital_gain = <&iqaudio_dac>,"iqaudio,24db_digital_gain?"; ++ auto_mute_amp = <&iqaudio_dac>,"iqaudio-dac,auto-mute-amp?"; ++ unmute_amp = <&iqaudio_dac>,"iqaudio-dac,unmute-amp?"; + }; + }; +--- a/sound/soc/bcm/iqaudio-dac.c ++++ b/sound/soc/bcm/iqaudio-dac.c +@@ -15,6 +15,7 @@ + */ + + #include ++#include + #include + + #include +@@ -25,6 +26,8 @@ + + static bool digital_gain_0db_limit = true; + ++static struct gpio_desc *mute_gpio; ++ + static int snd_rpi_iqaudio_dac_init(struct snd_soc_pcm_runtime *rtd) + { + if (digital_gain_0db_limit) +@@ -41,11 +44,9 @@ static int snd_rpi_iqaudio_dac_init(stru + } + + static int snd_rpi_iqaudio_dac_hw_params(struct snd_pcm_substream *substream, +- struct snd_pcm_hw_params *params) ++ struct snd_pcm_hw_params *params) + { + struct snd_soc_pcm_runtime *rtd = substream->private_data; +-// NOT USED struct snd_soc_dai *codec_dai = rtd->codec_dai; +-// NOT USED struct snd_soc_codec *codec = rtd->codec; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + + unsigned int sample_bits = +@@ -54,6 +55,56 @@ static int snd_rpi_iqaudio_dac_hw_params + return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); + } + ++static void snd_rpi_iqaudio_gpio_mute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) { ++ dev_info(card->dev, "%s: muting amp using GPIO22\n", ++ __func__); ++ gpiod_set_value_cansleep(mute_gpio, 0); ++ } ++} ++ ++static void snd_rpi_iqaudio_gpio_unmute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) { ++ dev_info(card->dev, "%s: un-muting amp using GPIO22\n", ++ __func__); ++ gpiod_set_value_cansleep(mute_gpio, 1); ++ } ++} ++ ++static int snd_rpi_iqaudio_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; ++ ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ ++ /* UNMUTE AMP */ ++ snd_rpi_iqaudio_gpio_unmute(card); ++ ++ break; ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ ++ /* MUTE AMP */ ++ snd_rpi_iqaudio_gpio_mute(card); ++ ++ break; ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ + /* machine stream operations */ + static struct snd_soc_ops snd_rpi_iqaudio_dac_ops = { + .hw_params = snd_rpi_iqaudio_dac_hw_params, +@@ -82,46 +133,81 @@ static struct snd_soc_card snd_rpi_iqaud + static int snd_rpi_iqaudio_dac_probe(struct platform_device *pdev) + { + int ret = 0; ++ bool gpio_unmute = false; + + snd_rpi_iqaudio_dac.dev = &pdev->dev; + + if (pdev->dev.of_node) { +- struct device_node *i2s_node; +- struct snd_soc_card *card = &snd_rpi_iqaudio_dac; +- struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_dac_dai[0]; +- i2s_node = of_parse_phandle(pdev->dev.of_node, +- "i2s-controller", 0); +- +- if (i2s_node) { +- dai->cpu_dai_name = NULL; +- dai->cpu_of_node = i2s_node; +- dai->platform_name = NULL; +- dai->platform_of_node = i2s_node; +- } +- +- digital_gain_0db_limit = !of_property_read_bool(pdev->dev.of_node, +- "iqaudio,24db_digital_gain"); +- if (of_property_read_string(pdev->dev.of_node, "card_name", +- &card->name)) +- card->name = "IQaudIODAC"; +- if (of_property_read_string(pdev->dev.of_node, "dai_name", +- &dai->name)) +- dai->name = "IQaudIO DAC"; +- if (of_property_read_string(pdev->dev.of_node, "dai_stream_name", +- &dai->stream_name)) +- dai->stream_name = "IQaudIO DAC HiFi"; ++ struct device_node *i2s_node; ++ struct snd_soc_card *card = &snd_rpi_iqaudio_dac; ++ struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_dac_dai[0]; ++ bool auto_gpio_mute = false; ++ ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ digital_gain_0db_limit = !of_property_read_bool( ++ pdev->dev.of_node, "iqaudio,24db_digital_gain"); ++ ++ if (of_property_read_string(pdev->dev.of_node, "card_name", ++ &card->name)) ++ card->name = "IQaudIODAC"; ++ ++ if (of_property_read_string(pdev->dev.of_node, "dai_name", ++ &dai->name)) ++ dai->name = "IQaudIO DAC"; ++ ++ if (of_property_read_string(pdev->dev.of_node, ++ "dai_stream_name", &dai->stream_name)) ++ dai->stream_name = "IQaudIO DAC HiFi"; ++ ++ /* gpio_unmute - one time unmute amp using GPIO */ ++ gpio_unmute = of_property_read_bool(pdev->dev.of_node, ++ "iqaudio-dac,unmute-amp"); ++ ++ /* auto_gpio_mute - mute/unmute amp using GPIO */ ++ auto_gpio_mute = of_property_read_bool(pdev->dev.of_node, ++ "iqaudio-dac,auto-mute-amp"); ++ ++ if (auto_gpio_mute || gpio_unmute) { ++ mute_gpio = devm_gpiod_get_optional(&pdev->dev, "mute", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio)) { ++ ret = PTR_ERR(mute_gpio); ++ dev_err(&pdev->dev, ++ "Failed to get mute gpio: %d\n", ret); ++ return ret; ++ } ++ ++ if (auto_gpio_mute && mute_gpio) ++ snd_rpi_iqaudio_dac.set_bias_level = ++ snd_rpi_iqaudio_set_bias_level; ++ } + } + + ret = snd_soc_register_card(&snd_rpi_iqaudio_dac); +- if (ret) ++ if (ret) { + dev_err(&pdev->dev, + "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (gpio_unmute && mute_gpio) ++ snd_rpi_iqaudio_gpio_unmute(&snd_rpi_iqaudio_dac); + +- return ret; ++ return 0; + } + + static int snd_rpi_iqaudio_dac_remove(struct platform_device *pdev) + { ++ snd_rpi_iqaudio_gpio_mute(&snd_rpi_iqaudio_dac); ++ + return snd_soc_unregister_card(&snd_rpi_iqaudio_dac); + } + diff --git a/target/linux/brcm2708/patches-4.4/0413-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch b/target/linux/brcm2708/patches-4.4/0413-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch deleted file mode 100644 index 1e6f65abd5..0000000000 --- a/target/linux/brcm2708/patches-4.4/0413-IQaudIO-auto-mute-for-AMP-and-DigiAMP.patch +++ /dev/null @@ -1,272 +0,0 @@ -From c5368041bdadf28f7081deb6e11c9aaafe05377f Mon Sep 17 00:00:00 2001 -From: DigitalDreamtime -Date: Mon, 9 May 2016 20:38:08 +0100 -Subject: [PATCH 413/423] IQaudIO: auto-mute for AMP+ and DigiAMP+ - -IQAudIO amplifier mute via GPIO22. Add dt params for "one-shot" unmute -and auto mute. - -Revision 2, auto mute implementing HiassofT suggestion to mute/unmute -using set_bias_level, rather than startup/shutdown.... -"By default DAPM waits 5 seconds (pmdown_time) before shutting down -playback streams so a close/stop immediately followed by open/start -doesn't trigger an amp mute+unmute." - -Tested on both AMP+ (via DAC+) and DigiAMP+, with both options... - -dtoverlay=iqaudio-dacplus,unmute_amp - "one-shot" unmute when kernel module loads. - -dtoverlay=iqaudio-dacplus,auto_mute_amp - Unmute amp when ALSA device opened by a client. Mute, with 5 second delay - when ALSA device closed. (Re-opening the device within the 5 second close - window, will cancel mute.) - -Revision 4, using gpiod. - -Revision 5, clean-up formatting before adding mute code. - - Convert tab plus 4 space formatting to 2x tab - - Remove '// NOT USED' commented code - -Revision 6, don't attempt to "one-shot" unmute amp, unless card is -successfully registered. - -Signed-off-by: DigitalDreamtime ---- - arch/arm/boot/dts/overlays/README | 4 + - .../boot/dts/overlays/iqaudio-dacplus-overlay.dts | 7 +- - sound/soc/bcm/iqaudio-dac.c | 144 ++++++++++++++++----- - 3 files changed, 124 insertions(+), 31 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -540,6 +540,10 @@ Params: 24db_digital_gain Allow ga - responsibility of the user to ensure that - the Digital volume control is set to a value - that does not result in clipping/distortion!) -+ auto_mute_amp If specified, unmute/mute the IQaudIO amp when -+ starting/stopping audio playback. -+ unmute_amp If specified, unmute the IQaudIO amp once when -+ the DAC driver module loads. - - - Name: justboom-dac ---- a/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts -+++ b/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts -@@ -30,14 +30,17 @@ - - fragment@2 { - target = <&sound>; -- frag2: __overlay__ { -+ iqaudio_dac: __overlay__ { - compatible = "iqaudio,iqaudio-dac"; - i2s-controller = <&i2s>; -+ mute-gpios = <&gpio 22 0>; - status = "okay"; - }; - }; - - __overrides__ { -- 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?"; -+ 24db_digital_gain = <&iqaudio_dac>,"iqaudio,24db_digital_gain?"; -+ auto_mute_amp = <&iqaudio_dac>,"iqaudio-dac,auto-mute-amp?"; -+ unmute_amp = <&iqaudio_dac>,"iqaudio-dac,unmute-amp?"; - }; - }; ---- a/sound/soc/bcm/iqaudio-dac.c -+++ b/sound/soc/bcm/iqaudio-dac.c -@@ -15,6 +15,7 @@ - */ - - #include -+#include - #include - - #include -@@ -25,6 +26,8 @@ - - static bool digital_gain_0db_limit = true; - -+static struct gpio_desc *mute_gpio; -+ - static int snd_rpi_iqaudio_dac_init(struct snd_soc_pcm_runtime *rtd) - { - if (digital_gain_0db_limit) -@@ -41,11 +44,9 @@ static int snd_rpi_iqaudio_dac_init(stru - } - - static int snd_rpi_iqaudio_dac_hw_params(struct snd_pcm_substream *substream, -- struct snd_pcm_hw_params *params) -+ struct snd_pcm_hw_params *params) - { - struct snd_soc_pcm_runtime *rtd = substream->private_data; --// NOT USED struct snd_soc_dai *codec_dai = rtd->codec_dai; --// NOT USED struct snd_soc_codec *codec = rtd->codec; - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - - unsigned int sample_bits = -@@ -54,6 +55,56 @@ static int snd_rpi_iqaudio_dac_hw_params - return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); - } - -+static void snd_rpi_iqaudio_gpio_mute(struct snd_soc_card *card) -+{ -+ if (mute_gpio) { -+ dev_info(card->dev, "%s: muting amp using GPIO22\n", -+ __func__); -+ gpiod_set_value_cansleep(mute_gpio, 0); -+ } -+} -+ -+static void snd_rpi_iqaudio_gpio_unmute(struct snd_soc_card *card) -+{ -+ if (mute_gpio) { -+ dev_info(card->dev, "%s: un-muting amp using GPIO22\n", -+ __func__); -+ gpiod_set_value_cansleep(mute_gpio, 1); -+ } -+} -+ -+static int snd_rpi_iqaudio_set_bias_level(struct snd_soc_card *card, -+ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) -+{ -+ struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; -+ -+ if (dapm->dev != codec_dai->dev) -+ return 0; -+ -+ switch (level) { -+ case SND_SOC_BIAS_PREPARE: -+ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) -+ break; -+ -+ /* UNMUTE AMP */ -+ snd_rpi_iqaudio_gpio_unmute(card); -+ -+ break; -+ case SND_SOC_BIAS_STANDBY: -+ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) -+ break; -+ -+ /* MUTE AMP */ -+ snd_rpi_iqaudio_gpio_mute(card); -+ -+ break; -+ default: -+ break; -+ } -+ -+ return 0; -+} -+ - /* machine stream operations */ - static struct snd_soc_ops snd_rpi_iqaudio_dac_ops = { - .hw_params = snd_rpi_iqaudio_dac_hw_params, -@@ -82,46 +133,81 @@ static struct snd_soc_card snd_rpi_iqaud - static int snd_rpi_iqaudio_dac_probe(struct platform_device *pdev) - { - int ret = 0; -+ bool gpio_unmute = false; - - snd_rpi_iqaudio_dac.dev = &pdev->dev; - - if (pdev->dev.of_node) { -- struct device_node *i2s_node; -- struct snd_soc_card *card = &snd_rpi_iqaudio_dac; -- struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_dac_dai[0]; -- i2s_node = of_parse_phandle(pdev->dev.of_node, -- "i2s-controller", 0); -- -- if (i2s_node) { -- dai->cpu_dai_name = NULL; -- dai->cpu_of_node = i2s_node; -- dai->platform_name = NULL; -- dai->platform_of_node = i2s_node; -- } -- -- digital_gain_0db_limit = !of_property_read_bool(pdev->dev.of_node, -- "iqaudio,24db_digital_gain"); -- if (of_property_read_string(pdev->dev.of_node, "card_name", -- &card->name)) -- card->name = "IQaudIODAC"; -- if (of_property_read_string(pdev->dev.of_node, "dai_name", -- &dai->name)) -- dai->name = "IQaudIO DAC"; -- if (of_property_read_string(pdev->dev.of_node, "dai_stream_name", -- &dai->stream_name)) -- dai->stream_name = "IQaudIO DAC HiFi"; -+ struct device_node *i2s_node; -+ struct snd_soc_card *card = &snd_rpi_iqaudio_dac; -+ struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_dac_dai[0]; -+ bool auto_gpio_mute = false; -+ -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ -+ digital_gain_0db_limit = !of_property_read_bool( -+ pdev->dev.of_node, "iqaudio,24db_digital_gain"); -+ -+ if (of_property_read_string(pdev->dev.of_node, "card_name", -+ &card->name)) -+ card->name = "IQaudIODAC"; -+ -+ if (of_property_read_string(pdev->dev.of_node, "dai_name", -+ &dai->name)) -+ dai->name = "IQaudIO DAC"; -+ -+ if (of_property_read_string(pdev->dev.of_node, -+ "dai_stream_name", &dai->stream_name)) -+ dai->stream_name = "IQaudIO DAC HiFi"; -+ -+ /* gpio_unmute - one time unmute amp using GPIO */ -+ gpio_unmute = of_property_read_bool(pdev->dev.of_node, -+ "iqaudio-dac,unmute-amp"); -+ -+ /* auto_gpio_mute - mute/unmute amp using GPIO */ -+ auto_gpio_mute = of_property_read_bool(pdev->dev.of_node, -+ "iqaudio-dac,auto-mute-amp"); -+ -+ if (auto_gpio_mute || gpio_unmute) { -+ mute_gpio = devm_gpiod_get_optional(&pdev->dev, "mute", -+ GPIOD_OUT_LOW); -+ if (IS_ERR(mute_gpio)) { -+ ret = PTR_ERR(mute_gpio); -+ dev_err(&pdev->dev, -+ "Failed to get mute gpio: %d\n", ret); -+ return ret; -+ } -+ -+ if (auto_gpio_mute && mute_gpio) -+ snd_rpi_iqaudio_dac.set_bias_level = -+ snd_rpi_iqaudio_set_bias_level; -+ } - } - - ret = snd_soc_register_card(&snd_rpi_iqaudio_dac); -- if (ret) -+ if (ret) { - dev_err(&pdev->dev, - "snd_soc_register_card() failed: %d\n", ret); -+ return ret; -+ } -+ -+ if (gpio_unmute && mute_gpio) -+ snd_rpi_iqaudio_gpio_unmute(&snd_rpi_iqaudio_dac); - -- return ret; -+ return 0; - } - - static int snd_rpi_iqaudio_dac_remove(struct platform_device *pdev) - { -+ snd_rpi_iqaudio_gpio_mute(&snd_rpi_iqaudio_dac); -+ - return snd_soc_unregister_card(&snd_rpi_iqaudio_dac); - } - diff --git a/target/linux/brcm2708/patches-4.4/0413-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch b/target/linux/brcm2708/patches-4.4/0413-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch new file mode 100644 index 0000000000..c644066414 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0413-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch @@ -0,0 +1,28 @@ +From 3aa91ff84515641bdc7a3b2ddf4638af0942bc56 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Jun 2016 16:37:46 +0100 +Subject: [PATCH] mmc: Apply ERASE_BROKEN quirks correctly + +Signed-off-by: Phil Elwell +--- + drivers/mmc/card/block.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -2563,12 +2563,9 @@ static const struct mmc_fixup blk_fixups + * On some Kingston SD cards, multiple erases of less than 64 + * sectors can cause corruption. + */ +- MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), +- MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), +- MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), + + END_FIXUP + }; diff --git a/target/linux/brcm2708/patches-4.4/0414-enable-led-support-for-xpad-driver-fixes-flashing-le.patch b/target/linux/brcm2708/patches-4.4/0414-enable-led-support-for-xpad-driver-fixes-flashing-le.patch new file mode 100644 index 0000000000..45ffaee247 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0414-enable-led-support-for-xpad-driver-fixes-flashing-le.patch @@ -0,0 +1,31 @@ +From 37d18c9d142632b625e03586657631099217dd5d Mon Sep 17 00:00:00 2001 +From: Jools Wills +Date: Sun, 26 Jun 2016 16:28:48 +0000 +Subject: [PATCH] enable led support for xpad driver - fixes flashing leds on + controller + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -559,6 +559,7 @@ CONFIG_JOYSTICK_IFORCE=m + CONFIG_JOYSTICK_IFORCE_USB=y + CONFIG_JOYSTICK_XPAD=m + CONFIG_JOYSTICK_XPAD_FF=y ++CONFIG_JOYSTICK_XPAD_LEDS=y + CONFIG_JOYSTICK_RPISENSE=m + CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -552,6 +552,7 @@ CONFIG_JOYSTICK_IFORCE=m + CONFIG_JOYSTICK_IFORCE_USB=y + CONFIG_JOYSTICK_XPAD=m + CONFIG_JOYSTICK_XPAD_FF=y ++CONFIG_JOYSTICK_XPAD_LEDS=y + CONFIG_JOYSTICK_RPISENSE=m + CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m diff --git a/target/linux/brcm2708/patches-4.4/0414-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch b/target/linux/brcm2708/patches-4.4/0414-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch deleted file mode 100644 index 97f95891cf..0000000000 --- a/target/linux/brcm2708/patches-4.4/0414-mmc-Apply-ERASE_BROKEN-quirks-correctly.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 62f0d8320a176602d37c51fad03cafc736441ad4 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 23 Jun 2016 16:37:46 +0100 -Subject: [PATCH 414/423] mmc: Apply ERASE_BROKEN quirks correctly - -Signed-off-by: Phil Elwell ---- - drivers/mmc/card/block.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - ---- a/drivers/mmc/card/block.c -+++ b/drivers/mmc/card/block.c -@@ -2563,12 +2563,9 @@ static const struct mmc_fixup blk_fixups - * On some Kingston SD cards, multiple erases of less than 64 - * sectors can cause corruption. - */ -- MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, -- MMC_QUIRK_ERASE_BROKEN), -- MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk_mmc, -- MMC_QUIRK_ERASE_BROKEN), -- MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk_mmc, -- MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), - - END_FIXUP - }; diff --git a/target/linux/brcm2708/patches-4.4/0415-Add-critical-information-for-getting-pi3-miniuart-bt.patch b/target/linux/brcm2708/patches-4.4/0415-Add-critical-information-for-getting-pi3-miniuart-bt.patch new file mode 100644 index 0000000000..dc3871d5b6 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0415-Add-critical-information-for-getting-pi3-miniuart-bt.patch @@ -0,0 +1,25 @@ +From 740fa92fd41e2c4dd5798d462fe4646d0cc6cc48 Mon Sep 17 00:00:00 2001 +From: David Lechner +Date: Mon, 27 Jun 2016 22:52:22 -0500 +Subject: [PATCH] Add critical information for getting pi3-miniuart-bt overlay + to work + +Bluetooth on RPi 3 using uart1 will not work without setting core_freq=250 in config.txt. This is not +documented anywhere, so this seems like a good place to start. +--- + arch/arm/boot/dts/overlays/README | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -691,7 +691,9 @@ Info: Switch Pi3 Bluetooth function to + N.B. It is also necessary to edit /lib/systemd/system/hciuart.service + and replace ttyAMA0 with ttyS0, unless you have a system with udev rules + that create /dev/serial0 and /dev/serial1, in which case use +- /dev/serial1 instead because it will always be correct. ++ /dev/serial1 instead because it will always be correct. Furthermore, ++ you must also set core_freq=250 in config.txt or the miniuart will not ++ work. + Load: dtoverlay=pi3-miniuart-bt + Params: + diff --git a/target/linux/brcm2708/patches-4.4/0415-enable-led-support-for-xpad-driver-fixes-flashing-le.patch b/target/linux/brcm2708/patches-4.4/0415-enable-led-support-for-xpad-driver-fixes-flashing-le.patch deleted file mode 100644 index 6d280b0721..0000000000 --- a/target/linux/brcm2708/patches-4.4/0415-enable-led-support-for-xpad-driver-fixes-flashing-le.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 7c9908c6f70b0c8c7213d663f8e517b5321ebfbe Mon Sep 17 00:00:00 2001 -From: Jools Wills -Date: Sun, 26 Jun 2016 16:28:48 +0000 -Subject: [PATCH 415/423] enable led support for xpad driver - fixes flashing - leds on controller - ---- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) - ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -559,6 +559,7 @@ CONFIG_JOYSTICK_IFORCE=m - CONFIG_JOYSTICK_IFORCE_USB=y - CONFIG_JOYSTICK_XPAD=m - CONFIG_JOYSTICK_XPAD_FF=y -+CONFIG_JOYSTICK_XPAD_LEDS=y - CONFIG_JOYSTICK_RPISENSE=m - CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -552,6 +552,7 @@ CONFIG_JOYSTICK_IFORCE=m - CONFIG_JOYSTICK_IFORCE_USB=y - CONFIG_JOYSTICK_XPAD=m - CONFIG_JOYSTICK_XPAD_FF=y -+CONFIG_JOYSTICK_XPAD_LEDS=y - CONFIG_JOYSTICK_RPISENSE=m - CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m diff --git a/target/linux/brcm2708/patches-4.4/0416-Add-critical-information-for-getting-pi3-miniuart-bt.patch b/target/linux/brcm2708/patches-4.4/0416-Add-critical-information-for-getting-pi3-miniuart-bt.patch deleted file mode 100644 index 3c1a46395a..0000000000 --- a/target/linux/brcm2708/patches-4.4/0416-Add-critical-information-for-getting-pi3-miniuart-bt.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 97230b9a008e1c6707ad1bafa4ebd4d6b11a022f Mon Sep 17 00:00:00 2001 -From: David Lechner -Date: Mon, 27 Jun 2016 22:52:22 -0500 -Subject: [PATCH 416/423] Add critical information for getting pi3-miniuart-bt - overlay to work - -Bluetooth on RPi 3 using uart1 will not work without setting core_freq=250 in config.txt. This is not -documented anywhere, so this seems like a good place to start. ---- - arch/arm/boot/dts/overlays/README | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -691,7 +691,9 @@ Info: Switch Pi3 Bluetooth function to - N.B. It is also necessary to edit /lib/systemd/system/hciuart.service - and replace ttyAMA0 with ttyS0, unless you have a system with udev rules - that create /dev/serial0 and /dev/serial1, in which case use -- /dev/serial1 instead because it will always be correct. -+ /dev/serial1 instead because it will always be correct. Furthermore, -+ you must also set core_freq=250 in config.txt or the miniuart will not -+ work. - Load: dtoverlay=pi3-miniuart-bt - Params: - diff --git a/target/linux/brcm2708/patches-4.4/0416-bcm2835-sdhost-Improvements-to-error-recovery.patch b/target/linux/brcm2708/patches-4.4/0416-bcm2835-sdhost-Improvements-to-error-recovery.patch new file mode 100644 index 0000000000..0437931d16 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0416-bcm2835-sdhost-Improvements-to-error-recovery.patch @@ -0,0 +1,312 @@ +From d90c379ffd993c72371252fe7840c14e4428410b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 15 Jun 2016 17:13:55 +0100 +Subject: [PATCH] bcm2835-sdhost: Improvements to error recovery + +1) Try to avoid reducing overclock when a card is removed. + +2) Reset overclock on card insertion. + +3) Reduce logging when errors occur, lowering the severity of + some messages and making others conditional on the debug + flag. + +4) Attempt to identify a disconnected SD bus earlier, treating a + zero returned OCR (voltage support) as an error condition. + +Signed-off-by: Phil Elwell +--- + drivers/mmc/host/bcm2835-sdhost.c | 117 ++++++++++++++++++++++++-------------- + 1 file changed, 74 insertions(+), 43 deletions(-) + +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -206,6 +207,7 @@ struct bcm2835_host { + struct timeval stop_time; /* when the last stop was issued */ + u32 delay_after_stop; /* minimum time between stop and subsequent data transfer */ + u32 delay_after_this_stop; /* minimum time between this stop and subsequent data transfer */ ++ u32 user_overclock_50; /* User's preferred frequency to use when 50MHz is requested (in MHz) */ + u32 overclock_50; /* frequency to use when 50MHz is requested (in MHz) */ + u32 overclock; /* Current frequency if overclocked, else zero */ + u32 pio_limit; /* Maximum block count for PIO (0 = always DMA) */ +@@ -282,7 +284,7 @@ static void log_dump(void) + do { + entry = sdhost_log_buf + idx; + if (entry->event[0] != '\0') +- pr_err("[%08x] %.4s %x %x\n", ++ pr_info("[%08x] %.4s %x %x\n", + entry->timestamp, + entry->event, + entry->param1, +@@ -324,7 +326,7 @@ static void bcm2835_sdhost_dumpcmd(struc + const char *label) + { + if (cmd) +- pr_err("%s:%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", ++ pr_info("%s:%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", + mmc_hostname(host->mmc), + (cmd == host->cmd) ? '>' : ' ', + label, cmd->opcode, cmd->arg, cmd->flags, +@@ -339,7 +341,7 @@ static void bcm2835_sdhost_dumpregs(stru + bcm2835_sdhost_dumpcmd(host, host->mrq->sbc, "sbc"); + bcm2835_sdhost_dumpcmd(host, host->mrq->cmd, "cmd"); + if (host->mrq->data) +- pr_err("%s: data blocks %x blksz %x - err %d\n", ++ pr_info("%s: data blocks %x blksz %x - err %d\n", + mmc_hostname(host->mmc), + host->mrq->data->blocks, + host->mrq->data->blksz, +@@ -347,53 +349,53 @@ static void bcm2835_sdhost_dumpregs(stru + bcm2835_sdhost_dumpcmd(host, host->mrq->stop, "stop"); + } + +- pr_err("%s: =========== REGISTER DUMP ===========\n", ++ pr_info("%s: =========== REGISTER DUMP ===========\n", + mmc_hostname(host->mmc)); + +- pr_err("%s: SDCMD 0x%08x\n", ++ pr_info("%s: SDCMD 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCMD)); +- pr_err("%s: SDARG 0x%08x\n", ++ pr_info("%s: SDARG 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDARG)); +- pr_err("%s: SDTOUT 0x%08x\n", ++ pr_info("%s: SDTOUT 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDTOUT)); +- pr_err("%s: SDCDIV 0x%08x\n", ++ pr_info("%s: SDCDIV 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCDIV)); +- pr_err("%s: SDRSP0 0x%08x\n", ++ pr_info("%s: SDRSP0 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP0)); +- pr_err("%s: SDRSP1 0x%08x\n", ++ pr_info("%s: SDRSP1 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP1)); +- pr_err("%s: SDRSP2 0x%08x\n", ++ pr_info("%s: SDRSP2 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP2)); + pr_err("%s: SDRSP3 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP3)); +- pr_err("%s: SDHSTS 0x%08x\n", ++ pr_info("%s: SDHSTS 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHSTS)); +- pr_err("%s: SDVDD 0x%08x\n", ++ pr_info("%s: SDVDD 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDVDD)); +- pr_err("%s: SDEDM 0x%08x\n", ++ pr_info("%s: SDEDM 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDEDM)); +- pr_err("%s: SDHCFG 0x%08x\n", ++ pr_info("%s: SDHCFG 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHCFG)); +- pr_err("%s: SDHBCT 0x%08x\n", ++ pr_info("%s: SDHBCT 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBCT)); +- pr_err("%s: SDHBLC 0x%08x\n", ++ pr_info("%s: SDHBLC 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBLC)); + +- pr_err("%s: ===========================================\n", ++ pr_info("%s: ===========================================\n", + mmc_hostname(host->mmc)); + } + +@@ -608,7 +610,7 @@ static void bcm2835_sdhost_read_block_pi + (fsm_state != SDEDM_FSM_READCRC)) { + hsts = bcm2835_sdhost_read(host, + SDHSTS); +- pr_err("%s: fsm %x, hsts %x\n", ++ pr_info("%s: fsm %x, hsts %x\n", + mmc_hostname(host->mmc), + fsm_state, hsts); + if (hsts & SDHSTS_ERROR_MASK) +@@ -698,7 +700,7 @@ static void bcm2835_sdhost_write_block_p + (fsm_state != SDEDM_FSM_WRITESTART2)) { + hsts = bcm2835_sdhost_read(host, + SDHSTS); +- pr_err("%s: fsm %x, hsts %x\n", ++ pr_info("%s: fsm %x, hsts %x\n", + mmc_hostname(host->mmc), + fsm_state, hsts); + if (hsts & SDHSTS_ERROR_MASK) +@@ -953,9 +955,10 @@ bool bcm2835_sdhost_send_command(struct + + while (bcm2835_sdhost_read(host, SDCMD) & SDCMD_NEW_FLAG) { + if (timeout == 0) { +- pr_err("%s: previous command never completed.\n", ++ pr_warn("%s: previous command never completed.\n", + mmc_hostname(host->mmc)); +- bcm2835_sdhost_dumpregs(host); ++ if (host->debug) ++ bcm2835_sdhost_dumpregs(host); + cmd->error = -EILSEQ; + tasklet_schedule(&host->finish_tasklet); + return false; +@@ -1213,10 +1216,12 @@ static void bcm2835_sdhost_finish_comman + + /* Check for errors */ + if (sdcmd & SDCMD_NEW_FLAG) { +- pr_err("%s: command never completed.\n", +- mmc_hostname(host->mmc)); +- bcm2835_sdhost_dumpregs(host); +- host->cmd->error = -EIO; ++ if (host->debug) { ++ pr_err("%s: command %d never completed.\n", ++ mmc_hostname(host->mmc), host->cmd->opcode); ++ bcm2835_sdhost_dumpregs(host); ++ } ++ host->cmd->error = -EILSEQ; + tasklet_schedule(&host->finish_tasklet); + return; + } else if (sdcmd & SDCMD_FAIL_FLAG) { +@@ -1238,15 +1243,14 @@ static void bcm2835_sdhost_finish_comman + } else { + if (sdhsts & SDHSTS_CMD_TIME_OUT) { + if (host->debug) +- pr_err("%s: command %d timeout\n", ++ pr_warn("%s: command %d timeout\n", + mmc_hostname(host->mmc), + host->cmd->opcode); + host->cmd->error = -ETIMEDOUT; + } else { +- pr_err("%s: unexpected command %d error\n", ++ pr_warn("%s: unexpected command %d error\n", + mmc_hostname(host->mmc), + host->cmd->opcode); +- bcm2835_sdhost_dumpregs(host); + host->cmd->error = -EILSEQ; + } + tasklet_schedule(&host->finish_tasklet); +@@ -1370,8 +1374,10 @@ static void bcm2835_sdhost_busy_irq(stru + } else if (intmask & SDHSTS_CMD_TIME_OUT) + host->cmd->error = -ETIMEDOUT; + +- log_dump(); +- bcm2835_sdhost_dumpregs(host); ++ if (host->debug) { ++ log_dump(); ++ bcm2835_sdhost_dumpregs(host); ++ } + } + else + bcm2835_sdhost_finish_command(host, NULL); +@@ -1595,7 +1601,7 @@ void bcm2835_sdhost_set_clock(struct bcm + host->overclock_50 = (clock/MHZ); + + if (clock != host->overclock) { +- pr_warn("%s: overclocking to %dHz\n", ++ pr_info("%s: overclocking to %dHz\n", + mmc_hostname(host->mmc), clock); + host->overclock = clock; + } +@@ -1605,6 +1611,11 @@ void bcm2835_sdhost_set_clock(struct bcm + pr_warn("%s: cancelling overclock\n", + mmc_hostname(host->mmc)); + } ++ } else if (input_clock == 0) { ++ /* Reset the preferred overclock when the clock is stopped. ++ * This always happens during initialisation. */ ++ host->overclock_50 = host->user_overclock_50; ++ host->overclock = 0; + } + + /* Set the timeout to 500ms */ +@@ -1678,13 +1689,15 @@ static void bcm2835_sdhost_request(struc + log_event("REQ<", (u32)mrq, edm); + if ((fsm != SDEDM_FSM_IDENTMODE) && + (fsm != SDEDM_FSM_DATAMODE)) { +- pr_err("%s: previous command (%d) not complete (EDM %x)\n", +- mmc_hostname(host->mmc), +- bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK, +- edm); + log_event("REQ!", (u32)mrq, edm); +- log_dump(); +- bcm2835_sdhost_dumpregs(host); ++ if (host->debug) { ++ pr_warn("%s: previous command (%d) not complete (EDM %x)\n", ++ mmc_hostname(host->mmc), ++ bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK, ++ edm); ++ log_dump(); ++ bcm2835_sdhost_dumpregs(host); ++ } + mrq->cmd->error = -EILSEQ; + tasklet_schedule(&host->finish_tasklet); + mmiowb(); +@@ -1814,16 +1827,19 @@ static void bcm2835_sdhost_tasklet_finis + mrq = host->mrq; + + /* Drop the overclock after any data corruption, or after any +- error overclocked */ ++ * error while overclocked. Ignore errors for status commands, ++ * as they are likely when a card is ejected. */ + if (host->overclock) { +- if ((mrq->cmd && mrq->cmd->error) || ++ if ((mrq->cmd && mrq->cmd->error && ++ (mrq->cmd->opcode != MMC_SEND_STATUS)) || + (mrq->data && mrq->data->error) || +- (mrq->stop && mrq->stop->error)) { ++ (mrq->stop && mrq->stop->error) || ++ (mrq->sbc && mrq->sbc->error)) { + host->overclock_50--; + pr_warn("%s: reducing overclock due to errors\n", + mmc_hostname(host->mmc)); + host->reset_clock = 1; +- mrq->cmd->error = -EILSEQ; ++ mrq->cmd->error = -ETIMEDOUT; + mrq->cmd->retries = 1; + } + } +@@ -1848,6 +1864,21 @@ static void bcm2835_sdhost_tasklet_finis + mmc_hostname(host->mmc), err); + } + ++ /* The SDHOST block doesn't report any errors for a disconnected ++ interface. All cards and SDIO devices should report some supported ++ voltage range, so a zero response to SEND_OP_COND, IO_SEND_OP_COND ++ or APP_SEND_OP_COND can be treated as an error. */ ++ if (((mrq->cmd->opcode == MMC_SEND_OP_COND) || ++ (mrq->cmd->opcode == SD_IO_SEND_OP_COND) || ++ (mrq->cmd->opcode == SD_APP_OP_COND)) && ++ (mrq->cmd->error == 0) && ++ (mrq->cmd->resp[0] == 0)) { ++ mrq->cmd->error = -ETIMEDOUT; ++ if (host->debug) ++ pr_info("%s: faking timeout due to zero OCR\n", ++ mmc_hostname(host->mmc)); ++ } ++ + mmc_request_done(host->mmc, mrq); + log_event("TSK>", (u32)mrq, 0); + } +@@ -2023,7 +2054,7 @@ static int bcm2835_sdhost_probe(struct p + &host->delay_after_stop); + of_property_read_u32(node, + "brcm,overclock-50", +- &host->overclock_50); ++ &host->user_overclock_50); + of_property_read_u32(node, + "brcm,pio-limit", + &host->pio_limit); diff --git a/target/linux/brcm2708/patches-4.4/0417-bcm2835-sdhost-Improvements-to-error-recovery.patch b/target/linux/brcm2708/patches-4.4/0417-bcm2835-sdhost-Improvements-to-error-recovery.patch deleted file mode 100644 index 7f770658c8..0000000000 --- a/target/linux/brcm2708/patches-4.4/0417-bcm2835-sdhost-Improvements-to-error-recovery.patch +++ /dev/null @@ -1,312 +0,0 @@ -From 336a4fae0a026365e58842b5df9e275858938f79 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 15 Jun 2016 17:13:55 +0100 -Subject: [PATCH 417/423] bcm2835-sdhost: Improvements to error recovery - -1) Try to avoid reducing overclock when a card is removed. - -2) Reset overclock on card insertion. - -3) Reduce logging when errors occur, lowering the severity of - some messages and making others conditional on the debug - flag. - -4) Attempt to identify a disconnected SD bus earlier, treating a - zero returned OCR (voltage support) as an error condition. - -Signed-off-by: Phil Elwell ---- - drivers/mmc/host/bcm2835-sdhost.c | 117 ++++++++++++++++++++++++-------------- - 1 file changed, 74 insertions(+), 43 deletions(-) - ---- a/drivers/mmc/host/bcm2835-sdhost.c -+++ b/drivers/mmc/host/bcm2835-sdhost.c -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -206,6 +207,7 @@ struct bcm2835_host { - struct timeval stop_time; /* when the last stop was issued */ - u32 delay_after_stop; /* minimum time between stop and subsequent data transfer */ - u32 delay_after_this_stop; /* minimum time between this stop and subsequent data transfer */ -+ u32 user_overclock_50; /* User's preferred frequency to use when 50MHz is requested (in MHz) */ - u32 overclock_50; /* frequency to use when 50MHz is requested (in MHz) */ - u32 overclock; /* Current frequency if overclocked, else zero */ - u32 pio_limit; /* Maximum block count for PIO (0 = always DMA) */ -@@ -282,7 +284,7 @@ static void log_dump(void) - do { - entry = sdhost_log_buf + idx; - if (entry->event[0] != '\0') -- pr_err("[%08x] %.4s %x %x\n", -+ pr_info("[%08x] %.4s %x %x\n", - entry->timestamp, - entry->event, - entry->param1, -@@ -324,7 +326,7 @@ static void bcm2835_sdhost_dumpcmd(struc - const char *label) - { - if (cmd) -- pr_err("%s:%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", -+ pr_info("%s:%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", - mmc_hostname(host->mmc), - (cmd == host->cmd) ? '>' : ' ', - label, cmd->opcode, cmd->arg, cmd->flags, -@@ -339,7 +341,7 @@ static void bcm2835_sdhost_dumpregs(stru - bcm2835_sdhost_dumpcmd(host, host->mrq->sbc, "sbc"); - bcm2835_sdhost_dumpcmd(host, host->mrq->cmd, "cmd"); - if (host->mrq->data) -- pr_err("%s: data blocks %x blksz %x - err %d\n", -+ pr_info("%s: data blocks %x blksz %x - err %d\n", - mmc_hostname(host->mmc), - host->mrq->data->blocks, - host->mrq->data->blksz, -@@ -347,53 +349,53 @@ static void bcm2835_sdhost_dumpregs(stru - bcm2835_sdhost_dumpcmd(host, host->mrq->stop, "stop"); - } - -- pr_err("%s: =========== REGISTER DUMP ===========\n", -+ pr_info("%s: =========== REGISTER DUMP ===========\n", - mmc_hostname(host->mmc)); - -- pr_err("%s: SDCMD 0x%08x\n", -+ pr_info("%s: SDCMD 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDCMD)); -- pr_err("%s: SDARG 0x%08x\n", -+ pr_info("%s: SDARG 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDARG)); -- pr_err("%s: SDTOUT 0x%08x\n", -+ pr_info("%s: SDTOUT 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDTOUT)); -- pr_err("%s: SDCDIV 0x%08x\n", -+ pr_info("%s: SDCDIV 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDCDIV)); -- pr_err("%s: SDRSP0 0x%08x\n", -+ pr_info("%s: SDRSP0 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDRSP0)); -- pr_err("%s: SDRSP1 0x%08x\n", -+ pr_info("%s: SDRSP1 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDRSP1)); -- pr_err("%s: SDRSP2 0x%08x\n", -+ pr_info("%s: SDRSP2 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDRSP2)); - pr_err("%s: SDRSP3 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDRSP3)); -- pr_err("%s: SDHSTS 0x%08x\n", -+ pr_info("%s: SDHSTS 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDHSTS)); -- pr_err("%s: SDVDD 0x%08x\n", -+ pr_info("%s: SDVDD 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDVDD)); -- pr_err("%s: SDEDM 0x%08x\n", -+ pr_info("%s: SDEDM 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDEDM)); -- pr_err("%s: SDHCFG 0x%08x\n", -+ pr_info("%s: SDHCFG 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDHCFG)); -- pr_err("%s: SDHBCT 0x%08x\n", -+ pr_info("%s: SDHBCT 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDHBCT)); -- pr_err("%s: SDHBLC 0x%08x\n", -+ pr_info("%s: SDHBLC 0x%08x\n", - mmc_hostname(host->mmc), - bcm2835_sdhost_read(host, SDHBLC)); - -- pr_err("%s: ===========================================\n", -+ pr_info("%s: ===========================================\n", - mmc_hostname(host->mmc)); - } - -@@ -608,7 +610,7 @@ static void bcm2835_sdhost_read_block_pi - (fsm_state != SDEDM_FSM_READCRC)) { - hsts = bcm2835_sdhost_read(host, - SDHSTS); -- pr_err("%s: fsm %x, hsts %x\n", -+ pr_info("%s: fsm %x, hsts %x\n", - mmc_hostname(host->mmc), - fsm_state, hsts); - if (hsts & SDHSTS_ERROR_MASK) -@@ -698,7 +700,7 @@ static void bcm2835_sdhost_write_block_p - (fsm_state != SDEDM_FSM_WRITESTART2)) { - hsts = bcm2835_sdhost_read(host, - SDHSTS); -- pr_err("%s: fsm %x, hsts %x\n", -+ pr_info("%s: fsm %x, hsts %x\n", - mmc_hostname(host->mmc), - fsm_state, hsts); - if (hsts & SDHSTS_ERROR_MASK) -@@ -953,9 +955,10 @@ bool bcm2835_sdhost_send_command(struct - - while (bcm2835_sdhost_read(host, SDCMD) & SDCMD_NEW_FLAG) { - if (timeout == 0) { -- pr_err("%s: previous command never completed.\n", -+ pr_warn("%s: previous command never completed.\n", - mmc_hostname(host->mmc)); -- bcm2835_sdhost_dumpregs(host); -+ if (host->debug) -+ bcm2835_sdhost_dumpregs(host); - cmd->error = -EILSEQ; - tasklet_schedule(&host->finish_tasklet); - return false; -@@ -1213,10 +1216,12 @@ static void bcm2835_sdhost_finish_comman - - /* Check for errors */ - if (sdcmd & SDCMD_NEW_FLAG) { -- pr_err("%s: command never completed.\n", -- mmc_hostname(host->mmc)); -- bcm2835_sdhost_dumpregs(host); -- host->cmd->error = -EIO; -+ if (host->debug) { -+ pr_err("%s: command %d never completed.\n", -+ mmc_hostname(host->mmc), host->cmd->opcode); -+ bcm2835_sdhost_dumpregs(host); -+ } -+ host->cmd->error = -EILSEQ; - tasklet_schedule(&host->finish_tasklet); - return; - } else if (sdcmd & SDCMD_FAIL_FLAG) { -@@ -1238,15 +1243,14 @@ static void bcm2835_sdhost_finish_comman - } else { - if (sdhsts & SDHSTS_CMD_TIME_OUT) { - if (host->debug) -- pr_err("%s: command %d timeout\n", -+ pr_warn("%s: command %d timeout\n", - mmc_hostname(host->mmc), - host->cmd->opcode); - host->cmd->error = -ETIMEDOUT; - } else { -- pr_err("%s: unexpected command %d error\n", -+ pr_warn("%s: unexpected command %d error\n", - mmc_hostname(host->mmc), - host->cmd->opcode); -- bcm2835_sdhost_dumpregs(host); - host->cmd->error = -EILSEQ; - } - tasklet_schedule(&host->finish_tasklet); -@@ -1370,8 +1374,10 @@ static void bcm2835_sdhost_busy_irq(stru - } else if (intmask & SDHSTS_CMD_TIME_OUT) - host->cmd->error = -ETIMEDOUT; - -- log_dump(); -- bcm2835_sdhost_dumpregs(host); -+ if (host->debug) { -+ log_dump(); -+ bcm2835_sdhost_dumpregs(host); -+ } - } - else - bcm2835_sdhost_finish_command(host, NULL); -@@ -1595,7 +1601,7 @@ void bcm2835_sdhost_set_clock(struct bcm - host->overclock_50 = (clock/MHZ); - - if (clock != host->overclock) { -- pr_warn("%s: overclocking to %dHz\n", -+ pr_info("%s: overclocking to %dHz\n", - mmc_hostname(host->mmc), clock); - host->overclock = clock; - } -@@ -1605,6 +1611,11 @@ void bcm2835_sdhost_set_clock(struct bcm - pr_warn("%s: cancelling overclock\n", - mmc_hostname(host->mmc)); - } -+ } else if (input_clock == 0) { -+ /* Reset the preferred overclock when the clock is stopped. -+ * This always happens during initialisation. */ -+ host->overclock_50 = host->user_overclock_50; -+ host->overclock = 0; - } - - /* Set the timeout to 500ms */ -@@ -1678,13 +1689,15 @@ static void bcm2835_sdhost_request(struc - log_event("REQ<", (u32)mrq, edm); - if ((fsm != SDEDM_FSM_IDENTMODE) && - (fsm != SDEDM_FSM_DATAMODE)) { -- pr_err("%s: previous command (%d) not complete (EDM %x)\n", -- mmc_hostname(host->mmc), -- bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK, -- edm); - log_event("REQ!", (u32)mrq, edm); -- log_dump(); -- bcm2835_sdhost_dumpregs(host); -+ if (host->debug) { -+ pr_warn("%s: previous command (%d) not complete (EDM %x)\n", -+ mmc_hostname(host->mmc), -+ bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK, -+ edm); -+ log_dump(); -+ bcm2835_sdhost_dumpregs(host); -+ } - mrq->cmd->error = -EILSEQ; - tasklet_schedule(&host->finish_tasklet); - mmiowb(); -@@ -1814,16 +1827,19 @@ static void bcm2835_sdhost_tasklet_finis - mrq = host->mrq; - - /* Drop the overclock after any data corruption, or after any -- error overclocked */ -+ * error while overclocked. Ignore errors for status commands, -+ * as they are likely when a card is ejected. */ - if (host->overclock) { -- if ((mrq->cmd && mrq->cmd->error) || -+ if ((mrq->cmd && mrq->cmd->error && -+ (mrq->cmd->opcode != MMC_SEND_STATUS)) || - (mrq->data && mrq->data->error) || -- (mrq->stop && mrq->stop->error)) { -+ (mrq->stop && mrq->stop->error) || -+ (mrq->sbc && mrq->sbc->error)) { - host->overclock_50--; - pr_warn("%s: reducing overclock due to errors\n", - mmc_hostname(host->mmc)); - host->reset_clock = 1; -- mrq->cmd->error = -EILSEQ; -+ mrq->cmd->error = -ETIMEDOUT; - mrq->cmd->retries = 1; - } - } -@@ -1848,6 +1864,21 @@ static void bcm2835_sdhost_tasklet_finis - mmc_hostname(host->mmc), err); - } - -+ /* The SDHOST block doesn't report any errors for a disconnected -+ interface. All cards and SDIO devices should report some supported -+ voltage range, so a zero response to SEND_OP_COND, IO_SEND_OP_COND -+ or APP_SEND_OP_COND can be treated as an error. */ -+ if (((mrq->cmd->opcode == MMC_SEND_OP_COND) || -+ (mrq->cmd->opcode == SD_IO_SEND_OP_COND) || -+ (mrq->cmd->opcode == SD_APP_OP_COND)) && -+ (mrq->cmd->error == 0) && -+ (mrq->cmd->resp[0] == 0)) { -+ mrq->cmd->error = -ETIMEDOUT; -+ if (host->debug) -+ pr_info("%s: faking timeout due to zero OCR\n", -+ mmc_hostname(host->mmc)); -+ } -+ - mmc_request_done(host->mmc, mrq); - log_event("TSK>", (u32)mrq, 0); - } -@@ -2023,7 +2054,7 @@ static int bcm2835_sdhost_probe(struct p - &host->delay_after_stop); - of_property_read_u32(node, - "brcm,overclock-50", -- &host->overclock_50); -+ &host->user_overclock_50); - of_property_read_u32(node, - "brcm,pio-limit", - &host->pio_limit); diff --git a/target/linux/brcm2708/patches-4.4/0417-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch b/target/linux/brcm2708/patches-4.4/0417-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch new file mode 100644 index 0000000000..57e5785bfb --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0417-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch @@ -0,0 +1,27 @@ +From a1c9b6e2482ecc3dd3191b494d6cb717fa700ce4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 28 Jun 2016 22:13:15 +0100 +Subject: [PATCH] pinctrl-bcm2835: Fix return type of bcm2835_pmx_free + +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -831,13 +831,14 @@ static const struct pinctrl_ops bcm2835_ + .dt_free_map = bcm2835_pctl_dt_free_map, + }; + +-static void bcm2835_pmx_free(struct pinctrl_dev *pctldev, ++static int bcm2835_pmx_free(struct pinctrl_dev *pctldev, + unsigned offset) + { + struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); + + /* disable by setting to GPIO_IN */ + bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_IN); ++ return 0; + } + + static int bcm2835_pmx_get_functions_count(struct pinctrl_dev *pctldev) diff --git a/target/linux/brcm2708/patches-4.4/0418-Add-IQAudIO-Digi-WM8804-board-support.patch b/target/linux/brcm2708/patches-4.4/0418-Add-IQAudIO-Digi-WM8804-board-support.patch new file mode 100644 index 0000000000..1c57cebc02 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0418-Add-IQAudIO-Digi-WM8804-board-support.patch @@ -0,0 +1,399 @@ +From a5bf4ef8a41a52453b9505ffef39b7635feef4b2 Mon Sep 17 00:00:00 2001 +From: DigitalDreamtime +Date: Thu, 30 Jun 2016 18:38:42 +0100 +Subject: [PATCH] Add IQAudIO Digi WM8804 board support + +Support IQAudIO Digi board with iqaudio_digi machine driver and + iqaudio-digi-wm8804-audio overlay. + +NB. Machine driver is a cut and paste of hifiberry_digi code, with format + and general cleanup to comply with kernel coding standards. + +Signed-off-by: DigitalDreamtime +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 9 + + .../overlays/iqaudio-digi-wm8804-audio-overlay.dts | 47 ++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/iqaudio_digi.c | 239 +++++++++++++++++++++ + 8 files changed, 307 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/iqaudio-digi-wm8804-audio-overlay.dts + create mode 100644 sound/soc/bcm/iqaudio_digi.c + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -42,6 +42,7 @@ dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31 + dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo + dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dac.dtbo + dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacplus.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += iqaudio-digi-wm8804-audio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo + dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -546,6 +546,15 @@ Params: 24db_digital_gain Allow ga + the DAC driver module loads. + + ++Name: iqaudio-digi-wm8804-audio ++Info: Configures the IQAudIO Digi WM8804 audio card ++Load: dtoverlay=iqaudio-digi-wm8804-audio,= ++Params: card_name Override the default, "IQAudIODigi", card name. ++ dai_name Override the default, "IQAudIO Digi", dai name. ++ dai_stream_name Override the default, "IQAudIO Digi HiFi", ++ dai stream name. ++ ++ + Name: justboom-dac + Info: Configures the JustBoom DAC HAT, Amp HAT, DAC Zero and Amp Zero audio + cards +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/iqaudio-digi-wm8804-audio-overlay.dts +@@ -0,0 +1,47 @@ ++// Definitions for IQAudIO Digi WM8804 audio board ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ wm8804@3b { ++ #sound-dai-cells = <0>; ++ compatible = "wlf,wm8804"; ++ reg = <0x3b>; ++ status = "okay"; ++ // DVDD-supply = <®_3v3>; ++ // PVDD-supply = <®_3v3>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ wm8804_digi: __overlay__ { ++ compatible = "iqaudio,wm8804-digi"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ card_name = <&wm8804_digi>,"wm8804-digi,card-name"; ++ dai_name = <&wm8804_digi>,"wm8804-digi,dai-name"; ++ dai_stream_name = <&wm8804_digi>,"wm8804-digi,dai-stream-name"; ++ }; ++}; +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -865,6 +865,7 @@ CONFIG_SND_BCM2708_SOC_RPI_PROTO=m + CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m + CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m ++CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -857,6 +857,7 @@ CONFIG_SND_BCM2708_SOC_RPI_PROTO=m + CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m + CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m ++CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -71,6 +71,13 @@ config SND_BCM2708_SOC_IQAUDIO_DAC + help + Say Y or M if you want to add support for IQaudIO-DAC. + ++config SND_BCM2708_SOC_IQAUDIO_DIGI ++ tristate "Support for IQAudIO Digi" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_WM8804 ++ help ++ Say Y or M if you want to add support for IQAudIO Digital IO board. ++ + config SND_BCM2708_SOC_RASPIDAC3 + tristate "Support for RaspiDAC Rev.3x" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -14,6 +14,7 @@ snd-soc-justboom-digi-objs := justboom-d + snd-soc-rpi-dac-objs := rpi-dac.o + snd-soc-rpi-proto-objs := rpi-proto.o + snd-soc-iqaudio-dac-objs := iqaudio-dac.o ++snd-soc-iqaudio-digi-objs := iqaudio_digi.o + snd-soc-raspidac3-objs := raspidac3.o + snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o +@@ -28,6 +29,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DI + obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o + obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o ++obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI) += snd-soc-iqaudio-digi.o + obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o + obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o +--- /dev/null ++++ b/sound/soc/bcm/iqaudio_digi.c +@@ -0,0 +1,239 @@ ++/* ++ * ASoC Driver for IQAudIO WM8804 Digi ++ * ++ * Author: Daniel Matuschek ++ * based on the HifiBerry DAC driver by Florian Meier ++ * Copyright 2013 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "../codecs/wm8804.h" ++ ++static short int auto_shutdown_output; ++module_param(auto_shutdown_output, short, ++ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); ++MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped"); ++ ++static int snd_rpi_iqaudio_digi_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ /* enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ return 0; ++} ++ ++static int snd_rpi_iqaudio_digi_startup(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ /* turn on digital output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); ++ ++ return 0; ++} ++ ++static void snd_rpi_iqaudio_digi_shutdown(struct snd_pcm_substream *substream) ++{ ++ if (auto_shutdown_output) { ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ /* turn off digital output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); ++ } ++} ++ ++ ++static int snd_rpi_iqaudio_digi_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ int sysclk = 27000000; /* This is fixed on this board */ ++ ++ long mclk_freq = 0; ++ int mclk_div = 1; ++ int sampling_freq = 1; ++ ++ int ret; ++ ++ int samplerate = params_rate(params); ++ ++ if (samplerate <= 96000) { ++ mclk_freq = samplerate * 256; ++ mclk_div = WM8804_MCLKDIV_256FS; ++ } else { ++ mclk_freq = samplerate * 128; ++ mclk_div = WM8804_MCLKDIV_128FS; ++ } ++ ++ switch (samplerate) { ++ case 32000: ++ sampling_freq = 0x03; ++ break; ++ case 44100: ++ sampling_freq = 0x00; ++ break; ++ case 48000: ++ sampling_freq = 0x02; ++ break; ++ case 88200: ++ sampling_freq = 0x08; ++ break; ++ case 96000: ++ sampling_freq = 0x0a; ++ break; ++ case 176400: ++ sampling_freq = 0x0c; ++ break; ++ case 192000: ++ sampling_freq = 0x0e; ++ break; ++ default: ++ dev_err(codec->dev, "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", ++ samplerate); ++ } ++ ++ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); ++ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); ++ ++ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, ++ sysclk, SND_SOC_CLOCK_OUT); ++ if (ret < 0) { ++ dev_err(codec->dev, "Failed to set WM8804 SYSCLK: %d\n", ret); ++ return ret; ++ } ++ ++ /* Enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ /* Power on */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); ++ ++ /* set sampling frequency status bits */ ++ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_rpi_iqaudio_digi_ops = { ++ .hw_params = snd_rpi_iqaudio_digi_hw_params, ++ .startup = snd_rpi_iqaudio_digi_startup, ++ .shutdown = snd_rpi_iqaudio_digi_shutdown, ++}; ++ ++static struct snd_soc_dai_link snd_rpi_iqaudio_digi_dai[] = { ++{ ++ .name = "IQAudIO Digi", ++ .stream_name = "IQAudIO Digi HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "wm8804-spdif", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "wm8804.1-003b", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBM_CFM, ++ .ops = &snd_rpi_iqaudio_digi_ops, ++ .init = snd_rpi_iqaudio_digi_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_rpi_iqaudio_digi = { ++ .name = "IQAudIODigi", ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_iqaudio_digi_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_iqaudio_digi_dai), ++}; ++ ++static int snd_rpi_iqaudio_digi_probe(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = &snd_rpi_iqaudio_digi; ++ char *prefix = "wm8804-digi,"; ++ char prop[128]; ++ struct device_node *np; ++ int ret = 0; ++ ++ snd_rpi_iqaudio_digi.dev = &pdev->dev; ++ ++ np = pdev->dev.of_node; ++ if (np) { ++ struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_digi_dai[0]; ++ struct device_node *i2s_node; ++ ++ i2s_node = of_parse_phandle(np, "i2s-controller", 0); ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ snprintf(prop, sizeof(prop), "%scard-name", prefix); ++ of_property_read_string(np, prop, &card->name); ++ ++ snprintf(prop, sizeof(prop), "%sdai-name", prefix); ++ of_property_read_string(np, prop, &dai->name); ++ ++ snprintf(prop, sizeof(prop), "%sdai-stream-name", prefix); ++ of_property_read_string(np, prop, &dai->stream_name); ++ } ++ ++ ret = snd_soc_register_card(card); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int snd_rpi_iqaudio_digi_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_iqaudio_digi); ++} ++ ++static const struct of_device_id snd_rpi_iqaudio_digi_of_match[] = { ++ { .compatible = "iqaudio,wm8804-digi", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_rpi_iqaudio_digi_of_match); ++ ++static struct platform_driver snd_rpi_iqaudio_digi_driver = { ++ .driver = { ++ .name = "IQAudIODigi", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_rpi_iqaudio_digi_of_match, ++ }, ++ .probe = snd_rpi_iqaudio_digi_probe, ++ .remove = snd_rpi_iqaudio_digi_remove, ++}; ++ ++module_platform_driver(snd_rpi_iqaudio_digi_driver); ++ ++MODULE_AUTHOR("Daniel Matuschek "); ++MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0418-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch b/target/linux/brcm2708/patches-4.4/0418-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch deleted file mode 100644 index 0cb395d466..0000000000 --- a/target/linux/brcm2708/patches-4.4/0418-pinctrl-bcm2835-Fix-return-type-of-bcm2835_pmx_free.patch +++ /dev/null @@ -1,27 +0,0 @@ -From cf4bd841e1b8b74c77601b90dff106331740af62 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 28 Jun 2016 22:13:15 +0100 -Subject: [PATCH 418/423] pinctrl-bcm2835: Fix return type of bcm2835_pmx_free - ---- - drivers/pinctrl/bcm/pinctrl-bcm2835.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c -+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -831,13 +831,14 @@ static const struct pinctrl_ops bcm2835_ - .dt_free_map = bcm2835_pctl_dt_free_map, - }; - --static void bcm2835_pmx_free(struct pinctrl_dev *pctldev, -+static int bcm2835_pmx_free(struct pinctrl_dev *pctldev, - unsigned offset) - { - struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); - - /* disable by setting to GPIO_IN */ - bcm2835_pinctrl_fsel_set(pc, offset, BCM2835_FSEL_GPIO_IN); -+ return 0; - } - - static int bcm2835_pmx_get_functions_count(struct pinctrl_dev *pctldev) diff --git a/target/linux/brcm2708/patches-4.4/0419-Add-IQAudIO-Digi-WM8804-board-support.patch b/target/linux/brcm2708/patches-4.4/0419-Add-IQAudIO-Digi-WM8804-board-support.patch deleted file mode 100644 index 0cc610cea2..0000000000 --- a/target/linux/brcm2708/patches-4.4/0419-Add-IQAudIO-Digi-WM8804-board-support.patch +++ /dev/null @@ -1,399 +0,0 @@ -From c0b9e2c502269ef126969709f54e4489b87e3923 Mon Sep 17 00:00:00 2001 -From: DigitalDreamtime -Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 419/423] Add IQAudIO Digi WM8804 board support - -Support IQAudIO Digi board with iqaudio_digi machine driver and - iqaudio-digi-wm8804-audio overlay. - -NB. Machine driver is a cut and paste of hifiberry_digi code, with format - and general cleanup to comply with kernel coding standards. - -Signed-off-by: DigitalDreamtime ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 9 + - .../overlays/iqaudio-digi-wm8804-audio-overlay.dts | 47 ++++ - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - sound/soc/bcm/Kconfig | 7 + - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/iqaudio_digi.c | 239 +++++++++++++++++++++ - 8 files changed, 307 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/iqaudio-digi-wm8804-audio-overlay.dts - create mode 100644 sound/soc/bcm/iqaudio_digi.c - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -42,6 +42,7 @@ dtbo-$(RPI_DT_OVERLAYS) += i2s-gpio28-31 - dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo - dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dac.dtbo - dtbo-$(RPI_DT_OVERLAYS) += iqaudio-dacplus.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += iqaudio-digi-wm8804-audio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += justboom-dac.dtbo - dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo - dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -546,6 +546,15 @@ Params: 24db_digital_gain Allow ga - the DAC driver module loads. - - -+Name: iqaudio-digi-wm8804-audio -+Info: Configures the IQAudIO Digi WM8804 audio card -+Load: dtoverlay=iqaudio-digi-wm8804-audio,= -+Params: card_name Override the default, "IQAudIODigi", card name. -+ dai_name Override the default, "IQAudIO Digi", dai name. -+ dai_stream_name Override the default, "IQAudIO Digi HiFi", -+ dai stream name. -+ -+ - Name: justboom-dac - Info: Configures the JustBoom DAC HAT, Amp HAT, DAC Zero and Amp Zero audio - cards ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/iqaudio-digi-wm8804-audio-overlay.dts -@@ -0,0 +1,47 @@ -+// Definitions for IQAudIO Digi WM8804 audio board -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ wm8804@3b { -+ #sound-dai-cells = <0>; -+ compatible = "wlf,wm8804"; -+ reg = <0x3b>; -+ status = "okay"; -+ // DVDD-supply = <®_3v3>; -+ // PVDD-supply = <®_3v3>; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ wm8804_digi: __overlay__ { -+ compatible = "iqaudio,wm8804-digi"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+ -+ __overrides__ { -+ card_name = <&wm8804_digi>,"wm8804-digi,card-name"; -+ dai_name = <&wm8804_digi>,"wm8804-digi,dai-name"; -+ dai_stream_name = <&wm8804_digi>,"wm8804-digi,dai-stream-name"; -+ }; -+}; ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -865,6 +865,7 @@ CONFIG_SND_BCM2708_SOC_RPI_PROTO=m - CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m - CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m -+CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -857,6 +857,7 @@ CONFIG_SND_BCM2708_SOC_RPI_PROTO=m - CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m - CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m -+CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -71,6 +71,13 @@ config SND_BCM2708_SOC_IQAUDIO_DAC - help - Say Y or M if you want to add support for IQaudIO-DAC. - -+config SND_BCM2708_SOC_IQAUDIO_DIGI -+ tristate "Support for IQAudIO Digi" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_WM8804 -+ help -+ Say Y or M if you want to add support for IQAudIO Digital IO board. -+ - config SND_BCM2708_SOC_RASPIDAC3 - tristate "Support for RaspiDAC Rev.3x" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -14,6 +14,7 @@ snd-soc-justboom-digi-objs := justboom-d - snd-soc-rpi-dac-objs := rpi-dac.o - snd-soc-rpi-proto-objs := rpi-proto.o - snd-soc-iqaudio-dac-objs := iqaudio-dac.o -+snd-soc-iqaudio-digi-objs := iqaudio_digi.o - snd-soc-raspidac3-objs := raspidac3.o - snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o - snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o -@@ -28,6 +29,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DI - obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o - obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o -+obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI) += snd-soc-iqaudio-digi.o - obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o - obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o - obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o ---- /dev/null -+++ b/sound/soc/bcm/iqaudio_digi.c -@@ -0,0 +1,239 @@ -+/* -+ * ASoC Driver for IQAudIO WM8804 Digi -+ * -+ * Author: Daniel Matuschek -+ * based on the HifiBerry DAC driver by Florian Meier -+ * Copyright 2013 -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "../codecs/wm8804.h" -+ -+static short int auto_shutdown_output; -+module_param(auto_shutdown_output, short, -+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); -+MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped"); -+ -+static int snd_rpi_iqaudio_digi_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ /* enable TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ return 0; -+} -+ -+static int snd_rpi_iqaudio_digi_startup(struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ /* turn on digital output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); -+ -+ return 0; -+} -+ -+static void snd_rpi_iqaudio_digi_shutdown(struct snd_pcm_substream *substream) -+{ -+ if (auto_shutdown_output) { -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ /* turn off digital output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); -+ } -+} -+ -+ -+static int snd_rpi_iqaudio_digi_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *codec_dai = rtd->codec_dai; -+ struct snd_soc_codec *codec = rtd->codec; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ -+ int sysclk = 27000000; /* This is fixed on this board */ -+ -+ long mclk_freq = 0; -+ int mclk_div = 1; -+ int sampling_freq = 1; -+ -+ int ret; -+ -+ int samplerate = params_rate(params); -+ -+ if (samplerate <= 96000) { -+ mclk_freq = samplerate * 256; -+ mclk_div = WM8804_MCLKDIV_256FS; -+ } else { -+ mclk_freq = samplerate * 128; -+ mclk_div = WM8804_MCLKDIV_128FS; -+ } -+ -+ switch (samplerate) { -+ case 32000: -+ sampling_freq = 0x03; -+ break; -+ case 44100: -+ sampling_freq = 0x00; -+ break; -+ case 48000: -+ sampling_freq = 0x02; -+ break; -+ case 88200: -+ sampling_freq = 0x08; -+ break; -+ case 96000: -+ sampling_freq = 0x0a; -+ break; -+ case 176400: -+ sampling_freq = 0x0c; -+ break; -+ case 192000: -+ sampling_freq = 0x0e; -+ break; -+ default: -+ dev_err(codec->dev, "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", -+ samplerate); -+ } -+ -+ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); -+ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); -+ -+ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, -+ sysclk, SND_SOC_CLOCK_OUT); -+ if (ret < 0) { -+ dev_err(codec->dev, "Failed to set WM8804 SYSCLK: %d\n", ret); -+ return ret; -+ } -+ -+ /* Enable TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ /* Power on */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); -+ -+ /* set sampling frequency status bits */ -+ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); -+ -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_rpi_iqaudio_digi_ops = { -+ .hw_params = snd_rpi_iqaudio_digi_hw_params, -+ .startup = snd_rpi_iqaudio_digi_startup, -+ .shutdown = snd_rpi_iqaudio_digi_shutdown, -+}; -+ -+static struct snd_soc_dai_link snd_rpi_iqaudio_digi_dai[] = { -+{ -+ .name = "IQAudIO Digi", -+ .stream_name = "IQAudIO Digi HiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "wm8804-spdif", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "wm8804.1-003b", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | -+ SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBM_CFM, -+ .ops = &snd_rpi_iqaudio_digi_ops, -+ .init = snd_rpi_iqaudio_digi_init, -+}, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_rpi_iqaudio_digi = { -+ .name = "IQAudIODigi", -+ .owner = THIS_MODULE, -+ .dai_link = snd_rpi_iqaudio_digi_dai, -+ .num_links = ARRAY_SIZE(snd_rpi_iqaudio_digi_dai), -+}; -+ -+static int snd_rpi_iqaudio_digi_probe(struct platform_device *pdev) -+{ -+ struct snd_soc_card *card = &snd_rpi_iqaudio_digi; -+ char *prefix = "wm8804-digi,"; -+ char prop[128]; -+ struct device_node *np; -+ int ret = 0; -+ -+ snd_rpi_iqaudio_digi.dev = &pdev->dev; -+ -+ np = pdev->dev.of_node; -+ if (np) { -+ struct snd_soc_dai_link *dai = &snd_rpi_iqaudio_digi_dai[0]; -+ struct device_node *i2s_node; -+ -+ i2s_node = of_parse_phandle(np, "i2s-controller", 0); -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ -+ snprintf(prop, sizeof(prop), "%scard-name", prefix); -+ of_property_read_string(np, prop, &card->name); -+ -+ snprintf(prop, sizeof(prop), "%sdai-name", prefix); -+ of_property_read_string(np, prop, &dai->name); -+ -+ snprintf(prop, sizeof(prop), "%sdai-stream-name", prefix); -+ of_property_read_string(np, prop, &dai->stream_name); -+ } -+ -+ ret = snd_soc_register_card(card); -+ if (ret) -+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", -+ ret); -+ -+ return ret; -+} -+ -+static int snd_rpi_iqaudio_digi_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_rpi_iqaudio_digi); -+} -+ -+static const struct of_device_id snd_rpi_iqaudio_digi_of_match[] = { -+ { .compatible = "iqaudio,wm8804-digi", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, snd_rpi_iqaudio_digi_of_match); -+ -+static struct platform_driver snd_rpi_iqaudio_digi_driver = { -+ .driver = { -+ .name = "IQAudIODigi", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_rpi_iqaudio_digi_of_match, -+ }, -+ .probe = snd_rpi_iqaudio_digi_probe, -+ .remove = snd_rpi_iqaudio_digi_remove, -+}; -+ -+module_platform_driver(snd_rpi_iqaudio_digi_driver); -+ -+MODULE_AUTHOR("Daniel Matuschek "); -+MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0419-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch b/target/linux/brcm2708/patches-4.4/0419-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch new file mode 100644 index 0000000000..f47efb7b8b --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0419-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch @@ -0,0 +1,106 @@ +From fbbafbb2b4739eb6980f18c78c276ffbee2602db Mon Sep 17 00:00:00 2001 +From: Erdem MEYDANLI +Date: Thu, 30 Jun 2016 21:05:08 +0300 +Subject: [PATCH] dts: Add overlay for NXP SC16IS752 Dual UART with SPI + Interface + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 10 ++++ + .../boot/dts/overlays/sc16is752-spi1-overlay.dts | 61 ++++++++++++++++++++++ + 3 files changed, 72 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -71,6 +71,7 @@ dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dt + dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo + dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo + dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += sc16is752-spi1.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -888,6 +888,16 @@ Load: dtoverlay=rra-digidac1-wm8741-au + Params: + + ++Name: sc16is752-spi1 ++Info: Overlay for the NXP SC16IS752 Dual UART with SPI Interface ++ Enables the chip on SPI1. ++ N.B.: spi1 is only accessible on devices with a 40pin header, eg: ++ A+, B+, Zero and PI2 B; as well as the Compute Module. ++ ++Load: dtoverlay=sc16is752-spi1,= ++Params: int_pin GPIO used for IRQ (default 24) ++ ++ + Name: sdhost + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock. + N.B. This overlay is designed for situations where the mmc driver is +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts +@@ -0,0 +1,61 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&gpio>; ++ __overlay__ { ++ spi1_pins: spi1_pins { ++ brcm,pins = <19 20 21>; ++ brcm,function = <3>; /* alt4 */ ++ }; ++ ++ spi1_cs_pins: spi1_cs_pins { ++ brcm,pins = <18>; ++ brcm,function = <1>; /* output */ ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&spi1>; ++ frag1: __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi1_pins &spi1_cs_pins>; ++ cs-gpios = <&gpio 18 1>; ++ status = "okay"; ++ ++ sc16is752: sc16is752@0 { ++ compatible = "nxp,sc16is752"; ++ reg = <0>; /* CE0 */ ++ clocks = <&sc16is752_clk>; ++ interrupt-parent = <&gpio>; ++ interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */ ++ #gpio-controller; ++ #gpio-cells = <2>; ++ spi-max-frequency = <4000000>; ++ ++ sc16is752_clk: sc16is752_clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <14745600>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&aux>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ int_pin = <&sc16is752>,"interrupts:0"; ++ }; ++}; diff --git a/target/linux/brcm2708/patches-4.4/0420-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch b/target/linux/brcm2708/patches-4.4/0420-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch deleted file mode 100644 index 595c0ee4e6..0000000000 --- a/target/linux/brcm2708/patches-4.4/0420-dts-Add-overlay-for-NXP-SC16IS752-Dual-UART-with-SPI.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 27fac2f6623e8a3cddeaaf9851b719469b8df22e Mon Sep 17 00:00:00 2001 -From: Erdem MEYDANLI -Date: Thu, 30 Jun 2016 21:05:08 +0300 -Subject: [PATCH 420/423] dts: Add overlay for NXP SC16IS752 Dual UART with SPI - Interface - ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 10 ++++ - .../boot/dts/overlays/sc16is752-spi1-overlay.dts | 61 ++++++++++++++++++++++ - 3 files changed, 72 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -71,6 +71,7 @@ dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dt - dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo - dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo - dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += sc16is752-spi1.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += sdio-1bit.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -888,6 +888,16 @@ Load: dtoverlay=rra-digidac1-wm8741-au - Params: - - -+Name: sc16is752-spi1 -+Info: Overlay for the NXP SC16IS752 Dual UART with SPI Interface -+ Enables the chip on SPI1. -+ N.B.: spi1 is only accessible on devices with a 40pin header, eg: -+ A+, B+, Zero and PI2 B; as well as the Compute Module. -+ -+Load: dtoverlay=sc16is752-spi1,= -+Params: int_pin GPIO used for IRQ (default 24) -+ -+ - Name: sdhost - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock. - N.B. This overlay is designed for situations where the mmc driver is ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts -@@ -0,0 +1,61 @@ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; -+ -+ fragment@0 { -+ target = <&gpio>; -+ __overlay__ { -+ spi1_pins: spi1_pins { -+ brcm,pins = <19 20 21>; -+ brcm,function = <3>; /* alt4 */ -+ }; -+ -+ spi1_cs_pins: spi1_cs_pins { -+ brcm,pins = <18>; -+ brcm,function = <1>; /* output */ -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&spi1>; -+ frag1: __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi1_pins &spi1_cs_pins>; -+ cs-gpios = <&gpio 18 1>; -+ status = "okay"; -+ -+ sc16is752: sc16is752@0 { -+ compatible = "nxp,sc16is752"; -+ reg = <0>; /* CE0 */ -+ clocks = <&sc16is752_clk>; -+ interrupt-parent = <&gpio>; -+ interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */ -+ #gpio-controller; -+ #gpio-cells = <2>; -+ spi-max-frequency = <4000000>; -+ -+ sc16is752_clk: sc16is752_clk { -+ compatible = "fixed-clock"; -+ #clock-cells = <0>; -+ clock-frequency = <14745600>; -+ }; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&aux>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ __overrides__ { -+ int_pin = <&sc16is752>,"interrupts:0"; -+ }; -+}; diff --git a/target/linux/brcm2708/patches-4.4/0420-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/brcm2708/patches-4.4/0420-spi-bcm2835-Disable-forced-software-CS.patch new file mode 100644 index 0000000000..ad922ae6f8 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0420-spi-bcm2835-Disable-forced-software-CS.patch @@ -0,0 +1,46 @@ +From f3ca1e96b47181a009fd99fbb8e22f9afa5b1972 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 1 Jul 2016 22:09:24 +0100 +Subject: [PATCH] spi-bcm2835: Disable forced software CS + +Select software CS in bcm2708_common.dtsi, and disable the automatic +conversion in the driver to allow hardware CS to be re-enabled with an +overlay. + +See: https://github.com/raspberrypi/linux/issues/1547 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- + drivers/spi/spi-bcm2835.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -183,7 +183,7 @@ + * add more gpios if necessary as <&gpio 6 1> + * (but do not forget to make them output!) + */ +- cs-gpios = <0>, <0>; ++ cs-gpios = <&gpio 8 1>, <&gpio 7 1>; + }; + + i2c0: i2c@7e205000 { +--- a/drivers/spi/spi-bcm2835.c ++++ b/drivers/spi/spi-bcm2835.c +@@ -707,6 +707,7 @@ static int bcm2835_spi_setup(struct spi_ + return -EINVAL; + } + ++#if 0 + /* now translate native cs to GPIO */ + /* first look for chip select pins in the devices pin groups */ + for (pingroup_index = 0; +@@ -761,6 +762,7 @@ static int bcm2835_spi_setup(struct spi_ + * so we are setting it here explicitly + */ + gpio_set_value(spi->cs_gpio, (spi->mode & SPI_CS_HIGH) ? 0 : 1); ++#endif + + return 0; + } diff --git a/target/linux/brcm2708/patches-4.4/0421-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch b/target/linux/brcm2708/patches-4.4/0421-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch new file mode 100644 index 0000000000..4300c54b84 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0421-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch @@ -0,0 +1,69 @@ +From 538f85c20d4209dbae6851f9733e3e3f0450ff32 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 1 Jul 2016 22:34:52 +0100 +Subject: [PATCH] BCM270X_DT: Overlay to re-enable HW CS on SPI0 + +See: https://github.com/raspberrypi/linux/issues/1547 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 ++++++ + arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts | 26 +++++++++++++++++++++++ + 3 files changed, 33 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -81,6 +81,7 @@ dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo + dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi-rtc.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += spi0-hw-cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo + dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1006,6 +1006,12 @@ Load: dtoverlay=spi-rtc,= + Params: pcf2123 Select the PCF2123 device + + ++Name: spi0-hw-cs ++Info: Re-enables hardware CS/CE (chip selects) for SPI0 ++Load: dtoverlay=spi0-hw-cs ++Params: ++ ++ + Name: spi1-1cs + Info: Enables spi1 with a single chip select (CS) line and associated spidev + dev node. The gpio pin number for the CS line and spidev device node +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts +@@ -0,0 +1,26 @@ ++/* ++ * Device tree overlay to re-enable hardware CS for SPI0 ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&spi0>; ++ __overlay__ { ++ cs-gpios = <0>, <0>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&spi0_cs_pins>; ++ __overlay__ { ++ brcm,pins = <8 7>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ }; ++}; diff --git a/target/linux/brcm2708/patches-4.4/0421-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/brcm2708/patches-4.4/0421-spi-bcm2835-Disable-forced-software-CS.patch deleted file mode 100644 index 1e407630ab..0000000000 --- a/target/linux/brcm2708/patches-4.4/0421-spi-bcm2835-Disable-forced-software-CS.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e95bf039347d97f57e7045d7cd2d1f7e4daed1c6 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 421/423] spi-bcm2835: Disable forced software CS - -Select software CS in bcm2708_common.dtsi, and disable the automatic -conversion in the driver to allow hardware CS to be re-enabled with an -overlay. - -See: https://github.com/raspberrypi/linux/issues/1547 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- - drivers/spi/spi-bcm2835.c | 2 ++ - 2 files changed, 3 insertions(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/bcm2708_common.dtsi -+++ b/arch/arm/boot/dts/bcm2708_common.dtsi -@@ -183,7 +183,7 @@ - * add more gpios if necessary as <&gpio 6 1> - * (but do not forget to make them output!) - */ -- cs-gpios = <0>, <0>; -+ cs-gpios = <&gpio 8 1>, <&gpio 7 1>; - }; - - i2c0: i2c@7e205000 { ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -707,6 +707,7 @@ static int bcm2835_spi_setup(struct spi_ - return -EINVAL; - } - -+#if 0 - /* now translate native cs to GPIO */ - /* first look for chip select pins in the devices pin groups */ - for (pingroup_index = 0; -@@ -761,6 +762,7 @@ static int bcm2835_spi_setup(struct spi_ - * so we are setting it here explicitly - */ - gpio_set_value(spi->cs_gpio, (spi->mode & SPI_CS_HIGH) ? 0 : 1); -+#endif - - return 0; - } diff --git a/target/linux/brcm2708/patches-4.4/0422-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch b/target/linux/brcm2708/patches-4.4/0422-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch new file mode 100644 index 0000000000..d51d4f9d3d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0422-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch @@ -0,0 +1,261 @@ +From 91bb6ae349039ab6c1336a463d3c3d26e4df9fb0 Mon Sep 17 00:00:00 2001 +From: DigitalDreamtime +Date: Sat, 2 Jul 2016 16:26:19 +0100 +Subject: [PATCH] Add support for Dion Audio LOCO DAC-AMP HAT + +Using dedicated machine driver and pcm5102a codec driver. + +Signed-off-by: DigitalDreamtime +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../boot/dts/overlays/dionaudio-loco-overlay.dts | 39 +++++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 7 ++ + sound/soc/bcm/Makefile | 3 +- + sound/soc/bcm/dionaudio_loco.c | 121 +++++++++++++++++++++ + 8 files changed, 178 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/overlays/dionaudio-loco-overlay.dts + create mode 100644 sound/soc/bcm/dionaudio_loco.c + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -20,6 +20,7 @@ dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtb + dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo + dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += dionaudio-loco.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -268,6 +268,12 @@ Params: gpiopin GPIO con + (default 4) + + ++Name: dionaudio-loco ++Info: Configures the Dion Audio LOCO DAC-AMP ++Load: dtoverlay=dionaudio-loco ++Params: ++ ++ + Name: dpi24 + Info: Overlay for a generic 24-bit DPI display + This uses GPIOs 0-27 (so no I2C, uart etc.), and activates the output +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/dionaudio-loco-overlay.dts +@@ -0,0 +1,39 @@ ++// Definitions for Dion Audio LOCO DAC-AMP ++ ++/* ++ * PCM5242 DAC (in hardware mode) and TPA3118 AMP. ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/"; ++ __overlay__ { ++ pcm5102a-codec { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5102a"; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "dionaudio,loco-pcm5242-tpa3118"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -870,6 +870,7 @@ CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m ++CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -862,6 +862,7 @@ CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m ++CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -107,3 +107,10 @@ config SND_DIGIDAC1_SOUNDCARD + select SND_SOC_WM8741 + help + Say Y or M if you want to add support for Red Rocks Audio DigiDAC1 board. ++ ++config SND_BCM2708_SOC_DIONAUDIO_LOCO ++ tristate "Support for Dion Audio LOCO DAC-AMP" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM5102a ++ help ++ Say Y or M if you want to add support for Dion Audio LOCO. +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -18,6 +18,7 @@ snd-soc-iqaudio-digi-objs := iqaudio_dig + snd-soc-raspidac3-objs := raspidac3.o + snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o ++snd-soc-dionaudio-loco-objs := dionaudio_loco.o + + obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o +@@ -33,4 +34,4 @@ obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIG + obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o + obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o +- ++obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o +--- /dev/null ++++ b/sound/soc/bcm/dionaudio_loco.c +@@ -0,0 +1,121 @@ ++/* ++ * ASoC Driver for Dion Audio LOCO DAC-AMP ++ * ++ * Author: Miquel Blauw ++ * Copyright 2016 ++ * ++ * Based on the software of the RPi-DAC writen by Florian Meier ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static int snd_rpi_dionaudio_loco_hw_params( ++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_rpi_dionaudio_loco_ops = { ++ .hw_params = snd_rpi_dionaudio_loco_hw_params, ++}; ++ ++static struct snd_soc_dai_link snd_rpi_dionaudio_loco_dai[] = { ++{ ++ .name = "DionAudio LOCO", ++ .stream_name = "DionAudio LOCO DAC-AMP", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "pcm5102a-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "pcm5102a-codec", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_rpi_dionaudio_loco_ops, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_rpi_dionaudio_loco = { ++ .name = "snd_rpi_dionaudio_loco", ++ .dai_link = snd_rpi_dionaudio_loco_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_dionaudio_loco_dai), ++}; ++ ++static int snd_rpi_dionaudio_loco_probe(struct platform_device *pdev) ++{ ++ struct device_node *np; ++ int ret = 0; ++ ++ snd_rpi_dionaudio_loco.dev = &pdev->dev; ++ ++ np = pdev->dev.of_node; ++ if (np) { ++ struct snd_soc_dai_link *dai = &snd_rpi_dionaudio_loco_dai[0]; ++ struct device_node *i2s_np; ++ ++ i2s_np = of_parse_phandle(np, "i2s-controller", 0); ++ if (i2s_np) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_np; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_np; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_rpi_dionaudio_loco); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int snd_rpi_dionaudio_loco_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_dionaudio_loco); ++} ++ ++static const struct of_device_id snd_rpi_dionaudio_loco_of_match[] = { ++ { .compatible = "dionaudio,loco-pcm5242-tpa3118", }, ++ { /* sentinel */ }, ++}; ++MODULE_DEVICE_TABLE(of, snd_rpi_dionaudio_loco_of_match); ++ ++static struct platform_driver snd_rpi_dionaudio_loco_driver = { ++ .driver = { ++ .name = "snd-dionaudio-loco", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_rpi_dionaudio_loco_of_match, ++ }, ++ .probe = snd_rpi_dionaudio_loco_probe, ++ .remove = snd_rpi_dionaudio_loco_remove, ++}; ++ ++module_platform_driver(snd_rpi_dionaudio_loco_driver); ++ ++MODULE_AUTHOR("Miquel Blauw "); ++MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0422-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch b/target/linux/brcm2708/patches-4.4/0422-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch deleted file mode 100644 index 81319b234e..0000000000 --- a/target/linux/brcm2708/patches-4.4/0422-BCM270X_DT-Overlay-to-re-enable-HW-CS-on-SPI0.patch +++ /dev/null @@ -1,69 +0,0 @@ -From b8fdcf0f9af482e7dfa6fc5bb470318696789a52 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 1 Jul 2016 22:34:52 +0100 -Subject: [PATCH 422/423] BCM270X_DT: Overlay to re-enable HW CS on SPI0 - -See: https://github.com/raspberrypi/linux/issues/1547 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 ++++++ - arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts | 26 +++++++++++++++++++++++ - 3 files changed, 33 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -81,6 +81,7 @@ dtbo-$(RPI_DT_OVERLAYS) += smi-dev.dtbo - dtbo-$(RPI_DT_OVERLAYS) += smi-nand.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi-gpio35-39.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi-rtc.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += spi0-hw-cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-1cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-2cs.dtbo - dtbo-$(RPI_DT_OVERLAYS) += spi1-3cs.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1006,6 +1006,12 @@ Load: dtoverlay=spi-rtc,= - Params: pcf2123 Select the PCF2123 device - - -+Name: spi0-hw-cs -+Info: Re-enables hardware CS/CE (chip selects) for SPI0 -+Load: dtoverlay=spi0-hw-cs -+Params: -+ -+ - Name: spi1-1cs - Info: Enables spi1 with a single chip select (CS) line and associated spidev - dev node. The gpio pin number for the CS line and spidev device node ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/spi0-hw-cs-overlay.dts -@@ -0,0 +1,26 @@ -+/* -+ * Device tree overlay to re-enable hardware CS for SPI0 -+ */ -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709"; -+ -+ fragment@0 { -+ target = <&spi0>; -+ __overlay__ { -+ cs-gpios = <0>, <0>; -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&spi0_cs_pins>; -+ __overlay__ { -+ brcm,pins = <8 7>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ }; -+}; diff --git a/target/linux/brcm2708/patches-4.4/0423-ASoc-wm8731-add-32bit-mode.patch b/target/linux/brcm2708/patches-4.4/0423-ASoc-wm8731-add-32bit-mode.patch new file mode 100644 index 0000000000..b9f3f39cb0 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0423-ASoc-wm8731-add-32bit-mode.patch @@ -0,0 +1,39 @@ +From 4dd7b6b8c1354ab21b4e3f85dcd513252fe8afea Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Fri, 17 Jun 2016 14:48:16 +1000 +Subject: [PATCH] ASoc: wm8731: add 32bit mode. + +commit cf5ef3a299ba32f6ac24c3c6ba18c1b7f1b5475f upstream. + +This patch adds 32 bit word capability to the wm8731 driver. The wm8731 +codec is capable of handling 32 bit word sizes, however that has not +previously been activated in the codec driver. + +Signed-off-by: Matt Flax +Acked-by: Charles Keepax +Signed-off-by: Mark Brown +--- + sound/soc/codecs/wm8731.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/sound/soc/codecs/wm8731.c ++++ b/sound/soc/codecs/wm8731.c +@@ -358,6 +358,9 @@ static int wm8731_hw_params(struct snd_p + case 24: + iface |= 0x0008; + break; ++ case 32: ++ iface |= 0x000c; ++ break; + } + + wm8731_set_deemph(codec); +@@ -541,7 +544,7 @@ static int wm8731_startup(struct snd_pcm + #define WM8731_RATES SNDRV_PCM_RATE_8000_96000 + + #define WM8731_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ +- SNDRV_PCM_FMTBIT_S24_LE) ++ SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) + + static const struct snd_soc_dai_ops wm8731_dai_ops = { + .startup = wm8731_startup, diff --git a/target/linux/brcm2708/patches-4.4/0423-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch b/target/linux/brcm2708/patches-4.4/0423-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch deleted file mode 100644 index fd411d8835..0000000000 --- a/target/linux/brcm2708/patches-4.4/0423-Add-support-for-Dion-Audio-LOCO-DAC-AMP-HAT.patch +++ /dev/null @@ -1,261 +0,0 @@ -From 6fa4c2110478a814a9dd44d64522e7a81a1a2793 Mon Sep 17 00:00:00 2001 -From: DigitalDreamtime -Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 423/423] Add support for Dion Audio LOCO DAC-AMP HAT - -Using dedicated machine driver and pcm5102a codec driver. - -Signed-off-by: DigitalDreamtime ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 + - .../boot/dts/overlays/dionaudio-loco-overlay.dts | 39 +++++++ - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - sound/soc/bcm/Kconfig | 7 ++ - sound/soc/bcm/Makefile | 3 +- - sound/soc/bcm/dionaudio_loco.c | 121 +++++++++++++++++++++ - 8 files changed, 178 insertions(+), 1 deletion(-) - create mode 100644 arch/arm/boot/dts/overlays/dionaudio-loco-overlay.dts - create mode 100644 sound/soc/bcm/dionaudio_loco.c - ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -20,6 +20,7 @@ dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtb - dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo - dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo -+dtbo-$(RPI_DT_OVERLAYS) += dionaudio-loco.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dpi24.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dwc-otg.dtbo - dtbo-$(RPI_DT_OVERLAYS) += dwc2.dtbo ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -268,6 +268,12 @@ Params: gpiopin GPIO con - (default 4) - - -+Name: dionaudio-loco -+Info: Configures the Dion Audio LOCO DAC-AMP -+Load: dtoverlay=dionaudio-loco -+Params: -+ -+ - Name: dpi24 - Info: Overlay for a generic 24-bit DPI display - This uses GPIOs 0-27 (so no I2C, uart etc.), and activates the output ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/dionaudio-loco-overlay.dts -@@ -0,0 +1,39 @@ -+// Definitions for Dion Audio LOCO DAC-AMP -+ -+/* -+ * PCM5242 DAC (in hardware mode) and TPA3118 AMP. -+ */ -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target-path = "/"; -+ __overlay__ { -+ pcm5102a-codec { -+ #sound-dai-cells = <0>; -+ compatible = "ti,pcm5102a"; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ __overlay__ { -+ compatible = "dionaudio,loco-pcm5242-tpa3118"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+}; ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -870,6 +870,7 @@ CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m -+CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m - CONFIG_SND_SIMPLE_CARD=m ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -862,6 +862,7 @@ CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m -+CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_WM8804_I2C=m - CONFIG_SND_SIMPLE_CARD=m ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -107,3 +107,10 @@ config SND_DIGIDAC1_SOUNDCARD - select SND_SOC_WM8741 - help - Say Y or M if you want to add support for Red Rocks Audio DigiDAC1 board. -+ -+config SND_BCM2708_SOC_DIONAUDIO_LOCO -+ tristate "Support for Dion Audio LOCO DAC-AMP" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_PCM5102a -+ help -+ Say Y or M if you want to add support for Dion Audio LOCO. ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -18,6 +18,7 @@ snd-soc-iqaudio-digi-objs := iqaudio_dig - snd-soc-raspidac3-objs := raspidac3.o - snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o - snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o -+snd-soc-dionaudio-loco-objs := dionaudio_loco.o - - obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o -@@ -33,4 +34,4 @@ obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIG - obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o - obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o - obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o -- -+obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o ---- /dev/null -+++ b/sound/soc/bcm/dionaudio_loco.c -@@ -0,0 +1,121 @@ -+/* -+ * ASoC Driver for Dion Audio LOCO DAC-AMP -+ * -+ * Author: Miquel Blauw -+ * Copyright 2016 -+ * -+ * Based on the software of the RPi-DAC writen by Florian Meier -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+static int snd_rpi_dionaudio_loco_hw_params( -+ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ -+ unsigned int sample_bits = -+ snd_pcm_format_physical_width(params_format(params)); -+ -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_rpi_dionaudio_loco_ops = { -+ .hw_params = snd_rpi_dionaudio_loco_hw_params, -+}; -+ -+static struct snd_soc_dai_link snd_rpi_dionaudio_loco_dai[] = { -+{ -+ .name = "DionAudio LOCO", -+ .stream_name = "DionAudio LOCO DAC-AMP", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "pcm5102a-hifi", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "pcm5102a-codec", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | -+ SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBS_CFS, -+ .ops = &snd_rpi_dionaudio_loco_ops, -+}, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_rpi_dionaudio_loco = { -+ .name = "snd_rpi_dionaudio_loco", -+ .dai_link = snd_rpi_dionaudio_loco_dai, -+ .num_links = ARRAY_SIZE(snd_rpi_dionaudio_loco_dai), -+}; -+ -+static int snd_rpi_dionaudio_loco_probe(struct platform_device *pdev) -+{ -+ struct device_node *np; -+ int ret = 0; -+ -+ snd_rpi_dionaudio_loco.dev = &pdev->dev; -+ -+ np = pdev->dev.of_node; -+ if (np) { -+ struct snd_soc_dai_link *dai = &snd_rpi_dionaudio_loco_dai[0]; -+ struct device_node *i2s_np; -+ -+ i2s_np = of_parse_phandle(np, "i2s-controller", 0); -+ if (i2s_np) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_np; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_np; -+ } -+ } -+ -+ ret = snd_soc_register_card(&snd_rpi_dionaudio_loco); -+ if (ret) -+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", -+ ret); -+ -+ return ret; -+} -+ -+static int snd_rpi_dionaudio_loco_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_rpi_dionaudio_loco); -+} -+ -+static const struct of_device_id snd_rpi_dionaudio_loco_of_match[] = { -+ { .compatible = "dionaudio,loco-pcm5242-tpa3118", }, -+ { /* sentinel */ }, -+}; -+MODULE_DEVICE_TABLE(of, snd_rpi_dionaudio_loco_of_match); -+ -+static struct platform_driver snd_rpi_dionaudio_loco_driver = { -+ .driver = { -+ .name = "snd-dionaudio-loco", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_rpi_dionaudio_loco_of_match, -+ }, -+ .probe = snd_rpi_dionaudio_loco_probe, -+ .remove = snd_rpi_dionaudio_loco_remove, -+}; -+ -+module_platform_driver(snd_rpi_dionaudio_loco_driver); -+ -+MODULE_AUTHOR("Miquel Blauw "); -+MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0424-BCM270X_DT-Declare-the-audio-PWM-pins-explicitly.patch b/target/linux/brcm2708/patches-4.4/0424-BCM270X_DT-Declare-the-audio-PWM-pins-explicitly.patch new file mode 100644 index 0000000000..c0f2c39457 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0424-BCM270X_DT-Declare-the-audio-PWM-pins-explicitly.patch @@ -0,0 +1,122 @@ +From 4a1655a918b26f5d24d04b1bb798feb39982ac78 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 20 Jun 2016 13:21:26 +0100 +Subject: [PATCH] BCM270X_DT: Declare the audio PWM pins explicitly + +Make the audio driver's use of the PWM functions explicit. Overlays +that want to use the PWM functionality for other purposes must +disable the audio node. + +See: https://github.com/raspberrypi/linux/issues/1473 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 10 ++++++++++ + arch/arm/boot/dts/bcm2708-rpi-b.dts | 9 +++++++++ + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 10 ++++++++++ + arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 10 ++++++++++ + 4 files changed, 39 insertions(+) + +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -37,6 +37,11 @@ + brcm,pins = <18 19 20 21>; + brcm,function = <4>; /* alt0 */ + }; ++ ++ audio_pins: audio_pins { ++ brcm,pins = <40 45>; ++ brcm,function = <4>; ++ }; + }; + + &sdhost { +@@ -120,6 +125,11 @@ + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; + ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -36,6 +36,10 @@ + i2s_pins: i2s { + brcm,pins = <28 29 30 31>; + brcm,function = <6>; /* alt2 */ ++ ++ audio_pins: audio_pins { ++ brcm,pins = <40 45>; ++ brcm,function = <4>; + }; + }; + +@@ -114,6 +118,11 @@ + hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; + }; + ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -37,6 +37,11 @@ + brcm,pins = <18 19 20 21>; + brcm,function = <4>; /* alt0 */ + }; ++ ++ audio_pins: audio_pins { ++ brcm,pins = <40 45>; ++ brcm,function = <4>; ++ }; + }; + + &sdhost { +@@ -120,6 +125,11 @@ + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; + ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++}; ++ + / { + __overrides__ { + uart0 = <&uart0>,"status"; +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -61,6 +61,11 @@ + brcm,function; + brcm,pull; + }; ++ ++ audio_pins: audio_pins { ++ brcm,pins = <40 41>; ++ brcm,function = <4>; ++ }; + }; + + &sdhost { +@@ -165,6 +170,11 @@ + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; + ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++}; ++ + / { + chosen { + bootargs = "8250.nr_uarts=1"; diff --git a/target/linux/brcm2708/patches-4.4/0425-BCM270X_DT-Restore-lost-closing-brace.patch b/target/linux/brcm2708/patches-4.4/0425-BCM270X_DT-Restore-lost-closing-brace.patch new file mode 100644 index 0000000000..38e04aa89e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0425-BCM270X_DT-Restore-lost-closing-brace.patch @@ -0,0 +1,20 @@ +From a9b472033e4d34df447f1bdf87d520137559bb66 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 12 Jul 2016 10:35:01 +0100 +Subject: [PATCH] BCM270X_DT: Restore lost closing brace. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708-rpi-b.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -36,6 +36,7 @@ + i2s_pins: i2s { + brcm,pins = <28 29 30 31>; + brcm,function = <6>; /* alt2 */ ++ }; + + audio_pins: audio_pins { + brcm,pins = <40 45>; diff --git a/target/linux/brcm2708/patches-4.4/0426-config-Add-driver-for-mcp23017-I2C-GPIO-expander.patch b/target/linux/brcm2708/patches-4.4/0426-config-Add-driver-for-mcp23017-I2C-GPIO-expander.patch new file mode 100644 index 0000000000..46a030c4e3 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0426-config-Add-driver-for-mcp23017-I2C-GPIO-expander.patch @@ -0,0 +1,56 @@ +From 42700ba3ac2664f121b29892762b5c7eb2292fe1 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 14 Jul 2016 10:40:20 +0100 +Subject: [PATCH] config: Add driver for mcp23017 I2C GPIO expander + +There is already an overlay for the mcp23017 I2C GPIO expander, +but it does nothing without the required driver module. + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 3 ++- + arch/arm/configs/bcmrpi_defconfig | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -619,6 +619,7 @@ CONFIG_GPIO_SYSFS=y + CONFIG_GPIO_BCM_VIRT=y + CONFIG_GPIO_ARIZONA=m + CONFIG_GPIO_STMPE=y ++CONFIG_GPIO_MCP23S08=m + CONFIG_W1=m + CONFIG_W1_MASTER_DS2490=m + CONFIG_W1_MASTER_DS2482=m +@@ -867,9 +868,9 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m ++CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +-CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -611,6 +611,7 @@ CONFIG_PPS_CLIENT_GPIO=m + CONFIG_GPIO_SYSFS=y + CONFIG_GPIO_ARIZONA=m + CONFIG_GPIO_STMPE=y ++CONFIG_GPIO_MCP23S08=m + CONFIG_W1=m + CONFIG_W1_MASTER_DS2490=m + CONFIG_W1_MASTER_DS2482=m +@@ -859,9 +860,9 @@ CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m ++CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +-CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_WM8804_I2C=m diff --git a/target/linux/brcm2708/patches-4.4/0427-vchiq_arm-Avoid-use-of-mutex-in-add_completion.patch b/target/linux/brcm2708/patches-4.4/0427-vchiq_arm-Avoid-use-of-mutex-in-add_completion.patch new file mode 100644 index 0000000000..6dfecc079e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0427-vchiq_arm-Avoid-use-of-mutex-in-add_completion.patch @@ -0,0 +1,192 @@ +From 00d6172964200c5d72cef2264ff09d38f764bd69 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 20 Jun 2016 13:51:44 +0100 +Subject: [PATCH] vchiq_arm: Avoid use of mutex in add_completion + +Claiming the completion_mutex within add_completion did prevent some +messages appearing twice, but provokes a deadlock caused by vcsm using +vchiq within a page fault handler. + +Revert the use of completion_mutex, and instead fix the original +problem using more memory barriers. + +Signed-off-by: Phil Elwell +--- + .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 55 +++++++++++----------- + .../vc04_services/interface/vchiq_arm/vchiq_core.c | 14 ++++-- + 2 files changed, 37 insertions(+), 32 deletions(-) + +--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +@@ -64,10 +64,10 @@ + #define VCHIQ_MINOR 0 + + /* Some per-instance constants */ +-#define MAX_COMPLETIONS 16 ++#define MAX_COMPLETIONS 128 + #define MAX_SERVICES 64 + #define MAX_ELEMENTS 8 +-#define MSG_QUEUE_SIZE 64 ++#define MSG_QUEUE_SIZE 128 + + #define KEEPALIVE_VER 1 + #define KEEPALIVE_VER_MIN KEEPALIVE_VER +@@ -208,28 +208,24 @@ add_completion(VCHIQ_INSTANCE_T instance + void *bulk_userdata) + { + VCHIQ_COMPLETION_DATA_T *completion; ++ int insert; + DEBUG_INITIALISE(g_state.local) + +- mutex_lock(&instance->completion_mutex); +- +- while (instance->completion_insert == +- (instance->completion_remove + MAX_COMPLETIONS)) { ++ insert = instance->completion_insert; ++ while ((insert - instance->completion_remove) >= MAX_COMPLETIONS) { + /* Out of space - wait for the client */ + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + vchiq_log_trace(vchiq_arm_log_level, + "add_completion - completion queue full"); + DEBUG_COUNT(COMPLETION_QUEUE_FULL_COUNT); + +- mutex_unlock(&instance->completion_mutex); + if (down_interruptible(&instance->remove_event) != 0) { + vchiq_log_info(vchiq_arm_log_level, + "service_callback interrupted"); + return VCHIQ_RETRY; + } + +- mutex_lock(&instance->completion_mutex); + if (instance->closing) { +- mutex_unlock(&instance->completion_mutex); + vchiq_log_info(vchiq_arm_log_level, + "service_callback closing"); + return VCHIQ_SUCCESS; +@@ -237,9 +233,7 @@ add_completion(VCHIQ_INSTANCE_T instance + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + } + +- completion = +- &instance->completions[instance->completion_insert & +- (MAX_COMPLETIONS - 1)]; ++ completion = &instance->completions[insert & (MAX_COMPLETIONS - 1)]; + + completion->header = header; + completion->reason = reason; +@@ -260,12 +254,9 @@ add_completion(VCHIQ_INSTANCE_T instance + wmb(); + + if (reason == VCHIQ_MESSAGE_AVAILABLE) +- user_service->message_available_pos = +- instance->completion_insert; +- +- instance->completion_insert++; ++ user_service->message_available_pos = insert; + +- mutex_unlock(&instance->completion_mutex); ++ instance->completion_insert = ++insert; + + up(&instance->insert_event); + +@@ -795,6 +786,7 @@ vchiq_ioctl(struct file *file, unsigned + instance->completion_insert) + && !instance->closing) { + int rc; ++ + DEBUG_TRACE(AWAIT_COMPLETION_LINE); + mutex_unlock(&instance->completion_mutex); + rc = down_interruptible(&instance->insert_event); +@@ -809,24 +801,29 @@ vchiq_ioctl(struct file *file, unsigned + } + DEBUG_TRACE(AWAIT_COMPLETION_LINE); + +- /* A read memory barrier is needed to stop prefetch of a stale +- ** completion record +- */ +- rmb(); +- + if (ret == 0) { + int msgbufcount = args.msgbufcount; ++ int remove; ++ ++ remove = instance->completion_remove; ++ + for (ret = 0; ret < args.count; ret++) { + VCHIQ_COMPLETION_DATA_T *completion; + VCHIQ_SERVICE_T *service; + USER_SERVICE_T *user_service; + VCHIQ_HEADER_T *header; +- if (instance->completion_remove == +- instance->completion_insert) ++ ++ if (remove == instance->completion_insert) + break; ++ + completion = &instance->completions[ +- instance->completion_remove & +- (MAX_COMPLETIONS - 1)]; ++ remove & (MAX_COMPLETIONS - 1)]; ++ ++ ++ /* A read memory barrier is needed to prevent ++ ** the prefetch of a stale completion record ++ */ ++ rmb(); + + service = completion->service_userdata; + user_service = service->base.userdata; +@@ -903,7 +900,11 @@ vchiq_ioctl(struct file *file, unsigned + break; + } + +- instance->completion_remove++; ++ /* Ensure that the above copy has completed ++ ** before advancing the remove pointer. */ ++ mb(); ++ ++ instance->completion_remove = ++remove; + } + + if (msgbufcount != args.msgbufcount) { +--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c +@@ -610,15 +610,15 @@ process_free_queue(VCHIQ_STATE_T *state) + BITSET_T service_found[BITSET_SIZE(VCHIQ_MAX_SERVICES)]; + int slot_queue_available; + +- /* Use a read memory barrier to ensure that any state that may have +- ** been modified by another thread is not masked by stale prefetched +- ** values. */ +- rmb(); +- + /* Find slots which have been freed by the other side, and return them + ** to the available queue. */ + slot_queue_available = state->slot_queue_available; + ++ /* Use a memory barrier to ensure that any state that may have been ++ ** modified by another thread is not masked by stale prefetched ++ ** values. */ ++ mb(); ++ + while (slot_queue_available != local->slot_queue_recycle) { + unsigned int pos; + int slot_index = local->slot_queue[slot_queue_available++ & +@@ -626,6 +626,8 @@ process_free_queue(VCHIQ_STATE_T *state) + char *data = (char *)SLOT_DATA_FROM_INDEX(state, slot_index); + int data_found = 0; + ++ rmb(); ++ + vchiq_log_trace(vchiq_core_log_level, "%d: pfq %d=%x %x %x", + state->id, slot_index, (unsigned int)data, + local->slot_queue_recycle, slot_queue_available); +@@ -741,6 +743,8 @@ process_free_queue(VCHIQ_STATE_T *state) + up(&state->data_quota_event); + } + ++ mb(); ++ + state->slot_queue_available = slot_queue_available; + up(&state->slot_available_event); + } diff --git a/target/linux/brcm2708/patches-4.4/0428-bcm2708_fb-Default-framebuffer-to-32-bit.patch b/target/linux/brcm2708/patches-4.4/0428-bcm2708_fb-Default-framebuffer-to-32-bit.patch new file mode 100644 index 0000000000..9f3ec1f8d3 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0428-bcm2708_fb-Default-framebuffer-to-32-bit.patch @@ -0,0 +1,21 @@ +From bf38f441ef6cbc85f8232f4a43e19557c89ad21c Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 28 Jul 2016 12:15:47 +0100 +Subject: [PATCH] bcm2708_fb: Default framebuffer to 32-bit + +Can be overridden with framebuffer_depth=16 in config.txt for old behaviour +--- + drivers/video/fbdev/bcm2708_fb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/video/fbdev/bcm2708_fb.c ++++ b/drivers/video/fbdev/bcm2708_fb.c +@@ -51,7 +51,7 @@ static const char *bcm2708_name = "BCM27 + + static int fbwidth = 800; /* module parameter */ + static int fbheight = 480; /* module parameter */ +-static int fbdepth = 16; /* module parameter */ ++static int fbdepth = 32; /* module parameter */ + static int fbswap = 0; /* module parameter */ + + static u32 dma_busy_wait_threshold = 1<<15; diff --git a/target/linux/brcm2708/patches-4.4/0429-fix-auto-sense-in-lirc_rpi-driver.patch b/target/linux/brcm2708/patches-4.4/0429-fix-auto-sense-in-lirc_rpi-driver.patch new file mode 100644 index 0000000000..4857620a09 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0429-fix-auto-sense-in-lirc_rpi-driver.patch @@ -0,0 +1,45 @@ +From 7e5bbf1a74ec6bbaa25fe6cadf715946e3e4d692 Mon Sep 17 00:00:00 2001 +From: Ingo Kresse +Date: Fri, 29 Jul 2016 22:50:21 +0000 +Subject: [PATCH] fix auto-sense in lirc_rpi driver + +On a Raspberry Pi 2, the lirc_rpi driver might receive spurious +interrupts and change it's low-active / high-active setting. +When this happens, the IR remote control stops working. + +This patch disables this auto-detection if the 'sense' parameter +was set in the device tree, making the driver robust to such +spurious interrupts. +--- + drivers/staging/media/lirc/lirc_rpi.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/staging/media/lirc/lirc_rpi.c ++++ b/drivers/staging/media/lirc/lirc_rpi.c +@@ -79,6 +79,7 @@ static bool invert = 0; + + struct gpio_chip *gpiochip; + static int irq_num; ++static int auto_sense = 1; + + /* forward declarations */ + static long send_pulse(unsigned long length); +@@ -279,7 +280,9 @@ static irqreturn_t irq_handler(int i, vo + * detecting pulse while this + * MUST be a space! + */ +- sense = sense ? 0 : 1; ++ if (auto_sense) { ++ sense = sense ? 0 : 1; ++ } + } + } else { + data = (int) (deltv*1000000 + +@@ -417,6 +420,7 @@ static int init_port(void) + printk(KERN_INFO LIRC_DRIVER_NAME + ": manually using active %s receiver on GPIO pin %d\n", + sense ? "low" : "high", gpio_in_pin); ++ auto_sense = 0; + } + + return 0; diff --git a/target/linux/brcm2708/patches-4.4/0430-enable-gembird-joypad-support.patch b/target/linux/brcm2708/patches-4.4/0430-enable-gembird-joypad-support.patch new file mode 100644 index 0000000000..2216661ace --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0430-enable-gembird-joypad-support.patch @@ -0,0 +1,30 @@ +From 71a05d081ab744650deae9bc9008739ad16581f5 Mon Sep 17 00:00:00 2001 +From: Jools Wills +Date: Mon, 8 Aug 2016 11:04:29 +0100 +Subject: [PATCH] enable gembird joypad support + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -891,6 +891,7 @@ CONFIG_HID_EMS_FF=m + CONFIG_HID_ELECOM=m + CONFIG_HID_ELO=m + CONFIG_HID_EZKEY=m ++CONFIG_HID_GEMBIRD=m + CONFIG_HID_HOLTEK=m + CONFIG_HID_KEYTOUCH=m + CONFIG_HID_KYE=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -883,6 +883,7 @@ CONFIG_HID_EMS_FF=m + CONFIG_HID_ELECOM=m + CONFIG_HID_ELO=m + CONFIG_HID_EZKEY=m ++CONFIG_HID_GEMBIRD=m + CONFIG_HID_HOLTEK=m + CONFIG_HID_KEYTOUCH=m + CONFIG_HID_KYE=m diff --git a/target/linux/brcm2708/patches-4.4/0431-Added-HiFiBerry-Digi-Pro-driver.patch b/target/linux/brcm2708/patches-4.4/0431-Added-HiFiBerry-Digi-Pro-driver.patch new file mode 100644 index 0000000000..c718209422 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0431-Added-HiFiBerry-Digi-Pro-driver.patch @@ -0,0 +1,187 @@ +From e528c5d3f8cffca37abf9c69f7178f0221974225 Mon Sep 17 00:00:00 2001 +From: "Daniel Matuschek (HiFiBerry)" +Date: Tue, 26 Jul 2016 19:16:25 +0200 +Subject: [PATCH] Added HiFiBerry Digi+ Pro driver + +Signed-off-by: Daniel Matuschek +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 8 +++- + .../dts/overlays/hifiberry-digi-pro-overlay.dts | 41 +++++++++++++++++ + sound/soc/bcm/hifiberry_digi.c | 51 ++++++++++++++++++++++ + 4 files changed, 100 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/overlays/hifiberry-digi-pro-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -31,6 +31,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hifiberry-amp + dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dac.dtbo + dtbo-$(RPI_DT_OVERLAYS) += hifiberry-dacplus.dtbo + dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += hifiberry-digi-pro.dtbo + dtbo-$(RPI_DT_OVERLAYS) += hy28a.dtbo + dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo + dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -377,11 +377,17 @@ Params: 24db_digital_gain Allow ga + + + Name: hifiberry-digi +-Info: Configures the HifiBerry Digi audio card ++Info: Configures the HifiBerry Digi and Digi+ audio card + Load: dtoverlay=hifiberry-digi + Params: + + ++Name: hifiberry-digi-pro ++Info: Configures the HifiBerry Digi+ Pro audio card ++Load: dtoverlay=hifiberry-digi-pro ++Params: ++ ++ + Name: hy28a + Info: HY28A - 2.8" TFT LCD Display Module by HAOYU Electronics + Default values match Texy's display shield +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/hifiberry-digi-pro-overlay.dts +@@ -0,0 +1,41 @@ ++// Definitions for HiFiBerry Digi Pro ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ wm8804@3b { ++ #sound-dai-cells = <0>; ++ compatible = "wlf,wm8804"; ++ reg = <0x3b>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "hifiberry,hifiberry-digi"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ clock44-gpio = <&gpio 5 0>; ++ clock48-gpio = <&gpio 6 0>; ++ }; ++ }; ++}; +--- a/sound/soc/bcm/hifiberry_digi.c ++++ b/sound/soc/bcm/hifiberry_digi.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include "../codecs/wm8804.h" + +@@ -30,9 +31,34 @@ static short int auto_shutdown_output = + module_param(auto_shutdown_output, short, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); + MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped"); + ++#define CLK_44EN_RATE 22579200UL ++#define CLK_48EN_RATE 24576000UL ++ ++static bool snd_rpi_hifiberry_is_digipro; ++static struct gpio_desc *snd_rpi_hifiberry_clk44gpio; ++static struct gpio_desc *snd_rpi_hifiberry_clk48gpio; + + static int samplerate=44100; + ++static uint32_t snd_rpi_hifiberry_digi_enable_clock(int sample_rate) ++{ ++ switch (sample_rate) { ++ case 11025: ++ case 22050: ++ case 44100: ++ case 88200: ++ case 176400: ++ gpiod_set_value_cansleep(snd_rpi_hifiberry_clk44gpio, 1); ++ gpiod_set_value_cansleep(snd_rpi_hifiberry_clk48gpio, 0); ++ return CLK_44EN_RATE; ++ default: ++ gpiod_set_value_cansleep(snd_rpi_hifiberry_clk48gpio, 1); ++ gpiod_set_value_cansleep(snd_rpi_hifiberry_clk44gpio, 0); ++ return CLK_48EN_RATE; ++ } ++} ++ ++ + static int snd_rpi_hifiberry_digi_init(struct snd_soc_pcm_runtime *rtd) + { + struct snd_soc_codec *codec = rtd->codec; +@@ -40,6 +66,14 @@ static int snd_rpi_hifiberry_digi_init(s + /* enable TX output */ + snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); + ++ /* Initialize Digi+ Pro hardware */ ++ if (snd_rpi_hifiberry_is_digipro) { ++ struct snd_soc_dai_link *dai = rtd->dai_link; ++ ++ dai->name = "HiFiBerry Digi+ Pro"; ++ dai->stream_name = "HiFiBerry Digi+ Pro HiFi"; ++ } ++ + return 0; + } + +@@ -87,6 +121,9 @@ static int snd_rpi_hifiberry_digi_hw_par + mclk_freq=samplerate*128; + mclk_div=WM8804_MCLKDIV_128FS; + } ++ ++ if (snd_rpi_hifiberry_is_digipro) ++ sysclk = snd_rpi_hifiberry_digi_enable_clock(samplerate); + + switch (samplerate) { + case 32000: +@@ -121,6 +158,7 @@ static int snd_rpi_hifiberry_digi_hw_par + + ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, + sysclk, SND_SOC_CLOCK_OUT); ++ + if (ret < 0) { + dev_err(codec->dev, + "Failed to set WM8804 SYSCLK: %d\n", ret); +@@ -187,6 +225,19 @@ static int snd_rpi_hifiberry_digi_probe( + dai->platform_name = NULL; + dai->platform_of_node = i2s_node; + } ++ ++ snd_rpi_hifiberry_is_digipro = 1; ++ ++ snd_rpi_hifiberry_clk44gpio = ++ devm_gpiod_get(&pdev->dev, "clock44", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_rpi_hifiberry_clk44gpio)) ++ snd_rpi_hifiberry_is_digipro = 0; ++ ++ snd_rpi_hifiberry_clk48gpio = ++ devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_rpi_hifiberry_clk48gpio)) ++ snd_rpi_hifiberry_is_digipro = 0; ++ + } + + ret = snd_soc_register_card(&snd_rpi_hifiberry_digi); diff --git a/target/linux/brcm2708/patches-4.4/0432-clk-bcm2835-Mark-the-CM-SDRAM-clock-s-parent-as-crit.patch b/target/linux/brcm2708/patches-4.4/0432-clk-bcm2835-Mark-the-CM-SDRAM-clock-s-parent-as-crit.patch new file mode 100644 index 0000000000..a24afc8632 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0432-clk-bcm2835-Mark-the-CM-SDRAM-clock-s-parent-as-crit.patch @@ -0,0 +1,73 @@ +From a916fdb4aef02300a69cb49fb20f36ab4dc91673 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 1 Jun 2016 12:05:35 -0700 +Subject: [PATCH] clk: bcm2835: Mark the CM SDRAM clock's parent as critical + +While the SDRAM is being driven by its dedicated PLL most of the time, +there is a little loop running in the firmware that periodically turns +on the CM SDRAM clock (using its pre-initialized parent) and switches +SDRAM to using the CM clock to do PVT recalibration. + +This avoids system hangs if we choose SDRAM's parent for some other +clock, then disable that clock. + +Signed-off-by: Eric Anholt +--- + drivers/clk/bcm/clk-bcm2835.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -36,6 +36,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -1839,6 +1840,25 @@ static const struct bcm2835_clk_desc clk + .ctl_reg = CM_PERIICTL), + }; + ++/* ++ * Permanently take a reference on the parent of the SDRAM clock. ++ * ++ * While the SDRAM is being driven by its dedicated PLL most of the ++ * time, there is a little loop running in the firmware that ++ * periodically switches the SDRAM to using our CM clock to do PVT ++ * recalibration, with the assumption that the previously configured ++ * SDRAM parent is still enabled and running. ++ */ ++static int bcm2835_mark_sdc_parent_critical(struct clk *sdc) ++{ ++ struct clk *parent = clk_get_parent(sdc); ++ ++ if (IS_ERR(parent)) ++ return PTR_ERR(parent); ++ ++ return clk_prepare_enable(parent); ++} ++ + static int bcm2835_clk_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; +@@ -1848,6 +1868,7 @@ static int bcm2835_clk_probe(struct plat + const struct bcm2835_clk_desc *desc; + const size_t asize = ARRAY_SIZE(clk_desc_array); + size_t i; ++ int ret; + + cprman = devm_kzalloc(dev, + sizeof(*cprman) + asize * sizeof(*clks), +@@ -1878,6 +1899,10 @@ static int bcm2835_clk_probe(struct plat + clks[i] = desc->clk_register(cprman, desc->data); + } + ++ ret = bcm2835_mark_sdc_parent_critical(clks[BCM2835_CLOCK_SDRAM]); ++ if (ret) ++ return ret; ++ + return of_clk_add_provider(dev->of_node, of_clk_src_onecell_get, + &cprman->onecell); + } diff --git a/target/linux/brcm2708/patches-4.4/0433-clk-bcm2835-Don-t-rate-change-PLLs-on-behalf-of-divi.patch b/target/linux/brcm2708/patches-4.4/0433-clk-bcm2835-Don-t-rate-change-PLLs-on-behalf-of-divi.patch new file mode 100644 index 0000000000..717c95b96b --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0433-clk-bcm2835-Don-t-rate-change-PLLs-on-behalf-of-divi.patch @@ -0,0 +1,27 @@ +From 523bd5057f674fec3006af36a1aaca2480cb09c6 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 31 Mar 2016 12:51:04 -0700 +Subject: [PATCH] clk: bcm2835: Don't rate change PLLs on behalf of dividers. + +Our core PLLs are intended to be configured once and left alone. With +the flag set, asking to set the PLLD_DSI1 clock rate would change PLLD +just to get closer to the requested DSI clock, thus changing PLLD_PER, +the UART and ethernet PHY clock rates downstream of it, and breaking +ethernet. + +Signed-off-by: Eric Anholt +--- + drivers/clk/bcm/clk-bcm2835.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -1209,7 +1209,7 @@ bcm2835_register_pll_divider(struct bcm2 + init.num_parents = 1; + init.name = divider_name; + init.ops = &bcm2835_pll_divider_clk_ops; +- init.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED; ++ init.flags = CLK_IGNORE_UNUSED; + + divider = devm_kzalloc(cprman->dev, sizeof(*divider), GFP_KERNEL); + if (!divider) diff --git a/target/linux/brcm2708/patches-4.4/0434-clk-bcm2835-Do-appropriate-name-lookups-for-DSI1-s-p.patch b/target/linux/brcm2708/patches-4.4/0434-clk-bcm2835-Do-appropriate-name-lookups-for-DSI1-s-p.patch new file mode 100644 index 0000000000..ab7eff3cd9 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0434-clk-bcm2835-Do-appropriate-name-lookups-for-DSI1-s-p.patch @@ -0,0 +1,125 @@ +From b0fde8ea889e47505e4112d89da4be9469a37775 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 14 Apr 2016 15:13:53 -0700 +Subject: [PATCH] clk: bcm2835: Do appropriate name lookups for DSI1's parents + as well. + +Signed-off-by: Eric Anholt +--- + .../bindings/clock/brcm,bcm2835-cprman.txt | 12 ++++- + drivers/clk/bcm/clk-bcm2835.c | 54 +++++++++++++++++----- + 2 files changed, 54 insertions(+), 12 deletions(-) + +--- a/Documentation/devicetree/bindings/clock/brcm,bcm2835-cprman.txt ++++ b/Documentation/devicetree/bindings/clock/brcm,bcm2835-cprman.txt +@@ -16,7 +16,17 @@ Required properties: + - #clock-cells: Should be <1>. The permitted clock-specifier values can be + found in include/dt-bindings/clock/bcm2835.h + - reg: Specifies base physical address and size of the registers +-- clocks: The external oscillator clock phandle ++- clocks: phandles to the parent clocks used as input to the module, in ++ the following order: ++ ++ - External oscillator ++ - DSI1 byte clock ++ - DSI1 DDR2 clock ++ - DSI1 DDR clock ++ ++ Only external oscillator is required. The DSI clocks may ++ not be present, in which case their children will be ++ unusable. + + Example: + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -297,11 +297,29 @@ + #define LOCK_TIMEOUT_NS 100000000 + #define BCM2835_MAX_FB_RATE 1750000000u + ++/* ++ * Names of clocks used within the driver that need to be replaced ++ * with an external parent's name. This array is in the order that ++ * the clocks node in the DT references external clocks. ++ */ ++static const char *cprman_parent_names[] = { ++ "xosc", ++ "dsi1_byte", ++ "dsi1_ddr2", ++ "dsi1_ddr", ++}; ++ + struct bcm2835_cprman { + struct device *dev; + void __iomem *regs; + spinlock_t regs_lock; /* spinlock for all clocks */ +- const char *osc_name; ++ ++ /* ++ * Real names of cprman clock parents looked up through ++ * of_clk_get_parent_name(), which will be used in the ++ * parent_names[] arrays for clock registration. ++ */ ++ const char *real_parent_names[ARRAY_SIZE(cprman_parent_names)]; + + struct clk_onecell_data onecell; + struct clk *clks[]; +@@ -1168,7 +1186,7 @@ static struct clk *bcm2835_register_pll( + memset(&init, 0, sizeof(init)); + + /* All of the PLLs derive from the external oscillator. */ +- init.parent_names = &cprman->osc_name; ++ init.parent_names = &cprman->real_parent_names[0]; + init.num_parents = 1; + init.name = data->name; + init.ops = &bcm2835_pll_clk_ops; +@@ -1251,17 +1269,21 @@ static struct clk *bcm2835_register_cloc + struct bcm2835_clock *clock; + struct clk_init_data init; + const char *parents[1 << CM_SRC_BITS]; +- size_t i; ++ size_t i, j; + + /* +- * Replace our "xosc" references with the oscillator's +- * actual name. ++ * Replace our strings referencing parent clocks with the ++ * actual clock-output-name of the parent. + */ + for (i = 0; i < data->num_mux_parents; i++) { +- if (strcmp(data->parents[i], "xosc") == 0) +- parents[i] = cprman->osc_name; +- else +- parents[i] = data->parents[i]; ++ parents[i] = data->parents[i]; ++ ++ for (j = 0; j < ARRAY_SIZE(cprman_parent_names); j++) { ++ if (strcmp(parents[i], cprman_parent_names[j]) == 0) { ++ parents[i] = cprman->real_parent_names[j]; ++ break; ++ } ++ } + } + + memset(&init, 0, sizeof(init)); +@@ -1883,8 +1905,18 @@ static int bcm2835_clk_probe(struct plat + if (IS_ERR(cprman->regs)) + return PTR_ERR(cprman->regs); + +- cprman->osc_name = of_clk_get_parent_name(dev->of_node, 0); +- if (!cprman->osc_name) ++ for (i = 0; i < ARRAY_SIZE(cprman_parent_names); i++) { ++ cprman->real_parent_names[i] = ++ of_clk_get_parent_name(dev->of_node, i); ++ } ++ /* ++ * Make sure the external oscillator has been registered. ++ * ++ * The other (DSI) clocks are not present on older device ++ * trees, which we still need to support for backwards ++ * compatibility. ++ */ ++ if (!cprman->real_parent_names[0]) + return -ENODEV; + + platform_set_drvdata(pdev, cprman); diff --git a/target/linux/brcm2708/patches-4.4/0435-clk-bcm2835-Add-an-enum-for-the-DSI1-pixel-clock.patch b/target/linux/brcm2708/patches-4.4/0435-clk-bcm2835-Add-an-enum-for-the-DSI1-pixel-clock.patch new file mode 100644 index 0000000000..db3201ed5e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0435-clk-bcm2835-Add-an-enum-for-the-DSI1-pixel-clock.patch @@ -0,0 +1,87 @@ +From 719dcb9b9bc907dafeb20fbbf4895f928dafa353 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 14 Apr 2016 19:00:33 -0700 +Subject: [PATCH] clk: bcm2835: Add an enum for the DSI1 pixel clock. + +Signed-off-by: Eric Anholt +--- + drivers/clk/bcm/clk-bcm2835.c | 39 +++++++++++++++++++++++++++++++++++-- + include/dt-bindings/clock/bcm2835.h | 1 + + 2 files changed, 38 insertions(+), 2 deletions(-) + +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -934,6 +934,9 @@ static long bcm2835_clock_rate_from_divi + const struct bcm2835_clock_data *data = clock->data; + u64 temp; + ++ if (data->int_bits == 0 && data->frac_bits == 0) ++ return parent_rate; ++ + /* + * The divisor is a 12.12 fixed point field, but only some of + * the bits are populated in any given clock. +@@ -957,7 +960,12 @@ static unsigned long bcm2835_clock_get_r + struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); + struct bcm2835_cprman *cprman = clock->cprman; + const struct bcm2835_clock_data *data = clock->data; +- u32 div = cprman_read(cprman, data->div_reg); ++ u32 div; ++ ++ if (data->int_bits == 0 && data->frac_bits == 0) ++ return parent_rate; ++ ++ div = cprman_read(cprman, data->div_reg); + + return bcm2835_clock_rate_from_divisor(clock, parent_rate, div); + } +@@ -1403,6 +1411,28 @@ static const char *const bcm2835_clock_v + __VA_ARGS__) + + /* ++ * DSI1 parent clocks. The DSI1 byte clock comes from the DSI1 PHY, ++ * which in turn sources from plld_dsi1. ++ */ ++static const char *const bcm2835_clock_dsi1_parents[] = { ++ "gnd", ++ "xosc", ++ "testdebug0", ++ "testdebug1", ++ "dsi1_ddr", ++ "dsi1_ddr_inv", ++ "dsi1_ddr2", ++ "dsi1_ddr2_inv", ++ "dsi1_byte", ++ "dsi1_byte_inv", ++}; ++ ++#define REGISTER_DSI1_CLK(...) REGISTER_CLK( \ ++ .num_mux_parents = ARRAY_SIZE(bcm2835_clock_dsi1_parents), \ ++ .parents = bcm2835_clock_dsi1_parents, \ ++ __VA_ARGS__) ++ ++/* + * the real definition of all the pll, pll_dividers and clocks + * these make use of the above REGISTER_* macros + */ +@@ -1847,7 +1877,12 @@ static const struct bcm2835_clk_desc clk + .div_reg = CM_DSI1EDIV, + .int_bits = 4, + .frac_bits = 8), +- ++ [BCM2835_CLOCK_DSI1P] = REGISTER_DSI1_CLK( ++ .name = "dsi1p", ++ .ctl_reg = CM_DSI1PCTL, ++ .div_reg = CM_DSI1PDIV, ++ .int_bits = 0, ++ .frac_bits = 0), + /* the gates */ + + /* +--- a/include/dt-bindings/clock/bcm2835.h ++++ b/include/dt-bindings/clock/bcm2835.h +@@ -64,3 +64,4 @@ + #define BCM2835_CLOCK_CAM1 46 + #define BCM2835_CLOCK_DSI0E 47 + #define BCM2835_CLOCK_DSI1E 48 ++#define BCM2835_CLOCK_DSI1P 49 diff --git a/target/linux/brcm2708/patches-4.4/0436-drm-fb_cma_helper-Remove-implicit-call-to-disable_un.patch b/target/linux/brcm2708/patches-4.4/0436-drm-fb_cma_helper-Remove-implicit-call-to-disable_un.patch new file mode 100644 index 0000000000..431e0d95b9 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0436-drm-fb_cma_helper-Remove-implicit-call-to-disable_un.patch @@ -0,0 +1,79 @@ +From 64eb54a20a8624412ba45bf453b8588e7e6a2c53 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Thu, 14 Jan 2016 16:24:56 +0100 +Subject: [PATCH] drm/fb_cma_helper: Remove implicit call to + disable_unused_functions + +The drm_fbdev_cma_init function always calls the +drm_helper_disable_unused_functions. Since it's part of the usual probe +process, all the drivers using that helper will end up having their encoder +and CRTC disable functions called at probe if their device has not been +reported as enabled. + +This could be fixed by reading out from the registers the current state of +the device if it is enabled, but even that will not handle the case where +the device is actually disabled. + +Moreover, the drivers using the atomic modesetting expect that their enable +and disable callback to be called when the device is already enabled or +disabled (respectively). + +We can however fix this issue by moving the call to +drm_helper_disable_unused_functions out of drm_fbdev_cma_init and make the +drivers needing it (all the drivers calling drm_fbdev_cma_init and not +using the atomic modesetting) explicitly call it. + +Signed-off-by: Maxime Ripard +Link: http://patchwork.freedesktop.org/patch/msgid/1452785109-6172-14-git-send-email-maxime.ripard@free-electrons.com +Acked-by: Laurent Pinchart +Signed-off-by: Daniel Vetter +(cherry picked from commit 4314e19ef4ae0ba8872bd8610f6fef5e8743e236) +--- + drivers/gpu/drm/drm_fb_cma_helper.c | 3 --- + drivers/gpu/drm/imx/imx-drm-core.c | 1 + + drivers/gpu/drm/sti/sti_drv.c | 1 + + drivers/gpu/drm/tilcdc/tilcdc_drv.c | 1 + + 4 files changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/drm_fb_cma_helper.c ++++ b/drivers/gpu/drm/drm_fb_cma_helper.c +@@ -348,9 +348,6 @@ struct drm_fbdev_cma *drm_fbdev_cma_init + + } + +- /* disable all the possible outputs/crtcs before entering KMS mode */ +- drm_helper_disable_unused_functions(dev); +- + ret = drm_fb_helper_initial_config(helper, preferred_bpp); + if (ret < 0) { + dev_err(dev->dev, "Failed to set initial hw configuration.\n"); +--- a/drivers/gpu/drm/imx/imx-drm-core.c ++++ b/drivers/gpu/drm/imx/imx-drm-core.c +@@ -313,6 +313,7 @@ static int imx_drm_driver_load(struct dr + dev_warn(drm->dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n"); + legacyfb_depth = 16; + } ++ drm_helper_disable_unused_functions(drm); + imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth, + drm->mode_config.num_crtc, MAX_CRTC); + if (IS_ERR(imxdrm->fbhelper)) { +--- a/drivers/gpu/drm/sti/sti_drv.c ++++ b/drivers/gpu/drm/sti/sti_drv.c +@@ -160,6 +160,7 @@ static int sti_load(struct drm_device *d + + drm_mode_config_reset(dev); + ++ drm_helper_disable_unused_functions(dev); + drm_fbdev_cma_init(dev, 32, + dev->mode_config.num_crtc, + dev->mode_config.num_connector); +--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c ++++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c +@@ -294,6 +294,7 @@ static int tilcdc_load(struct drm_device + break; + } + ++ drm_helper_disable_unused_functions(dev); + priv->fbdev = drm_fbdev_cma_init(dev, bpp, + dev->mode_config.num_crtc, + dev->mode_config.num_connector); diff --git a/target/linux/brcm2708/patches-4.4/0437-overlays-Add-assert_falling_edge-to-pps-gpio-overlay.patch b/target/linux/brcm2708/patches-4.4/0437-overlays-Add-assert_falling_edge-to-pps-gpio-overlay.patch new file mode 100644 index 0000000000..496539e20c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0437-overlays-Add-assert_falling_edge-to-pps-gpio-overlay.patch @@ -0,0 +1,31 @@ +From b90a1393b3bdffa88c8e8dfbdc2bec650a5f885e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 9 Aug 2016 21:51:41 +0100 +Subject: [PATCH] overlays: Add assert_falling_edge to pps-gpio overlay + +See: https://github.com/raspberrypi/linux/issues/1590 +--- + arch/arm/boot/dts/overlays/README | 2 ++ + arch/arm/boot/dts/overlays/pps-gpio-overlay.dts | 1 + + 2 files changed, 3 insertions(+) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -797,6 +797,8 @@ Name: pps-gpio + Info: Configures the pps-gpio (pulse-per-second time signal via GPIO). + Load: dtoverlay=pps-gpio,= + Params: gpiopin Input GPIO (default "18") ++ assert_falling_edge When present, assert is indicated by a falling ++ edge, rather than by a rising edge + + + Name: pwm +--- a/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts +@@ -30,5 +30,6 @@ + __overrides__ { + gpiopin = <&pps>,"gpios:4", + <&pps_pins>,"brcm,pins:0"; ++ assert_falling_edge = <&pps>,"assert-falling-edge?"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0438-drm-mipi-dsi-Unregister-bus-at-exit.patch b/target/linux/brcm2708/patches-4.4/0438-drm-mipi-dsi-Unregister-bus-at-exit.patch new file mode 100644 index 0000000000..a5ed02c42e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0438-drm-mipi-dsi-Unregister-bus-at-exit.patch @@ -0,0 +1,30 @@ +From 229ed4a50a90820a5288c7f839db1f089bed71c4 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 2 Aug 2016 14:16:42 +0200 +Subject: [PATCH] drm/mipi-dsi: Unregister bus at exit + +This is a preliminary patch for building drm-mipi-dsi as a module. +Add the module exit callback to unregister the bus properly. + +Suggested-by: Thierry Reding +Signed-off-by: Takashi Iwai +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/drm_mipi_dsi.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/gpu/drm/drm_mipi_dsi.c ++++ b/drivers/gpu/drm/drm_mipi_dsi.c +@@ -928,6 +928,12 @@ static int __init mipi_dsi_bus_init(void + } + postcore_initcall(mipi_dsi_bus_init); + ++static void __exit mipi_dsi_bus_exit(void) ++{ ++ bus_unregister(&mipi_dsi_bus_type); ++} ++module_exit(mipi_dsi_bus_exit); ++ + MODULE_AUTHOR("Andrzej Hajda "); + MODULE_DESCRIPTION("MIPI DSI Bus"); + MODULE_LICENSE("GPL and additional rights"); diff --git a/target/linux/brcm2708/patches-4.4/0439-drm-mipi-dsi-Allow-to-build-drm-mipi-dsi-as-a-module.patch b/target/linux/brcm2708/patches-4.4/0439-drm-mipi-dsi-Allow-to-build-drm-mipi-dsi-as-a-module.patch new file mode 100644 index 0000000000..7d21e2a226 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0439-drm-mipi-dsi-Allow-to-build-drm-mipi-dsi-as-a-module.patch @@ -0,0 +1,32 @@ +From cee1a8a6610e7184a9df7975c67d7e64bb80ee27 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 2 Aug 2016 14:16:43 +0200 +Subject: [PATCH] drm/mipi-dsi: Allow to build drm-mipi-dsi as a module + +The drm-mipi-dsi driver has been only built-in although this isn't +strictly required to be so. Since it's referred by lots of DRM +drivers nowadays, most of distro kernels include the driver as +built-in as a result, even though many systems don't need it at all. + +This patch fixes Kconfig to allow drm-mipi-dsi driver built as a +module, so that we can save footprint on systems without such DRM +drivers. The probe order is managed by the module dependency, and +postcore_initcall() works just fine as a module init call. + +Signed-off-by: Takashi Iwai +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/Kconfig ++++ b/drivers/gpu/drm/Kconfig +@@ -22,7 +22,7 @@ menuconfig DRM + (/dev/agpgart) support if it is available for your platform. + + config DRM_MIPI_DSI +- bool ++ tristate + depends on DRM + + config DRM_KMS_HELPER diff --git a/target/linux/brcm2708/patches-4.4/0440-drm-vc4-Fix-flipped-HVS-channels-for-DSI0-1.patch b/target/linux/brcm2708/patches-4.4/0440-drm-vc4-Fix-flipped-HVS-channels-for-DSI0-1.patch new file mode 100644 index 0000000000..116ae0cf54 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0440-drm-vc4-Fix-flipped-HVS-channels-for-DSI0-1.patch @@ -0,0 +1,30 @@ +From 3ecee79bedf0a2dbca94281674b7a86f3b82f522 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 11 Feb 2016 12:29:45 -0800 +Subject: [PATCH] drm/vc4: Fix flipped HVS channels for DSI0/1. + +Empirically, DSI1 appears to be using HVS channel 0 on my Pi2. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -699,13 +699,13 @@ void vc4_cancel_page_flip(struct drm_crt + } + + static const struct vc4_crtc_data pv0_data = { +- .hvs_channel = 0, ++ .hvs_channel = 2, + .encoder0_type = VC4_ENCODER_TYPE_DSI0, + .encoder1_type = VC4_ENCODER_TYPE_DPI, + }; + + static const struct vc4_crtc_data pv1_data = { +- .hvs_channel = 2, ++ .hvs_channel = 0, + .encoder0_type = VC4_ENCODER_TYPE_DSI1, + .encoder1_type = VC4_ENCODER_TYPE_SMI, + }; diff --git a/target/linux/brcm2708/patches-4.4/0441-drm-vc4-Add-support-for-feeding-DSI-encoders-from-th.patch b/target/linux/brcm2708/patches-4.4/0441-drm-vc4-Add-support-for-feeding-DSI-encoders-from-th.patch new file mode 100644 index 0000000000..7b36ff9af8 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0441-drm-vc4-Add-support-for-feeding-DSI-encoders-from-th.patch @@ -0,0 +1,96 @@ +From c50d2b2fc772468306a8b30159924f19edab4901 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 10 Feb 2016 16:17:29 -0800 +Subject: [PATCH] drm/vc4: Add support for feeding DSI encoders from the pixel + valve. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 30 +++++++++++++++++------------- + drivers/gpu/drm/vc4/vc4_regs.h | 2 ++ + 2 files changed, 19 insertions(+), 13 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -210,38 +210,40 @@ static u32 vc4_get_fifo_full_level(u32 f + } + + /* +- * Returns the clock select bit for the connector attached to the +- * CRTC. ++ * Returns the encoder attached to the CRTC. ++ * ++ * VC4 can only scan out to one encoder at a type, while the DRM core ++ * allows drivers to push pixels to more than one encoder from the ++ * same CRTC. + */ +-static int vc4_get_clock_select(struct drm_crtc *crtc) ++static struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc) + { + struct drm_connector *connector; + + drm_for_each_connector(connector, crtc->dev) { + if (connector->state->crtc == crtc) { +- struct drm_encoder *encoder = connector->encoder; +- struct vc4_encoder *vc4_encoder = +- to_vc4_encoder(encoder); +- +- return vc4_encoder->clock_select; ++ return connector->encoder; + } + } + +- return -1; ++ return NULL; + } + + static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + { + struct drm_device *dev = crtc->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc); ++ struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); + struct drm_crtc_state *state = crtc->state; + struct drm_display_mode *mode = &state->adjusted_mode; + bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; + u32 vactive = (mode->vdisplay >> (interlace ? 1 : 0)); +- u32 format = PV_CONTROL_FORMAT_24; +- bool debug_dump_regs = false; +- int clock_select = vc4_get_clock_select(crtc); ++ bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 || ++ vc4_encoder->type == VC4_ENCODER_TYPE_DSI1); ++ u32 format = is_dsi ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24; ++ bool debug_dump_regs = true; + + if (debug_dump_regs) { + DRM_INFO("CRTC %d regs before:\n", drm_crtc_index(crtc)); +@@ -289,6 +291,7 @@ static void vc4_crtc_mode_set_nofb(struc + + CRTC_WRITE(PV_V_CONTROL, + PV_VCONTROL_CONTINUOUS | ++ (is_dsi ? PV_VCONTROL_DSI : 0) | + (interlace ? PV_VCONTROL_INTERLACE : 0)); + + CRTC_WRITE(PV_CONTROL, +@@ -298,7 +301,8 @@ static void vc4_crtc_mode_set_nofb(struc + PV_CONTROL_CLR_AT_START | + PV_CONTROL_TRIGGER_UNDERFLOW | + PV_CONTROL_WAIT_HSTART | +- VC4_SET_FIELD(clock_select, PV_CONTROL_CLK_SELECT) | ++ VC4_SET_FIELD(vc4_encoder->clock_select, ++ PV_CONTROL_CLK_SELECT) | + PV_CONTROL_FIFO_CLR | + PV_CONTROL_EN); + +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -184,6 +184,8 @@ + + #define PV_V_CONTROL 0x04 + # define PV_VCONTROL_INTERLACE BIT(4) ++# define PV_VCONTROL_DSI BIT(3) ++# define PV_VCONTROL_COMMAND BIT(2) + # define PV_VCONTROL_CONTINUOUS BIT(1) + # define PV_VCONTROL_VIDEN BIT(0) + diff --git a/target/linux/brcm2708/patches-4.4/0442-drm-vc4-Start-switching-to-using-debugfs_reg32-helpe.patch b/target/linux/brcm2708/patches-4.4/0442-drm-vc4-Start-switching-to-using-debugfs_reg32-helpe.patch new file mode 100644 index 0000000000..3733c324d0 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0442-drm-vc4-Start-switching-to-using-debugfs_reg32-helpe.patch @@ -0,0 +1,156 @@ +From e2934c6a46a8bfadced1866adea668cebbc698da Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 20 May 2016 16:24:47 -0700 +Subject: [PATCH] drm/vc4: Start switching to using debugfs_reg32 helpers for + debugfs. + +Every file was defining its own little struct and dumping for the +regs, when there's a helper in debugfs for doing just this. However, +instead of printing: + +PV_HORZA (0x000c): 0x00000000 + +we now print: + +PV_HORZA = 0x00000000 + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 48 ++++++++++++++++-------------------------- + drivers/gpu/drm/vc4/vc4_drv.c | 13 ++++++++++++ + drivers/gpu/drm/vc4/vc4_drv.h | 6 ++++++ + 3 files changed, 37 insertions(+), 30 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -35,6 +35,7 @@ + #include "drm_atomic_helper.h" + #include "drm_crtc_helper.h" + #include "linux/clk.h" ++#include "linux/debugfs.h" + #include "drm_fb_cma_helper.h" + #include "linux/component.h" + #include "linux/of_device.h" +@@ -85,35 +86,25 @@ struct vc4_crtc_data { + #define CRTC_WRITE(offset, val) writel(val, vc4_crtc->regs + (offset)) + #define CRTC_READ(offset) readl(vc4_crtc->regs + (offset)) + +-#define CRTC_REG(reg) { reg, #reg } +-static const struct { +- u32 reg; +- const char *name; +-} crtc_regs[] = { +- CRTC_REG(PV_CONTROL), +- CRTC_REG(PV_V_CONTROL), +- CRTC_REG(PV_VSYNCD_EVEN), +- CRTC_REG(PV_HORZA), +- CRTC_REG(PV_HORZB), +- CRTC_REG(PV_VERTA), +- CRTC_REG(PV_VERTB), +- CRTC_REG(PV_VERTA_EVEN), +- CRTC_REG(PV_VERTB_EVEN), +- CRTC_REG(PV_INTEN), +- CRTC_REG(PV_INTSTAT), +- CRTC_REG(PV_STAT), +- CRTC_REG(PV_HACT_ACT), ++static const struct debugfs_reg32 crtc_regs[] = { ++ VC4_DEBUG_REG(PV_CONTROL), ++ VC4_DEBUG_REG(PV_V_CONTROL), ++ VC4_DEBUG_REG(PV_VSYNCD_EVEN), ++ VC4_DEBUG_REG(PV_HORZA), ++ VC4_DEBUG_REG(PV_HORZB), ++ VC4_DEBUG_REG(PV_VERTA), ++ VC4_DEBUG_REG(PV_VERTB), ++ VC4_DEBUG_REG(PV_VERTA_EVEN), ++ VC4_DEBUG_REG(PV_VERTB_EVEN), ++ VC4_DEBUG_REG(PV_INTEN), ++ VC4_DEBUG_REG(PV_INTSTAT), ++ VC4_DEBUG_REG(PV_STAT), ++ VC4_DEBUG_REG(PV_HACT_ACT), + }; + + static void vc4_crtc_dump_regs(struct vc4_crtc *vc4_crtc) + { +- int i; +- +- for (i = 0; i < ARRAY_SIZE(crtc_regs); i++) { +- DRM_INFO("0x%04x (%s): 0x%08x\n", +- crtc_regs[i].reg, crtc_regs[i].name, +- CRTC_READ(crtc_regs[i].reg)); +- } ++ vc4_dump_regs32(crtc_regs, ARRAY_SIZE(crtc_regs), vc4_crtc->regs, ""); + } + + #ifdef CONFIG_DEBUG_FS +@@ -136,11 +127,8 @@ int vc4_crtc_debugfs_regs(struct seq_fil + return 0; + vc4_crtc = to_vc4_crtc(crtc); + +- for (i = 0; i < ARRAY_SIZE(crtc_regs); i++) { +- seq_printf(m, "%s (0x%04x): 0x%08x\n", +- crtc_regs[i].name, crtc_regs[i].reg, +- CRTC_READ(crtc_regs[i].reg)); +- } ++ debugfs_print_regs32(m, crtc_regs, ARRAY_SIZE(crtc_regs), ++ vc4_crtc->regs, ""); + + return 0; + } +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -9,6 +9,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -52,6 +53,18 @@ static void vc4_drm_preclose(struct drm_ + vc4_cancel_page_flip(crtc, file); + } + ++void vc4_dump_regs32(const struct debugfs_reg32 *regs, unsigned int num_regs, ++ void __iomem *base, const char *prefix) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < num_regs; i++) { ++ DRM_INFO("%s0x%04lx (%s): 0x%08x\n", ++ prefix, regs[i].offset, regs[i].name, ++ readl(base + regs[i].offset)); ++ } ++} ++ + static void vc4_lastclose(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -9,6 +9,8 @@ + #include "drmP.h" + #include "drm_gem_cma_helper.h" + ++struct debugfs_reg32; ++ + struct vc4_dev { + struct drm_device *dev; + +@@ -207,6 +209,8 @@ to_vc4_encoder(struct drm_encoder *encod + #define HVS_READ(offset) readl(vc4->hvs->regs + offset) + #define HVS_WRITE(offset, val) writel(val, vc4->hvs->regs + offset) + ++#define VC4_DEBUG_REG(reg) { .name = #reg, .offset = reg } ++ + struct vc4_exec_info { + /* Sequence number for this bin/render job. */ + uint64_t seqno; +@@ -418,6 +422,8 @@ void vc4_debugfs_cleanup(struct drm_mino + + /* vc4_drv.c */ + void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); ++void vc4_dump_regs32(const struct debugfs_reg32 *reg, unsigned int num_regs, ++ void __iomem *base, const char *prefix); + + /* vc4_dpi.c */ + extern struct platform_driver vc4_dpi_driver; diff --git a/target/linux/brcm2708/patches-4.4/0443-drm-vc4-Add-DSI1-driver.patch b/target/linux/brcm2708/patches-4.4/0443-drm-vc4-Add-DSI1-driver.patch new file mode 100644 index 0000000000..a59dd3dfce --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0443-drm-vc4-Add-DSI1-driver.patch @@ -0,0 +1,1914 @@ +From 7e409fcf8006642edc6f817b6832f27b66debc44 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 10 Feb 2016 11:42:32 -0800 +Subject: [PATCH] drm/vc4: Add DSI1 driver + +The DSI0 and DSI1 blocks on the 2835 are different but very similar +hardware blocks. Some registers move around, and the featureset is +slightly different, but they're clearly related. This doesn't enable +DSI0, but some of the infrastructure is present. + +Also, this driver doesn't initialize the DSI successfully from +poweron, so we currently require that the Raspberry Pi firmware enable +it at boot time. From there, we just keep the same settings forever, +and when poweroff is requested we just scan out black instead. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/Kconfig | 2 + + drivers/gpu/drm/vc4/Makefile | 1 + + drivers/gpu/drm/vc4/vc4_crtc.c | 41 +- + drivers/gpu/drm/vc4/vc4_debugfs.c | 2 + + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_drv.h | 8 + + drivers/gpu/drm/vc4/vc4_dsi.c | 1737 +++++++++++++++++++++++++++++++++++++ + 7 files changed, 1780 insertions(+), 12 deletions(-) + create mode 100644 drivers/gpu/drm/vc4/vc4_dsi.c + +--- a/drivers/gpu/drm/vc4/Kconfig ++++ b/drivers/gpu/drm/vc4/Kconfig +@@ -6,6 +6,8 @@ config DRM_VC4 + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER + select DRM_PANEL ++ select DRM_MIPI_DSI ++ select CLKSRC_OF + help + Choose this option if you have a system that has a Broadcom + VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835. +--- a/drivers/gpu/drm/vc4/Makefile ++++ b/drivers/gpu/drm/vc4/Makefile +@@ -8,6 +8,7 @@ vc4-y := \ + vc4_crtc.o \ + vc4_drv.o \ + vc4_dpi.o \ ++ vc4_dsi.o \ + vc4_kms.o \ + vc4_gem.o \ + vc4_hdmi.o \ +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -231,7 +231,7 @@ static void vc4_crtc_mode_set_nofb(struc + bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 || + vc4_encoder->type == VC4_ENCODER_TYPE_DSI1); + u32 format = is_dsi ? PV_CONTROL_FORMAT_DSIV_24 : PV_CONTROL_FORMAT_24; +- bool debug_dump_regs = true; ++ bool debug_dump_regs = false; + + if (debug_dump_regs) { + DRM_INFO("CRTC %d regs before:\n", drm_crtc_index(crtc)); +@@ -327,6 +327,19 @@ static void vc4_crtc_disable(struct drm_ + int ret; + require_hvs_enabled(dev); + ++ if (VC4_DSI_USE_FIRMWARE_SETUP && ++ (CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_DSI)) { ++ /* Skip disabling the PV/HVS for the channel if it was ++ * connected to the DSI panel and we're using the ++ * firmware setup. Instead, just set it to stuff ++ * black in the composite output buffer. ++ */ ++ HVS_WRITE(SCALER_DISPBKGNDX(vc4_crtc->channel), ++ HVS_READ(SCALER_DISPBKGNDX(vc4_crtc->channel)) | ++ SCALER_DISPBKGND_FILL); ++ return; ++ } ++ + CRTC_WRITE(PV_V_CONTROL, + CRTC_READ(PV_V_CONTROL) & ~PV_VCONTROL_VIDEN); + ret = wait_for(!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VIDEN), 1); +@@ -396,17 +409,19 @@ static int vc4_crtc_atomic_check(struct + if (drm_atomic_connectors_for_crtc(state->state, crtc) > 1) + return -EINVAL; + +- drm_atomic_crtc_state_for_each_plane(plane, state) { +- struct drm_plane_state *plane_state = +- state->state->plane_states[drm_plane_index(plane)]; +- +- /* plane might not have changed, in which case take +- * current state: +- */ +- if (!plane_state) +- plane_state = plane->state; ++ if (state->active) { ++ drm_atomic_crtc_state_for_each_plane(plane, state) { ++ struct drm_plane_state *plane_state = ++ state->state->plane_states[drm_plane_index(plane)]; ++ ++ /* plane might not have changed, in which case take ++ * current state: ++ */ ++ if (!plane_state) ++ plane_state = plane->state; + +- dlist_count += vc4_plane_dlist_size(plane_state); ++ dlist_count += vc4_plane_dlist_size(plane_state); ++ } + } + + dlist_count++; /* Account for SCALER_CTL0_END. */ +@@ -439,8 +454,10 @@ static void vc4_crtc_atomic_flush(struct + } + + /* Copy all the active planes' dlist contents to the hardware dlist. */ +- drm_atomic_crtc_for_each_plane(plane, crtc) { +- dlist_next += vc4_plane_write_dlist(plane, dlist_next); ++ if (crtc->state->active) { ++ drm_atomic_crtc_for_each_plane(plane, crtc) { ++ dlist_next += vc4_plane_write_dlist(plane, dlist_next); ++ } + } + + writel(SCALER_CTL0_END, dlist_next); +--- a/drivers/gpu/drm/vc4/vc4_debugfs.c ++++ b/drivers/gpu/drm/vc4/vc4_debugfs.c +@@ -19,6 +19,8 @@ static const struct drm_info_list vc4_de + {"bo_stats", vc4_bo_stats_debugfs, 0}, + {"dpi_regs", vc4_dpi_debugfs_regs, 0}, + {"gem_exec", vc4_gem_exec_debugfs, 0}, ++ {"dsi0_regs", vc4_dsi_debugfs_regs, 0, (void *)(uintptr_t)0}, ++ {"dsi1_regs", vc4_dsi_debugfs_regs, 0, (void *)(uintptr_t)1}, + {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, + {"hvs_regs", vc4_hvs_debugfs_regs, 0}, + {"crtc0_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)0}, +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -294,6 +294,7 @@ static const struct component_master_ops + static struct platform_driver *const component_drivers[] = { + &vc4_hdmi_driver, + &vc4_dpi_driver, ++ &vc4_dsi_driver, + &vc4_crtc_driver, + &vc4_hvs_driver, + &vc4_v3d_driver, +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -19,6 +19,8 @@ struct vc4_dev { + struct vc4_crtc *crtc[3]; + struct vc4_v3d *v3d; + struct vc4_dpi *dpi; ++ struct vc4_dsi *dsi0; ++ struct vc4_dsi *dsi1; + + struct drm_fbdev_cma *fbdev; + struct rpi_firmware *firmware; +@@ -192,6 +194,8 @@ enum vc4_encoder_type { + VC4_ENCODER_TYPE_DPI, + }; + ++#define VC4_DSI_USE_FIRMWARE_SETUP true ++ + struct vc4_encoder { + struct drm_encoder base; + enum vc4_encoder_type type; +@@ -429,6 +433,10 @@ void vc4_dump_regs32(const struct debugf + extern struct platform_driver vc4_dpi_driver; + int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); + ++/* vc4_dsi.c */ ++extern struct platform_driver vc4_dsi_driver; ++int vc4_dsi_debugfs_regs(struct seq_file *m, void *unused); ++ + /* vc4_gem.c */ + void vc4_gem_init(struct drm_device *dev); + void vc4_gem_destroy(struct drm_device *dev); +--- /dev/null ++++ b/drivers/gpu/drm/vc4/vc4_dsi.c +@@ -0,0 +1,1737 @@ ++ /* ++ * Copyright (C) 2016 Broadcom Limited ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published by ++ * the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ++ * more details. ++ * ++ * You should have received a copy of the GNU General Public License along with ++ * this program. If not, see . ++ */ ++ ++/** ++ * DOC: VC4 DSI0 module ++ */ ++ ++#include "drm_atomic_helper.h" ++#include "drm_crtc_helper.h" ++#include "drm_edid.h" ++#include "drm_mipi_dsi.h" ++#include "drm_panel.h" ++#include "linux/clk.h" ++#include "linux/clk-provider.h" ++#include "linux/completion.h" ++#include "linux/component.h" ++#include "linux/debugfs.h" ++#include "linux/dmaengine.h" ++#include "linux/i2c.h" ++#include "linux/of_address.h" ++#include "linux/of_gpio.h" ++#include "linux/of_platform.h" ++#include "vc4_drv.h" ++#include "vc4_regs.h" ++ ++#define DSI_CMD_FIFO_DEPTH 16 ++#define DSI_PIX_FIFO_DEPTH 256 ++#define DSI_PIX_FIFO_WIDTH 4 ++ ++#define DSI0_CTRL 0x00 ++ ++/* Command packet control. */ ++#define DSI0_TXPKT1C 0x04 /* AKA PKTC */ ++#define DSI1_TXPKT1C 0x04 ++# define DSI_TXPKT1C_TRIG_CMD_MASK VC4_MASK(31, 24) ++# define DSI_TXPKT1C_TRIG_CMD_SHIFT 24 ++# define DSI_TXPKT1C_CMD_REPEAT_MASK VC4_MASK(23, 10) ++# define DSI_TXPKT1C_CMD_REPEAT_SHIFT 10 ++ ++# define DSI_TXPKT1C_DISPLAY_NO_MASK VC4_MASK(9, 8) ++# define DSI_TXPKT1C_DISPLAY_NO_SHIFT 8 ++/* Short, trigger, BTA, or a long packet that fits all in CMDFIFO. */ ++# define DSI_TXPKT1C_DISPLAY_NO_SHORT 0 ++/* Primary display where cmdfifo provides part of the payload and ++ * pixelvalve the rest. ++ */ ++# define DSI_TXPKT1C_DISPLAY_NO_PRIMARY 1 ++/* Secondary display where cmdfifo provides part of the payload and ++ * pixfifo the rest. ++ */ ++# define DSI_TXPKT1C_DISPLAY_NO_SECONDARY 2 ++ ++# define DSI_TXPKT1C_CMD_TX_TIME_MASK VC4_MASK(7, 6) ++# define DSI_TXPKT1C_CMD_TX_TIME_SHIFT 6 ++# define DSI_TXPKT1C_CMD_CTRL_MASK VC4_MASK(5, 4) ++# define DSI_TXPKT1C_CMD_CTRL_SHIFT 4 ++/* Command only. Uses TXPKT1H and DISPLAY_NO */ ++# define DSI_TXPKT1C_CMD_CTRL_TX 0 ++/* Command with BTA for either ack or read data. */ ++# define DSI_TXPKT1C_CMD_CTRL_RX 1 ++/* Trigger according to TRIG_CMD */ ++# define DSI_TXPKT1C_CMD_CTRL_TRIG 2 ++/* BTA alone for getting error status after a command, or a TE trigger ++ * without a previous command. ++ */ ++# define DSI_TXPKT1C_CMD_CTRL_BTA 3 ++ ++# define DSI_TXPKT1C_CMD_MODE_LP BIT(3) ++# define DSI_TXPKT1C_CMD_TYPE_LONG BIT(2) ++# define DSI_TXPKT1C_CMD_TE_EN BIT(1) ++# define DSI_TXPKT1C_CMD_EN BIT(0) ++ ++/* Command packet header. */ ++#define DSI0_TXPKT1H 0x08 /* AKA PKTH */ ++#define DSI1_TXPKT1H 0x08 ++# define DSI_TXPKT1H_BC_CMDFIFO_MASK VC4_MASK(31, 24) ++# define DSI_TXPKT1H_BC_CMDFIFO_SHIFT 24 ++# define DSI_TXPKT1H_BC_PARAM_MASK VC4_MASK(23, 8) ++# define DSI_TXPKT1H_BC_PARAM_SHIFT 8 ++# define DSI_TXPKT1H_BC_DT_MASK VC4_MASK(7, 0) ++# define DSI_TXPKT1H_BC_DT_SHIFT 0 ++ ++#define DSI0_RXPKT1H 0x0c /* AKA RX1_PKTH */ ++#define DSI1_RXPKT1H 0x14 ++# define DSI_RXPKT1H_CRC_ERR BIT(31) ++# define DSI_RXPKT1H_DET_ERR BIT(30) ++# define DSI_RXPKT1H_ECC_ERR BIT(29) ++# define DSI_RXPKT1H_COR_ERR BIT(28) ++# define DSI_RXPKT1H_INCOMP_PKT BIT(25) ++# define DSI_RXPKT1H_PKT_TYPE_LONG BIT(24) ++/* Byte count if DSI_RXPKT1H_PKT_TYPE_LONG */ ++# define DSI_RXPKT1H_BC_PARAM_MASK VC4_MASK(23, 8) ++# define DSI_RXPKT1H_BC_PARAM_SHIFT 8 ++/* Short return bytes if !DSI_RXPKT1H_PKT_TYPE_LONG */ ++# define DSI_RXPKT1H_SHORT_1_MASK VC4_MASK(23, 16) ++# define DSI_RXPKT1H_SHORT_1_SHIFT 16 ++# define DSI_RXPKT1H_SHORT_0_MASK VC4_MASK(15, 8) ++# define DSI_RXPKT1H_SHORT_0_SHIFT 8 ++# define DSI_RXPKT1H_DT_LP_CMD_MASK VC4_MASK(7, 0) ++# define DSI_RXPKT1H_DT_LP_CMD_SHIFT 0 ++ ++#define DSI0_RXPKT2H 0x10 /* AKA RX2_PKTH */ ++#define DSI1_RXPKT2H 0x18 ++# define DSI_RXPKT1H_DET_ERR BIT(30) ++# define DSI_RXPKT1H_ECC_ERR BIT(29) ++# define DSI_RXPKT1H_COR_ERR BIT(28) ++# define DSI_RXPKT1H_INCOMP_PKT BIT(25) ++# define DSI_RXPKT1H_BC_PARAM_MASK VC4_MASK(23, 8) ++# define DSI_RXPKT1H_BC_PARAM_SHIFT 8 ++# define DSI_RXPKT1H_DT_MASK VC4_MASK(7, 0) ++# define DSI_RXPKT1H_DT_SHIFT 0 ++ ++#define DSI0_TXPKT_CMD_FIFO 0x14 /* AKA CMD_DATAF */ ++#define DSI1_TXPKT_CMD_FIFO 0x1c ++ ++#define DSI0_DISP0_CTRL 0x18 ++# define DSI_DISP0_PIX_CLK_DIV_MASK VC4_MASK(21, 13) ++# define DSI_DISP0_PIX_CLK_DIV_SHIFT 13 ++# define DSI_DISP0_LP_STOP_CTRL_MASK VC4_MASK(12, 11) ++# define DSI_DISP0_LP_STOP_CTRL_SHIFT 11 ++# define DSI_DISP0_LP_STOP_DISABLE 0 ++# define DSI_DISP0_LP_STOP_PERLINE 1 ++# define DSI_DISP0_LP_STOP_PERFRAME 2 ++ ++/* Transmit RGB pixels and null packets only during HACTIVE, instead ++ * of going to LP-STOP. ++ */ ++# define DSI_DISP_HACTIVE_NULL BIT(10) ++/* Transmit blanking packet only during vblank, instead of allowing LP-STOP. */ ++# define DSI_DISP_VBLP_CTRL BIT(9) ++/* Transmit blanking packet only during HFP, instead of allowing LP-STOP. */ ++# define DSI_DISP_HFP_CTRL BIT(8) ++/* Transmit blanking packet only during HBP, instead of allowing LP-STOP. */ ++# define DSI_DISP_HBP_CTRL BIT(7) ++# define DSI_DISP0_CHANNEL_MASK VC4_MASK(6, 5) ++# define DSI_DISP0_CHANNEL_SHIFT 5 ++/* Enables and end events for HSYNC/VSYNC, not just start events. */ ++# define DSI_DISP0_ST_END BIT(4) ++# define DSI_DISP0_PFORMAT_MASK VC4_MASK(3, 2) ++# define DSI_DISP0_PFORMAT_SHIFT 2 ++# define DSI_PFORMAT_RGB565 0 ++# define DSI_PFORMAT_RGB666_PACKED 1 ++# define DSI_PFORMAT_RGB666 2 ++# define DSI_PFORMAT_RGB888 3 ++/* Default is VIDEO mode. */ ++# define DSI_DISP0_COMMAND_MODE BIT(1) ++# define DSI_DISP0_ENABLE BIT(0) ++ ++#define DSI0_DISP1_CTRL 0x1c ++#define DSI1_DISP1_CTRL 0x2c ++/* Format of the data written to TXPKT_PIX_FIFO. */ ++# define DSI_DISP1_PFORMAT_MASK VC4_MASK(2, 1) ++# define DSI_DISP1_PFORMAT_SHIFT 1 ++# define DSI_DISP1_PFORMAT_16BIT 0 ++# define DSI_DISP1_PFORMAT_24BIT 1 ++# define DSI_DISP1_PFORMAT_32BIT_LE 2 ++# define DSI_DISP1_PFORMAT_32BIT_BE 3 ++ ++/* DISP1 is always command mode. */ ++# define DSI_DISP1_ENABLE BIT(0) ++ ++#define DSI0_TXPKT_PIX_FIFO 0x20 /* AKA PIX_FIFO */ ++ ++#define DSI0_INT_STAT 0x24 ++#define DSI0_INT_EN 0x28 ++# define DSI1_INT_PHY_D3_ULPS BIT(30) ++# define DSI1_INT_PHY_D3_STOP BIT(29) ++# define DSI1_INT_PHY_D2_ULPS BIT(28) ++# define DSI1_INT_PHY_D2_STOP BIT(27) ++# define DSI1_INT_PHY_D1_ULPS BIT(26) ++# define DSI1_INT_PHY_D1_STOP BIT(25) ++# define DSI1_INT_PHY_D0_ULPS BIT(24) ++# define DSI1_INT_PHY_D0_STOP BIT(23) ++# define DSI1_INT_FIFO_ERR BIT(22) ++# define DSI1_INT_PHY_DIR_RTF BIT(21) ++# define DSI1_INT_PHY_RXLPDT BIT(20) ++# define DSI1_INT_PHY_RXTRIG BIT(19) ++# define DSI1_INT_PHY_D0_LPDT BIT(18) ++# define DSI1_INT_PHY_DIR_FTR BIT(17) ++ ++/* Signaled when the clock lane enters the given state. */ ++# define DSI1_INT_PHY_CLOCK_ULPS BIT(16) ++# define DSI1_INT_PHY_CLOCK_HS BIT(15) ++# define DSI1_INT_PHY_CLOCK_STOP BIT(14) ++ ++/* Signaled on timeouts */ ++# define DSI1_INT_PR_TO BIT(13) ++# define DSI1_INT_TA_TO BIT(12) ++# define DSI1_INT_LPRX_TO BIT(11) ++# define DSI1_INT_HSTX_TO BIT(10) ++ ++/* Contention on a line when trying to drive the line low */ ++# define DSI1_INT_ERR_CONT_LP1 BIT(9) ++# define DSI1_INT_ERR_CONT_LP0 BIT(8) ++ ++/* Control error: incorrect line state sequence on data lane 0. */ ++# define DSI1_INT_ERR_CONTROL BIT(7) ++/* LPDT synchronization error (bits received not a multiple of 8. */ ++ ++# define DSI1_INT_ERR_SYNC_ESC BIT(6) ++/* Signaled after receiving an error packet from the display in ++ * response to a read. ++ */ ++# define DSI1_INT_RXPKT2 BIT(5) ++/* Signaled after receiving a packet. The header and optional short ++ * response will be in RXPKT1H, and a long response will be in the ++ * RXPKT_FIFO. ++ */ ++# define DSI1_INT_RXPKT1 BIT(4) ++# define DSI1_INT_TXPKT2_DONE BIT(3) ++# define DSI1_INT_TXPKT2_END BIT(2) ++/* Signaled after all repeats of TXPKT1 are transferred. */ ++# define DSI1_INT_TXPKT1_DONE BIT(1) ++/* Signaled after each TXPKT1 repeat is scheduled. */ ++# define DSI1_INT_TXPKT1_END BIT(0) ++ ++#define DSI1_INTERRUPTS_ALWAYS_ENABLED (DSI1_INT_ERR_SYNC_ESC | \ ++ DSI1_INT_ERR_CONTROL | \ ++ DSI1_INT_ERR_CONT_LP0 | \ ++ DSI1_INT_ERR_CONT_LP1 | \ ++ DSI1_INT_HSTX_TO | \ ++ DSI1_INT_LPRX_TO | \ ++ DSI1_INT_TA_TO | \ ++ DSI1_INT_PR_TO) ++ ++#define DSI0_STAT 0x2c ++#define DSI0_HSTX_TO_CNT 0x30 ++#define DSI0_LPRX_TO_CNT 0x34 ++#define DSI0_TA_TO_CNT 0x38 ++#define DSI0_PR_TO_CNT 0x3c ++#define DSI0_PHYC 0x40 ++# define DSI1_PHYC_ESC_CLK_LPDT_MASK VC4_MASK(25, 20) ++# define DSI1_PHYC_ESC_CLK_LPDT_SHIFT 20 ++# define DSI1_PHYC_HS_CLK_CONTINUOUS BIT(18) ++# define DSI1_PHYC_CLANE_ULPS BIT(17) ++# define DSI0_PHYC_ESC_CLK_LPDT_MASK VC4_MASK(17, 12) ++# define DSI0_PHYC_ESC_CLK_LPDT_SHIFT 12 ++# define DSI1_PHYC_CLANE_ENABLE BIT(16) ++# define DSI_PHYC_DLANE3_ULPS BIT(13) ++# define DSI_PHYC_DLANE3_ENABLE BIT(12) ++# define DSI0_PHYC_HS_CLK_CONTINUOUS BIT(10) ++# define DSI0_PHYC_CLANE_ULPS BIT(9) ++# define DSI_PHYC_DLANE2_ULPS BIT(9) ++# define DSI0_PHYC_CLANE_ENABLE BIT(8) ++# define DSI_PHYC_DLANE2_ENABLE BIT(8) ++# define DSI_PHYC_DLANE1_ULPS BIT(5) ++# define DSI_PHYC_DLANE1_ENABLE BIT(4) ++# define DSI_PHYC_DLANE0_FORCE_STOP BIT(2) ++# define DSI_PHYC_DLANE0_ULPS BIT(1) ++# define DSI_PHYC_DLANE0_ENABLE BIT(0) ++ ++#define DSI0_HS_CLT0 0x44 ++#define DSI0_HS_CLT1 0x48 ++#define DSI0_HS_CLT2 0x4c ++#define DSI0_HS_DLT3 0x50 ++#define DSI0_HS_DLT4 0x54 ++#define DSI0_HS_DLT5 0x58 ++#define DSI0_HS_DLT6 0x5c ++#define DSI0_HS_DLT7 0x60 ++ ++#define DSI0_PHY_AFEC0 0x64 ++# define DSI0_PHY_AFEC0_DDR2CLK_EN BIT(26) ++# define DSI0_PHY_AFEC0_DDRCLK_EN BIT(25) ++# define DSI0_PHY_AFEC0_LATCH_ULPS BIT(24) ++# define DSI1_PHY_AFEC0_IDR_DLANE3_MASK VC4_MASK(31, 29) ++# define DSI1_PHY_AFEC0_IDR_DLANE3_SHIFT 29 ++# define DSI1_PHY_AFEC0_IDR_DLANE2_MASK VC4_MASK(28, 26) ++# define DSI1_PHY_AFEC0_IDR_DLANE2_SHIFT 26 ++# define DSI1_PHY_AFEC0_IDR_DLANE1_MASK VC4_MASK(27, 23) ++# define DSI1_PHY_AFEC0_IDR_DLANE1_SHIFT 23 ++# define DSI1_PHY_AFEC0_IDR_DLANE0_MASK VC4_MASK(22, 20) ++# define DSI1_PHY_AFEC0_IDR_DLANE0_SHIFT 20 ++# define DSI1_PHY_AFEC0_IDR_CLANE_MASK VC4_MASK(19, 17) ++# define DSI1_PHY_AFEC0_IDR_CLANE_SHIFT 17 ++# define DSI0_PHY_AFEC0_ACTRL_DLANE1_MASK VC4_MASK(23, 20) ++# define DSI0_PHY_AFEC0_ACTRL_DLANE1_SHIFT 20 ++# define DSI0_PHY_AFEC0_ACTRL_DLANE0_MASK VC4_MASK(19, 16) ++# define DSI0_PHY_AFEC0_ACTRL_DLANE0_SHIFT 16 ++# define DSI0_PHY_AFEC0_ACTRL_CLANE_MASK VC4_MASK(15, 12) ++# define DSI0_PHY_AFEC0_ACTRL_CLANE_SHIFT 12 ++# define DSI1_PHY_AFEC0_DDR2CLK_EN BIT(16) ++# define DSI1_PHY_AFEC0_DDRCLK_EN BIT(15) ++# define DSI1_PHY_AFEC0_LATCH_ULPS BIT(14) ++# define DSI1_PHY_AFEC0_RESET BIT(13) ++# define DSI1_PHY_AFEC0_PD BIT(12) ++# define DSI0_PHY_AFEC0_RESET BIT(11) ++# define DSI1_PHY_AFEC0_PD_BG BIT(11) ++# define DSI0_PHY_AFEC0_PD BIT(10) ++# define DSI1_PHY_AFEC0_PD_DLANE3 BIT(10) ++# define DSI0_PHY_AFEC0_PD_BG BIT(9) ++# define DSI1_PHY_AFEC0_PD_DLANE2 BIT(9) ++# define DSI0_PHY_AFEC0_PD_DLANE1 BIT(8) ++# define DSI1_PHY_AFEC0_PD_DLANE1 BIT(8) ++# define DSI_PHY_AFEC0_PTATADJ_MASK VC4_MASK(7, 4) ++# define DSI_PHY_AFEC0_PTATADJ_SHIFT 4 ++# define DSI_PHY_AFEC0_CTATADJ_MASK VC4_MASK(3, 0) ++# define DSI_PHY_AFEC0_CTATADJ_SHIFT 0 ++ ++#define DSI0_PHY_AFEC1 0x68 ++# define DSI0_PHY_AFEC1_IDR_DLANE1_MASK VC4_MASK(10, 8) ++# define DSI0_PHY_AFEC1_IDR_DLANE1_SHIFT 8 ++# define DSI0_PHY_AFEC1_IDR_DLANE0_MASK VC4_MASK(6, 4) ++# define DSI0_PHY_AFEC1_IDR_DLANE0_SHIFT 4 ++# define DSI0_PHY_AFEC1_IDR_CLANE_MASK VC4_MASK(2, 0) ++# define DSI0_PHY_AFEC1_IDR_CLANE_SHIFT 0 ++ ++#define DSI0_TST_SEL 0x6c ++#define DSI0_TST_MON 0x70 ++#define DSI0_ID 0x74 ++# define DSI_ID_VALUE 0x00647369 ++ ++ ++#define DSI1_CTRL 0x00 ++# define DSI_CTRL_HS_CLKC_MASK VC4_MASK(15, 14) ++# define DSI_CTRL_HS_CLKC_SHIFT 14 ++# define DSI_CTRL_HS_CLKC_BYTE 0 ++# define DSI_CTRL_HS_CLKC_DDR2 1 ++# define DSI_CTRL_HS_CLKC_DDR 2 ++ ++# define DSI_CTRL_RX_LPDT_EOT_DISABLE BIT(13) ++# define DSI_CTRL_LPDT_EOT_DISABLE BIT(12) ++# define DSI_CTRL_HSDT_EOT_DISABLE BIT(11) ++# define DSI_CTRL_SOFT_RESET_CFG BIT(10) ++# define DSI_CTRL_CAL_BYTE BIT(9) ++# define DSI_CTRL_INV_BYTE BIT(8) ++# define DSI_CTRL_CLR_LDF BIT(7) ++# define DSI0_CTRL_CLR_PBCF BIT(6) ++# define DSI1_CTRL_CLR_RXF BIT(6) ++# define DSI0_CTRL_CLR_CPBCF BIT(5) ++# define DSI1_CTRL_CLR_PDF BIT(5) ++# define DSI0_CTRL_CLR_PDF BIT(4) ++# define DSI1_CTRL_CLR_CDF BIT(4) ++# define DSI0_CTRL_CLR_CDF BIT(3) ++# define DSI0_CTRL_CTRL2 BIT(2) ++# define DSI1_CTRL_DISABLE_DISP_CRCC BIT(2) ++# define DSI0_CTRL_CTRL1 BIT(1) ++# define DSI1_CTRL_DISABLE_DISP_ECCC BIT(1) ++# define DSI0_CTRL_CTRL0 BIT(0) ++# define DSI1_CTRL_EN BIT(0) ++# define DSI0_CTRL_RESET_FIFOS (DSI_CTRL_CLR_LDF | \ ++ DSI0_CTRL_CLR_PBCF | \ ++ DSI0_CTRL_CLR_CPBCF | \ ++ DSI0_CTRL_CLR_PDF | \ ++ DSI0_CTRL_CLR_CDF) ++# define DSI1_CTRL_RESET_FIFOS (DSI_CTRL_CLR_LDF | \ ++ DSI1_CTRL_CLR_RXF | \ ++ DSI1_CTRL_CLR_PDF | \ ++ DSI1_CTRL_CLR_CDF) ++ ++#define DSI1_TXPKT2C 0x0c ++#define DSI1_TXPKT2H 0x10 ++#define DSI1_TXPKT_PIX_FIFO 0x20 ++#define DSI1_RXPKT_FIFO 0x24 ++#define DSI1_DISP0_CTRL 0x28 ++#define DSI1_INT_STAT 0x30 ++#define DSI1_INT_EN 0x34 ++ ++/* State reporting bits. These mostly behave like INT_STAT, where ++ * writing a 1 clears the bit. ++ */ ++#define DSI1_STAT 0x38 ++# define DSI1_STAT_PHY_D3_ULPS BIT(31) ++# define DSI1_STAT_PHY_D3_STOP BIT(30) ++# define DSI1_STAT_PHY_D2_ULPS BIT(29) ++# define DSI1_STAT_PHY_D2_STOP BIT(28) ++# define DSI1_STAT_PHY_D1_ULPS BIT(27) ++# define DSI1_STAT_PHY_D1_STOP BIT(26) ++# define DSI1_STAT_PHY_D0_ULPS BIT(25) ++# define DSI1_STAT_PHY_D0_STOP BIT(24) ++# define DSI1_STAT_FIFO_ERR BIT(23) ++# define DSI1_STAT_PHY_RXLPDT BIT(22) ++# define DSI1_STAT_PHY_RXTRIG BIT(21) ++# define DSI1_STAT_PHY_D0_LPDT BIT(20) ++/* Set when in forward direction */ ++# define DSI1_STAT_PHY_DIR BIT(19) ++# define DSI1_STAT_PHY_CLOCK_ULPS BIT(18) ++# define DSI1_STAT_PHY_CLOCK_HS BIT(17) ++# define DSI1_STAT_PHY_CLOCK_STOP BIT(16) ++# define DSI1_STAT_PR_TO BIT(15) ++# define DSI1_STAT_TA_TO BIT(14) ++# define DSI1_STAT_LPRX_TO BIT(13) ++# define DSI1_STAT_HSTX_TO BIT(12) ++# define DSI1_STAT_ERR_CONT_LP1 BIT(11) ++# define DSI1_STAT_ERR_CONT_LP0 BIT(10) ++# define DSI1_STAT_ERR_CONTROL BIT(9) ++# define DSI1_STAT_ERR_SYNC_ESC BIT(8) ++# define DSI1_STAT_RXPKT2 BIT(7) ++# define DSI1_STAT_RXPKT1 BIT(6) ++# define DSI1_STAT_TXPKT2_BUSY BIT(5) ++# define DSI1_STAT_TXPKT2_DONE BIT(4) ++# define DSI1_STAT_TXPKT2_END BIT(3) ++# define DSI1_STAT_TXPKT1_BUSY BIT(2) ++# define DSI1_STAT_TXPKT1_DONE BIT(1) ++# define DSI1_STAT_TXPKT1_END BIT(0) ++ ++#define DSI1_HSTX_TO_CNT 0x3c ++#define DSI1_LPRX_TO_CNT 0x40 ++#define DSI1_TA_TO_CNT 0x44 ++#define DSI1_PR_TO_CNT 0x48 ++#define DSI1_PHYC 0x4c ++ ++#define DSI1_HS_CLT0 0x50 ++# define DSI_HS_CLT0_CZERO_MASK VC4_MASK(26, 18) ++# define DSI_HS_CLT0_CZERO_SHIFT 18 ++# define DSI_HS_CLT0_CPRE_MASK VC4_MASK(17, 9) ++# define DSI_HS_CLT0_CPRE_SHIFT 9 ++# define DSI_HS_CLT0_CPREP_MASK VC4_MASK(8, 0) ++# define DSI_HS_CLT0_CPREP_SHIFT 0 ++ ++#define DSI1_HS_CLT1 0x54 ++# define DSI_HS_CLT1_CTRAIL_MASK VC4_MASK(17, 9) ++# define DSI_HS_CLT1_CTRAIL_SHIFT 9 ++# define DSI_HS_CLT1_CPOST_MASK VC4_MASK(8, 0) ++# define DSI_HS_CLT1_CPOST_SHIFT 0 ++ ++#define DSI1_HS_CLT2 0x58 ++# define DSI_HS_CLT2_WUP_MASK VC4_MASK(23, 0) ++# define DSI_HS_CLT2_WUP_SHIFT 0 ++ ++#define DSI1_HS_DLT3 0x5c ++# define DSI_HS_DLT3_EXIT_MASK VC4_MASK(26, 18) ++# define DSI_HS_DLT3_EXIT_SHIFT 18 ++# define DSI_HS_DLT3_ZERO_MASK VC4_MASK(17, 9) ++# define DSI_HS_DLT3_ZERO_SHIFT 9 ++# define DSI_HS_DLT3_PRE_MASK VC4_MASK(8, 0) ++# define DSI_HS_DLT3_PRE_SHIFT 0 ++ ++#define DSI1_HS_DLT4 0x60 ++# define DSI_HS_DLT4_ANLAT_MASK VC4_MASK(22, 18) ++# define DSI_HS_DLT4_ANLAT_SHIFT 18 ++# define DSI_HS_DLT4_TRAIL_MASK VC4_MASK(17, 9) ++# define DSI_HS_DLT4_TRAIL_SHIFT 9 ++# define DSI_HS_DLT4_LPX_MASK VC4_MASK(8, 0) ++# define DSI_HS_DLT4_LPX_SHIFT 0 ++ ++#define DSI1_HS_DLT5 0x64 ++# define DSI_HS_DLT5_INIT_MASK VC4_MASK(23, 0) ++# define DSI_HS_DLT5_INIT_SHIFT 0 ++ ++#define DSI1_HS_DLT6 0x68 ++# define DSI_HS_DLT6_TA_GET_MASK VC4_MASK(31, 24) ++# define DSI_HS_DLT6_TA_GET_SHIFT 24 ++# define DSI_HS_DLT6_TA_SURE_MASK VC4_MASK(23, 16) ++# define DSI_HS_DLT6_TA_SURE_SHIFT 16 ++# define DSI_HS_DLT6_TA_GO_MASK VC4_MASK(15, 8) ++# define DSI_HS_DLT6_TA_GO_SHIFT 8 ++# define DSI_HS_DLT6_LP_LPX_MASK VC4_MASK(7, 0) ++# define DSI_HS_DLT6_LP_LPX_SHIFT 0 ++ ++#define DSI1_HS_DLT7 0x6c ++# define DSI_HS_DLT7_LP_WUP_MASK VC4_MASK(23, 0) ++# define DSI_HS_DLT7_LP_WUP_SHIFT 0 ++ ++#define DSI1_PHY_AFEC0 0x70 ++ ++#define DSI1_PHY_AFEC1 0x74 ++# define DSI1_PHY_AFEC1_ACTRL_DLANE3_MASK VC4_MASK(19, 16) ++# define DSI1_PHY_AFEC1_ACTRL_DLANE3_SHIFT 16 ++# define DSI1_PHY_AFEC1_ACTRL_DLANE2_MASK VC4_MASK(15, 12) ++# define DSI1_PHY_AFEC1_ACTRL_DLANE2_SHIFT 12 ++# define DSI1_PHY_AFEC1_ACTRL_DLANE1_MASK VC4_MASK(11, 8) ++# define DSI1_PHY_AFEC1_ACTRL_DLANE1_SHIFT 8 ++# define DSI1_PHY_AFEC1_ACTRL_DLANE0_MASK VC4_MASK(7, 4) ++# define DSI1_PHY_AFEC1_ACTRL_DLANE0_SHIFT 4 ++# define DSI1_PHY_AFEC1_ACTRL_CLANE_MASK VC4_MASK(3, 0) ++# define DSI1_PHY_AFEC1_ACTRL_CLANE_SHIFT 0 ++ ++#define DSI1_TST_SEL 0x78 ++#define DSI1_TST_MON 0x7c ++#define DSI1_PHY_TST1 0x80 ++#define DSI1_PHY_TST2 0x84 ++#define DSI1_PHY_FIFO_STAT 0x88 ++/* Actually, all registers in the range that aren't otherwise claimed ++ * will return the ID. ++ */ ++#define DSI1_ID 0x8c ++ ++/* General DSI hardware state. */ ++struct vc4_dsi { ++ struct platform_device *pdev; ++ ++ struct mipi_dsi_host dsi_host; ++ struct drm_encoder *encoder; ++ struct drm_connector *connector; ++ struct drm_panel *panel; ++ ++ void __iomem *regs; ++ ++ struct dma_chan *reg_dma_chan; ++ dma_addr_t reg_dma_paddr; ++ u32 *reg_dma_mem; ++ dma_addr_t reg_paddr; ++ ++ /* Whether we're on bcm2835's DSI0 or DSI1. */ ++ int port; ++ ++ /* DSI channel for the panel we're connected to. */ ++ u32 channel; ++ u32 lanes; ++ enum mipi_dsi_pixel_format format; ++ u32 mode_flags; ++ ++ /* Input clock to the PHY, for the DSI escape clock. */ ++ struct clk *escape_clock; ++ ++ /* Input clock to the PHY, used to generate the DSI bit ++ * clock. ++ */ ++ struct clk *pll_phy_clock; ++ ++ /* Byte clock generated within the DSI PHY. */ ++ struct clk_hw phy_byte_clock; ++ ++ struct clk_onecell_data clk_onecell; ++ ++ /* Pixel clock output to the pixelvalve, generated from the ++ * byte clock. ++ */ ++ struct clk *pixel_clock; ++ ++ struct completion xfer_completion; ++ int xfer_result; ++ ++ bool use_firmware_setup; ++}; ++ ++static inline void ++dsi_write(struct vc4_dsi *dsi, u32 offset, u32 val) ++{ ++ struct dma_chan *chan = dsi->reg_dma_chan; ++ struct dma_async_tx_descriptor *tx; ++ dma_cookie_t cookie; ++ int ret; ++ ++#if 0 /* XXX */ ++ dev_info(&dsi->pdev->dev, "WRITE 0x%04x -> 0x%08x\n", offset, val); ++#endif ++ ++ if (!chan) { ++ writel(val, dsi->regs + offset); ++ return; ++ } ++ ++ *dsi->reg_dma_mem = val; ++ ++ tx = chan->device->device_prep_dma_memcpy(chan, ++ dsi->reg_paddr + offset, ++ dsi->reg_dma_paddr, ++ 4, 0); ++ if (!tx) { ++ DRM_ERROR("Failed to set up DMA register write\n"); ++ return; ++ } ++ ++ cookie = tx->tx_submit(tx); ++ ret = dma_submit_error(cookie); ++ if (ret) { ++ DRM_ERROR("Failed to submit DMA: %d\n", ret); ++ return; ++ } ++ ret = dma_sync_wait(chan, cookie); ++ if (ret) ++ DRM_ERROR("Failed to wait for DMA: %d\n", ret); ++ ++#if 0 /* XXX */ ++ if (offset != DSI1_TXPKT_CMD_FIFO && ++ offset != DSI1_TXPKT_PIX_FIFO) { ++ dev_info(&dsi->pdev->dev, ++ " -> 0x%08x\n", ++ readl(dsi->regs + (offset))); ++ } ++#endif ++} ++ ++#define DSI_READ(offset) readl(dsi->regs + (offset)) ++#define DSI_WRITE(offset, val) dsi_write(dsi, offset, val) ++#define DSI_PORT_READ(offset) \ ++ DSI_READ(dsi->port ? DSI1_##offset : DSI0_##offset) ++#define DSI_PORT_WRITE(offset, val) \ ++ DSI_WRITE(dsi->port ? DSI1_##offset : DSI0_##offset, val) ++#define DSI_PORT_BIT(bit) (dsi->port ? DSI1_##bit : DSI0_##bit) ++ ++/* VC4 DSI encoder KMS struct */ ++struct vc4_dsi_encoder { ++ struct vc4_encoder base; ++ struct vc4_dsi *dsi; ++}; ++ ++static inline struct vc4_dsi_encoder * ++to_vc4_dsi_encoder(struct drm_encoder *encoder) ++{ ++ return container_of(encoder, struct vc4_dsi_encoder, base.base); ++} ++#define host_to_dsi(host) container_of(host, struct vc4_dsi, dsi_host) ++ ++/* VC4 DSI connector KMS struct */ ++struct vc4_dsi_connector { ++ struct drm_connector base; ++ struct vc4_dsi *dsi; ++ ++ /* Since the connector is attached to just the one encoder, ++ * this is the reference to it so we can do the best_encoder() ++ * hook. ++ */ ++ struct drm_encoder *encoder; ++}; ++ ++static inline struct vc4_dsi_connector * ++to_vc4_dsi_connector(struct drm_connector *connector) ++{ ++ return container_of(connector, struct vc4_dsi_connector, base); ++} ++ ++static const struct debugfs_reg32 dsi0_regs[] = { ++ VC4_DEBUG_REG(DSI0_CTRL), ++ VC4_DEBUG_REG(DSI0_STAT), ++ VC4_DEBUG_REG(DSI0_DISP0_CTRL), ++ VC4_DEBUG_REG(DSI0_DISP1_CTRL), ++ VC4_DEBUG_REG(DSI0_PHYC), ++ VC4_DEBUG_REG(DSI0_STAT), ++ VC4_DEBUG_REG(DSI0_HS_CLT0), ++ VC4_DEBUG_REG(DSI0_HS_CLT1), ++ VC4_DEBUG_REG(DSI0_HS_CLT2), ++ VC4_DEBUG_REG(DSI0_HS_DLT3), ++ VC4_DEBUG_REG(DSI0_HS_DLT4), ++ VC4_DEBUG_REG(DSI0_HS_DLT5), ++ VC4_DEBUG_REG(DSI0_HS_DLT6), ++ VC4_DEBUG_REG(DSI0_HS_DLT7), ++ VC4_DEBUG_REG(DSI0_PHY_AFEC0), ++ VC4_DEBUG_REG(DSI0_PHY_AFEC1), ++ VC4_DEBUG_REG(DSI0_ID), ++}; ++ ++static const struct debugfs_reg32 dsi1_regs[] = { ++ VC4_DEBUG_REG(DSI1_CTRL), ++ VC4_DEBUG_REG(DSI1_STAT), ++ VC4_DEBUG_REG(DSI1_DISP0_CTRL), ++ VC4_DEBUG_REG(DSI1_DISP1_CTRL), ++ VC4_DEBUG_REG(DSI1_PHYC), ++ VC4_DEBUG_REG(DSI1_STAT), ++ VC4_DEBUG_REG(DSI1_HS_CLT0), ++ VC4_DEBUG_REG(DSI1_HS_CLT1), ++ VC4_DEBUG_REG(DSI1_HS_CLT2), ++ VC4_DEBUG_REG(DSI1_HS_DLT3), ++ VC4_DEBUG_REG(DSI1_HS_DLT4), ++ VC4_DEBUG_REG(DSI1_HS_DLT5), ++ VC4_DEBUG_REG(DSI1_HS_DLT6), ++ VC4_DEBUG_REG(DSI1_HS_DLT7), ++ VC4_DEBUG_REG(DSI1_PHY_AFEC0), ++ VC4_DEBUG_REG(DSI1_PHY_AFEC1), ++ VC4_DEBUG_REG(DSI1_ID), ++}; ++ ++static void vc4_dsi_dump_regs(struct vc4_dsi *dsi, const char *prefix) ++{ ++ if (dsi->port == 0) { ++ vc4_dump_regs32(dsi0_regs, ARRAY_SIZE(dsi0_regs), dsi->regs, ++ prefix); ++ } else { ++ vc4_dump_regs32(dsi1_regs, ARRAY_SIZE(dsi1_regs), dsi->regs, ++ prefix); ++ } ++} ++ ++#ifdef CONFIG_DEBUG_FS ++int vc4_dsi_debugfs_regs(struct seq_file *m, void *number) ++{ ++ struct drm_info_node *node = (struct drm_info_node *)m->private; ++ struct drm_device *dev = node->minor->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct vc4_dsi *dsi; ++ int port = (uintptr_t)number; ++ ++ if (port == 0) { ++ dsi = vc4->dsi0; ++ debugfs_print_regs32(m, dsi0_regs, ARRAY_SIZE(dsi0_regs), ++ dsi->regs, ""); ++ } else { ++ dsi = vc4->dsi1; ++ debugfs_print_regs32(m, dsi1_regs, ARRAY_SIZE(dsi1_regs), ++ dsi->regs, ""); ++ } ++ ++ return 0; ++} ++#endif ++ ++static enum drm_connector_status ++vc4_dsi_connector_detect(struct drm_connector *connector, bool force) ++{ ++ struct vc4_dsi_connector *vc4_connector = ++ to_vc4_dsi_connector(connector); ++ struct vc4_dsi *dsi = vc4_connector->dsi; ++ ++ if (dsi->panel) ++ return connector_status_connected; ++ else ++ return connector_status_disconnected; ++} ++ ++static void vc4_dsi_connector_destroy(struct drm_connector *connector) ++{ ++ drm_connector_unregister(connector); ++ drm_connector_cleanup(connector); ++} ++ ++static int vc4_dsi_connector_get_modes(struct drm_connector *connector) ++{ ++ struct vc4_dsi_connector *vc4_connector = ++ to_vc4_dsi_connector(connector); ++ struct vc4_dsi *dsi = vc4_connector->dsi; ++ ++ if (dsi->panel) ++ return drm_panel_get_modes(dsi->panel); ++ ++ return 0; ++} ++ ++static struct drm_encoder * ++vc4_dsi_connector_best_encoder(struct drm_connector *connector) ++{ ++ struct vc4_dsi_connector *dsi_connector = ++ to_vc4_dsi_connector(connector); ++ return dsi_connector->encoder; ++} ++ ++static const struct drm_connector_funcs vc4_dsi_connector_funcs = { ++ .dpms = drm_atomic_helper_connector_dpms, ++ .detect = vc4_dsi_connector_detect, ++ .fill_modes = drm_helper_probe_single_connector_modes, ++ .destroy = vc4_dsi_connector_destroy, ++ .reset = drm_atomic_helper_connector_reset, ++ .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, ++}; ++ ++static const struct drm_connector_helper_funcs vc4_dsi_connector_helper_funcs = { ++ .get_modes = vc4_dsi_connector_get_modes, ++ .best_encoder = vc4_dsi_connector_best_encoder, ++}; ++ ++static struct drm_connector *vc4_dsi_connector_init(struct drm_device *dev, ++ struct vc4_dsi *dsi) ++{ ++ struct drm_connector *connector = NULL; ++ struct vc4_dsi_connector *dsi_connector; ++ int ret = 0; ++ ++ dsi_connector = devm_kzalloc(dev->dev, sizeof(*dsi_connector), ++ GFP_KERNEL); ++ if (!dsi_connector) { ++ ret = -ENOMEM; ++ goto fail; ++ } ++ connector = &dsi_connector->base; ++ ++ dsi_connector->encoder = dsi->encoder; ++ dsi_connector->dsi = dsi; ++ ++ drm_connector_init(dev, connector, &vc4_dsi_connector_funcs, ++ DRM_MODE_CONNECTOR_DSI); ++ drm_connector_helper_add(connector, &vc4_dsi_connector_helper_funcs); ++ ++ connector->polled = 0; ++ connector->interlace_allowed = 0; ++ connector->doublescan_allowed = 0; ++ ++ drm_mode_connector_attach_encoder(connector, dsi->encoder); ++ ++ return connector; ++ ++ fail: ++ if (connector) ++ vc4_dsi_connector_destroy(connector); ++ ++ return ERR_PTR(ret); ++} ++ ++static void vc4_dsi_encoder_destroy(struct drm_encoder *encoder) ++{ ++ drm_encoder_cleanup(encoder); ++} ++ ++static const struct drm_encoder_funcs vc4_dsi_encoder_funcs = { ++ .destroy = vc4_dsi_encoder_destroy, ++}; ++ ++static void vc4_dsi_latch_ulps(struct vc4_dsi *dsi, bool latch) ++{ ++ u32 afec0 = DSI_PORT_READ(PHY_AFEC0); ++ ++ if (latch) ++ afec0 |= DSI_PORT_BIT(PHY_AFEC0_LATCH_ULPS); ++ else ++ afec0 &= ~DSI_PORT_BIT(PHY_AFEC0_LATCH_ULPS); ++ ++ DSI_PORT_WRITE(PHY_AFEC0, afec0); ++} ++ ++/* Enters or exits Ultra Low Power State. */ ++static void vc4_dsi_ulps(struct vc4_dsi *dsi, bool ulps) ++{ ++ u32 phyc_ulps = (DSI_PORT_BIT(PHYC_CLANE_ULPS) | ++ DSI_PHYC_DLANE0_ULPS | ++ (dsi->lanes > 1 ? DSI_PHYC_DLANE1_ULPS : 0) | ++ (dsi->lanes > 2 ? DSI_PHYC_DLANE2_ULPS : 0) | ++ (dsi->lanes > 3 ? DSI_PHYC_DLANE3_ULPS : 0)); ++ u32 stat_ulps = (DSI1_STAT_PHY_CLOCK_ULPS | ++ DSI1_STAT_PHY_D0_ULPS | ++ (dsi->lanes > 1 ? DSI1_STAT_PHY_D1_ULPS : 0) | ++ (dsi->lanes > 2 ? DSI1_STAT_PHY_D2_ULPS : 0) | ++ (dsi->lanes > 3 ? DSI1_STAT_PHY_D3_ULPS : 0)); ++ u32 stat_stop = (DSI1_STAT_PHY_CLOCK_STOP | ++ DSI1_STAT_PHY_D0_STOP | ++ (dsi->lanes > 1 ? DSI1_STAT_PHY_D1_STOP : 0) | ++ (dsi->lanes > 2 ? DSI1_STAT_PHY_D2_STOP : 0) | ++ (dsi->lanes > 3 ? DSI1_STAT_PHY_D3_STOP : 0)); ++ int ret; ++ ++ DSI_PORT_WRITE(STAT, stat_ulps); ++ DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) | phyc_ulps); ++ ret = wait_for((DSI_PORT_READ(STAT) & stat_ulps) == stat_ulps, 20); ++ if (ret) { ++ dev_warn(&dsi->pdev->dev, ++ "Timeout waiting for DSI ULPS entry: STAT 0x%08x", ++ DSI_PORT_READ(STAT)); ++ DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) & ~phyc_ulps); ++ vc4_dsi_latch_ulps(dsi, false); ++ return; ++ } ++ ++ /* The DSI module can't be disabled while the module is ++ * generating ULPS state. So, to be able to disable the ++ * module, we have the AFE latch the ULPS state and continue ++ * on to having the module enter STOP. ++ */ ++ vc4_dsi_latch_ulps(dsi, ulps); ++ ++ DSI_PORT_WRITE(STAT, stat_stop); ++ DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) & ~phyc_ulps); ++ ret = wait_for((DSI_PORT_READ(STAT) & stat_stop) == stat_stop, 20); ++ if (ret) { ++ dev_warn(&dsi->pdev->dev, ++ "Timeout waiting for DSI STOP entry: STAT 0x%08x", ++ DSI_PORT_READ(STAT)); ++ DSI_PORT_WRITE(PHYC, DSI_PORT_READ(PHYC) & ~phyc_ulps); ++ return; ++ } ++} ++ ++static uint32_t ++dsi_hs_timing(u32 ui_ns, u32 ns, u32 ui) ++{ ++ /* The HS timings have to be rounded up to a multiple of 8 ++ * because we're using the byte clock. ++ */ ++ return roundup(ui + DIV_ROUND_UP(ns, ui_ns), 8); ++} ++ ++/* ESC always runs at 100Mhz. */ ++#define ESC_TIME_NS 10 ++ ++static uint32_t ++dsi_esc_timing(u32 ns) ++{ ++ return DIV_ROUND_UP(ns, ESC_TIME_NS); ++} ++ ++static void vc4_dsi_encoder_disable(struct drm_encoder *encoder) ++{ ++ struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder); ++ struct vc4_dsi *dsi = vc4_encoder->dsi; ++ ++ drm_panel_disable(dsi->panel); ++ ++ if (!dsi->use_firmware_setup) ++ vc4_dsi_ulps(dsi, true); ++ ++ drm_panel_unprepare(dsi->panel); ++ ++ if (dsi->use_firmware_setup) { ++ /* Since we're using the firmware setup and aren't ++ * communicating with the panel to bring the link ++ * down, we need to just keep the clocks and DSI ++ * module running. ++ */ ++ } else { ++ clk_disable_unprepare(dsi->pll_phy_clock); ++ clk_disable_unprepare(dsi->escape_clock); ++ clk_disable_unprepare(dsi->pixel_clock); ++ } ++} ++ ++static void vc4_dsi_encoder_enable(struct drm_encoder *encoder) ++{ ++ struct drm_display_mode *mode = &encoder->crtc->mode; ++ struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder); ++ struct vc4_dsi *dsi = vc4_encoder->dsi; ++ struct device *dev = &dsi->pdev->dev; ++ uint32_t format = 0, divider = 0; ++ bool debug_dump_regs = false; ++ unsigned long hs_clock; ++ uint32_t ui_ns; ++ /* Minimum LP state duration in escape clock cycles. */ ++ uint32_t lpx = dsi_esc_timing(60); ++ uint32_t phyc; ++ int ret; ++ ++ ret = drm_panel_prepare(dsi->panel); ++ if (ret) { ++ DRM_ERROR("Panel failed to prepare\n"); ++ return; ++ } ++ ++ if (debug_dump_regs) ++ vc4_dsi_dump_regs(dsi, "DSI before: "); ++ ++ /* XXX */ ++ if (!dsi->use_firmware_setup) { ++ ret = clk_set_rate(dsi->pll_phy_clock, 2020000000 / 3); ++ if (ret) ++ dev_err(&dsi->pdev->dev, "Failed to set phy clock: %d\n", ret); ++ dev_info(&dsi->pdev->dev, "Tried to set clock to: %d\n", 2000000000 / 3); ++ ++ ret = clk_prepare_enable(dsi->escape_clock); ++ if (ret) { ++ DRM_ERROR("Failed to turn on DSI escape clock: %d\n", ret); ++ return; ++ } ++ ++ ret = clk_prepare_enable(dsi->pll_phy_clock); ++ if (ret) { ++ DRM_ERROR("Failed to turn on DSI PLL: %d\n", ret); ++ return; ++ } ++ ++ ret = clk_set_rate(dsi->pixel_clock, mode->clock * 1000); ++ if (ret) ++ dev_err(dev, "Failed to set pixel clock: %d\n", ret); ++ dev_info(&dsi->pdev->dev, "Tried to set pixel clock to: %d\n", mode->clock * 1000); ++ ++ ret = clk_prepare_enable(dsi->pixel_clock); ++ if (ret) { ++ DRM_ERROR("Failed to turn on DSI pixel clock: %d\n", ret); ++ return; ++ } ++ } ++ ++ hs_clock = clk_get_rate(dsi->pll_phy_clock); ++ ++ /* Reset the DSI and all its fifos. */ ++ if (dsi->port == 0) { ++ DSI_PORT_WRITE(CTRL, ++ DSI_CTRL_SOFT_RESET_CFG | ++ DSI0_CTRL_RESET_FIFOS); ++ } else { ++ DSI_PORT_WRITE(CTRL, ++ DSI_CTRL_SOFT_RESET_CFG | ++ DSI1_CTRL_RESET_FIFOS); ++ } ++ ++ DSI_PORT_WRITE(CTRL, ++ DSI_CTRL_HSDT_EOT_DISABLE | ++ DSI_CTRL_RX_LPDT_EOT_DISABLE); ++ ++ switch (dsi->format) { ++ case MIPI_DSI_FMT_RGB888: ++ format = DSI_PFORMAT_RGB888; ++ divider = 24 / dsi->lanes; ++ break; ++ case MIPI_DSI_FMT_RGB666: ++ format = DSI_PFORMAT_RGB666; ++ divider = 24 / dsi->lanes; ++ break; ++ case MIPI_DSI_FMT_RGB666_PACKED: ++ format = DSI_PFORMAT_RGB666_PACKED; ++ divider = 18 / dsi->lanes; ++ break; ++ case MIPI_DSI_FMT_RGB565: ++ format = DSI_PFORMAT_RGB565; ++ divider = 16 / dsi->lanes; ++ break; ++ } ++ ++ /* Set AFE CTR00/CTR1 to release powerdown of analog. */ ++ if (dsi->port == 0) { ++ u32 afec0 = (VC4_SET_FIELD(7, DSI_PHY_AFEC0_PTATADJ) | ++ VC4_SET_FIELD(7, DSI_PHY_AFEC0_CTATADJ)); ++ ++ if (dsi->lanes < 2) ++ afec0 |= DSI0_PHY_AFEC0_PD_DLANE1; ++ ++ if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO)) ++ afec0 |= DSI0_PHY_AFEC0_RESET; ++ ++ DSI_PORT_WRITE(PHY_AFEC0, afec0); ++ ++ DSI_PORT_WRITE(PHY_AFEC1, ++ VC4_SET_FIELD(6, DSI0_PHY_AFEC1_IDR_DLANE1) | ++ VC4_SET_FIELD(6, DSI0_PHY_AFEC1_IDR_DLANE0) | ++ VC4_SET_FIELD(6, DSI0_PHY_AFEC1_IDR_CLANE)); ++ } else { ++ u32 afec0 = (VC4_SET_FIELD(7, DSI_PHY_AFEC0_PTATADJ) | ++ VC4_SET_FIELD(7, DSI_PHY_AFEC0_CTATADJ) | ++ VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_CLANE) | ++ VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE0) | ++ VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE1) | ++ VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE2) | ++ VC4_SET_FIELD(6, DSI1_PHY_AFEC0_IDR_DLANE3)); ++ ++ if (dsi->lanes < 4) ++ afec0 |= DSI1_PHY_AFEC0_PD_DLANE3; ++ if (dsi->lanes < 3) ++ afec0 |= DSI1_PHY_AFEC0_PD_DLANE2; ++ if (dsi->lanes < 2) ++ afec0 |= DSI1_PHY_AFEC0_PD_DLANE1; ++ ++ if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO)) ++ afec0 |= DSI1_PHY_AFEC0_RESET; ++ ++ DSI_PORT_WRITE(PHY_AFEC0, afec0); ++ ++ DSI_PORT_WRITE(PHY_AFEC1, 0); ++ } ++ ++ /* How many ns one DSI unit interval is. Note that the clock ++ * is DDR, so there's an extra divide by 2. ++ */ ++ ui_ns = DIV_ROUND_UP(500000000, hs_clock); ++ ++ DSI_PORT_WRITE(HS_CLT0, ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 262, 0), ++ DSI_HS_CLT0_CZERO) | ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 0, 8), ++ DSI_HS_CLT0_CPRE) | ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 38, 0), ++ DSI_HS_CLT0_CPREP)); ++ ++ DSI_PORT_WRITE(HS_CLT1, ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 60, 0), ++ DSI_HS_CLT1_CTRAIL) | ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 60, 52), ++ DSI_HS_CLT1_CPOST)); ++ ++ DSI_PORT_WRITE(HS_CLT2, ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 1000000, 0), ++ DSI_HS_CLT2_WUP)); ++ ++ DSI_PORT_WRITE(HS_DLT3, ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 100, 0), ++ DSI_HS_DLT3_EXIT) | ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 105, 6), ++ DSI_HS_DLT3_ZERO) | ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, 40, 4), ++ DSI_HS_DLT3_PRE)); ++ ++ DSI_PORT_WRITE(HS_DLT4, ++ VC4_SET_FIELD(dsi_hs_timing(ui_ns, lpx * ESC_TIME_NS, 0), ++ DSI_HS_DLT4_LPX) | ++ VC4_SET_FIELD(max(dsi_hs_timing(ui_ns, 0, 8), ++ dsi_hs_timing(ui_ns, 60, 4)), ++ DSI_HS_DLT4_TRAIL) | ++ VC4_SET_FIELD(0, DSI_HS_DLT4_ANLAT)); ++ ++ DSI_PORT_WRITE(HS_DLT5, VC4_SET_FIELD(dsi_hs_timing(ui_ns, 1000, 5000), ++ DSI_HS_DLT5_INIT)); ++ ++ DSI_PORT_WRITE(HS_DLT6, ++ VC4_SET_FIELD(lpx * 5, DSI_HS_DLT6_TA_GET) | ++ VC4_SET_FIELD(lpx, DSI_HS_DLT6_TA_SURE) | ++ VC4_SET_FIELD(lpx * 4, DSI_HS_DLT6_TA_GO) | ++ VC4_SET_FIELD(lpx, DSI_HS_DLT6_LP_LPX)); ++ ++ DSI_PORT_WRITE(HS_DLT7, ++ VC4_SET_FIELD(dsi_esc_timing(1000000), ++ DSI_HS_DLT7_LP_WUP)); ++ ++ /* Define EOT PKT in EOT reg. */ ++ ++ phyc = (DSI_PHYC_DLANE0_ENABLE | ++ (dsi->lanes >= 2 ? DSI_PHYC_DLANE1_ENABLE : 0) | ++ (dsi->lanes >= 3 ? DSI_PHYC_DLANE2_ENABLE : 0) | ++ (dsi->lanes >= 4 ? DSI_PHYC_DLANE3_ENABLE : 0) | ++ (dsi->port == 0 ? ++ VC4_SET_FIELD(lpx - 1, DSI0_PHYC_ESC_CLK_LPDT) : ++ VC4_SET_FIELD(lpx - 1, DSI1_PHYC_ESC_CLK_LPDT)) | ++ DSI_PORT_BIT(PHYC_CLANE_ENABLE)); ++ ++ DSI_PORT_WRITE(CTRL, ++ DSI_PORT_READ(CTRL) | ++ DSI_CTRL_CAL_BYTE); ++ ++ /* HS timeout in HS clock cycles: disabled. */ ++ DSI_PORT_WRITE(HSTX_TO_CNT, 0); ++ /* LP receive timeout in HS clocks. */ ++ DSI_PORT_WRITE(LPRX_TO_CNT, 0xffffff); ++ /* Bus turnaround timeout */ ++ DSI_PORT_WRITE(TA_TO_CNT, 100000); ++ /* Display reset sequence timeout */ ++ DSI_PORT_WRITE(TA_TO_CNT, 100000); ++ ++ if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) { ++ DSI_PORT_WRITE(DISP0_CTRL, ++ VC4_SET_FIELD(divider, DSI_DISP0_PIX_CLK_DIV) | ++ VC4_SET_FIELD(format, DSI_DISP0_PFORMAT) | ++ VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME, ++ DSI_DISP0_LP_STOP_CTRL) | ++ DSI_DISP0_ST_END | ++ DSI_DISP0_ENABLE); ++ } else { ++ DSI_PORT_WRITE(DISP0_CTRL, ++ DSI_DISP0_COMMAND_MODE | ++ DSI_DISP0_ENABLE); ++ } ++ ++ /* Set up DISP1 for transferring long command payloads through ++ * the pixfifo. ++ */ ++ DSI_PORT_WRITE(DISP1_CTRL, ++ VC4_SET_FIELD(DSI_DISP1_PFORMAT_32BIT_LE, ++ DSI_DISP1_PFORMAT) | ++ DSI_DISP1_ENABLE); ++ ++ if (!(dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)) ++ phyc |= DSI_PORT_BIT(PHYC_HS_CLK_CONTINUOUS); ++ ++ DSI_PORT_WRITE(PHYC, phyc); ++ ++ /* Ungate the block. */ ++ if (dsi->port == 0) ++ DSI_PORT_WRITE(CTRL, DSI_PORT_READ(CTRL) | DSI0_CTRL_CTRL0); ++ else { ++ DSI_PORT_WRITE(CTRL, DSI_PORT_READ(CTRL) | DSI1_CTRL_EN); ++ } ++ ++ if (!dsi->use_firmware_setup) ++ vc4_dsi_ulps(dsi, false); ++ ++ if (debug_dump_regs) ++ vc4_dsi_dump_regs(dsi, "DSI after: "); ++ ++ ret = drm_panel_enable(dsi->panel); ++ if (ret) { ++ DRM_ERROR("Panel failed to enable\n"); ++ drm_panel_unprepare(dsi->panel); ++ return; ++ } ++} ++ ++static ssize_t vc4_dsi_host_transfer(struct mipi_dsi_host *host, ++ const struct mipi_dsi_msg *msg) ++{ ++ struct vc4_dsi *dsi = host_to_dsi(host); ++ struct mipi_dsi_packet packet; ++ u32 pkth = 0, pktc = 0; ++ int i, ret; ++ bool is_long = mipi_dsi_packet_format_is_long(msg->type); ++ u32 cmd_fifo_len = 0, pix_fifo_len = 0; ++ ++ mipi_dsi_create_packet(&packet, msg); ++ pr_err("DSI host xfer %db, %s\n", ++ packet.payload_length, ++ is_long ? "long" : "short"); ++ ++ pkth |= VC4_SET_FIELD(packet.header[0], DSI_TXPKT1H_BC_DT); ++ pkth |= VC4_SET_FIELD(packet.header[1] | ++ (packet.header[2] << 8), ++ DSI_TXPKT1H_BC_PARAM); ++ if (is_long) { ++ /* Divide data across the various FIFOs we have available. ++ * The command FIFO takes byte-oriented data, but is of ++ * limited size. The pixel FIFO (never actually used for ++ * pixel data in reality) is word oriented, and substantially ++ * larger. So, we use the pixel FIFO for most of the data, ++ * sending the residual bytes in the command FIFO at the start. ++ * ++ * With this arrangement, the command FIFO will never get full. ++ */ ++ cmd_fifo_len = packet.payload_length % DSI_PIX_FIFO_WIDTH; ++ pix_fifo_len = ((packet.payload_length - cmd_fifo_len) / ++ DSI_PIX_FIFO_WIDTH); ++ ++ WARN_ON_ONCE(pix_fifo_len >= DSI_PIX_FIFO_DEPTH); ++ ++ pkth |= VC4_SET_FIELD(cmd_fifo_len, DSI_TXPKT1H_BC_CMDFIFO); ++ } ++ ++ if (msg->rx_len) { ++ pktc |= VC4_SET_FIELD(DSI_TXPKT1C_CMD_CTRL_RX, ++ DSI_TXPKT1C_CMD_CTRL); ++ } else { ++ pktc |= VC4_SET_FIELD(DSI_TXPKT1C_CMD_CTRL_TX, ++ DSI_TXPKT1C_CMD_CTRL); ++ } ++ ++ dev_info(&dsi->pdev->dev, "FIFO setup: %d, %d\n", ++ cmd_fifo_len, pix_fifo_len); ++ ++ for (i = 0; i < cmd_fifo_len; i++) ++ DSI_PORT_WRITE(TXPKT_CMD_FIFO, packet.payload[i]); ++ for (i = 0; i < pix_fifo_len; i++) { ++ const uint8_t *pix = packet.payload + cmd_fifo_len + i * 4; ++ DSI_PORT_WRITE(TXPKT_PIX_FIFO, ++ pix[0] | ++ pix[1] << 8 | ++ pix[2] << 16 | ++ pix[3] << 24); ++ } ++ ++ if (msg->flags & MIPI_DSI_MSG_USE_LPM) ++ pktc |= DSI_TXPKT1C_CMD_MODE_LP; ++ if (is_long) ++ pktc |= DSI_TXPKT1C_CMD_TYPE_LONG; ++ ++ /* Send one copy of the packet. Larger repeats are used for pixel ++ * data in command mode. ++ */ ++ pktc |= VC4_SET_FIELD(1, DSI_TXPKT1C_CMD_REPEAT); ++ ++ pktc |= DSI_TXPKT1C_CMD_EN; ++ if (pix_fifo_len) { ++ pktc |= VC4_SET_FIELD(DSI_TXPKT1C_DISPLAY_NO_SECONDARY, ++ DSI_TXPKT1C_DISPLAY_NO); ++ } else { ++ pktc |= VC4_SET_FIELD(DSI_TXPKT1C_DISPLAY_NO_SHORT, ++ DSI_TXPKT1C_DISPLAY_NO); ++ } ++ ++ /* Enable the appropriate interrupt for the transfer completion. */ ++ dsi->xfer_result = 0; ++ reinit_completion(&dsi->xfer_completion); ++ DSI_PORT_WRITE(INT_STAT, DSI1_INT_TXPKT1_DONE | DSI1_INT_PHY_DIR_RTF); ++ if (msg->rx_len) { ++ DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED | ++ DSI1_INT_PHY_DIR_RTF)); ++ } else { ++ DSI_PORT_WRITE(INT_EN, (DSI1_INTERRUPTS_ALWAYS_ENABLED | ++ DSI1_INT_TXPKT1_DONE)); ++ } ++ ++ /* Send the packet. */ ++ DSI_PORT_WRITE(TXPKT1H, pkth); ++ DSI_PORT_WRITE(TXPKT1C, pktc); ++ ++ if (!wait_for_completion_timeout(&dsi->xfer_completion, ++ msecs_to_jiffies(100))) { ++ u32 stat = DSI_PORT_READ(STAT); ++ ++ dev_err(&dsi->pdev->dev, "transfer interrupt wait timeout"); ++ dev_err(&dsi->pdev->dev, "INT_STAT: 0x%08x, STAT: 0x%08x\n", ++ DSI_PORT_READ(INT_STAT), stat); ++ ++ if (stat & DSI1_STAT_TXPKT1_DONE) { ++ dev_info(&dsi->pdev->dev, ++ "STAT reports DONE, though.\n"); ++ ret = 0; ++ } else { ++ ret = -ETIMEDOUT; ++ } ++ } else { ++ ret = dsi->xfer_result; ++ } ++ ++ DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED); ++ if (ret) ++ goto reset_fifo_and_return; ++ ++ if (ret == 0 && msg->rx_len) { ++ u32 rxpkt1h = DSI_PORT_READ(RXPKT1H); ++ u8 *msg_rx = msg->rx_buf; ++ ++ if (rxpkt1h & DSI_RXPKT1H_PKT_TYPE_LONG) { ++ u32 rxlen = VC4_GET_FIELD(rxpkt1h, DSI_RXPKT1H_BC_PARAM); ++ ++ if (rxlen != msg->rx_len) { ++ DRM_ERROR("DSI returned %db, expecting %db\n", ++ rxlen, msg->rx_len); ++ ret = -ENXIO; ++ goto reset_fifo_and_return; ++ } ++ ++ for (i = 0; i < msg->rx_len; i++) ++ msg_rx[i] = DSI_READ(DSI1_RXPKT_FIFO); ++ } else { ++ /* XXX: AWER */ ++ ++ msg_rx[0] = VC4_GET_FIELD(rxpkt1h, ++ DSI_RXPKT1H_SHORT_0); ++ if (msg->rx_len > 1) { ++ msg_rx[1] = VC4_GET_FIELD(rxpkt1h, ++ DSI_RXPKT1H_SHORT_1); ++ } ++ } ++ } ++ ++ return ret; ++ ++reset_fifo_and_return: ++ DRM_ERROR("DSI TRANSFER failed, resetting: %d\n", ret); ++ ++ DSI_PORT_WRITE(TXPKT1C, DSI_PORT_READ(TXPKT1C) & ~DSI_TXPKT1C_CMD_EN); ++ udelay(1); ++ if (dsi->port == 0) { ++ DSI_PORT_WRITE(CTRL, ++ DSI_PORT_READ(CTRL) | DSI0_CTRL_RESET_FIFOS); ++ } else { ++ DSI_PORT_WRITE(CTRL, ++ DSI_PORT_READ(CTRL) | DSI1_CTRL_RESET_FIFOS); ++ } ++ ++ DSI_PORT_WRITE(TXPKT1C, 0); ++ DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED); ++ ++ ++ return ret; ++} ++ ++static int vc4_dsi_host_attach(struct mipi_dsi_host *host, ++ struct mipi_dsi_device *device) ++{ ++ struct vc4_dsi *dsi = host_to_dsi(host); ++ ++ dsi->lanes = device->lanes; ++ dsi->channel = device->channel; ++ dsi->format = device->format; ++ dsi->mode_flags = device->mode_flags; ++ ++ if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO)) { ++ dev_err(&dsi->pdev->dev, ++ "Only VIDEO mode panels supported currently.\n"); ++ return 0; ++ } ++ ++ dsi->panel = of_drm_find_panel(device->dev.of_node); ++ if (dsi->panel) ++ return drm_panel_attach(dsi->panel, dsi->connector); ++ ++ drm_helper_hpd_irq_event(dsi->connector->dev); ++ ++ return 0; ++} ++ ++static int vc4_dsi_host_detach(struct mipi_dsi_host *host, ++ struct mipi_dsi_device *device) ++{ ++ struct vc4_dsi *dsi = host_to_dsi(host); ++ ++ if (dsi->panel) { ++ int ret = drm_panel_detach(dsi->panel); ++ if (ret) ++ return ret; ++ ++ dsi->panel = NULL; ++ } ++ ++ drm_helper_hpd_irq_event(dsi->connector->dev); ++ ++ return 0; ++} ++ ++static const struct mipi_dsi_host_ops vc4_dsi_host_ops = { ++ .attach = vc4_dsi_host_attach, ++ .detach = vc4_dsi_host_detach, ++ .transfer = vc4_dsi_host_transfer, ++}; ++ ++static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { ++ .disable = vc4_dsi_encoder_disable, ++ .enable = vc4_dsi_encoder_enable, ++}; ++ ++static const struct of_device_id vc4_dsi_dt_match[] = { ++ { .compatible = "brcm,bcm2835-dsi0", (void *)(uintptr_t)0 }, ++ { .compatible = "brcm,bcm2835-dsi1", (void *)(uintptr_t)1 }, ++ {} ++}; ++ ++static long vc4_dsi_byte_clock_round_rate(struct clk_hw *hw, unsigned long rate, ++ unsigned long *parent_rate) ++{ ++ return *parent_rate / 8; ++} ++ ++static unsigned long vc4_dsi_byte_clock_get_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ return parent_rate / 8; ++} ++ ++static int vc4_dsi_byte_clock_set_rate(struct clk_hw *hw, ++ unsigned long rate, ++ unsigned long parent_rate) ++{ ++ return 0; ++} ++ ++/* The byte clock has *no* ops filled. It's always running when the ++ * PHY is. ++ */ ++static const struct clk_ops vc4_dsi_byte_clock_ops = { ++ .recalc_rate = vc4_dsi_byte_clock_get_rate, ++ .set_rate = vc4_dsi_byte_clock_set_rate, ++ .round_rate = vc4_dsi_byte_clock_round_rate, ++}; ++ ++static void dsi_handle_error(struct vc4_dsi *dsi, ++ irqreturn_t *ret, u32 stat, u32 bit, ++ const char *type) ++{ ++ if (!(stat & bit)) ++ return; ++ ++ DRM_ERROR("DSI%d: %s error\n", dsi->port, type); ++ *ret = IRQ_HANDLED; ++} ++ ++static irqreturn_t vc4_dsi_irq_handler(int irq, void *data) ++{ ++ struct vc4_dsi *dsi = data; ++ u32 stat = DSI_PORT_READ(INT_STAT); ++ irqreturn_t ret = IRQ_NONE; ++ ++ DSI_PORT_WRITE(INT_STAT, stat); ++ ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_ERR_SYNC_ESC, "LPDT sync"); ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_ERR_CONTROL, "data lane 0 sequence"); ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_ERR_CONT_LP0, "LP0 contention"); ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_ERR_CONT_LP1, "LP1 contention"); ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_HSTX_TO, "HSTX timeout"); ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_LPRX_TO, "LPRX timeout"); ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_TA_TO, "turnaround timeout"); ++ dsi_handle_error(dsi, &ret, stat, ++ DSI1_INT_PR_TO, "peripheral reset timeout"); ++ ++ if (stat & (DSI1_INT_TXPKT1_DONE | DSI1_INT_PHY_DIR_RTF)) { ++ complete(&dsi->xfer_completion); ++ ret = IRQ_HANDLED; ++ } else if (stat & DSI1_INT_HSTX_TO) { ++ complete(&dsi->xfer_completion); ++ dsi->xfer_result = -ETIMEDOUT; ++ ret = IRQ_HANDLED; ++ } ++ ++ return ret; ++} ++ ++static int ++vc4_dsi_init_phy_byte_clock(struct vc4_dsi *dsi) ++{ ++ struct device *dev = &dsi->pdev->dev; ++ const char *parent_name = __clk_get_name(dsi->pll_phy_clock); ++ struct clk_init_data init; ++ struct clk *clk; ++ ++ memset(&init, 0, sizeof(init)); ++ init.parent_names = &parent_name; ++ init.num_parents = 1; ++ if (dsi->port == 1) ++ init.name = "dsi1_byte"; ++ else ++ init.name = "dsi0_byte"; ++ init.ops = &vc4_dsi_byte_clock_ops; ++ init.flags = 0; ++ ++ dsi->phy_byte_clock.init = &init; ++ clk = devm_clk_register(dev, &dsi->phy_byte_clock); ++ if (IS_ERR(clk)) ++ return PTR_ERR(clk); ++ ++ /* Use the onecell provider because we may need to expose the ++ * DDR and DDR2 clocks at some point, which we'd want to put ++ * in slots 1 and 2. ++ */ ++ dsi->clk_onecell.clk_num = 1; ++ dsi->clk_onecell.clks = devm_kcalloc(dev, ++ dsi->clk_onecell.clk_num, ++ sizeof(*dsi->clk_onecell.clks), ++ GFP_KERNEL); ++ if (!dsi->clk_onecell.clks) ++ return -ENOMEM; ++ ++ dsi->clk_onecell.clks[0] = clk; ++ ++ return of_clk_add_provider(dev->of_node, ++ of_clk_src_onecell_get, ++ &dsi->clk_onecell); ++} ++ ++static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct drm_device *drm = dev_get_drvdata(master); ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_dsi *dsi; ++ struct vc4_dsi_encoder *vc4_dsi_encoder; ++ const struct of_device_id *match; ++ dma_cap_mask_t dma_mask; ++ int ret; ++ ++ dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); ++ if (!dsi) ++ return -ENOMEM; ++ ++ match = of_match_device(vc4_dsi_dt_match, dev); ++ if (!match) ++ return -ENODEV; ++ ++ dsi->port = (uintptr_t)match->data; ++ ++ vc4_dsi_encoder = devm_kzalloc(dev, sizeof(*vc4_dsi_encoder), ++ GFP_KERNEL); ++ if (!vc4_dsi_encoder) ++ return -ENOMEM; ++ vc4_dsi_encoder->base.type = VC4_ENCODER_TYPE_DSI1; ++ vc4_dsi_encoder->dsi = dsi; ++ dsi->encoder = &vc4_dsi_encoder->base.base; ++ ++ dsi->pdev = pdev; ++ dsi->regs = vc4_ioremap_regs(pdev, 0); ++ if (IS_ERR(dsi->regs)) ++ return PTR_ERR(dsi->regs); ++ ++ if (DSI_PORT_READ(ID) != DSI_ID_VALUE) { ++ dev_err(dev, "Port returned 0x%08x for ID instead of 0x%08x\n", ++ DSI_PORT_READ(ID), DSI_ID_VALUE); ++ return -ENODEV; ++ } ++ ++ if (DSI_PORT_READ(CTRL) == 0) { ++ dev_info(dev, "DSI not set up by firmware.\n"); ++ return 0; ++ } ++ ++ /* Set this flag to indicate that we're relying on boot-time ++ * DSI state and can't successfully reconfigure DSI yet. ++ */ ++ dsi->use_firmware_setup = VC4_DSI_USE_FIRMWARE_SETUP; ++ ++ if (dsi->use_firmware_setup) { ++ /* Increment references to the various clocks so that ++ * they stay always enabled and the clock framework ++ * doesn't disable their parents. ++ */ ++ ret = clk_prepare_enable(dsi->escape_clock); ++ if (ret) { ++ DRM_ERROR("Failed to refcount DSI escape clock: %d\n", ret); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(dsi->pll_phy_clock); ++ if (ret) { ++ DRM_ERROR("Failed to refcount DSI PLL: %d\n", ret); ++ return ret; ++ } ++ ++ ret = clk_prepare_enable(dsi->pixel_clock); ++ if (ret) { ++ DRM_ERROR("Failed to refcount pixel clock: %d\n", ret); ++ return ret; ++ } ++ } ++ ++ /* DSI1 has a broken AXI slave that doesn't respond to writes ++ * from the ARM. It does handle writes from the DMA engine, ++ * so set up a channel for talking to it. ++ */ ++ if (dsi->port == 1) { ++ dsi->reg_dma_mem = dma_alloc_coherent(dev, 4, ++ &dsi->reg_dma_paddr, ++ GFP_KERNEL); ++ if (!dsi->reg_dma_mem) { ++ DRM_ERROR("Failed to get DMA memory\n"); ++ return -ENOMEM; ++ } ++ ++ dma_cap_zero(dma_mask); ++ dma_cap_set(DMA_MEMCPY, dma_mask); ++ dsi->reg_dma_chan = dma_request_channel(dma_mask, NULL, NULL); ++ if (IS_ERR(dsi->reg_dma_chan)) { ++ ret = PTR_ERR(dsi->reg_dma_chan); ++ if (ret != -EPROBE_DEFER) ++ DRM_ERROR("Failed to get DMA channel: %d\n", ++ ret); ++ return ret; ++ } ++ ++ /* Get the physical address of the device's registers. The ++ * struct resource for the regs gives us the bus address ++ * instead. ++ */ ++ dsi->reg_paddr = be32_to_cpup(of_get_address(dev->of_node, ++ 0, NULL, NULL)); ++ } ++ ++ init_completion(&dsi->xfer_completion); ++ /* At startup enable error-reporting interrupts and nothing else. */ ++ DSI_PORT_WRITE(INT_EN, DSI1_INTERRUPTS_ALWAYS_ENABLED); ++ /* Clear any existing interrupt state. */ ++ DSI_PORT_WRITE(INT_STAT, DSI_PORT_READ(INT_STAT)); ++ ++ ret = devm_request_irq(dev, platform_get_irq(pdev, 0), ++ vc4_dsi_irq_handler, 0, "vc4 dsi", dsi); ++ if (ret) { ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "Failed to get interrupt: %d\n", ret); ++ return ret; ++ } ++ ++ dsi->escape_clock = devm_clk_get(dev, "escape"); ++ if (IS_ERR(dsi->escape_clock)) { ++ ret = PTR_ERR(dsi->escape_clock); ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "Failed to get escape clock: %d\n", ret); ++ return ret; ++ } ++ ++ dsi->pll_phy_clock = devm_clk_get(dev, "phy"); ++ if (IS_ERR(dsi->pll_phy_clock)) { ++ ret = PTR_ERR(dsi->pll_phy_clock); ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "Failed to get phy clock: %d\n", ret); ++ return ret; ++ } ++ ++ dsi->pixel_clock = devm_clk_get(dev, "pixel"); ++ if (IS_ERR(dsi->pixel_clock)) { ++ ret = PTR_ERR(dsi->pixel_clock); ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "Failed to get pixel clock: %d\n", ret); ++ return ret; ++ } ++ ++ /* The esc clock rate is supposed to always be 100Mhz. */ ++ ret = clk_set_rate(dsi->escape_clock, 100 * 1000000); ++ if (ret) { ++ dev_err(dev, "Failed to set esc clock: %d\n", ret); ++ return ret; ++ } ++ ++ ret = vc4_dsi_init_phy_byte_clock(dsi); ++ if (ret) ++ return ret; ++ ++ if (dsi->port == 1) ++ vc4->dsi1 = dsi; ++ ++ drm_encoder_init(drm, dsi->encoder, &vc4_dsi_encoder_funcs, ++ DRM_MODE_ENCODER_DSI); ++ drm_encoder_helper_add(dsi->encoder, &vc4_dsi_encoder_helper_funcs); ++ ++ dsi->connector = vc4_dsi_connector_init(drm, dsi); ++ if (IS_ERR(dsi->connector)) { ++ ret = PTR_ERR(dsi->connector); ++ goto err_destroy_encoder; ++ } ++ ++ dsi->dsi_host.ops = &vc4_dsi_host_ops; ++ dsi->dsi_host.dev = dev; ++ ++ mipi_dsi_host_register(&dsi->dsi_host); ++ ++ dev_set_drvdata(dev, dsi); ++ ++ return 0; ++ ++err_destroy_encoder: ++ vc4_dsi_encoder_destroy(dsi->encoder); ++ ++ return ret; ++} ++ ++static void vc4_dsi_unbind(struct device *dev, struct device *master, ++ void *data) ++{ ++ struct drm_device *drm = dev_get_drvdata(master); ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_dsi *dsi = dev_get_drvdata(dev); ++ ++ vc4_dsi_connector_destroy(dsi->connector); ++ vc4_dsi_encoder_destroy(dsi->encoder); ++ ++ mipi_dsi_host_unregister(&dsi->dsi_host); ++ ++ if (!dsi->use_firmware_setup) { ++ clk_disable_unprepare(dsi->pll_phy_clock); ++ clk_disable_unprepare(dsi->escape_clock); ++ clk_disable_unprepare(dsi->pixel_clock); ++ } ++ ++ if (dsi->port == 1) ++ vc4->dsi1 = NULL; ++} ++ ++static const struct component_ops vc4_dsi_ops = { ++ .bind = vc4_dsi_bind, ++ .unbind = vc4_dsi_unbind, ++}; ++ ++static int vc4_dsi_dev_probe(struct platform_device *pdev) ++{ ++ return component_add(&pdev->dev, &vc4_dsi_ops); ++} ++ ++static int vc4_dsi_dev_remove(struct platform_device *pdev) ++{ ++ component_del(&pdev->dev, &vc4_dsi_ops); ++ return 0; ++} ++ ++struct platform_driver vc4_dsi_driver = { ++ .probe = vc4_dsi_dev_probe, ++ .remove = vc4_dsi_dev_remove, ++ .driver = { ++ .name = "vc4_dsi", ++ .of_match_table = vc4_dsi_dt_match, ++ }, ++}; diff --git a/target/linux/brcm2708/patches-4.4/0444-drm-panel-Add-support-for-the-Raspberry-Pi-7-Touchsc.patch b/target/linux/brcm2708/patches-4.4/0444-drm-panel-Add-support-for-the-Raspberry-Pi-7-Touchsc.patch new file mode 100644 index 0000000000..0291ce2243 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0444-drm-panel-Add-support-for-the-Raspberry-Pi-7-Touchsc.patch @@ -0,0 +1,390 @@ +From 4557de6d23737cf44fa5ddf1379be59d4bca2df7 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 26 Apr 2016 13:46:13 -0700 +Subject: [PATCH] drm/panel: Add support for the Raspberry Pi 7" Touchscreen. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/panel/Kconfig | 9 + + drivers/gpu/drm/panel/Makefile | 1 + + .../gpu/drm/panel/panel-raspberrypi-touchscreen.c | 347 +++++++++++++++++++++ + 3 files changed, 357 insertions(+) + create mode 100644 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c + +--- a/drivers/gpu/drm/panel/Kconfig ++++ b/drivers/gpu/drm/panel/Kconfig +@@ -31,6 +31,15 @@ config DRM_PANEL_LG_LG4573 + Say Y here if you want to enable support for LG4573 RGB panel. + To compile this driver as a module, choose M here. + ++config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN ++ tristate "Raspberry Pi 7-inch touchscreen panel" ++ depends on DRM_MIPI_DSI ++ depends on BACKLIGHT_CLASS_DEVICE ++ help ++ Say Y here if you want to enable support for the Raspberry ++ Pi 7" Touchscreen. To compile this driver as a module, ++ choose M here. ++ + config DRM_PANEL_SAMSUNG_S6E8AA0 + tristate "Samsung S6E8AA0 DSI video mode panel" + depends on OF +--- a/drivers/gpu/drm/panel/Makefile ++++ b/drivers/gpu/drm/panel/Makefile +@@ -1,5 +1,6 @@ + obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o + obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o ++obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o + obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o + obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o + obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o +--- /dev/null ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -0,0 +1,347 @@ ++/* ++ * Copyright © 2016 Broadcom Limited ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * Portions of this file (derived from panel-simple.c) are: ++ * ++ * Copyright (C) 2013, NVIDIA Corporation. All rights reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sub license, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the ++ * next paragraph) shall be included in all copies or substantial portions ++ * of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++/** ++ * DOC: Raspberry Pi 7" touchscreen panel driver. ++ * ++ * The 7" touchscreen consists of a DPI LCD panel, a Toshiba ++ * TC358762XBG DSI-DPI bridge, and an I2C-connected Atmel ATTINY88-MUR ++ * controlling power management, the LCD PWM, and the touchscreen. ++ * ++ * This driver presents this device as a MIPI DSI panel to the DRM ++ * driver, and should expose the touchscreen as a HID device. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++struct rpi_touchscreen { ++ struct drm_panel base; ++ struct mipi_dsi_device *dsi; ++ struct i2c_client *bridge_i2c; ++ struct backlight_device *backlight; ++ ++ bool prepared; ++ bool enabled; ++ ++ /* Version of the firmware on the bridge chip */ ++ int atmel_ver; ++}; ++ ++static const struct drm_display_mode rpi_touchscreen_modes[] = { ++ { ++ /* This is assuming that we'll be running the DSI PLL ++ * at 2Ghz / 3 (since we only get integer dividers), ++ * so a pixel clock of 2Ghz / 3 / 8. ++ */ ++ .clock = 83333, ++ .hdisplay = 800, ++ .hsync_start = 800 + 61, ++ .hsync_end = 800 + 61 + 2, ++ .htotal = 800 + 61 + 2 + 44, ++ .vdisplay = 480, ++ .vsync_start = 480 + 7, ++ .vsync_end = 480 + 7 + 2, ++ .vtotal = 480 + 7 + 2 + 21, ++ .vrefresh = 60, ++ }, ++}; ++ ++static struct rpi_touchscreen *panel_to_ts(struct drm_panel *panel) ++{ ++ return container_of(panel, struct rpi_touchscreen, base); ++} ++ ++struct regdump { ++ const char *reg; ++ u32 offset; ++}; ++ ++#define REGDUMP(reg) { #reg, reg } ++ ++static int rpi_touchscreen_disable(struct drm_panel *panel) ++{ ++ struct rpi_touchscreen *ts = panel_to_ts(panel); ++ pr_err("disable\n"); ++ ++ if (!ts->enabled) ++ return 0; ++ ++ if (ts->backlight) { ++ ts->backlight->props.power = FB_BLANK_POWERDOWN; ++ backlight_update_status(ts->backlight); ++ } ++ ++ ts->enabled = false; ++ ++ return 0; ++} ++ ++static int rpi_touchscreen_unprepare(struct drm_panel *panel) ++{ ++ struct rpi_touchscreen *ts = panel_to_ts(panel); ++ ++ if (!ts->prepared) ++ return 0; ++ ++ ts->prepared = false; ++ ++ return 0; ++} ++ ++static int rpi_touchscreen_prepare(struct drm_panel *panel) ++{ ++ struct rpi_touchscreen *ts = panel_to_ts(panel); ++ ++ if (ts->prepared) ++ return 0; ++ ++ ts->prepared = true; ++ ++ return 0; ++} ++ ++/* ++ * Powers on the panel once the DSI link is up. ++ * ++ * The TC358762 is run in PLLOFF mode, where it usees the MIPI DSI ++ * byte clock instead of an external reference clock. This means that ++ * we need the DSI host to be on and transmitting before we start ++ * talking to it. ++ */ ++static int rpi_touchscreen_enable(struct drm_panel *panel) ++{ ++ struct rpi_touchscreen *ts = panel_to_ts(panel); ++ ++ if (ts->enabled) ++ return 0; ++ ++ if (ts->backlight) { ++ ts->backlight->props.power = FB_BLANK_UNBLANK; ++ backlight_update_status(ts->backlight); ++ } ++ ++ ts->enabled = true; ++ ++ return 0; ++} ++ ++static int rpi_touchscreen_get_modes(struct drm_panel *panel) ++{ ++ struct drm_connector *connector = panel->connector; ++ struct drm_device *drm = panel->drm; ++ unsigned int i, num = 0; ++ ++ for (i = 0; i < ARRAY_SIZE(rpi_touchscreen_modes); i++) { ++ const struct drm_display_mode *m = &rpi_touchscreen_modes[i]; ++ struct drm_display_mode *mode; ++ ++ mode = drm_mode_duplicate(drm, m); ++ if (!mode) { ++ dev_err(drm->dev, "failed to add mode %ux%u@%u\n", ++ m->hdisplay, m->vdisplay, m->vrefresh); ++ continue; ++ } ++ ++ mode->type |= DRM_MODE_TYPE_DRIVER; ++ ++ if (i == 0) ++ mode->type |= DRM_MODE_TYPE_PREFERRED; ++ ++ drm_mode_set_name(mode); ++ ++ drm_mode_probed_add(connector, mode); ++ num++; ++ } ++ ++ connector->display_info.bpc = 8; ++ connector->display_info.width_mm = 217; /* XXX */ ++ connector->display_info.height_mm = 136; /* XXX */ ++ ++ return num; ++} ++ ++static int rpi_touchscreen_backlight_update(struct backlight_device *bl) ++{ ++ int brightness = bl->props.brightness; ++ ++ if (bl->props.power != FB_BLANK_UNBLANK || ++ bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) ++ brightness = 0; ++ ++ return 0; ++} ++ ++static const struct backlight_ops rpi_touchscreen_backlight_ops = { ++ .update_status = rpi_touchscreen_backlight_update, ++}; ++ ++static const struct drm_panel_funcs rpi_touchscreen_funcs = { ++ .disable = rpi_touchscreen_disable, ++ .unprepare = rpi_touchscreen_unprepare, ++ .prepare = rpi_touchscreen_prepare, ++ .enable = rpi_touchscreen_enable, ++ .get_modes = rpi_touchscreen_get_modes, ++}; ++ ++static struct i2c_client *rpi_touchscreen_get_i2c(struct device *dev, ++ const char *name) ++{ ++ struct device_node *node; ++ struct i2c_client *client; ++ ++ node = of_parse_phandle(dev->of_node, name, 0); ++ if (!node) ++ return ERR_PTR(-ENODEV); ++ ++ client = of_find_i2c_device_by_node(node); ++ ++ of_node_put(node); ++ ++ return client; ++} ++ ++static int rpi_touchscreen_dsi_probe(struct mipi_dsi_device *dsi) ++{ ++ struct device *dev = &dsi->dev; ++ struct rpi_touchscreen *ts; ++ int ret; ++ ++ ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); ++ if (!ts) ++ return -ENOMEM; ++ ++ dev_set_drvdata(dev, ts); ++ ++ ts->dsi = dsi; ++ dsi->mode_flags = (MIPI_DSI_MODE_VIDEO | ++ MIPI_DSI_MODE_VIDEO_SYNC_PULSE); ++ dsi->format = MIPI_DSI_FMT_RGB888; ++ dsi->lanes = 1; ++ ++ ts->bridge_i2c = ++ rpi_touchscreen_get_i2c(dev, "raspberrypi,touchscreen-bridge"); ++ if (!ts->bridge_i2c) { ++ ret = -EPROBE_DEFER; ++ return ret; ++ } ++ ++#if 0 ++ ts->backlight = ++ devm_backlight_device_register(dev, ++ "raspberrypi-touchscreen-backlight", ++ dev, ts, ++ &rpi_touchscreen_backlight_ops, ++ NULL); ++ if (IS_ERR(ts->backlight)) { ++ DRM_ERROR("failed to register backlight\n"); ++ return PTR_ERR(ts->backlight); ++ } ++ ts->backlight->props.max_brightness = RPI_TOUCHSCREEN_MAX_BRIGHTNESS; ++ ts->backlight->props.brightness = RPI_TOUCHSCREEN_MAX_BRIGHTNESS; ++#endif ++ ++ drm_panel_init(&ts->base); ++ ts->base.dev = dev; ++ ts->base.funcs = &rpi_touchscreen_funcs; ++ ++ ret = drm_panel_add(&ts->base); ++ if (ret < 0) ++ goto err_release_bridge; ++ ++ return mipi_dsi_attach(dsi); ++ ++err_release_bridge: ++ put_device(&ts->bridge_i2c->dev); ++ return ret; ++} ++ ++static int rpi_touchscreen_dsi_remove(struct mipi_dsi_device *dsi) ++{ ++ struct device *dev = &dsi->dev; ++ struct rpi_touchscreen *ts = dev_get_drvdata(dev); ++ int ret; ++ ++ ret = mipi_dsi_detach(dsi); ++ if (ret < 0) { ++ dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); ++ return ret; ++ } ++ ++ drm_panel_detach(&ts->base); ++ drm_panel_remove(&ts->base); ++ ++ put_device(&ts->bridge_i2c->dev); ++ ++ return 0; ++} ++ ++static void rpi_touchscreen_dsi_shutdown(struct mipi_dsi_device *dsi) ++{ ++ /* XXX: poweroff */ ++} ++ ++static const struct of_device_id rpi_touchscreen_of_match[] = { ++ { .compatible = "raspberrypi,touchscreen" }, ++ { } /* sentinel */ ++}; ++MODULE_DEVICE_TABLE(of, rpi_touchscreen_of_match); ++ ++static struct mipi_dsi_driver rpi_touchscreen_driver = { ++ .driver = { ++ .name = "raspberrypi-touchscreen", ++ .of_match_table = rpi_touchscreen_of_match, ++ }, ++ .probe = rpi_touchscreen_dsi_probe, ++ .remove = rpi_touchscreen_dsi_remove, ++ .shutdown = rpi_touchscreen_dsi_shutdown, ++}; ++module_mipi_dsi_driver(rpi_touchscreen_driver); ++ ++MODULE_AUTHOR("Eric Anholt "); ++MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/brcm2708/patches-4.4/0445-BCM270X-Add-the-DSI-panel-to-the-defconfig.patch b/target/linux/brcm2708/patches-4.4/0445-BCM270X-Add-the-DSI-panel-to-the-defconfig.patch new file mode 100644 index 0000000000..5e813f9f44 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0445-BCM270X-Add-the-DSI-panel-to-the-defconfig.patch @@ -0,0 +1,31 @@ +From 42c5b9d02e0076ce2b198a6364215ca46bec6e29 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 2 Jun 2016 12:29:45 -0700 +Subject: [PATCH] BCM270X: Add the DSI panel to the defconfig. + +Signed-off-by: Eric Anholt +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -822,6 +822,7 @@ CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_PANEL_SIMPLE=m ++CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_VC4=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -814,6 +814,7 @@ CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_PANEL_SIMPLE=m ++CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_VC4=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y diff --git a/target/linux/brcm2708/patches-4.4/0446-BCM270X-Add-the-DSI-and-DSI-panel-nodes-to-the-VC4-o.patch b/target/linux/brcm2708/patches-4.4/0446-BCM270X-Add-the-DSI-and-DSI-panel-nodes-to-the-VC4-o.patch new file mode 100644 index 0000000000..44f29ddea0 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0446-BCM270X-Add-the-DSI-and-DSI-panel-nodes-to-the-VC4-o.patch @@ -0,0 +1,84 @@ +From 64871d96e1d387437fa52d8398f2212722890bcd Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 2 Jun 2016 15:09:35 -0700 +Subject: [PATCH] BCM270X: Add the DSI and DSI panel nodes to the VC4 overlay. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 24 ++++++++++++++++++++-- + arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 16 +++++++++++++++ + 2 files changed, 38 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -2,6 +2,7 @@ + #include + #include "dt-bindings/power/raspberrypi-power.h" + #include "dt-bindings/gpio/gpio.h" ++#include "dt-bindings/pinctrl/bcm2835.h" + #include "skeleton.dtsi" + + / { +@@ -110,9 +111,10 @@ + reg = <0x7e101000 0x2000>; + + /* CPRMAN derives everything from the platform's +- * oscillator. ++ * oscillator except for a few clocks that may ++ * derive from something else derived from CPRMAN.. + */ +- clocks = <&clk_osc>; ++ clocks = <&clk_osc>, <&dsi1 0>, <&dsi1 1>, <&dsi1 2>; + status = "disabled"; + }; + +@@ -282,6 +284,24 @@ + status = "disabled"; + }; + ++ dsi1: dsi@7e700000 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ #clock-cells = <1>; ++ ++ compatible = "brcm,bcm2835-dsi1"; ++ reg = <0x7e700000 0x8c>; ++ interrupts = <2 12>; ++ ++ clocks = <&cprman BCM2835_PLLD_DSI1>, ++ <&cprman BCM2835_CLOCK_DSI1E>, ++ <&cprman BCM2835_CLOCK_DSI1P>; ++ clock-names = "phy", "escape", "pixel"; ++ clock-output-names = "dsi1_byte", "dsi1_ddr2", "dsi1_ddr"; ++ status = "disabled"; ++ power-domains = <&power RPI_POWER_DOMAIN_DSI1>; ++ }; ++ + i2c1: i2c@7e804000 { + compatible = "brcm,bcm2708-i2c"; + reg = <0x7e804000 0x1000>; +--- a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts ++++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts +@@ -126,6 +126,22 @@ + }; + }; + ++ fragment@16 { ++ target = <&dsi1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ brcm,panel = <&pitouchscreen>; ++ ++ pitouchscreen: panel { ++ compatible = "raspberrypi,touchscreen"; ++ reg = <0>; ++ }; ++ }; ++ }; ++ + __overrides__ { + cma-256 = <0>,"+0-1-2-3-4"; + cma-192 = <0>,"-0+1-2-3-4"; diff --git a/target/linux/brcm2708/patches-4.4/0447-of-Export-of_device_uevent_modalias-for-DRM_MIPI_DSI.patch b/target/linux/brcm2708/patches-4.4/0447-of-Export-of_device_uevent_modalias-for-DRM_MIPI_DSI.patch new file mode 100644 index 0000000000..a9ae593326 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0447-of-Export-of_device_uevent_modalias-for-DRM_MIPI_DSI.patch @@ -0,0 +1,21 @@ +From e294a4775d033ed4d0850f841786ec9358facf69 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 9 Aug 2016 15:12:06 -0700 +Subject: [PATCH] of: Export of_device_uevent_modalias for DRM_MIPI_DSI. + +In order to make DSI panel modules able to load automatically, we need +to emit the OF modalias uevent so that their MODULE_DEVICE_TABLE(of, +...) can match against it. + +Signed-off-by: Eric Anholt +--- + drivers/of/device.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/of/device.c ++++ b/drivers/of/device.c +@@ -287,3 +287,4 @@ int of_device_uevent_modalias(struct dev + + return 0; + } ++EXPORT_SYMBOL(of_device_uevent_modalias); diff --git a/target/linux/brcm2708/patches-4.4/0448-drm-Emit-modalias-uevents-for-the-DSI-devices-we-cre.patch b/target/linux/brcm2708/patches-4.4/0448-drm-Emit-modalias-uevents-for-the-DSI-devices-we-cre.patch new file mode 100644 index 0000000000..77b0eca35e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0448-drm-Emit-modalias-uevents-for-the-DSI-devices-we-cre.patch @@ -0,0 +1,48 @@ +From e46450e232a96665344b825557bacf1d37842174 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 9 Aug 2016 15:13:33 -0700 +Subject: [PATCH] drm: Emit modalias uevents for the DSI devices we create. + +This gets the Raspberry Pi panel module to automatically load at boot +time. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/drm_mipi_dsi.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +--- a/drivers/gpu/drm/drm_mipi_dsi.c ++++ b/drivers/gpu/drm/drm_mipi_dsi.c +@@ -50,6 +50,24 @@ static int mipi_dsi_device_match(struct + return of_driver_match_device(dev, drv); + } + ++/** ++ * Send modalias events when devices are created on the bus, so that ++ * modules can load automatically. ++ */ ++static int mipi_dsi_uevent(struct device *dev, struct kobj_uevent_env *env) ++{ ++ int rc; ++ ++ /* Just do the OF uevent, which emits the compatible string so ++ * that a MODULE_DEVICE_TABLE(of, ...) works. ++ */ ++ rc = of_device_uevent_modalias(dev, env); ++ if (rc != -ENODEV) ++ return rc; ++ ++ return 0; ++} ++ + static const struct dev_pm_ops mipi_dsi_device_pm_ops = { + .runtime_suspend = pm_generic_runtime_suspend, + .runtime_resume = pm_generic_runtime_resume, +@@ -65,6 +83,7 @@ static struct bus_type mipi_dsi_bus_type + .name = "mipi-dsi", + .match = mipi_dsi_device_match, + .pm = &mipi_dsi_device_pm_ops, ++ .uevent = mipi_dsi_uevent, + }; + + static int of_device_match(struct device *dev, void *data) diff --git a/target/linux/brcm2708/patches-4.4/0449-gpu-drm-vc4_hdmi-add-missing-of_node_put-after-calli.patch b/target/linux/brcm2708/patches-4.4/0449-gpu-drm-vc4_hdmi-add-missing-of_node_put-after-calli.patch new file mode 100644 index 0000000000..75bc32dc19 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0449-gpu-drm-vc4_hdmi-add-missing-of_node_put-after-calli.patch @@ -0,0 +1,46 @@ +From cededb2870ab15fcf79f063a83f5f37421e5bdfc Mon Sep 17 00:00:00 2001 +From: Peter Chen +Date: Tue, 5 Jul 2016 10:04:54 +0800 +Subject: [PATCH] gpu: drm: vc4_hdmi: add missing of_node_put after calling + of_parse_phandle + +of_node_put needs to be called when the device node which is got +from of_parse_phandle has finished using. + +Signed-off-by: Peter Chen +Reviewed-by: Eric Anholt +(cherry picked from commit 027a697677b0d5ff211773596d96f84078ceda80) +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -467,12 +467,6 @@ static int vc4_hdmi_bind(struct device * + if (IS_ERR(hdmi->hd_regs)) + return PTR_ERR(hdmi->hd_regs); + +- ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); +- if (!ddc_node) { +- DRM_ERROR("Failed to find ddc node in device tree\n"); +- return -ENODEV; +- } +- + hdmi->pixel_clock = devm_clk_get(dev, "pixel"); + if (IS_ERR(hdmi->pixel_clock)) { + DRM_ERROR("Failed to get pixel clock\n"); +@@ -484,7 +478,14 @@ static int vc4_hdmi_bind(struct device * + return PTR_ERR(hdmi->hsm_clock); + } + ++ ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); ++ if (!ddc_node) { ++ DRM_ERROR("Failed to find ddc node in device tree\n"); ++ return -ENODEV; ++ } ++ + hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); ++ of_node_put(ddc_node); + if (!hdmi->ddc) { + DRM_DEBUG("Failed to get ddc i2c adapter by node\n"); + return -EPROBE_DEFER; diff --git a/target/linux/brcm2708/patches-4.4/0450-drm-vc4-Use-for_each_plane_in_state.patch b/target/linux/brcm2708/patches-4.4/0450-drm-vc4-Use-for_each_plane_in_state.patch new file mode 100644 index 0000000000..8b0d0b6a9c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0450-drm-vc4-Use-for_each_plane_in_state.patch @@ -0,0 +1,42 @@ +From fa8b827fb90719d981a8fa292064958219c8ed10 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Thu, 2 Jun 2016 00:06:28 +0200 +Subject: [PATCH] drm/vc4: Use for_each_plane_in_state + +We want to hide drm_atomic_stat internals a bit better. + +Cc: Eric Anholt +Reviewed-by: Maarten Lankhorst +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-6-git-send-email-daniel.vetter@ffwll.ch +(cherry picked from commit 833cd78adbc236db684f19e93121d4bf6659a8af) +--- + drivers/gpu/drm/vc4/vc4_kms.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -111,6 +111,8 @@ static int vc4_atomic_commit(struct drm_ + int i; + uint64_t wait_seqno = 0; + struct vc4_commit *c; ++ struct drm_plane *plane; ++ struct drm_plane_state *new_state; + + c = commit_init(state); + if (!c) +@@ -130,13 +132,7 @@ static int vc4_atomic_commit(struct drm_ + return ret; + } + +- for (i = 0; i < dev->mode_config.num_total_plane; i++) { +- struct drm_plane *plane = state->planes[i]; +- struct drm_plane_state *new_state = state->plane_states[i]; +- +- if (!plane) +- continue; +- ++ for_each_plane_in_state(state, plane, new_state, i) { + if ((plane->state->fb != new_state->fb) && new_state->fb) { + struct drm_gem_cma_object *cma_bo = + drm_fb_cma_get_gem_obj(new_state->fb, 0); diff --git a/target/linux/brcm2708/patches-4.4/0451-drm-vc4-Fix-ioctl-permissions-for-render-nodes.patch b/target/linux/brcm2708/patches-4.4/0451-drm-vc4-Fix-ioctl-permissions-for-render-nodes.patch new file mode 100644 index 0000000000..40afd95058 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0451-drm-vc4-Fix-ioctl-permissions-for-render-nodes.patch @@ -0,0 +1,39 @@ +From cd24c4594b21f3a9dec5780d06dacbaf59415225 Mon Sep 17 00:00:00 2001 +From: Herve Jourdain +Date: Wed, 1 Jun 2016 02:24:46 +0800 +Subject: [PATCH] drm/vc4: Fix ioctl permissions for render nodes. + +Contrary to other flags to DRM_IOCTL_DEF_DRV(), which restrict usage, +the flag for render node is an enabler (the IOCTL can't be used from +render node if it's not present). So DRM_RENDER_ALLOW needs to be +added to all the flags that were previously 0. + +Signed-off-by: Herve Jourdain +Reviewed-by: Eric Anholt +Fixes: 0cd3e2747662 ("drm/vc4: Add missing render node support") +(cherry picked from commit b10c22e5f9902a329450c2027e9291b71e9f1602) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -88,12 +88,12 @@ static const struct file_operations vc4_ + }; + + static const struct drm_ioctl_desc vc4_drm_ioctls[] = { +- DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, 0), +- DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, 0), +- DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, 0), +- DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, 0), +- DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, 0), +- DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, 0), ++ DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_WAIT_SEQNO, vc4_wait_seqno_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_WAIT_BO, vc4_wait_bo_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_CREATE_BO, vc4_create_bo_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_MMAP_BO, vc4_mmap_bo_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, DRM_RENDER_ALLOW), + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), + }; diff --git a/target/linux/brcm2708/patches-4.4/0452-drm-vc4-Make-pageflip-completion-handling-more-robus.patch b/target/linux/brcm2708/patches-4.4/0452-drm-vc4-Make-pageflip-completion-handling-more-robus.patch new file mode 100644 index 0000000000..00701f8334 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0452-drm-vc4-Make-pageflip-completion-handling-more-robus.patch @@ -0,0 +1,126 @@ +From cb182bb6180c57b28636669a613861023fd8f03d Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Wed, 18 May 2016 14:02:46 +0200 +Subject: [PATCH] drm/vc4: Make pageflip completion handling more robust. + +Protect both the setup of the pageflip event and the +latching of the new requested displaylist head pointer +by the event lock, so we can't get into a situation +where vc4_atomic_flush latches the new display list via +HVS_WRITE, then immediately gets preempted before queueing +the pageflip event, then the page-flip completes in hw and +the vc4_crtc_handle_page_flip() runs and no-ops due to +lack of a pending pageflip event, then vc4_atomic_flush +continues and only then queues the pageflip event - after +the page flip handling already no-oped. This would cause +flip completion handling only at the next vblank - one +frame too late. + +In vc4_crtc_handle_page_flip() check the actual DL head +pointer in SCALER_DISPLACTX against the requested pointer +for page flip to make sure that the flip actually really +completed in the current vblank and doesn't get deferred +to the next one because the DL head pointer was written +a bit too late into SCALER_DISPLISTX, after start of +vblank, and missed the boat. This avoids handling a +pageflip completion too early - one frame too early. + +According to Eric, DL head pointer updates which were +written into the HVS DISPLISTX reg get committed to hardware +at the last pixel of active scanout. Our vblank interrupt +handler, as triggered by PV_INT_VFP_START irq, gets to run +earliest at the first pixel of HBLANK at the end of the +last scanline of active scanout, ie. vblank irq handling +runs at least 1 pixel duration after a potential pageflip +completion happened in hardware. + +This ordering of events in the hardware, together with the +lock protection and SCALER_DISPLACTX sampling of this patch, +guarantees that pageflip completion handling only runs at +exactly the vblank irq of actual pageflip completion in all +cases. + +Background info from Eric about the relative timing of +HVS, PV's and trigger points for interrupts, DL updates: + +https://lists.freedesktop.org/archives/dri-devel/2016-May/107510.html + +Tested on RPi 2B with hardware timing measurement equipment +and shown to no longer complete flips too early or too late. + +Signed-off-by: Mario Kleiner +Reviewed-by: Eric Anholt +(cherry picked from commit 56d1fe0979dc9b73c1c12ee07722ac380d42a0c4) +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 28 ++++++++++++++++++---------- + drivers/gpu/drm/vc4/vc4_regs.h | 4 ++++ + 2 files changed, 22 insertions(+), 10 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -465,14 +465,6 @@ static void vc4_crtc_atomic_flush(struct + + WARN_ON_ONCE(dlist_next - dlist_start != vc4_state->mm.size); + +- HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel), +- vc4_state->mm.start); +- +- if (debug_dump_regs) { +- DRM_INFO("CRTC %d HVS after:\n", drm_crtc_index(crtc)); +- vc4_hvs_dump_state(dev); +- } +- + if (crtc->state->event) { + unsigned long flags; + +@@ -482,8 +474,20 @@ static void vc4_crtc_atomic_flush(struct + + spin_lock_irqsave(&dev->event_lock, flags); + vc4_crtc->event = crtc->state->event; +- spin_unlock_irqrestore(&dev->event_lock, flags); + crtc->state->event = NULL; ++ ++ HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel), ++ vc4_state->mm.start); ++ ++ spin_unlock_irqrestore(&dev->event_lock, flags); ++ } else { ++ HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel), ++ vc4_state->mm.start); ++ } ++ ++ if (debug_dump_regs) { ++ DRM_INFO("CRTC %d HVS after:\n", drm_crtc_index(crtc)); ++ vc4_hvs_dump_state(dev); + } + } + +@@ -509,10 +513,14 @@ static void vc4_crtc_handle_page_flip(st + { + struct drm_crtc *crtc = &vc4_crtc->base; + struct drm_device *dev = crtc->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state); ++ u32 chan = vc4_crtc->channel; + unsigned long flags; + + spin_lock_irqsave(&dev->event_lock, flags); +- if (vc4_crtc->event) { ++ if (vc4_crtc->event && ++ (vc4_state->mm.start == HVS_READ(SCALER_DISPLACTX(chan)))) { + drm_crtc_send_vblank_event(crtc, vc4_crtc->event); + vc4_crtc->event = NULL; + drm_crtc_vblank_put(crtc); +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -343,6 +343,10 @@ + #define SCALER_DISPLACT0 0x00000030 + #define SCALER_DISPLACT1 0x00000034 + #define SCALER_DISPLACT2 0x00000038 ++#define SCALER_DISPLACTX(x) (SCALER_DISPLACT0 + \ ++ (x) * (SCALER_DISPLACT1 - \ ++ SCALER_DISPLACT0)) ++ + #define SCALER_DISPCTRL0 0x00000040 + # define SCALER_DISPCTRLX_ENABLE BIT(31) + # define SCALER_DISPCTRLX_RESET BIT(30) diff --git a/target/linux/brcm2708/patches-4.4/0453-drm-vc4-clean-up-error-exit-path-on-failed-dpi_conne.patch b/target/linux/brcm2708/patches-4.4/0453-drm-vc4-clean-up-error-exit-path-on-failed-dpi_conne.patch new file mode 100644 index 0000000000..4407c4afc1 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0453-drm-vc4-clean-up-error-exit-path-on-failed-dpi_conne.patch @@ -0,0 +1,53 @@ +From 2092b669dd8d4c87cbbf107fd63fe2050ec5b4aa Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Thu, 2 Jun 2016 10:38:29 +0100 +Subject: [PATCH] drm/vc4: clean up error exit path on failed dpi_connector + allocation + +There is redundant code in the clean up exit path when dpi_connector +fails to be allocated. The current code checks if connector is NULL +before destroying it, in fact, connector is NULL at this point so +the check is redundant and can be removed. The final clean up is +that we can remove the goto fail with a simple return and the unused +variable ret. + +Signed-off-by: Colin Ian King +Reviewed-by: Eric Anholt +(cherry picked from commit a9402dfe17bddeee5c72943385eaa13c39f106f7) +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -236,14 +236,12 @@ static struct drm_connector *vc4_dpi_con + { + struct drm_connector *connector = NULL; + struct vc4_dpi_connector *dpi_connector; +- int ret = 0; + + dpi_connector = devm_kzalloc(dev->dev, sizeof(*dpi_connector), + GFP_KERNEL); +- if (!dpi_connector) { +- ret = -ENOMEM; +- goto fail; +- } ++ if (!dpi_connector) ++ return ERR_PTR(-ENOMEM); ++ + connector = &dpi_connector->base; + + dpi_connector->encoder = dpi->encoder; +@@ -260,12 +258,6 @@ static struct drm_connector *vc4_dpi_con + drm_mode_connector_attach_encoder(connector, dpi->encoder); + + return connector; +- +- fail: +- if (connector) +- vc4_dpi_connector_destroy(connector); +- +- return ERR_PTR(ret); + } + + static const struct drm_encoder_funcs vc4_dpi_encoder_funcs = { diff --git a/target/linux/brcm2708/patches-4.4/0454-drm-vc4-enable-XBGR8888-and-ABGR8888-pixel-formats.patch b/target/linux/brcm2708/patches-4.4/0454-drm-vc4-enable-XBGR8888-and-ABGR8888-pixel-formats.patch new file mode 100644 index 0000000000..f68531ecf8 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0454-drm-vc4-enable-XBGR8888-and-ABGR8888-pixel-formats.patch @@ -0,0 +1,34 @@ +From 1a5b389a95cc5e468477b183d3e7312caf2ea2f4 Mon Sep 17 00:00:00 2001 +From: Rob Herring +Date: Thu, 9 Jun 2016 16:19:25 -0500 +Subject: [PATCH] drm: vc4: enable XBGR8888 and ABGR8888 pixel formats + +DRM_FORMAT_XBGR8888 and DRM_FORMAT_ABGR8888 are 2 of the native formats +used in Android, so enable them for VC4. There seems to be no logic behind +HVS_PIXEL_ORDER_xxxx naming, but HVS_PIXEL_ORDER_ARGB seems to work +correctly. + +Signed-off-by: Rob Herring +Reviewed-by: Eric Anholt +(cherry picked from commit 93977767f092fbf0787e5d2a0bf2e0a3fc6f6ced) +--- + drivers/gpu/drm/vc4/vc4_plane.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -94,6 +94,14 @@ static const struct hvs_format { + .pixel_order = HVS_PIXEL_ORDER_ABGR, .has_alpha = true, + }, + { ++ .drm = DRM_FORMAT_ABGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888, ++ .pixel_order = HVS_PIXEL_ORDER_ARGB, .has_alpha = true, ++ }, ++ { ++ .drm = DRM_FORMAT_XBGR8888, .hvs = HVS_PIXEL_FORMAT_RGBA8888, ++ .pixel_order = HVS_PIXEL_ORDER_ARGB, .has_alpha = false, ++ }, ++ { + .drm = DRM_FORMAT_RGB565, .hvs = HVS_PIXEL_FORMAT_RGB565, + .pixel_order = HVS_PIXEL_ORDER_XRGB, .has_alpha = false, + }, diff --git a/target/linux/brcm2708/patches-4.4/0455-drm-vc4-Bind-the-HVS-before-we-bind-the-individual-C.patch b/target/linux/brcm2708/patches-4.4/0455-drm-vc4-Bind-the-HVS-before-we-bind-the-individual-C.patch new file mode 100644 index 0000000000..351220b0d3 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0455-drm-vc4-Bind-the-HVS-before-we-bind-the-individual-C.patch @@ -0,0 +1,28 @@ +From 4bdd6172dbf4ea9d9ae85b6a3214bdb787f16778 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 8 Jul 2016 11:25:09 -0700 +Subject: [PATCH] drm/vc4: Bind the HVS before we bind the individual CRTCs. + +We need to be able to look at the CRTC's registers in the HVS as part +of initialization, while the HVS doesn't need to look at the PV +registers. + +Signed-off-by: Eric Anholt +Reviewed-and-tested-by: Mario Kleiner +(cherry picked from commit 7a100969f30b77761901c05a5c810bcaea65df44) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -295,8 +295,8 @@ static struct platform_driver *const com + &vc4_hdmi_driver, + &vc4_dpi_driver, + &vc4_dsi_driver, +- &vc4_crtc_driver, + &vc4_hvs_driver, ++ &vc4_crtc_driver, + &vc4_v3d_driver, + }; + diff --git a/target/linux/brcm2708/patches-4.4/0456-drm-vc4-Implement-precise-vblank-timestamping.patch b/target/linux/brcm2708/patches-4.4/0456-drm-vc4-Implement-precise-vblank-timestamping.patch new file mode 100644 index 0000000000..8ae2819502 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0456-drm-vc4-Implement-precise-vblank-timestamping.patch @@ -0,0 +1,358 @@ +From d1a9a03cbe1110756a63d4a3747e22eb8417f75e Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Thu, 23 Jun 2016 08:17:50 +0200 +Subject: [PATCH] drm/vc4: Implement precise vblank timestamping. + +Precise vblank timestamping is implemented via the +usual scanout position based method. On VC4 the +pixelvalves PV do not have a scanout position +register. Only the hardware video scaler HVS has a +similar register which describes which scanline for +the output is currently composited and stored in the +HVS fifo for later consumption by the PV. + +This causes a problem in that the HVS runs at a much +faster clock (system clock / audio gate) than the PV +which runs at video mode dot clock, so the unless the +fifo between HVS and PV is full, the HVS will progress +faster in its observable read line position than video +scan rate, so the HVS position reading can't be directly +translated into a scanout position for timestamp correction. + +Additionally when the PV is in vblank, it doesn't consume +from the fifo, so the fifo gets full very quickly and then +the HVS stops compositing until the PV enters active scanout +and starts consuming scanlines from the fifo again, making +new space for the HVS to composite. + +Therefore a simple translation of HVS read position into +elapsed time since (or to) start of active scanout does +not work, but for the most interesting cases we can still +get useful and sufficiently accurate results: + +1. The PV enters active scanout of a new frame with the + fifo of the HVS completely full, and the HVS can refill + any fifo line which gets consumed and thereby freed up by + the PV during active scanout very quickly. Therefore the + PV and HVS work effectively in lock-step during active + scanout with the fifo never having more than 1 scanline + freed up by the PV before it gets refilled. The PV's + real scanout position is therefore trailing the HVS + compositing position as scanoutpos = hvspos - fifosize + and we can get the true scanoutpos as HVS readpos minus + fifo size, so precise timestamping works while in active + scanout, except for the last few scanlines of the frame, + when the HVS reaches end of frame, stops compositing and + the PV catches up and drains the fifo. This special case + would only introduce minor errors though. + +2. If we are in vblank, then we can only guess something + reasonable. If called from vblank irq, we assume the irq is + usually dispatched with minimum delay, so we can take a + timestamp taken at entry into the vblank irq handler as a + baseline and then add a full vblank duration until the + guessed start of active scanout. As irq dispatch is usually + pretty low latency this works with relatively low jitter and + good results. + + If we aren't called from vblank then we could be anywhere + within the vblank interval, so we return a neutral result, + simply the current system timestamp, and hope for the best. + +Measurement shows the generated timestamps to be rather precise, +and at least never off more than 1 vblank duration worst-case. + +Limitations: Doesn't work well yet for interlaced video modes, + therefore disabled in interlaced mode for now. + +v2: Use the DISPBASE registers to determine the FIFO size (changes + by anholt) + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +Reviewed-and-tested-by: Mario Kleiner (v2) +(cherry picked from commit 1bf59f1dcbe25272f6b5d870054647e58a8a9c55) +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 162 +++++++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_drv.c | 2 + + drivers/gpu/drm/vc4/vc4_drv.h | 7 ++ + drivers/gpu/drm/vc4/vc4_regs.h | 22 +++++- + 4 files changed, 192 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -47,12 +47,17 @@ struct vc4_crtc { + const struct vc4_crtc_data *data; + void __iomem *regs; + ++ /* Timestamp at start of vblank irq - unaffected by lock delays. */ ++ ktime_t t_vblank; ++ + /* Which HVS channel we're using for our CRTC. */ + int channel; + + u8 lut_r[256]; + u8 lut_g[256]; + u8 lut_b[256]; ++ /* Size in pixels of the COB memory allocated to this CRTC. */ ++ u32 cob_size; + + struct drm_pending_vblank_event *event; + }; +@@ -134,6 +139,144 @@ int vc4_crtc_debugfs_regs(struct seq_fil + } + #endif + ++int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, ++ unsigned int flags, int *vpos, int *hpos, ++ ktime_t *stime, ktime_t *etime, ++ const struct drm_display_mode *mode) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; ++ u32 val; ++ int fifo_lines; ++ int vblank_lines; ++ int ret = 0; ++ ++ /* ++ * XXX Doesn't work well in interlaced mode yet, partially due ++ * to problems in vc4 kms or drm core interlaced mode handling, ++ * so disable for now in interlaced mode. ++ */ ++ if (mode->flags & DRM_MODE_FLAG_INTERLACE) ++ return ret; ++ ++ /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ ++ ++ /* Get optional system timestamp before query. */ ++ if (stime) ++ *stime = ktime_get(); ++ ++ /* ++ * Read vertical scanline which is currently composed for our ++ * pixelvalve by the HVS, and also the scaler status. ++ */ ++ val = HVS_READ(SCALER_DISPSTATX(vc4_crtc->channel)); ++ ++ /* Get optional system timestamp after query. */ ++ if (etime) ++ *etime = ktime_get(); ++ ++ /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ ++ ++ /* Vertical position of hvs composed scanline. */ ++ *vpos = VC4_GET_FIELD(val, SCALER_DISPSTATX_LINE); ++ ++ /* No hpos info available. */ ++ if (hpos) ++ *hpos = 0; ++ ++ /* This is the offset we need for translating hvs -> pv scanout pos. */ ++ fifo_lines = vc4_crtc->cob_size / mode->crtc_hdisplay; ++ ++ if (fifo_lines > 0) ++ ret |= DRM_SCANOUTPOS_VALID; ++ ++ /* HVS more than fifo_lines into frame for compositing? */ ++ if (*vpos > fifo_lines) { ++ /* ++ * We are in active scanout and can get some meaningful results ++ * from HVS. The actual PV scanout can not trail behind more ++ * than fifo_lines as that is the fifo's capacity. Assume that ++ * in active scanout the HVS and PV work in lockstep wrt. HVS ++ * refilling the fifo and PV consuming from the fifo, ie. ++ * whenever the PV consumes and frees up a scanline in the ++ * fifo, the HVS will immediately refill it, therefore ++ * incrementing vpos. Therefore we choose HVS read position - ++ * fifo size in scanlines as a estimate of the real scanout ++ * position of the PV. ++ */ ++ *vpos -= fifo_lines + 1; ++ if (mode->flags & DRM_MODE_FLAG_INTERLACE) ++ *vpos /= 2; ++ ++ ret |= DRM_SCANOUTPOS_ACCURATE; ++ return ret; ++ } ++ ++ /* ++ * Less: This happens when we are in vblank and the HVS, after getting ++ * the VSTART restart signal from the PV, just started refilling its ++ * fifo with new lines from the top-most lines of the new framebuffers. ++ * The PV does not scan out in vblank, so does not remove lines from ++ * the fifo, so the fifo will be full quickly and the HVS has to pause. ++ * We can't get meaningful readings wrt. scanline position of the PV ++ * and need to make things up in a approximative but consistent way. ++ */ ++ ret |= DRM_SCANOUTPOS_IN_VBLANK; ++ vblank_lines = mode->crtc_vtotal - mode->crtc_vdisplay; ++ ++ if (flags & DRM_CALLED_FROM_VBLIRQ) { ++ /* ++ * Assume the irq handler got called close to first ++ * line of vblank, so PV has about a full vblank ++ * scanlines to go, and as a base timestamp use the ++ * one taken at entry into vblank irq handler, so it ++ * is not affected by random delays due to lock ++ * contention on event_lock or vblank_time lock in ++ * the core. ++ */ ++ *vpos = -vblank_lines; ++ ++ if (stime) ++ *stime = vc4_crtc->t_vblank; ++ if (etime) ++ *etime = vc4_crtc->t_vblank; ++ ++ /* ++ * If the HVS fifo is not yet full then we know for certain ++ * we are at the very beginning of vblank, as the hvs just ++ * started refilling, and the stime and etime timestamps ++ * truly correspond to start of vblank. ++ */ ++ if ((val & SCALER_DISPSTATX_FULL) != SCALER_DISPSTATX_FULL) ++ ret |= DRM_SCANOUTPOS_ACCURATE; ++ } else { ++ /* ++ * No clue where we are inside vblank. Return a vpos of zero, ++ * which will cause calling code to just return the etime ++ * timestamp uncorrected. At least this is no worse than the ++ * standard fallback. ++ */ ++ *vpos = 0; ++ } ++ ++ return ret; ++} ++ ++int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, ++ int *max_error, struct timeval *vblank_time, ++ unsigned flags) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; ++ struct drm_crtc *crtc = &vc4_crtc->base; ++ struct drm_crtc_state *state = crtc->state; ++ ++ /* Helper routine in DRM core does all the work: */ ++ return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc_id, max_error, ++ vblank_time, flags, ++ &state->adjusted_mode); ++} ++ + static void vc4_crtc_destroy(struct drm_crtc *crtc) + { + drm_crtc_cleanup(crtc); +@@ -535,6 +678,7 @@ static irqreturn_t vc4_crtc_irq_handler( + irqreturn_t ret = IRQ_NONE; + + if (stat & PV_INT_VFP_START) { ++ vc4_crtc->t_vblank = ktime_get(); + CRTC_WRITE(PV_INTSTAT, PV_INT_VFP_START); + drm_crtc_handle_vblank(&vc4_crtc->base); + vc4_crtc_handle_page_flip(vc4_crtc); +@@ -759,6 +903,22 @@ static void vc4_set_crtc_possible_masks( + } + } + ++static void ++vc4_crtc_get_cob_allocation(struct vc4_crtc *vc4_crtc) ++{ ++ struct drm_device *drm = vc4_crtc->base.dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ u32 dispbase = HVS_READ(SCALER_DISPBASEX(vc4_crtc->channel)); ++ /* Top/base are supposed to be 4-pixel aligned, but the ++ * Raspberry Pi firmware fills the low bits (which are ++ * presumably ignored). ++ */ ++ u32 top = VC4_GET_FIELD(dispbase, SCALER_DISPBASEX_TOP) & ~3; ++ u32 base = VC4_GET_FIELD(dispbase, SCALER_DISPBASEX_BASE) & ~3; ++ ++ vc4_crtc->cob_size = top - base + 4; ++} ++ + static int vc4_crtc_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -835,6 +995,8 @@ static int vc4_crtc_bind(struct device * + crtc->cursor = cursor_plane; + } + ++ vc4_crtc_get_cob_allocation(vc4_crtc); ++ + CRTC_WRITE(PV_INTEN, 0); + CRTC_WRITE(PV_INTSTAT, PV_INT_VFP_START); + ret = devm_request_irq(dev, platform_get_irq(pdev, 0), +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -116,6 +116,8 @@ static struct drm_driver vc4_drm_driver + .enable_vblank = vc4_enable_vblank, + .disable_vblank = vc4_disable_vblank, + .get_vblank_counter = drm_vblank_no_hw_counter, ++ .get_scanout_position = vc4_crtc_get_scanoutpos, ++ .get_vblank_timestamp = vc4_crtc_get_vblank_timestamp, + + #if defined(CONFIG_DEBUG_FS) + .debugfs_init = vc4_debugfs_init, +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -419,6 +419,13 @@ int vc4_enable_vblank(struct drm_device + void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id); + void vc4_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file); + int vc4_crtc_debugfs_regs(struct seq_file *m, void *arg); ++int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, ++ unsigned int flags, int *vpos, int *hpos, ++ ktime_t *stime, ktime_t *etime, ++ const struct drm_display_mode *mode); ++int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, ++ int *max_error, struct timeval *vblank_time, ++ unsigned flags); + + /* vc4_debugfs.c */ + int vc4_debugfs_init(struct drm_minor *minor); +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -368,7 +368,6 @@ + # define SCALER_DISPBKGND_FILL BIT(24) + + #define SCALER_DISPSTAT0 0x00000048 +-#define SCALER_DISPBASE0 0x0000004c + # define SCALER_DISPSTATX_MODE_MASK VC4_MASK(31, 30) + # define SCALER_DISPSTATX_MODE_SHIFT 30 + # define SCALER_DISPSTATX_MODE_DISABLED 0 +@@ -377,6 +376,24 @@ + # define SCALER_DISPSTATX_MODE_EOF 3 + # define SCALER_DISPSTATX_FULL BIT(29) + # define SCALER_DISPSTATX_EMPTY BIT(28) ++# define SCALER_DISPSTATX_FRAME_COUNT_MASK VC4_MASK(17, 12) ++# define SCALER_DISPSTATX_FRAME_COUNT_SHIFT 12 ++# define SCALER_DISPSTATX_LINE_MASK VC4_MASK(11, 0) ++# define SCALER_DISPSTATX_LINE_SHIFT 0 ++ ++#define SCALER_DISPBASE0 0x0000004c ++/* Last pixel in the COB (display FIFO memory) allocated to this HVS ++ * channel. Must be 4-pixel aligned (and thus 4 pixels less than the ++ * next COB base). ++ */ ++# define SCALER_DISPBASEX_TOP_MASK VC4_MASK(31, 16) ++# define SCALER_DISPBASEX_TOP_SHIFT 16 ++/* First pixel in the COB (display FIFO memory) allocated to this HVS ++ * channel. Must be 4-pixel aligned. ++ */ ++# define SCALER_DISPBASEX_BASE_MASK VC4_MASK(15, 0) ++# define SCALER_DISPBASEX_BASE_SHIFT 0 ++ + #define SCALER_DISPCTRL1 0x00000050 + #define SCALER_DISPBKGND1 0x00000054 + #define SCALER_DISPBKGNDX(x) (SCALER_DISPBKGND0 + \ +@@ -387,6 +404,9 @@ + (x) * (SCALER_DISPSTAT1 - \ + SCALER_DISPSTAT0)) + #define SCALER_DISPBASE1 0x0000005c ++#define SCALER_DISPBASEX(x) (SCALER_DISPBASE0 + \ ++ (x) * (SCALER_DISPBASE1 - \ ++ SCALER_DISPBASE0)) + #define SCALER_DISPCTRL2 0x00000060 + #define SCALER_DISPCTRLX(x) (SCALER_DISPCTRL0 + \ + (x) * (SCALER_DISPCTRL1 - \ diff --git a/target/linux/brcm2708/patches-4.4/0457-drm-vc4-remove-redundant-ret-status-check.patch b/target/linux/brcm2708/patches-4.4/0457-drm-vc4-remove-redundant-ret-status-check.patch new file mode 100644 index 0000000000..7887f60d04 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0457-drm-vc4-remove-redundant-ret-status-check.patch @@ -0,0 +1,35 @@ +From 2b643111b81df8724f317507471499660f4fc6f6 Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Sat, 9 Jul 2016 23:26:03 +0100 +Subject: [PATCH] drm/vc4: remove redundant ret status check + +At the current point where ret is being checked for non-zero it has +not changed since it was initialized to zero, hence the check and the +label unref are redundant and can be removed. + +Signed-off-by: Colin Ian King +Reviewed-by: Eric Anholt +(cherry picked from commit deb4765db386db67626ffd075d8b5eb5fdf9c4f6) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -233,8 +233,6 @@ static int vc4_drm_bind(struct device *d + vc4_bo_cache_init(drm); + + drm_mode_config_init(drm); +- if (ret) +- goto unref; + + vc4_gem_init(drm); + +@@ -268,7 +266,6 @@ unbind_all: + component_unbind_all(dev, drm); + gem_destroy: + vc4_gem_destroy(drm); +-unref: + drm_dev_unref(drm); + vc4_bo_cache_destroy(drm); + return ret; diff --git a/target/linux/brcm2708/patches-4.4/0458-drm-vc4-add-extern-C-guard-for-the-UAPI-header.patch b/target/linux/brcm2708/patches-4.4/0458-drm-vc4-add-extern-C-guard-for-the-UAPI-header.patch new file mode 100644 index 0000000000..3b32bf867e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0458-drm-vc4-add-extern-C-guard-for-the-UAPI-header.patch @@ -0,0 +1,34 @@ +From 2f037770b9fedc29f75847a8323ffca49244e140 Mon Sep 17 00:00:00 2001 +From: Emil Velikov +Date: Thu, 7 Apr 2016 19:36:57 +0100 +Subject: [PATCH] drm/vc4: add extern C guard for the UAPI header + +Cc: Eric Anholt +Signed-off-by: Emil Velikov +(cherry picked from commit 6a982350f892c286c645a6fe0e1da1f869a0c43f) +--- + include/uapi/drm/vc4_drm.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -26,6 +26,10 @@ + + #include "drm.h" + ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ + #define DRM_VC4_SUBMIT_CL 0x00 + #define DRM_VC4_WAIT_SEQNO 0x01 + #define DRM_VC4_WAIT_BO 0x02 +@@ -276,4 +280,8 @@ struct drm_vc4_get_hang_state { + __u32 pad[16]; + }; + ++#if defined(__cplusplus) ++} ++#endif ++ + #endif /* _UAPI_VC4_DRM_H_ */ diff --git a/target/linux/brcm2708/patches-4.4/0459-drm-vc4-Fix-definition-of-QPU_R_MS_REV_FLAGS.patch b/target/linux/brcm2708/patches-4.4/0459-drm-vc4-Fix-definition-of-QPU_R_MS_REV_FLAGS.patch new file mode 100644 index 0000000000..15dfd76286 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0459-drm-vc4-Fix-definition-of-QPU_R_MS_REV_FLAGS.patch @@ -0,0 +1,25 @@ +From ad6f4991e27d60b8939b8a1421166342355db503 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 4 Jul 2016 12:59:18 -0700 +Subject: [PATCH] drm/vc4: Fix definition of QPU_R_MS_REV_FLAGS + +We don't use it in shader validation currently, so it had no effect, +but best to fix it anyway in case we do some day. + +Signed-off-by: Eric Anholt +(cherry picked from commit 20e48fd6a9252e21528c7e39b874c8fdca97f25a) +--- + drivers/gpu/drm/vc4/vc4_qpu_defines.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_qpu_defines.h ++++ b/drivers/gpu/drm/vc4/vc4_qpu_defines.h +@@ -70,7 +70,7 @@ enum qpu_raddr { + QPU_R_ELEM_QPU = 38, + QPU_R_NOP, + QPU_R_XY_PIXEL_COORD = 41, +- QPU_R_MS_REV_FLAGS = 41, ++ QPU_R_MS_REV_FLAGS = 42, + QPU_R_VPM = 48, + QPU_R_VPM_LD_BUSY, + QPU_R_VPM_LD_WAIT, diff --git a/target/linux/brcm2708/patches-4.4/0460-drm-vc4-Fix-a-the-the-typo-in-a-comment.patch b/target/linux/brcm2708/patches-4.4/0460-drm-vc4-Fix-a-the-the-typo-in-a-comment.patch new file mode 100644 index 0000000000..ca504cfa26 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0460-drm-vc4-Fix-a-the-the-typo-in-a-comment.patch @@ -0,0 +1,22 @@ +From 18b45d780c43af635c4ed343ef99738bbfd07e26 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Sat, 2 Jul 2016 09:58:41 -0700 +Subject: [PATCH] drm/vc4: Fix a "the the" typo in a comment. + +Signed-off-by: Eric Anholt +(cherry picked from commit a20d5fa61c32a0c94d237da642326db2ef3c7433) +--- + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -162,7 +162,7 @@ check_tmu_write(uint64_t inst, + return false; + } + +- /* We assert that the the clamped address is the first ++ /* We assert that the clamped address is the first + * argument, and the UBO base address is the second argument. + * This is arbitrary, but simpler than supporting flipping the + * two either way. diff --git a/target/linux/brcm2708/patches-4.4/0461-drm-vc4-Return-EBUSY-if-there-s-already-a-pending-fl.patch b/target/linux/brcm2708/patches-4.4/0461-drm-vc4-Return-EBUSY-if-there-s-already-a-pending-fl.patch new file mode 100644 index 0000000000..39f74e907d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0461-drm-vc4-Return-EBUSY-if-there-s-already-a-pending-fl.patch @@ -0,0 +1,44 @@ +From bc27882bfefac9a1596aaed387ac01a844765e6c Mon Sep 17 00:00:00 2001 +From: Robert Foss +Date: Tue, 3 May 2016 13:48:20 -0400 +Subject: [PATCH] drm/vc4: Return -EBUSY if there's already a pending flip + event. + +As per the documentation in drm_crtc.h, atomic_commit should return +-EBUSY if an asynchronous update is requested and there is an earlier +update pending. + +v2: Rebase on the s/async/nonblock/ change. + +Signed-off-by: Robert Foss +Reviewed-by: Eric Anholt +(cherry picked from commit e7c31f6f25b84fed961dc0dce6248878527693ae) +--- + drivers/gpu/drm/vc4/vc4_kms.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -119,10 +119,18 @@ static int vc4_atomic_commit(struct drm_ + return -ENOMEM; + + /* Make sure that any outstanding modesets have finished. */ +- ret = down_interruptible(&vc4->async_modeset); +- if (ret) { +- kfree(c); +- return ret; ++ if (nonblock) { ++ ret = down_trylock(&vc4->async_modeset); ++ if (ret) { ++ kfree(c); ++ return -EBUSY; ++ } ++ } else { ++ ret = down_interruptible(&vc4->async_modeset); ++ if (ret) { ++ kfree(c); ++ return ret; ++ } + } + + ret = drm_atomic_helper_prepare_planes(dev, state); diff --git a/target/linux/brcm2708/patches-4.4/0462-config-Enable-SENSORS_LM75.patch b/target/linux/brcm2708/patches-4.4/0462-config-Enable-SENSORS_LM75.patch new file mode 100644 index 0000000000..4a2259f1dd --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0462-config-Enable-SENSORS_LM75.patch @@ -0,0 +1,30 @@ +From a770137c882b00d89888e007cd1f0a44475c2b60 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 12 Aug 2016 17:12:32 +0100 +Subject: [PATCH] config: Enable SENSORS_LM75 + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -642,6 +642,7 @@ CONFIG_BATTERY_DS2760=m + CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_HWMON=m ++CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m + CONFIG_THERMAL=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -634,6 +634,7 @@ CONFIG_BATTERY_DS2760=m + CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_HWMON=m ++CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m + CONFIG_THERMAL=y diff --git a/target/linux/brcm2708/patches-4.4/0463-config-Enable-SERIAL_SC16IS7XX.patch b/target/linux/brcm2708/patches-4.4/0463-config-Enable-SERIAL_SC16IS7XX.patch new file mode 100644 index 0000000000..5fec3d7a15 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0463-config-Enable-SERIAL_SC16IS7XX.patch @@ -0,0 +1,30 @@ +From d64a1deaa6da4663cbd148e9a047f069d99c14f5 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 12 Aug 2016 17:00:18 +0100 +Subject: [PATCH] config: Enable SERIAL_SC16IS7XX + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -600,6 +600,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=0 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y ++CONFIG_SERIAL_SC16IS7XX=m + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_RAW_DRIVER=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -593,6 +593,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=0 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y ++CONFIG_SERIAL_SC16IS7XX=m + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_RAW_DRIVER=y diff --git a/target/linux/brcm2708/patches-4.4/0464-snd-bcm2835-Don-t-allow-responses-from-VC-to-be-inte.patch b/target/linux/brcm2708/patches-4.4/0464-snd-bcm2835-Don-t-allow-responses-from-VC-to-be-inte.patch new file mode 100644 index 0000000000..ef5d0a3099 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0464-snd-bcm2835-Don-t-allow-responses-from-VC-to-be-inte.patch @@ -0,0 +1,63 @@ +From 385eb363335dfe4120643ea72f3060fce745b5b7 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 12 Aug 2016 15:46:21 +0100 +Subject: [PATCH] snd-bcm2835: Don't allow responses from VC to be interrupted + by user signals + +There should always be a response, and retry after a signal interruption is not handled, so don't report +we are interruptible. + +See: https://github.com/raspberrypi/linux/issues/1560 +--- + sound/arm/bcm2835-vchiq.c | 25 ++++++------------------- + 1 file changed, 6 insertions(+), 19 deletions(-) + +--- a/sound/arm/bcm2835-vchiq.c ++++ b/sound/arm/bcm2835-vchiq.c +@@ -511,12 +511,7 @@ static int bcm2835_audio_set_ctls_chan(b + } + + /* We are expecting a reply from the videocore */ +- ret = wait_for_completion_interruptible(&instance->msg_avail_comp); +- if (ret) { +- LOG_DBG("%s: failed on waiting for event (status=%d)\n", +- __func__, success); +- goto unlock; +- } ++ wait_for_completion(&instance->msg_avail_comp); + + if (instance->result != 0) { + LOG_ERR("%s: result=%d\n", __func__, instance->result); +@@ -615,12 +610,7 @@ int bcm2835_audio_set_params(bcm2835_als + } + + /* We are expecting a reply from the videocore */ +- ret = wait_for_completion_interruptible(&instance->msg_avail_comp); +- if (ret) { +- LOG_DBG("%s: failed on waiting for event (status=%d)\n", +- __func__, success); +- goto unlock; +- } ++ wait_for_completion(&instance->msg_avail_comp); + + if (instance->result != 0) { + LOG_ERR("%s: result=%d", __func__, instance->result); +@@ -761,14 +751,11 @@ int bcm2835_audio_close(bcm2835_alsa_str + goto unlock; + } + +- ret = wait_for_completion_interruptible(&instance->msg_avail_comp); +- if (ret) { +- LOG_DBG("%s: failed on waiting for event (status=%d)\n", +- __func__, success); +- goto unlock; +- } ++ /* We are expecting a reply from the videocore */ ++ wait_for_completion(&instance->msg_avail_comp); ++ + if (instance->result != 0) { +- LOG_ERR("%s: failed result (status=%d)\n", ++ LOG_ERR("%s: failed result (result=%d)\n", + __func__, instance->result); + + ret = -1; diff --git a/target/linux/brcm2708/patches-4.4/0465-BCM270X-Connect-V3D-to-its-power-domain.patch b/target/linux/brcm2708/patches-4.4/0465-BCM270X-Connect-V3D-to-its-power-domain.patch new file mode 100644 index 0000000000..c305216e5e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0465-BCM270X-Connect-V3D-to-its-power-domain.patch @@ -0,0 +1,23 @@ +From 1337324cc06c008a9d65b15328a96b21ab675113 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 12 Aug 2016 10:15:34 -0700 +Subject: [PATCH] BCM270X: Connect V3D to its power domain. + +We were doing this with manual firmware calls before, but to backport +runtime PM we want to be using a proper power domain. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -366,6 +366,7 @@ + v3d: v3d@7ec00000 { + compatible = "brcm,vc4-v3d"; + reg = <0x7ec00000 0x1000>; ++ power-domains = <&power RPI_POWER_DOMAIN_V3D>; + status = "disabled"; + }; + diff --git a/target/linux/brcm2708/patches-4.4/0466-drm-vc4-Enable-runtime-PM.patch b/target/linux/brcm2708/patches-4.4/0466-drm-vc4-Enable-runtime-PM.patch new file mode 100644 index 0000000000..fc00a1ab75 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0466-drm-vc4-Enable-runtime-PM.patch @@ -0,0 +1,205 @@ +From 02a0346c7f8159cb0930ff153bf2cb3b1f1a7a79 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 5 Feb 2016 17:41:49 -0800 +Subject: [PATCH] drm/vc4: Enable runtime PM. + +This may actually get us a feature that the closed driver didn't have: +turning off the GPU in between rendering jobs, while the V3D device is +still opened by the client. + +There may be some tuning to be applied here to use autosuspend so that +we don't bounce the device's power so much, but in steady-state +GPU-bound rendering we keep the power on (since we keep multiple jobs +outstanding) and even if we power cycle on every job we can still +manage at least 680 fps. + +More importantly, though, runtime PM will allow us to power off the +device to do a GPU reset. + +v2: Switch #ifdef to CONFIG_PM not CONFIG_PM_SLEEP (caught by kbuild + test robot) + +Signed-off-by: Eric Anholt +(cherry picked from commit 001bdb55d9eb72a9e2d5b623bacfc52da74ae03e) +--- + drivers/gpu/drm/vc4/vc4_drv.h | 1 + + drivers/gpu/drm/vc4/vc4_gem.c | 10 ++++++++ + drivers/gpu/drm/vc4/vc4_v3d.c | 59 ++++++++++++++++++++++++++----------------- + 3 files changed, 47 insertions(+), 23 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -155,6 +155,7 @@ struct vc4_seqno_cb { + }; + + struct vc4_v3d { ++ struct vc4_dev *vc4; + struct platform_device *pdev; + void __iomem *regs; + }; +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -23,6 +23,7 @@ + + #include + #include ++#include + #include + #include + +@@ -689,6 +690,7 @@ fail: + static void + vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + { ++ struct vc4_dev *vc4 = to_vc4_dev(dev); + unsigned i; + + /* Need the struct lock for drm_gem_object_unreference(). */ +@@ -707,6 +709,8 @@ vc4_complete_exec(struct drm_device *dev + } + mutex_unlock(&dev->struct_mutex); + ++ pm_runtime_put(&vc4->v3d->pdev->dev); ++ + kfree(exec); + } + +@@ -860,6 +864,12 @@ vc4_submit_cl_ioctl(struct drm_device *d + return -ENOMEM; + } + ++ ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ++ if (ret < 0) { ++ kfree(exec); ++ return ret; ++ } ++ + exec->args = args; + INIT_LIST_HEAD(&exec->unref_list); + +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -17,7 +17,7 @@ + */ + + #include "linux/component.h" +-#include "soc/bcm2835/raspberrypi-firmware.h" ++#include "linux/pm_runtime.h" + #include "vc4_drv.h" + #include "vc4_regs.h" + +@@ -145,22 +145,6 @@ int vc4_v3d_debugfs_ident(struct seq_fil + } + #endif /* CONFIG_DEBUG_FS */ + +-/* +- * Asks the firmware to turn on power to the V3D engine. +- * +- * This may be doable with just the clocks interface, though this +- * packet does some other register setup from the firmware, too. +- */ +-int +-vc4_v3d_set_power(struct vc4_dev *vc4, bool on) +-{ +- u32 packet = on; +- +- return rpi_firmware_property(vc4->firmware, +- RPI_FIRMWARE_SET_ENABLE_QPU, +- &packet, sizeof(packet)); +-} +- + static void vc4_v3d_init_hw(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +@@ -172,6 +156,29 @@ static void vc4_v3d_init_hw(struct drm_d + V3D_WRITE(V3D_VPMBASE, 0); + } + ++#ifdef CONFIG_PM ++static int vc4_v3d_runtime_suspend(struct device *dev) ++{ ++ struct vc4_v3d *v3d = dev_get_drvdata(dev); ++ struct vc4_dev *vc4 = v3d->vc4; ++ ++ vc4_irq_uninstall(vc4->dev); ++ ++ return 0; ++} ++ ++static int vc4_v3d_runtime_resume(struct device *dev) ++{ ++ struct vc4_v3d *v3d = dev_get_drvdata(dev); ++ struct vc4_dev *vc4 = v3d->vc4; ++ ++ vc4_v3d_init_hw(vc4->dev); ++ vc4_irq_postinstall(vc4->dev); ++ ++ return 0; ++} ++#endif ++ + static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -184,6 +191,8 @@ static int vc4_v3d_bind(struct device *d + if (!v3d) + return -ENOMEM; + ++ dev_set_drvdata(dev, v3d); ++ + v3d->pdev = pdev; + + v3d->regs = vc4_ioremap_regs(pdev, 0); +@@ -191,10 +200,7 @@ static int vc4_v3d_bind(struct device *d + return PTR_ERR(v3d->regs); + + vc4->v3d = v3d; +- +- ret = vc4_v3d_set_power(vc4, true); +- if (ret) +- return ret; ++ v3d->vc4 = vc4; + + if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) { + DRM_ERROR("V3D_IDENT0 read 0x%08x instead of 0x%08x\n", +@@ -216,6 +222,8 @@ static int vc4_v3d_bind(struct device *d + return ret; + } + ++ pm_runtime_enable(dev); ++ + return 0; + } + +@@ -225,6 +233,8 @@ static void vc4_v3d_unbind(struct device + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_dev *vc4 = to_vc4_dev(drm); + ++ pm_runtime_disable(dev); ++ + drm_irq_uninstall(drm); + + /* Disable the binner's overflow memory address, so the next +@@ -234,11 +244,13 @@ static void vc4_v3d_unbind(struct device + V3D_WRITE(V3D_BPOA, 0); + V3D_WRITE(V3D_BPOS, 0); + +- vc4_v3d_set_power(vc4, false); +- + vc4->v3d = NULL; + } + ++static const struct dev_pm_ops vc4_v3d_pm_ops = { ++ SET_RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL) ++}; ++ + static const struct component_ops vc4_v3d_ops = { + .bind = vc4_v3d_bind, + .unbind = vc4_v3d_unbind, +@@ -267,5 +279,6 @@ struct platform_driver vc4_v3d_driver = + .driver = { + .name = "vc4_v3d", + .of_match_table = vc4_v3d_dt_match, ++ .pm = &vc4_v3d_pm_ops, + }, + }; diff --git a/target/linux/brcm2708/patches-4.4/0467-drm-vc4-Drop-firmware-node-getting-now-that-we-use-t.patch b/target/linux/brcm2708/patches-4.4/0467-drm-vc4-Drop-firmware-node-getting-now-that-we-use-t.patch new file mode 100644 index 0000000000..353eb437e5 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0467-drm-vc4-Drop-firmware-node-getting-now-that-we-use-t.patch @@ -0,0 +1,54 @@ +From f83b96d75cab6d19376dcb9f49ebd870a8f73b69 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 12 Aug 2016 10:45:04 -0700 +Subject: [PATCH] drm/vc4: Drop firmware node getting now that we use the power + domain. + +--- + drivers/gpu/drm/vc4/vc4_drv.c | 10 ---------- + drivers/gpu/drm/vc4/vc4_drv.h | 1 - + 2 files changed, 11 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -15,7 +15,6 @@ + #include + #include + #include +-#include + #include "drm_fb_cma_helper.h" + + #include "uapi/drm/vc4_drm.h" +@@ -204,7 +203,6 @@ static int vc4_drm_bind(struct device *d + struct drm_device *drm; + struct drm_connector *connector; + struct vc4_dev *vc4; +- struct device_node *firmware_node; + int ret = 0; + + dev->coherent_dma_mask = DMA_BIT_MASK(32); +@@ -213,14 +211,6 @@ static int vc4_drm_bind(struct device *d + if (!vc4) + return -ENOMEM; + +- firmware_node = of_parse_phandle(dev->of_node, "firmware", 0); +- vc4->firmware = rpi_firmware_get(firmware_node); +- if (!vc4->firmware) { +- DRM_DEBUG("Failed to get Raspberry Pi firmware reference.\n"); +- return -EPROBE_DEFER; +- } +- of_node_put(firmware_node); +- + drm = drm_dev_alloc(&vc4_drm_driver, dev); + if (!drm) + return -ENOMEM; +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -23,7 +23,6 @@ struct vc4_dev { + struct vc4_dsi *dsi1; + + struct drm_fbdev_cma *fbdev; +- struct rpi_firmware *firmware; + + struct vc4_hang_state *hang_state; + diff --git a/target/linux/brcm2708/patches-4.4/0468-drm-vc4-Use-runtime-PM-to-power-cycle-the-device-whe.patch b/target/linux/brcm2708/patches-4.4/0468-drm-vc4-Use-runtime-PM-to-power-cycle-the-device-whe.patch new file mode 100644 index 0000000000..d771261a19 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0468-drm-vc4-Use-runtime-PM-to-power-cycle-the-device-whe.patch @@ -0,0 +1,102 @@ +From e70d1a5fdbb7277490c273533ce535977326c6a5 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 8 Feb 2016 12:59:02 -0800 +Subject: [PATCH] drm/vc4: Use runtime PM to power cycle the device when the + GPU hangs. + +This gets us functional GPU reset again, like we had until a refactor +at merge time. Tested with a little patch to stuff in a broken binner +job every 100 frames. + +Signed-off-by: Eric Anholt +(cherry picked from commit 36cb6253f9383fd9a59ee7b8458c6232ef48577c) +--- + drivers/gpu/drm/vc4/vc4_drv.h | 6 +++++- + drivers/gpu/drm/vc4/vc4_gem.c | 26 +++++++++++++++++++++----- + 2 files changed, 26 insertions(+), 6 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -104,6 +104,11 @@ struct vc4_dev { + struct vc4_bo *overflow_mem; + struct work_struct overflow_mem_work; + ++ int power_refcount; ++ ++ /* Mutex controlling the power refcount. */ ++ struct mutex power_lock; ++ + struct { + struct timer_list timer; + struct work_struct reset_work; +@@ -495,7 +500,6 @@ void vc4_plane_async_set_fb(struct drm_p + extern struct platform_driver vc4_v3d_driver; + int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused); + int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused); +-int vc4_v3d_set_power(struct vc4_dev *vc4, bool on); + + /* vc4_validate.c */ + int +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -261,8 +261,16 @@ vc4_reset(struct drm_device *dev) + struct vc4_dev *vc4 = to_vc4_dev(dev); + + DRM_INFO("Resetting GPU.\n"); +- vc4_v3d_set_power(vc4, false); +- vc4_v3d_set_power(vc4, true); ++ ++ mutex_lock(&vc4->power_lock); ++ if (vc4->power_refcount) { ++ /* Power the device off and back on the by dropping the ++ * reference on runtime PM. ++ */ ++ pm_runtime_put_sync_suspend(&vc4->v3d->pdev->dev); ++ pm_runtime_get_sync(&vc4->v3d->pdev->dev); ++ } ++ mutex_unlock(&vc4->power_lock); + + vc4_irq_reset(dev); + +@@ -709,7 +717,10 @@ vc4_complete_exec(struct drm_device *dev + } + mutex_unlock(&dev->struct_mutex); + +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ mutex_lock(&vc4->power_lock); ++ if (--vc4->power_refcount == 0) ++ pm_runtime_put(&vc4->v3d->pdev->dev); ++ mutex_unlock(&vc4->power_lock); + + kfree(exec); + } +@@ -851,7 +862,7 @@ vc4_submit_cl_ioctl(struct drm_device *d + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct drm_vc4_submit_cl *args = data; + struct vc4_exec_info *exec; +- int ret; ++ int ret = 0; + + if ((args->flags & ~VC4_SUBMIT_CL_USE_CLEAR_COLOR) != 0) { + DRM_ERROR("Unknown flags: 0x%02x\n", args->flags); +@@ -864,7 +875,10 @@ vc4_submit_cl_ioctl(struct drm_device *d + return -ENOMEM; + } + +- ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ++ mutex_lock(&vc4->power_lock); ++ if (vc4->power_refcount++ == 0) ++ ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ++ mutex_unlock(&vc4->power_lock); + if (ret < 0) { + kfree(exec); + return ret; +@@ -925,6 +939,8 @@ vc4_gem_init(struct drm_device *dev) + (unsigned long)dev); + + INIT_WORK(&vc4->job_done_work, vc4_job_done_work); ++ ++ mutex_init(&vc4->power_lock); + } + + void diff --git a/target/linux/brcm2708/patches-4.4/0469-drm-panel-Drop-debug-printf-from-the-Raspberry-Pi-to.patch b/target/linux/brcm2708/patches-4.4/0469-drm-panel-Drop-debug-printf-from-the-Raspberry-Pi-to.patch new file mode 100644 index 0000000000..56ccf2e8f6 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0469-drm-panel-Drop-debug-printf-from-the-Raspberry-Pi-to.patch @@ -0,0 +1,21 @@ +From 7cac96392a51584d864291e08aeda97f9ee3e384 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 12 Aug 2016 10:55:53 -0700 +Subject: [PATCH] drm/panel: Drop debug printf from the Raspberry Pi + touchscreen. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -106,7 +106,6 @@ struct regdump { + static int rpi_touchscreen_disable(struct drm_panel *panel) + { + struct rpi_touchscreen *ts = panel_to_ts(panel); +- pr_err("disable\n"); + + if (!ts->enabled) + return 0; diff --git a/target/linux/brcm2708/patches-4.4/0470-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch b/target/linux/brcm2708/patches-4.4/0470-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch new file mode 100644 index 0000000000..3c2379438d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0470-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch @@ -0,0 +1,42 @@ +From 05352a2959d8924a6333726cd15144245d7c98fa Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 12 Aug 2016 10:57:41 -0700 +Subject: [PATCH] drm/vc4: Replace HDMI force-connected with an EDID probe. + +The force-connected started out because I didn't know how to read the +HPD pin successfully, which required the hpd_active_low check and +getting the correct active level into the DTs. It stayed because we +don't have the Pi3's HPD line exposed to Linux, so this was the only +way to bring up graphics on it. + +However, with the DSI panel support now present, users want to be able +to run DSI-only systems, and forcing HDMI on is interfering with +default screen configurations. Work around the Pi3's missing HPD by +probing the DDC on I2C and see if it's present at all. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -166,8 +166,6 @@ vc4_hdmi_connector_detect(struct drm_con + struct drm_device *dev = connector->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); + +- return connector_status_connected; +- + if (vc4->hdmi->hpd_gpio) { + if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^ + vc4->hdmi->hpd_active_low) +@@ -176,6 +174,9 @@ vc4_hdmi_connector_detect(struct drm_con + return connector_status_disconnected; + } + ++ if (drm_probe_ddc(vc4->hdmi->ddc)) ++ return connector_status_connected; ++ + if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) + return connector_status_connected; + else diff --git a/target/linux/brcm2708/patches-4.4/0471-net-ethernet-enc28j60-add-device-tree-support.patch b/target/linux/brcm2708/patches-4.4/0471-net-ethernet-enc28j60-add-device-tree-support.patch new file mode 100644 index 0000000000..eab1286fc0 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0471-net-ethernet-enc28j60-add-device-tree-support.patch @@ -0,0 +1,143 @@ +From 55d0ce46f962a768dd358ca26158c8c195988645 Mon Sep 17 00:00:00 2001 +From: Michael Heimpold +Date: Thu, 28 Apr 2016 22:06:15 +0200 +Subject: [PATCH] net: ethernet: enc28j60: add device tree support + +(Upstream commit 2dd355a007e44960ec049c75920ddb6778fec9ee) + +The following patch adds the required match table for device tree support +(and while at, fix the indent). It's also possible to specify the +MAC address in the DT blob. + +Also add the corresponding binding documentation file. + +Signed-off-by: Michael Heimpold +Signed-off-by: David S. Miller +--- + .../devicetree/bindings/net/microchip,enc28j60.txt | 59 ++++++++++++++++++++++ + drivers/net/ethernet/microchip/enc28j60.c | 21 +++++--- + 2 files changed, 73 insertions(+), 7 deletions(-) + create mode 100644 Documentation/devicetree/bindings/net/microchip,enc28j60.txt + +--- /dev/null ++++ b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt +@@ -0,0 +1,59 @@ ++* Microchip ENC28J60 ++ ++This is a standalone 10 MBit ethernet controller with SPI interface. ++ ++For each device connected to a SPI bus, define a child node within ++the SPI master node. ++ ++Required properties: ++- compatible: Should be "microchip,enc28j60" ++- reg: Specify the SPI chip select the ENC28J60 is wired to ++- interrupt-parent: Specify the phandle of the source interrupt, see interrupt ++ binding documentation for details. Usually this is the GPIO bank ++ the interrupt line is wired to. ++- interrupts: Specify the interrupt index within the interrupt controller (referred ++ to above in interrupt-parent) and interrupt type. The ENC28J60 natively ++ generates falling edge interrupts, however, additional board logic ++ might invert the signal. ++- pinctrl-names: List of assigned state names, see pinctrl binding documentation. ++- pinctrl-0: List of phandles to configure the GPIO pin used as interrupt line, ++ see also generic and your platform specific pinctrl binding ++ documentation. ++ ++Optional properties: ++- spi-max-frequency: Maximum frequency of the SPI bus when accessing the ENC28J60. ++ According to the ENC28J80 datasheet, the chip allows a maximum of 20 MHz, however, ++ board designs may need to limit this value. ++- local-mac-address: See ethernet.txt in the same directory. ++ ++ ++Example (for NXP i.MX28 with pin control stuff for GPIO irq): ++ ++ ssp2: ssp@80014000 { ++ compatible = "fsl,imx28-spi"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi2_pins_b &spi2_sck_cfg>; ++ status = "okay"; ++ ++ enc28j60: ethernet@0 { ++ compatible = "microchip,enc28j60"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&enc28j60_pins>; ++ reg = <0>; ++ interrupt-parent = <&gpio3>; ++ interrupts = <3 IRQ_TYPE_EDGE_FALLING>; ++ spi-max-frequency = <12000000>; ++ }; ++ }; ++ ++ pinctrl@80018000 { ++ enc28j60_pins: enc28j60_pins@0 { ++ reg = <0>; ++ fsl,pinmux-ids = < ++ MX28_PAD_AUART0_RTS__GPIO_3_3 /* Interrupt */ ++ >; ++ fsl,drive-strength = ; ++ fsl,voltage = ; ++ fsl,pull-up = ; ++ }; ++ }; +--- a/drivers/net/ethernet/microchip/enc28j60.c ++++ b/drivers/net/ethernet/microchip/enc28j60.c +@@ -28,11 +28,12 @@ + #include + #include + #include ++#include + + #include "enc28j60_hw.h" + + #define DRV_NAME "enc28j60" +-#define DRV_VERSION "1.01" ++#define DRV_VERSION "1.02" + + #define SPI_OPLEN 1 + +@@ -1544,6 +1545,7 @@ static int enc28j60_probe(struct spi_dev + { + struct net_device *dev; + struct enc28j60_net *priv; ++ const void *macaddr; + int ret = 0; + + if (netif_msg_drv(&debug)) +@@ -1575,7 +1577,12 @@ static int enc28j60_probe(struct spi_dev + ret = -EIO; + goto error_irq; + } +- eth_hw_addr_random(dev); ++ ++ macaddr = of_get_mac_address(spi->dev.of_node); ++ if (macaddr) ++ ether_addr_copy(dev->dev_addr, macaddr); ++ else ++ eth_hw_addr_random(dev); + enc28j60_set_hw_macaddr(dev); + + /* Board setup must set the relevant edge trigger type; +@@ -1630,16 +1637,16 @@ static int enc28j60_remove(struct spi_de + return 0; + } + +-static const struct of_device_id enc28j60_of_match[] = { +- { .compatible = "microchip,enc28j60", }, ++static const struct of_device_id enc28j60_dt_ids[] = { ++ { .compatible = "microchip,enc28j60" }, + { /* sentinel */ } + }; +-MODULE_DEVICE_TABLE(of, enc28j60_of_match); ++MODULE_DEVICE_TABLE(of, enc28j60_dt_ids); + + static struct spi_driver enc28j60_driver = { + .driver = { +- .name = DRV_NAME, +- .of_match_table = enc28j60_of_match, ++ .name = DRV_NAME, ++ .of_match_table = enc28j60_dt_ids, + }, + .probe = enc28j60_probe, + .remove = enc28j60_remove, diff --git a/target/linux/brcm2708/patches-4.4/0472-enc28j60-Fix-race-condition-in-enc28j60-driver.patch b/target/linux/brcm2708/patches-4.4/0472-enc28j60-Fix-race-condition-in-enc28j60-driver.patch new file mode 100644 index 0000000000..1447bebc36 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0472-enc28j60-Fix-race-condition-in-enc28j60-driver.patch @@ -0,0 +1,64 @@ +From 2f1038fb16442e7285c6a4da47c56d1967ab05da Mon Sep 17 00:00:00 2001 +From: Sergio Valverde +Date: Fri, 1 Jul 2016 11:44:30 -0600 +Subject: [PATCH] enc28j60: Fix race condition in enc28j60 driver + +(Upstream commit 373819ec391de0d11f63b10b2fb69ef2854236ca) + +The interrupt worker code for the enc28j60 relies only on the TXIF flag to +determinate if the packet transmission was completed. However the datasheet +specifies in section 12.1.3 that TXERIF will clear the TXRTS after a +transmit abort. Also in section 12.1.4 that TXIF will be set +when TXRTS transitions from '1' to '0'. Therefore the TXIF flag is enabled +during transmission errors. + +This causes a race condition, since the worker code will invoke +enc28j60_tx_clear() -> netif_wake_queue(), potentially invoking the +ndo_start_xmit function to send a new packet. The enc28j60_send_packet function +uses a workqueue that invokes enc28j60_hw_tx(). In between this function is +called, the worker from the interrupt handler will enter the path for error +handler because of the TXERIF flag, causing to invoke enc28j60_tx_clear() again +and releasing the packet scheduled for transmission, causing a kernel crash with +due a NULL pointer. + +These crashes due a NULL pointer were observed under stress conditions of the +device. A BUG_ON() sequence was used to validate the issue was fixed, and has +been running without problems for 2 years now. + +Signed-off-by: Diego Dompe +Acked-by: Sergio Valverde +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/microchip/enc28j60.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/microchip/enc28j60.c ++++ b/drivers/net/ethernet/microchip/enc28j60.c +@@ -1147,7 +1147,8 @@ static void enc28j60_irq_work_handler(st + enc28j60_phy_read(priv, PHIR); + } + /* TX complete handler */ +- if ((intflags & EIR_TXIF) != 0) { ++ if (((intflags & EIR_TXIF) != 0) && ++ ((intflags & EIR_TXERIF) == 0)) { + bool err = false; + loop++; + if (netif_msg_intr(priv)) +@@ -1199,7 +1200,7 @@ static void enc28j60_irq_work_handler(st + enc28j60_tx_clear(ndev, true); + } else + enc28j60_tx_clear(ndev, true); +- locked_reg_bfclr(priv, EIR, EIR_TXERIF); ++ locked_reg_bfclr(priv, EIR, EIR_TXERIF | EIR_TXIF); + } + /* RX Error handler */ + if ((intflags & EIR_RXERIF) != 0) { +@@ -1234,6 +1235,8 @@ static void enc28j60_irq_work_handler(st + */ + static void enc28j60_hw_tx(struct enc28j60_net *priv) + { ++ BUG_ON(!priv->tx_skb); ++ + if (netif_msg_tx_queued(priv)) + printk(KERN_DEBUG DRV_NAME + ": Tx Packet Len:%d\n", priv->tx_skb->len); diff --git a/target/linux/brcm2708/patches-4.4/0473-Add-cm3-dts-file.patch b/target/linux/brcm2708/patches-4.4/0473-Add-cm3-dts-file.patch new file mode 100644 index 0000000000..4f322bb76d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0473-Add-cm3-dts-file.patch @@ -0,0 +1,200 @@ +From 22af0da1539b63a5dc49cc03d28a726027e2d688 Mon Sep 17 00:00:00 2001 +From: James Adams +Date: Fri, 12 Aug 2016 14:35:00 +0100 +Subject: [PATCH] Add cm3 dts file + +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 176 ++++++++++++++++++++++++++++++++++ + 2 files changed, 177 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm2710-rpi-cm3.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -6,6 +6,7 @@ dtb-$(CONFIG_ARCH_BCM2708) += bcm2708-rp + dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-cm.dtb + dtb-$(CONFIG_ARCH_BCM2709) += bcm2709-rpi-2-b.dtb + dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb ++dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-cm3.dtb + + # Raspberry Pi + ifeq ($(CONFIG_ARCH_BCM2708),y) +--- /dev/null ++++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts +@@ -0,0 +1,176 @@ ++/dts-v1/; ++ ++#include "bcm2710.dtsi" ++ ++/ { ++ compatible = "brcm,bcm2710","brcm,bcm2709"; ++ model = "Raspberry Pi Compute Module 3"; ++}; ++ ++&gpio { ++ ++ mmc_pins: mmc_pins { ++ brcm,pins = <48 49 50 51 52 53>; ++ brcm,function = <7>; /* alt3 */ ++ brcm,pull = <0 2 2 2 2 2>; ++ }; ++ ++ spi0_pins: spi0_pins { ++ brcm,pins = <9 10 11>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ ++ spi0_cs_pins: spi0_cs_pins { ++ brcm,pins = <8 7>; ++ brcm,function = <1>; /* output */ ++ }; ++ ++ i2c0_pins: i2c0 { ++ brcm,pins = <0 1>; ++ brcm,function = <4>; ++ }; ++ ++ i2c1_pins: i2c1 { ++ brcm,pins = <2 3>; ++ brcm,function = <4>; ++ }; ++ ++ i2s_pins: i2s { ++ brcm,pins = <18 19 20 21>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++ ++ uart0_pins: uart0_pins { ++ brcm,pins; ++ brcm,function; ++ brcm,pull = <0 2>; ++ }; ++ ++ audio_pins: audio_pins { ++ brcm,pins; ++ brcm,function; ++ }; ++}; ++ ++&mmc { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc_pins>; ++ non-removable; ++ bus-width = <4>; ++ status = "okay"; ++ brcm,overclock-50 = <0>; ++}; ++ ++&soc { ++ virtgpio: virtgpio { ++ compatible = "brcm,bcm2835-virtgpio"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ firmware = <&firmware>; ++ status = "okay"; ++ }; ++}; ++ ++&fb { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins>; ++ status = "okay"; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins &spi0_cs_pins>; ++ cs-gpios = <&gpio 8 1>, <&gpio 7 1>; ++ ++ spidev0: spidev@0{ ++ compatible = "spidev"; ++ reg = <0>; /* CE0 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <500000>; ++ }; ++ ++ spidev1: spidev@1{ ++ compatible = "spidev"; ++ reg = <1>; /* CE1 */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spi-max-frequency = <500000>; ++ }; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; ++ clock-frequency = <100000>; ++}; ++ ++&i2c2 { ++ clock-frequency = <100000>; ++}; ++ ++&i2s { ++ #sound-dai-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ ++&random { ++ status = "okay"; ++}; ++ ++&leds { ++ act_led: act { ++ label = "led0"; ++ linux,default-trigger = "mmc0"; ++ gpios = <&virtgpio 0 0>; ++ }; ++}; ++ ++&hdmi { ++ hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; ++}; ++ ++&audio { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&audio_pins>; ++}; ++ ++/ { ++ __overrides__ { ++ uart0 = <&uart0>,"status"; ++ uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ uart1 = <&uart1>,"status"; ++ i2s = <&i2s>,"status"; ++ spi = <&spi0>,"status"; ++ i2c0 = <&i2c0>,"status"; ++ i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; ++ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; ++ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; ++ ++ act_led_gpio = <&act_led>,"gpios:4"; ++ act_led_activelow = <&act_led>,"gpios:8"; ++ act_led_trigger = <&act_led>,"linux,default-trigger"; ++ ++ audio = <&audio>,"status"; ++ watchdog = <&watchdog>,"status"; ++ random = <&random>,"status"; ++ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; ++ sd_force_pio = <&sdhost>,"brcm,force-pio?"; ++ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; ++ sd_debug = <&sdhost>,"brcm,debug"; ++ }; ++}; diff --git a/target/linux/brcm2708/patches-4.4/0474-BCM270X-Drop-HPD-setting-from-the-common-dtsi.patch b/target/linux/brcm2708/patches-4.4/0474-BCM270X-Drop-HPD-setting-from-the-common-dtsi.patch new file mode 100644 index 0000000000..61b198540d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0474-BCM270X-Drop-HPD-setting-from-the-common-dtsi.patch @@ -0,0 +1,21 @@ +From 8f7b6b3db2ffcec68137e671c158c705241e1009 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 15 Aug 2016 10:08:58 -0700 +Subject: [PATCH] BCM270X: Drop HPD setting from the common dtsi. + +The HPD is quite board-specific, so we need to set it in the per-board +DT. +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -347,7 +347,6 @@ + reg = <0x7e902000 0x600>, + <0x7e808000 0x100>; + ddc = <&i2c2>; +- hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; + clocks = <&cprman BCM2835_PLLH_PIX>, + <&cprman BCM2835_CLOCK_HSM>; + clock-names = "pixel", "hdmi"; diff --git a/target/linux/brcm2708/patches-4.4/0475-BCM2710-Drop-incorrect-HDMI-HPD-line-from-the-DT.patch b/target/linux/brcm2708/patches-4.4/0475-BCM2710-Drop-incorrect-HDMI-HPD-line-from-the-DT.patch new file mode 100644 index 0000000000..4ae0e30573 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0475-BCM2710-Drop-incorrect-HDMI-HPD-line-from-the-DT.patch @@ -0,0 +1,26 @@ +From 5bdac7f7f6e6d9938da0d6bd0d58a136cf29515b Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 12 Aug 2016 11:02:14 -0700 +Subject: [PATCH] BCM2710: Drop incorrect HDMI HPD line from the DT. + +It's actually off on the GPIO expander, which I don't think we have +access to. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -166,10 +166,6 @@ + }; + }; + +-&hdmi { +- hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; +-}; +- + &audio { + pinctrl-names = "default"; + pinctrl-0 = <&audio_pins>; diff --git a/target/linux/brcm2708/patches-4.4/0476-drm-vc4-Add-a-getparam-ioctl-for-getting-the-V3D-ide.patch b/target/linux/brcm2708/patches-4.4/0476-drm-vc4-Add-a-getparam-ioctl-for-getting-the-V3D-ide.patch new file mode 100644 index 0000000000..a51347e79f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0476-drm-vc4-Add-a-getparam-ioctl-for-getting-the-V3D-ide.patch @@ -0,0 +1,124 @@ +From 35d17fc64d8612bfc019a9a6078647886fae783f Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 1 Jul 2016 13:10:38 -0700 +Subject: [PATCH] drm/vc4: Add a getparam ioctl for getting the V3D identity + regs. + +As I extend the driver to support different V3D revisions, userspace +needs to know what version it's targeting. This is most easily +detected using the V3D identity registers. + +v2: Make sure V3D is runtime PM on when reading the registers. +v3: Switch to a 64-bit param value (suggested by Rob Clark in review) + +Signed-off-by: Eric Anholt +Acked-by: Daniel Vetter (v2) +Reviewed-by: Rob Clark (v3, over irc) +(cherry picked from commit af713795c59fea36161a7debf97dbc10bf652cf7) + +v4: Squashed in "drm/vc4: Fix handling of a pm_runtime_get_sync() success case." +--- + drivers/gpu/drm/vc4/vc4_drv.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + include/uapi/drm/vc4_drm.h | 12 ++++++++++++ + 2 files changed, 54 insertions(+) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include "drm_fb_cma_helper.h" + + #include "uapi/drm/vc4_drm.h" +@@ -64,6 +65,46 @@ void vc4_dump_regs32(const struct debugf + } + } + ++static int vc4_get_param_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ struct drm_vc4_get_param *args = data; ++ int ret; ++ ++ if (args->pad != 0) ++ return -EINVAL; ++ ++ switch (args->param) { ++ case DRM_VC4_PARAM_V3D_IDENT0: ++ ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ++ if (ret < 0) ++ return ret; ++ args->value = V3D_READ(V3D_IDENT0); ++ pm_runtime_put(&vc4->v3d->pdev->dev); ++ break; ++ case DRM_VC4_PARAM_V3D_IDENT1: ++ ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ++ if (ret < 0) ++ return ret; ++ args->value = V3D_READ(V3D_IDENT1); ++ pm_runtime_put(&vc4->v3d->pdev->dev); ++ break; ++ case DRM_VC4_PARAM_V3D_IDENT2: ++ ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); ++ if (ret < 0) ++ return ret; ++ args->value = V3D_READ(V3D_IDENT2); ++ pm_runtime_put(&vc4->v3d->pdev->dev); ++ break; ++ default: ++ DRM_DEBUG("Unknown parameter %d\n", args->param); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ + static void vc4_lastclose(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +@@ -95,6 +136,7 @@ static const struct drm_ioctl_desc vc4_d + DRM_IOCTL_DEF_DRV(VC4_CREATE_SHADER_BO, vc4_create_shader_bo_ioctl, DRM_RENDER_ALLOW), + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), ++ DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), + }; + + static struct drm_driver vc4_drm_driver = { +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -37,6 +37,7 @@ extern "C" { + #define DRM_VC4_MMAP_BO 0x04 + #define DRM_VC4_CREATE_SHADER_BO 0x05 + #define DRM_VC4_GET_HANG_STATE 0x06 ++#define DRM_VC4_GET_PARAM 0x07 + + #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) + #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +@@ -45,6 +46,7 @@ extern "C" { + #define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo) + #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) + #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) ++#define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) + + struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ +@@ -280,6 +282,16 @@ struct drm_vc4_get_hang_state { + __u32 pad[16]; + }; + ++#define DRM_VC4_PARAM_V3D_IDENT0 0 ++#define DRM_VC4_PARAM_V3D_IDENT1 1 ++#define DRM_VC4_PARAM_V3D_IDENT2 2 ++ ++struct drm_vc4_get_param { ++ __u32 param; ++ __u32 pad; ++ __u64 value; ++}; ++ + #if defined(__cplusplus) + } + #endif diff --git a/target/linux/brcm2708/patches-4.4/0477-drm-vc4-Move-validation-s-current-max-ip-into-the-va.patch b/target/linux/brcm2708/patches-4.4/0477-drm-vc4-Move-validation-s-current-max-ip-into-the-va.patch new file mode 100644 index 0000000000..53b8fb0e90 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0477-drm-vc4-Move-validation-s-current-max-ip-into-the-va.patch @@ -0,0 +1,176 @@ +From 71f1e833c8f76504921b3913d5a8da310318934f Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Sat, 2 Jul 2016 09:57:07 -0700 +Subject: [PATCH] drm/vc4: Move validation's current/max ip into the validation + struct. + +Reduces the argument count for some of the functions, and will be used +more with the upcoming looping support. + +Signed-off-by: Eric Anholt +(cherry picked from commit d0566c2a2f2baacefe1eb75be8a001fdd6fe84a3) +--- + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 54 +++++++++++++++++------------- + 1 file changed, 30 insertions(+), 24 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -40,6 +40,14 @@ + #include "vc4_qpu_defines.h" + + struct vc4_shader_validation_state { ++ /* Current IP being validated. */ ++ uint32_t ip; ++ ++ /* IP at the end of the BO, do not read shader[max_ip] */ ++ uint32_t max_ip; ++ ++ uint64_t *shader; ++ + struct vc4_texture_sample_info tmu_setup[2]; + int tmu_write_count[2]; + +@@ -129,11 +137,11 @@ record_texture_sample(struct vc4_validat + } + + static bool +-check_tmu_write(uint64_t inst, +- struct vc4_validated_shader_info *validated_shader, ++check_tmu_write(struct vc4_validated_shader_info *validated_shader, + struct vc4_shader_validation_state *validation_state, + bool is_mul) + { ++ uint64_t inst = validation_state->shader[validation_state->ip]; + uint32_t waddr = (is_mul ? + QPU_GET_FIELD(inst, QPU_WADDR_MUL) : + QPU_GET_FIELD(inst, QPU_WADDR_ADD)); +@@ -228,11 +236,11 @@ check_tmu_write(uint64_t inst, + } + + static bool +-check_reg_write(uint64_t inst, +- struct vc4_validated_shader_info *validated_shader, ++check_reg_write(struct vc4_validated_shader_info *validated_shader, + struct vc4_shader_validation_state *validation_state, + bool is_mul) + { ++ uint64_t inst = validation_state->shader[validation_state->ip]; + uint32_t waddr = (is_mul ? + QPU_GET_FIELD(inst, QPU_WADDR_MUL) : + QPU_GET_FIELD(inst, QPU_WADDR_ADD)); +@@ -261,7 +269,7 @@ check_reg_write(uint64_t inst, + case QPU_W_TMU1_T: + case QPU_W_TMU1_R: + case QPU_W_TMU1_B: +- return check_tmu_write(inst, validated_shader, validation_state, ++ return check_tmu_write(validated_shader, validation_state, + is_mul); + + case QPU_W_HOST_INT: +@@ -294,10 +302,10 @@ check_reg_write(uint64_t inst, + } + + static void +-track_live_clamps(uint64_t inst, +- struct vc4_validated_shader_info *validated_shader, ++track_live_clamps(struct vc4_validated_shader_info *validated_shader, + struct vc4_shader_validation_state *validation_state) + { ++ uint64_t inst = validation_state->shader[validation_state->ip]; + uint32_t op_add = QPU_GET_FIELD(inst, QPU_OP_ADD); + uint32_t waddr_add = QPU_GET_FIELD(inst, QPU_WADDR_ADD); + uint32_t waddr_mul = QPU_GET_FIELD(inst, QPU_WADDR_MUL); +@@ -369,10 +377,10 @@ track_live_clamps(uint64_t inst, + } + + static bool +-check_instruction_writes(uint64_t inst, +- struct vc4_validated_shader_info *validated_shader, ++check_instruction_writes(struct vc4_validated_shader_info *validated_shader, + struct vc4_shader_validation_state *validation_state) + { ++ uint64_t inst = validation_state->shader[validation_state->ip]; + uint32_t waddr_add = QPU_GET_FIELD(inst, QPU_WADDR_ADD); + uint32_t waddr_mul = QPU_GET_FIELD(inst, QPU_WADDR_MUL); + bool ok; +@@ -382,12 +390,10 @@ check_instruction_writes(uint64_t inst, + return false; + } + +- ok = (check_reg_write(inst, validated_shader, validation_state, +- false) && +- check_reg_write(inst, validated_shader, validation_state, +- true)); ++ ok = (check_reg_write(validated_shader, validation_state, false) && ++ check_reg_write(validated_shader, validation_state, true)); + +- track_live_clamps(inst, validated_shader, validation_state); ++ track_live_clamps(validated_shader, validation_state); + + return ok; + } +@@ -417,30 +423,30 @@ vc4_validate_shader(struct drm_gem_cma_o + { + bool found_shader_end = false; + int shader_end_ip = 0; +- uint32_t ip, max_ip; +- uint64_t *shader; ++ uint32_t ip; + struct vc4_validated_shader_info *validated_shader; + struct vc4_shader_validation_state validation_state; + int i; + + memset(&validation_state, 0, sizeof(validation_state)); ++ validation_state.shader = shader_obj->vaddr; ++ validation_state.max_ip = shader_obj->base.size / sizeof(uint64_t); + + for (i = 0; i < 8; i++) + validation_state.tmu_setup[i / 4].p_offset[i % 4] = ~0; + for (i = 0; i < ARRAY_SIZE(validation_state.live_min_clamp_offsets); i++) + validation_state.live_min_clamp_offsets[i] = ~0; + +- shader = shader_obj->vaddr; +- max_ip = shader_obj->base.size / sizeof(uint64_t); +- + validated_shader = kcalloc(1, sizeof(*validated_shader), GFP_KERNEL); + if (!validated_shader) + return NULL; + +- for (ip = 0; ip < max_ip; ip++) { +- uint64_t inst = shader[ip]; ++ for (ip = 0; ip < validation_state.max_ip; ip++) { ++ uint64_t inst = validation_state.shader[ip]; + uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG); + ++ validation_state.ip = ip; ++ + switch (sig) { + case QPU_SIG_NONE: + case QPU_SIG_WAIT_FOR_SCOREBOARD: +@@ -450,7 +456,7 @@ vc4_validate_shader(struct drm_gem_cma_o + case QPU_SIG_LOAD_TMU1: + case QPU_SIG_PROG_END: + case QPU_SIG_SMALL_IMM: +- if (!check_instruction_writes(inst, validated_shader, ++ if (!check_instruction_writes(validated_shader, + &validation_state)) { + DRM_ERROR("Bad write at ip %d\n", ip); + goto fail; +@@ -467,7 +473,7 @@ vc4_validate_shader(struct drm_gem_cma_o + break; + + case QPU_SIG_LOAD_IMM: +- if (!check_instruction_writes(inst, validated_shader, ++ if (!check_instruction_writes(validated_shader, + &validation_state)) { + DRM_ERROR("Bad LOAD_IMM write at ip %d\n", ip); + goto fail; +@@ -487,7 +493,7 @@ vc4_validate_shader(struct drm_gem_cma_o + break; + } + +- if (ip == max_ip) { ++ if (ip == validation_state.max_ip) { + DRM_ERROR("shader failed to terminate before " + "shader BO end at %zd\n", + shader_obj->base.size); diff --git a/target/linux/brcm2708/patches-4.4/0478-drm-vc4-Add-a-bitmap-of-branch-targets-during-shader.patch b/target/linux/brcm2708/patches-4.4/0478-drm-vc4-Add-a-bitmap-of-branch-targets-during-shader.patch new file mode 100644 index 0000000000..a8787acb7e --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0478-drm-vc4-Add-a-bitmap-of-branch-targets-during-shader.patch @@ -0,0 +1,200 @@ +From ba3aa9ce57cb933203cb0ebaa7c00ef756e5f84e Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Sat, 2 Jul 2016 10:10:24 -0700 +Subject: [PATCH] drm/vc4: Add a bitmap of branch targets during shader + validation. + +This isn't used yet, it's just a first step toward loop validation. +During the main parsing of instructions, we need to know when we hit a +new basic block so that we can reset validated state. + +v2: Fix a stray semicolon after an if block. (caught by kbuild test). + +Signed-off-by: Eric Anholt +(cherry picked from commit 93aa9ae3e5523e49e4e5abacd4dbee0e4ab2d931) +--- + drivers/gpu/drm/vc4/vc4_qpu_defines.h | 12 +++ + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 114 ++++++++++++++++++++++++++++- + 2 files changed, 124 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_qpu_defines.h ++++ b/drivers/gpu/drm/vc4/vc4_qpu_defines.h +@@ -230,6 +230,15 @@ enum qpu_unpack_r4 { + #define QPU_COND_MUL_SHIFT 46 + #define QPU_COND_MUL_MASK QPU_MASK(48, 46) + ++#define QPU_BRANCH_COND_SHIFT 52 ++#define QPU_BRANCH_COND_MASK QPU_MASK(55, 52) ++ ++#define QPU_BRANCH_REL ((uint64_t)1 << 51) ++#define QPU_BRANCH_REG ((uint64_t)1 << 50) ++ ++#define QPU_BRANCH_RADDR_A_SHIFT 45 ++#define QPU_BRANCH_RADDR_A_MASK QPU_MASK(49, 45) ++ + #define QPU_SF ((uint64_t)1 << 45) + + #define QPU_WADDR_ADD_SHIFT 38 +@@ -261,4 +270,7 @@ enum qpu_unpack_r4 { + #define QPU_OP_ADD_SHIFT 24 + #define QPU_OP_ADD_MASK QPU_MASK(28, 24) + ++#define QPU_BRANCH_TARGET_SHIFT 0 ++#define QPU_BRANCH_TARGET_MASK QPU_MASK(31, 0) ++ + #endif /* VC4_QPU_DEFINES_H */ +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -59,6 +59,13 @@ struct vc4_shader_validation_state { + */ + uint32_t live_min_clamp_offsets[32 + 32 + 4]; + bool live_max_clamp_regs[32 + 32 + 4]; ++ ++ /* Bitfield of which IPs are used as branch targets. ++ * ++ * Used for validation that the uniform stream is updated at the right ++ * points and clearing the texturing/clamping state. ++ */ ++ unsigned long *branch_targets; + }; + + static uint32_t +@@ -418,13 +425,104 @@ check_instruction_reads(uint64_t inst, + return true; + } + ++/* Make sure that all branches are absolute and point within the shader, and ++ * note their targets for later. ++ */ ++static bool ++vc4_validate_branches(struct vc4_shader_validation_state *validation_state) ++{ ++ uint32_t max_branch_target = 0; ++ bool found_shader_end = false; ++ int ip; ++ int shader_end_ip = 0; ++ int last_branch = -2; ++ ++ for (ip = 0; ip < validation_state->max_ip; ip++) { ++ uint64_t inst = validation_state->shader[ip]; ++ int32_t branch_imm = QPU_GET_FIELD(inst, QPU_BRANCH_TARGET); ++ uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG); ++ uint32_t after_delay_ip = ip + 4; ++ uint32_t branch_target_ip; ++ ++ if (sig == QPU_SIG_PROG_END) { ++ shader_end_ip = ip; ++ found_shader_end = true; ++ continue; ++ } ++ ++ if (sig != QPU_SIG_BRANCH) ++ continue; ++ ++ if (ip - last_branch < 4) { ++ DRM_ERROR("Branch at %d during delay slots\n", ip); ++ return false; ++ } ++ last_branch = ip; ++ ++ if (inst & QPU_BRANCH_REG) { ++ DRM_ERROR("branching from register relative " ++ "not supported\n"); ++ return false; ++ } ++ ++ if (!(inst & QPU_BRANCH_REL)) { ++ DRM_ERROR("relative branching required\n"); ++ return false; ++ } ++ ++ /* The actual branch target is the instruction after the delay ++ * slots, plus whatever byte offset is in the low 32 bits of ++ * the instruction. Make sure we're not branching beyond the ++ * end of the shader object. ++ */ ++ if (branch_imm % sizeof(inst) != 0) { ++ DRM_ERROR("branch target not aligned\n"); ++ return false; ++ } ++ ++ branch_target_ip = after_delay_ip + (branch_imm >> 3); ++ if (branch_target_ip >= validation_state->max_ip) { ++ DRM_ERROR("Branch at %d outside of shader (ip %d/%d)\n", ++ ip, branch_target_ip, ++ validation_state->max_ip); ++ return false; ++ } ++ set_bit(branch_target_ip, validation_state->branch_targets); ++ ++ /* Make sure that the non-branching path is also not outside ++ * the shader. ++ */ ++ if (after_delay_ip >= validation_state->max_ip) { ++ DRM_ERROR("Branch at %d continues past shader end " ++ "(%d/%d)\n", ++ ip, after_delay_ip, validation_state->max_ip); ++ return false; ++ } ++ set_bit(after_delay_ip, validation_state->branch_targets); ++ max_branch_target = max(max_branch_target, after_delay_ip); ++ ++ /* There are two delay slots after program end is signaled ++ * that are still executed, then we're finished. ++ */ ++ if (found_shader_end && ip == shader_end_ip + 2) ++ break; ++ } ++ ++ if (max_branch_target > shader_end_ip) { ++ DRM_ERROR("Branch landed after QPU_SIG_PROG_END"); ++ return false; ++ } ++ ++ return true; ++} ++ + struct vc4_validated_shader_info * + vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + { + bool found_shader_end = false; + int shader_end_ip = 0; + uint32_t ip; +- struct vc4_validated_shader_info *validated_shader; ++ struct vc4_validated_shader_info *validated_shader = NULL; + struct vc4_shader_validation_state validation_state; + int i; + +@@ -437,9 +535,18 @@ vc4_validate_shader(struct drm_gem_cma_o + for (i = 0; i < ARRAY_SIZE(validation_state.live_min_clamp_offsets); i++) + validation_state.live_min_clamp_offsets[i] = ~0; + ++ validation_state.branch_targets = ++ kcalloc(BITS_TO_LONGS(validation_state.max_ip), ++ sizeof(unsigned long), GFP_KERNEL); ++ if (!validation_state.branch_targets) ++ goto fail; ++ + validated_shader = kcalloc(1, sizeof(*validated_shader), GFP_KERNEL); + if (!validated_shader) +- return NULL; ++ goto fail; ++ ++ if (!vc4_validate_branches(&validation_state)) ++ goto fail; + + for (ip = 0; ip < validation_state.max_ip; ip++) { + uint64_t inst = validation_state.shader[ip]; +@@ -508,9 +615,12 @@ vc4_validate_shader(struct drm_gem_cma_o + (validated_shader->uniforms_size + + 4 * validated_shader->num_texture_samples); + ++ kfree(validation_state.branch_targets); ++ + return validated_shader; + + fail: ++ kfree(validation_state.branch_targets); + if (validated_shader) { + kfree(validated_shader->texture_samples); + kfree(validated_shader); diff --git a/target/linux/brcm2708/patches-4.4/0479-drm-vc4-Add-support-for-branching-in-shader-validati.patch b/target/linux/brcm2708/patches-4.4/0479-drm-vc4-Add-support-for-branching-in-shader-validati.patch new file mode 100644 index 0000000000..eb78dbae2d --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0479-drm-vc4-Add-support-for-branching-in-shader-validati.patch @@ -0,0 +1,475 @@ +From f9cd25fae900b1251e14ec894849846e0a2a7cb3 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Sat, 2 Jul 2016 12:17:10 -0700 +Subject: [PATCH] drm/vc4: Add support for branching in shader validation. + +We're already checking that branch instructions are between the start +of the shader and the proper PROG_END sequence. The other thing we +need to make branching safe is to verify that the shader doesn't read +past the end of the uniforms stream. + +To do that, we require that at any basic block reading uniforms have +the following instructions: + +load_imm temp, +add unif_addr, temp, unif + +The instructions are generated by userspace, and the kernel verifies +that the load_imm is of the expected offset, and that the add adds it +to a uniform. We track which uniform in the stream that is, and at +draw call time fix up the uniform stream to have the address of the +start of the shader's uniforms at that location. + +Signed-off-by: Eric Anholt +(cherry picked from commit 6d45c81d229d71da54d374143e7d6abad4c0cf31) +--- + drivers/gpu/drm/vc4/vc4_drv.h | 3 + + drivers/gpu/drm/vc4/vc4_qpu_defines.h | 3 + + drivers/gpu/drm/vc4/vc4_validate.c | 13 +- + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 281 +++++++++++++++++++++++++++-- + 4 files changed, 283 insertions(+), 17 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -363,6 +363,9 @@ struct vc4_validated_shader_info { + uint32_t uniforms_src_size; + uint32_t num_texture_samples; + struct vc4_texture_sample_info *texture_samples; ++ ++ uint32_t num_uniform_addr_offsets; ++ uint32_t *uniform_addr_offsets; + }; + + /** +--- a/drivers/gpu/drm/vc4/vc4_qpu_defines.h ++++ b/drivers/gpu/drm/vc4/vc4_qpu_defines.h +@@ -270,6 +270,9 @@ enum qpu_unpack_r4 { + #define QPU_OP_ADD_SHIFT 24 + #define QPU_OP_ADD_MASK QPU_MASK(28, 24) + ++#define QPU_LOAD_IMM_SHIFT 0 ++#define QPU_LOAD_IMM_MASK QPU_MASK(31, 0) ++ + #define QPU_BRANCH_TARGET_SHIFT 0 + #define QPU_BRANCH_TARGET_MASK QPU_MASK(31, 0) + +--- a/drivers/gpu/drm/vc4/vc4_validate.c ++++ b/drivers/gpu/drm/vc4/vc4_validate.c +@@ -802,7 +802,7 @@ validate_gl_shader_rec(struct drm_device + uint32_t src_offset = *(uint32_t *)(pkt_u + o); + uint32_t *texture_handles_u; + void *uniform_data_u; +- uint32_t tex; ++ uint32_t tex, uni; + + *(uint32_t *)(pkt_v + o) = bo[i]->paddr + src_offset; + +@@ -840,6 +840,17 @@ validate_gl_shader_rec(struct drm_device + } + } + ++ /* Fill in the uniform slots that need this shader's ++ * start-of-uniforms address (used for resetting the uniform ++ * stream in the presence of control flow). ++ */ ++ for (uni = 0; ++ uni < validated_shader->num_uniform_addr_offsets; ++ uni++) { ++ uint32_t o = validated_shader->uniform_addr_offsets[uni]; ++ ((uint32_t *)exec->uniforms_v)[o] = exec->uniforms_p; ++ } ++ + *(uint32_t *)(pkt_v + o + 4) = exec->uniforms_p; + + exec->uniforms_u += validated_shader->uniforms_src_size; +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -39,6 +39,8 @@ + #include "vc4_drv.h" + #include "vc4_qpu_defines.h" + ++#define LIVE_REG_COUNT (32 + 32 + 4) ++ + struct vc4_shader_validation_state { + /* Current IP being validated. */ + uint32_t ip; +@@ -57,8 +59,9 @@ struct vc4_shader_validation_state { + * + * This is used for the validation of direct address memory reads. + */ +- uint32_t live_min_clamp_offsets[32 + 32 + 4]; +- bool live_max_clamp_regs[32 + 32 + 4]; ++ uint32_t live_min_clamp_offsets[LIVE_REG_COUNT]; ++ bool live_max_clamp_regs[LIVE_REG_COUNT]; ++ uint32_t live_immediates[LIVE_REG_COUNT]; + + /* Bitfield of which IPs are used as branch targets. + * +@@ -66,6 +69,20 @@ struct vc4_shader_validation_state { + * points and clearing the texturing/clamping state. + */ + unsigned long *branch_targets; ++ ++ /* Set when entering a basic block, and cleared when the uniform ++ * address update is found. This is used to make sure that we don't ++ * read uniforms when the address is undefined. ++ */ ++ bool needs_uniform_address_update; ++ ++ /* Set when we find a backwards branch. If the branch is backwards, ++ * the taraget is probably doing an address reset to read uniforms, ++ * and so we need to be sure that a uniforms address is present in the ++ * stream, even if the shader didn't need to read uniforms in later ++ * basic blocks. ++ */ ++ bool needs_uniform_address_for_loop; + }; + + static uint32_t +@@ -227,8 +244,14 @@ check_tmu_write(struct vc4_validated_sha + /* Since direct uses a RADDR uniform reference, it will get counted in + * check_instruction_reads() + */ +- if (!is_direct) ++ if (!is_direct) { ++ if (validation_state->needs_uniform_address_update) { ++ DRM_ERROR("Texturing with undefined uniform address\n"); ++ return false; ++ } ++ + validated_shader->uniforms_size += 4; ++ } + + if (submit) { + if (!record_texture_sample(validated_shader, +@@ -242,6 +265,98 @@ check_tmu_write(struct vc4_validated_sha + return true; + } + ++static bool require_uniform_address_uniform(struct vc4_validated_shader_info *validated_shader) ++{ ++ uint32_t o = validated_shader->num_uniform_addr_offsets; ++ uint32_t num_uniforms = validated_shader->uniforms_size / 4; ++ ++ validated_shader->uniform_addr_offsets = ++ krealloc(validated_shader->uniform_addr_offsets, ++ (o + 1) * ++ sizeof(*validated_shader->uniform_addr_offsets), ++ GFP_KERNEL); ++ if (!validated_shader->uniform_addr_offsets) ++ return false; ++ ++ validated_shader->uniform_addr_offsets[o] = num_uniforms; ++ validated_shader->num_uniform_addr_offsets++; ++ ++ return true; ++} ++ ++static bool ++validate_uniform_address_write(struct vc4_validated_shader_info *validated_shader, ++ struct vc4_shader_validation_state *validation_state, ++ bool is_mul) ++{ ++ uint64_t inst = validation_state->shader[validation_state->ip]; ++ u32 add_b = QPU_GET_FIELD(inst, QPU_ADD_B); ++ u32 raddr_a = QPU_GET_FIELD(inst, QPU_RADDR_A); ++ u32 raddr_b = QPU_GET_FIELD(inst, QPU_RADDR_B); ++ u32 add_lri = raddr_add_a_to_live_reg_index(inst); ++ /* We want our reset to be pointing at whatever uniform follows the ++ * uniforms base address. ++ */ ++ u32 expected_offset = validated_shader->uniforms_size + 4; ++ ++ /* We only support absolute uniform address changes, and we ++ * require that they be in the current basic block before any ++ * of its uniform reads. ++ * ++ * One could potentially emit more efficient QPU code, by ++ * noticing that (say) an if statement does uniform control ++ * flow for all threads and that the if reads the same number ++ * of uniforms on each side. However, this scheme is easy to ++ * validate so it's all we allow for now. ++ */ ++ ++ if (QPU_GET_FIELD(inst, QPU_SIG) != QPU_SIG_NONE) { ++ DRM_ERROR("uniforms address change must be " ++ "normal math\n"); ++ return false; ++ } ++ ++ if (is_mul || QPU_GET_FIELD(inst, QPU_OP_ADD) != QPU_A_ADD) { ++ DRM_ERROR("Uniform address reset must be an ADD.\n"); ++ return false; ++ } ++ ++ if (QPU_GET_FIELD(inst, QPU_COND_ADD) != QPU_COND_ALWAYS) { ++ DRM_ERROR("Uniform address reset must be unconditional.\n"); ++ return false; ++ } ++ ++ if (QPU_GET_FIELD(inst, QPU_PACK) != QPU_PACK_A_NOP && ++ !(inst & QPU_PM)) { ++ DRM_ERROR("No packing allowed on uniforms reset\n"); ++ return false; ++ } ++ ++ if (add_lri == -1) { ++ DRM_ERROR("First argument of uniform address write must be " ++ "an immediate value.\n"); ++ return false; ++ } ++ ++ if (validation_state->live_immediates[add_lri] != expected_offset) { ++ DRM_ERROR("Resetting uniforms with offset %db instead of %db\n", ++ validation_state->live_immediates[add_lri], ++ expected_offset); ++ return false; ++ } ++ ++ if (!(add_b == QPU_MUX_A && raddr_a == QPU_R_UNIF) && ++ !(add_b == QPU_MUX_B && raddr_b == QPU_R_UNIF)) { ++ DRM_ERROR("Second argument of uniform address write must be " ++ "a uniform.\n"); ++ return false; ++ } ++ ++ validation_state->needs_uniform_address_update = false; ++ validation_state->needs_uniform_address_for_loop = false; ++ return require_uniform_address_uniform(validated_shader); ++} ++ + static bool + check_reg_write(struct vc4_validated_shader_info *validated_shader, + struct vc4_shader_validation_state *validation_state, +@@ -251,14 +366,37 @@ check_reg_write(struct vc4_validated_sha + uint32_t waddr = (is_mul ? + QPU_GET_FIELD(inst, QPU_WADDR_MUL) : + QPU_GET_FIELD(inst, QPU_WADDR_ADD)); ++ uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG); ++ bool ws = inst & QPU_WS; ++ bool is_b = is_mul ^ ws; ++ u32 lri = waddr_to_live_reg_index(waddr, is_b); ++ ++ if (lri != -1) { ++ uint32_t cond_add = QPU_GET_FIELD(inst, QPU_COND_ADD); ++ uint32_t cond_mul = QPU_GET_FIELD(inst, QPU_COND_MUL); ++ ++ if (sig == QPU_SIG_LOAD_IMM && ++ QPU_GET_FIELD(inst, QPU_PACK) == QPU_PACK_A_NOP && ++ ((is_mul && cond_mul == QPU_COND_ALWAYS) || ++ (!is_mul && cond_add == QPU_COND_ALWAYS))) { ++ validation_state->live_immediates[lri] = ++ QPU_GET_FIELD(inst, QPU_LOAD_IMM); ++ } else { ++ validation_state->live_immediates[lri] = ~0; ++ } ++ } + + switch (waddr) { + case QPU_W_UNIFORMS_ADDRESS: +- /* XXX: We'll probably need to support this for reladdr, but +- * it's definitely a security-related one. +- */ +- DRM_ERROR("uniforms address load unsupported\n"); +- return false; ++ if (is_b) { ++ DRM_ERROR("relative uniforms address change " ++ "unsupported\n"); ++ return false; ++ } ++ ++ return validate_uniform_address_write(validated_shader, ++ validation_state, ++ is_mul); + + case QPU_W_TLB_COLOR_MS: + case QPU_W_TLB_COLOR_ALL: +@@ -406,9 +544,35 @@ check_instruction_writes(struct vc4_vali + } + + static bool +-check_instruction_reads(uint64_t inst, +- struct vc4_validated_shader_info *validated_shader) ++check_branch(uint64_t inst, ++ struct vc4_validated_shader_info *validated_shader, ++ struct vc4_shader_validation_state *validation_state, ++ int ip) + { ++ int32_t branch_imm = QPU_GET_FIELD(inst, QPU_BRANCH_TARGET); ++ uint32_t waddr_add = QPU_GET_FIELD(inst, QPU_WADDR_ADD); ++ uint32_t waddr_mul = QPU_GET_FIELD(inst, QPU_WADDR_MUL); ++ ++ if ((int)branch_imm < 0) ++ validation_state->needs_uniform_address_for_loop = true; ++ ++ /* We don't want to have to worry about validation of this, and ++ * there's no need for it. ++ */ ++ if (waddr_add != QPU_W_NOP || waddr_mul != QPU_W_NOP) { ++ DRM_ERROR("branch instruction at %d wrote a register.\n", ++ validation_state->ip); ++ return false; ++ } ++ ++ return true; ++} ++ ++static bool ++check_instruction_reads(struct vc4_validated_shader_info *validated_shader, ++ struct vc4_shader_validation_state *validation_state) ++{ ++ uint64_t inst = validation_state->shader[validation_state->ip]; + uint32_t raddr_a = QPU_GET_FIELD(inst, QPU_RADDR_A); + uint32_t raddr_b = QPU_GET_FIELD(inst, QPU_RADDR_B); + uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG); +@@ -420,6 +584,12 @@ check_instruction_reads(uint64_t inst, + * already be OOM. + */ + validated_shader->uniforms_size += 4; ++ ++ if (validation_state->needs_uniform_address_update) { ++ DRM_ERROR("Uniform read with undefined uniform " ++ "address\n"); ++ return false; ++ } + } + + return true; +@@ -516,6 +686,65 @@ vc4_validate_branches(struct vc4_shader_ + return true; + } + ++/* Resets any known state for the shader, used when we may be branched to from ++ * multiple locations in the program (or at shader start). ++ */ ++static void ++reset_validation_state(struct vc4_shader_validation_state *validation_state) ++{ ++ int i; ++ ++ for (i = 0; i < 8; i++) ++ validation_state->tmu_setup[i / 4].p_offset[i % 4] = ~0; ++ ++ for (i = 0; i < LIVE_REG_COUNT; i++) { ++ validation_state->live_min_clamp_offsets[i] = ~0; ++ validation_state->live_max_clamp_regs[i] = false; ++ validation_state->live_immediates[i] = ~0; ++ } ++} ++ ++static bool ++texturing_in_progress(struct vc4_shader_validation_state *validation_state) ++{ ++ return (validation_state->tmu_write_count[0] != 0 || ++ validation_state->tmu_write_count[1] != 0); ++} ++ ++static bool ++vc4_handle_branch_target(struct vc4_shader_validation_state *validation_state) ++{ ++ uint32_t ip = validation_state->ip; ++ ++ if (!test_bit(ip, validation_state->branch_targets)) ++ return true; ++ ++ if (texturing_in_progress(validation_state)) { ++ DRM_ERROR("Branch target landed during TMU setup\n"); ++ return false; ++ } ++ ++ /* Reset our live values tracking, since this instruction may have ++ * multiple predecessors. ++ * ++ * One could potentially do analysis to determine that, for ++ * example, all predecessors have a live max clamp in the same ++ * register, but we don't bother with that. ++ */ ++ reset_validation_state(validation_state); ++ ++ /* Since we've entered a basic block from potentially multiple ++ * predecessors, we need the uniforms address to be updated before any ++ * unforms are read. We require that after any branch point, the next ++ * uniform to be loaded is a uniform address offset. That uniform's ++ * offset will be marked by the uniform address register write ++ * validation, or a one-off the end-of-program check. ++ */ ++ validation_state->needs_uniform_address_update = true; ++ ++ return true; ++} ++ + struct vc4_validated_shader_info * + vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + { +@@ -524,16 +753,12 @@ vc4_validate_shader(struct drm_gem_cma_o + uint32_t ip; + struct vc4_validated_shader_info *validated_shader = NULL; + struct vc4_shader_validation_state validation_state; +- int i; + + memset(&validation_state, 0, sizeof(validation_state)); + validation_state.shader = shader_obj->vaddr; + validation_state.max_ip = shader_obj->base.size / sizeof(uint64_t); + +- for (i = 0; i < 8; i++) +- validation_state.tmu_setup[i / 4].p_offset[i % 4] = ~0; +- for (i = 0; i < ARRAY_SIZE(validation_state.live_min_clamp_offsets); i++) +- validation_state.live_min_clamp_offsets[i] = ~0; ++ reset_validation_state(&validation_state); + + validation_state.branch_targets = + kcalloc(BITS_TO_LONGS(validation_state.max_ip), +@@ -554,6 +779,9 @@ vc4_validate_shader(struct drm_gem_cma_o + + validation_state.ip = ip; + ++ if (!vc4_handle_branch_target(&validation_state)) ++ goto fail; ++ + switch (sig) { + case QPU_SIG_NONE: + case QPU_SIG_WAIT_FOR_SCOREBOARD: +@@ -569,7 +797,8 @@ vc4_validate_shader(struct drm_gem_cma_o + goto fail; + } + +- if (!check_instruction_reads(inst, validated_shader)) ++ if (!check_instruction_reads(validated_shader, ++ &validation_state)) + goto fail; + + if (sig == QPU_SIG_PROG_END) { +@@ -587,6 +816,11 @@ vc4_validate_shader(struct drm_gem_cma_o + } + break; + ++ case QPU_SIG_BRANCH: ++ if (!check_branch(inst, validated_shader, ++ &validation_state, ip)) ++ goto fail; ++ break; + default: + DRM_ERROR("Unsupported QPU signal %d at " + "instruction %d\n", sig, ip); +@@ -607,6 +841,21 @@ vc4_validate_shader(struct drm_gem_cma_o + goto fail; + } + ++ /* If we did a backwards branch and we haven't emitted a uniforms ++ * reset since then, we still need the uniforms stream to have the ++ * uniforms address available so that the backwards branch can do its ++ * uniforms reset. ++ * ++ * We could potentially prove that the backwards branch doesn't ++ * contain any uses of uniforms until program exit, but that doesn't ++ * seem to be worth the trouble. ++ */ ++ if (validation_state.needs_uniform_address_for_loop) { ++ if (!require_uniform_address_uniform(validated_shader)) ++ goto fail; ++ validated_shader->uniforms_size += 4; ++ } ++ + /* Again, no chance of integer overflow here because the worst case + * scenario is 8 bytes of uniforms plus handles per 8-byte + * instruction. diff --git a/target/linux/brcm2708/patches-4.4/0480-drm-vc4-Add-a-getparam-to-signal-support-for-branche.patch b/target/linux/brcm2708/patches-4.4/0480-drm-vc4-Add-a-getparam-to-signal-support-for-branche.patch new file mode 100644 index 0000000000..63c0445c50 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0480-drm-vc4-Add-a-getparam-to-signal-support-for-branche.patch @@ -0,0 +1,38 @@ +From f6b1410aedc0c8d04363a930fd70509e30e23eeb Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Sat, 2 Jul 2016 14:14:27 -0700 +Subject: [PATCH] drm/vc4: Add a getparam to signal support for branches. + +Userspace needs to know if it can create shaders that do branching. +Otherwise, for backwards compatibility with old kernels it needs to +lower if statements to conditional assignments. + +Signed-off-by: Eric Anholt +(cherry picked from commit 7363cee5b467c31dc3af2ac98df0634bb8bbc668) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 3 +++ + include/uapi/drm/vc4_drm.h | 1 + + 2 files changed, 4 insertions(+) + +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -97,6 +97,9 @@ static int vc4_get_param_ioctl(struct dr + args->value = V3D_READ(V3D_IDENT2); + pm_runtime_put(&vc4->v3d->pdev->dev); + break; ++ case DRM_VC4_PARAM_SUPPORTS_BRANCHES: ++ args->value = true; ++ break; + default: + DRM_DEBUG("Unknown parameter %d\n", args->param); + return -EINVAL; +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -285,6 +285,7 @@ struct drm_vc4_get_hang_state { + #define DRM_VC4_PARAM_V3D_IDENT0 0 + #define DRM_VC4_PARAM_V3D_IDENT1 1 + #define DRM_VC4_PARAM_V3D_IDENT2 2 ++#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3 + + struct drm_vc4_get_param { + __u32 param; diff --git a/target/linux/brcm2708/patches-4.4/0481-drm-vc4-Don-t-force-new-binner-overflow-allocation-p.patch b/target/linux/brcm2708/patches-4.4/0481-drm-vc4-Don-t-force-new-binner-overflow-allocation-p.patch new file mode 100644 index 0000000000..716961ef3a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0481-drm-vc4-Don-t-force-new-binner-overflow-allocation-p.patch @@ -0,0 +1,28 @@ +From 033049599046df7c51b605b24224bbce6d60c762 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 2 Aug 2016 17:17:52 -0700 +Subject: [PATCH] drm/vc4: Don't force new binner overflow allocation per draw. + +This came from the initial bringup code, which always idled the GPU +and always reset the overflow. That massively increases the size of +the working set when you're doing lots of small draws, though, as is +common on X desktops or piglit. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_gem.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -435,10 +435,6 @@ again: + + vc4_flush_caches(dev); + +- /* Disable the binner's pre-loaded overflow memory address */ +- V3D_WRITE(V3D_BPOA, 0); +- V3D_WRITE(V3D_BPOS, 0); +- + /* Either put the job in the binner if it uses the binner, or + * immediately move it to the to-be-rendered queue. + */ diff --git a/target/linux/brcm2708/patches-4.4/0482-drm-vc4-Use-drm_free_large-on-handles-to-match-its-a.patch b/target/linux/brcm2708/patches-4.4/0482-drm-vc4-Use-drm_free_large-on-handles-to-match-its-a.patch new file mode 100644 index 0000000000..2975c9b068 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0482-drm-vc4-Use-drm_free_large-on-handles-to-match-its-a.patch @@ -0,0 +1,27 @@ +From 60db7ffd6d4ace445eb56659c6e700ee9494b846 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 19 Jul 2016 11:31:19 -0700 +Subject: [PATCH] drm/vc4: Use drm_free_large() on handles to match its + allocation. + +If you managed to exceed the limit to switch to vmalloc, we'd use the +wrong free. + +Signed-off-by: Eric Anholt +Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") +Cc: stable@vger.kernel.org +--- + drivers/gpu/drm/vc4/vc4_gem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -584,7 +584,7 @@ vc4_cl_lookup_bos(struct drm_device *dev + spin_unlock(&file_priv->table_lock); + + fail: +- kfree(handles); ++ drm_free_large(handles); + return 0; + } + diff --git a/target/linux/brcm2708/patches-4.4/0483-drm-vc4-Fix-oops-when-userspace-hands-in-a-bad-BO.patch b/target/linux/brcm2708/patches-4.4/0483-drm-vc4-Fix-oops-when-userspace-hands-in-a-bad-BO.patch new file mode 100644 index 0000000000..00b1511981 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0483-drm-vc4-Fix-oops-when-userspace-hands-in-a-bad-BO.patch @@ -0,0 +1,26 @@ +From 6d3d23c57b33d76f0b4f01221593182c0de34ef4 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 25 Jul 2016 16:10:04 -0700 +Subject: [PATCH] drm/vc4: Fix oops when userspace hands in a bad BO. + +We'd end up NULL pointer dereferencing because we didn't take the +error path out in the parent. Fixes igt vc4_lookup_fail test. + +Signed-off-by: Eric Anholt +Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") +Cc: stable@vger.kernel.org +--- + drivers/gpu/drm/vc4/vc4_gem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -585,7 +585,7 @@ vc4_cl_lookup_bos(struct drm_device *dev + + fail: + drm_free_large(handles); +- return 0; ++ return ret; + } + + static int diff --git a/target/linux/brcm2708/patches-4.4/0484-drm-vc4-Fix-overflow-mem-unreferencing-when-the-binn.patch b/target/linux/brcm2708/patches-4.4/0484-drm-vc4-Fix-overflow-mem-unreferencing-when-the-binn.patch new file mode 100644 index 0000000000..c136742fe8 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0484-drm-vc4-Fix-overflow-mem-unreferencing-when-the-binn.patch @@ -0,0 +1,57 @@ +From 379b5d818939dc58742278f744b60241a577568d Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 21 Jul 2016 13:39:11 -0700 +Subject: [PATCH] drm/vc4: Fix overflow mem unreferencing when the binner runs + dry. + +Overflow memory handling is tricky: While it's still referenced by the +BPO registers, we want to keep it from being freed. When we are +putting a new set of overflow memory in the registers, we need to +assign the old one to the last rendering job using it. + +We were looking at "what's currently running in the binner", but since +the bin/render submission split, we may end up with the binner +completing and having no new job while the renderer is still +processing. So, if we don't find a bin job at all, look at the +highest-seqno (last) render job to attach our overflow to. + +Signed-off-by: Eric Anholt +Fixes: ca26d28bbaa3 ("drm/vc4: improve throughput by pipelining binning and rendering jobs") +Cc: stable@vger.kernel.org +--- + drivers/gpu/drm/vc4/vc4_drv.h | 9 +++++++++ + drivers/gpu/drm/vc4/vc4_irq.c | 4 +++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -329,6 +329,15 @@ vc4_first_render_job(struct vc4_dev *vc4 + struct vc4_exec_info, head); + } + ++static inline struct vc4_exec_info * ++vc4_last_render_job(struct vc4_dev *vc4) ++{ ++ if (list_empty(&vc4->render_job_list)) ++ return NULL; ++ return list_last_entry(&vc4->render_job_list, ++ struct vc4_exec_info, head); ++} ++ + /** + * struct vc4_texture_sample_info - saves the offsets into the UBO for texture + * setup parameters. +--- a/drivers/gpu/drm/vc4/vc4_irq.c ++++ b/drivers/gpu/drm/vc4/vc4_irq.c +@@ -83,8 +83,10 @@ vc4_overflow_mem_work(struct work_struct + + spin_lock_irqsave(&vc4->job_lock, irqflags); + current_exec = vc4_first_bin_job(vc4); ++ if (!current_exec) ++ current_exec = vc4_last_render_job(vc4); + if (current_exec) { +- vc4->overflow_mem->seqno = vc4->finished_seqno + 1; ++ vc4->overflow_mem->seqno = current_exec->seqno; + list_add_tail(&vc4->overflow_mem->unref_head, + ¤t_exec->unref_list); + vc4->overflow_mem = NULL; diff --git a/target/linux/brcm2708/patches-4.4/0485-config-Enable-SERIAL_SC16IS7XX_SPI.patch b/target/linux/brcm2708/patches-4.4/0485-config-Enable-SERIAL_SC16IS7XX_SPI.patch new file mode 100644 index 0000000000..c780c9a295 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0485-config-Enable-SERIAL_SC16IS7XX_SPI.patch @@ -0,0 +1,33 @@ +From 6032b4e7060993a3a32b2e2a26c62ce0dd79a7fb Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 18 Aug 2016 17:36:39 +0100 +Subject: [PATCH] config: Enable SERIAL_SC16IS7XX_SPI + +Previously only the I2C mode was supported. + +See: https://github.com/raspberrypi/linux/issues/1594 +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -601,6 +601,7 @@ CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_SERIAL_SC16IS7XX=m ++CONFIG_SERIAL_SC16IS7XX_SPI=y + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_RAW_DRIVER=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -594,6 +594,7 @@ CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y + CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_SERIAL_SC16IS7XX=m ++CONFIG_SERIAL_SC16IS7XX_SPI=y + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_RAW_DRIVER=y diff --git a/target/linux/brcm2708/patches-4.4/0486-Overlay-for-Microchip-MCP23S08-17-SPI-gpio-expanders.patch b/target/linux/brcm2708/patches-4.4/0486-Overlay-for-Microchip-MCP23S08-17-SPI-gpio-expanders.patch new file mode 100644 index 0000000000..cd54783a3f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0486-Overlay-for-Microchip-MCP23S08-17-SPI-gpio-expanders.patch @@ -0,0 +1,791 @@ +From bd7c2eac2ada8f60058768b00935cdfe010720a5 Mon Sep 17 00:00:00 2001 +From: wavelet2 +Date: Fri, 19 Aug 2016 09:32:53 +0100 +Subject: [PATCH] Overlay for Microchip MCP23S08/17 SPI gpio expanders (#1566) + +Added Overlay for Microchip MCP23S08/17 SPI gpio expanders +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 24 + + arch/arm/boot/dts/overlays/mcp23s17-overlay.dts | 732 ++++++++++++++++++++++++ + 3 files changed, 757 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/mcp23s17-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -49,6 +49,7 @@ dtbo-$(RPI_DT_OVERLAYS) += justboom-dac. + dtbo-$(RPI_DT_OVERLAYS) += justboom-digi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += lirc-rpi.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mcp23017.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += mcp23s17.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can0.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mcp2515-can1.dtbo + dtbo-$(RPI_DT_OVERLAYS) += mmc.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -628,6 +628,30 @@ Params: gpiopin Gpio pin + addr I2C address of the MCP23017 (default: 0x20) + + ++Name: mcp23s17 ++Info: Configures the MCP23S08/17 SPI GPIO expanders. ++ If devices are present on SPI1 or SPI2, those interfaces must be enabled ++ with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays. ++ If interrupts are enabled for a device on a given CS# on a SPI bus, that ++ device must be the only one present on that SPI bus/CS#. ++Load: dtoverlay=mcp23s17,= ++Params: s08-spi--present 4-bit integer, bitmap indicating MCP23S08 ++ devices present on SPI, CS# ++ ++ s17-spi--present 8-bit integer, bitmap indicating MCP23S17 ++ devices present on SPI, CS# ++ ++ s08-spi--int-gpio integer, enables interrupts on a single ++ MCP23S08 device on SPI, CS#, specifies ++ the GPIO pin to which INT output of MCP23S08 ++ is connected. ++ ++ s17-spi--int-gpio integer, enables mirrored interrupts on a ++ single MCP23S17 device on SPI, CS#, ++ specifies the GPIO pin to which either INTA ++ or INTB output of MCP23S17 is connected. ++ ++ + Name: mcp2515-can0 + Info: Configures the MCP2515 CAN controller on spi0.0 + Load: dtoverlay=mcp2515-can0,= +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/mcp23s17-overlay.dts +@@ -0,0 +1,732 @@ ++// Overlay for MCP23S08/17 GPIO Extenders from Microchip Semiconductor ++ ++// dtparams: ++// s08-spi--present - 4-bit integer, bitmap indicating MCP23S08 devices present on SPI, CS#. ++// s17-spi--present - 8-bit integer, bitmap indicating MCP23S17 devices present on SPI, CS#. ++// s08-spi--int-gpio - integer, enables interrupts on a single MCP23S08 device on SPI, CS#, specifies the GPIO pin to which INT output is connected. ++// s17-spi--int-gpio - integer, enables mirrored interrupts on a single MCP23S17 device on SPI, CS#, specifies the GPIO pin to which either INTA or INTB output is connected. ++// ++// If devices are present on SPI1 or SPI2, those interfaces must be enabled with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays. ++// If interrupts are enabled for a device on a given CS# on a SPI bus, that device must be the only one present on that SPI bus/CS#. ++// ++// Example 1: A single MCP23S17 device on SPI0, CS#0 with its SPI addr set to 0 and INTA output connected to GPIO25: ++// dtoverlay=mcp23s17:s17-spi0-0-present=1,s17-spi0-0-int-gpio=25 ++// ++// Example 2: Two MCP23S08 devices on SPI1, CS#0 with their addrs set to 2 and 3. Three MCP23S17 devices on SPI1, CS#1 with their addrs set to 0, 1 and 7: ++// dtoverlay=spi1-2cs ++// dtoverlay=mcp23s17:s08-spi1-0-present=12,s17-spi1-1-present=131 ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ // disable spi-dev on spi0.0 ++ fragment@0 { ++ target = <&spidev0>; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // disable spi-dev on spi0.1 ++ fragment@1 { ++ target = <&spidev1>; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // disable spi-dev on spi1.0 ++ fragment@2 { ++ target-path = "spi1/spidev@0"; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // disable spi-dev on spi1.1 ++ fragment@3 { ++ target-path = "spi1/spidev@1"; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // disable spi-dev on spi1.2 ++ fragment@4 { ++ target-path = "spi1/spidev@2"; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // disable spi-dev on spi2.0 ++ fragment@5 { ++ target-path = "spi2/spidev@0"; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // disable spi-dev on spi2.1 ++ fragment@6 { ++ target-path = "spi2/spidev@1"; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // disable spi-dev on spi2.2 ++ fragment@7 { ++ target-path = "spi2/spidev@2"; ++ __dormant__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi0.0 ++ fragment@8 { ++ target = <&spi0>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_00: mcp23s08@0 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi0-0-present parameter */ ++ reg = <0>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi0-0-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi0.1 ++ fragment@9 { ++ target = <&spi0>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_01: mcp23s08@1 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi0-1-present parameter */ ++ reg = <1>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi0-1-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi1.0 ++ fragment@10 { ++ target = <&spi1>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_10: mcp23s08@0 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-0-present parameter */ ++ reg = <0>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-0-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi1.1 ++ fragment@11 { ++ target = <&spi1>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_11: mcp23s08@1 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-1-present parameter */ ++ reg = <1>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-1-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi1.2 ++ fragment@12 { ++ target = <&spi1>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_12: mcp23s08@2 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi1-2-present parameter */ ++ reg = <2>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-2-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi2.0 ++ fragment@13 { ++ target = <&spi2>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_20: mcp23s08@0 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-0-present parameter */ ++ reg = <0>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-0-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi2.1 ++ fragment@14 { ++ target = <&spi2>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_21: mcp23s08@1 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-1-present parameter */ ++ reg = <1>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-1-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s08s on spi2.2 ++ fragment@15 { ++ target = <&spi2>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s08_22: mcp23s08@2 { ++ compatible = "microchip,mcp23s08"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s08-spi2-2-present parameter */ ++ reg = <2>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-2-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi0.0 ++ fragment@16 { ++ target = <&spi0>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_00: mcp23s17@0 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi0-0-present parameter */ ++ reg = <0>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi0-0-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi0.1 ++ fragment@17 { ++ target = <&spi0>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_01: mcp23s17@1 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi0-1-present parameter */ ++ reg = <1>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi0-1-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi1.0 ++ fragment@18 { ++ target = <&spi1>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_10: mcp23s17@0 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-0-present parameter */ ++ reg = <0>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-0-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi1.1 ++ fragment@19 { ++ target = <&spi1>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_11: mcp23s17@1 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-1-present parameter */ ++ reg = <1>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-1-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi1.2 ++ fragment@20 { ++ target = <&spi1>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_12: mcp23s17@2 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi1-2-present parameter */ ++ reg = <2>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-2-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi2.0 ++ fragment@21 { ++ target = <&spi2>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_20: mcp23s17@0 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-0-present parameter */ ++ reg = <0>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-0-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi2.1 ++ fragment@22 { ++ target = <&spi2>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_21: mcp23s17@1 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-1-present parameter */ ++ reg = <1>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-1-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // enable one or more mcp23s17s on spi2.2 ++ fragment@23 { ++ target = <&spi2>; ++ __dormant__ { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mcp23s17_22: mcp23s17@2 { ++ compatible = "microchip,mcp23s17"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ microchip,spi-present-mask = <0x00>; /* overwritten by mcp23s17-spi2-2-present parameter */ ++ reg = <2>; ++ spi-max-frequency = <500000>; ++ status = "okay"; ++ #interrupt-cells=<2>; ++ interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-2-int-gpio parameter */ ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi0.0 as a input with no pull-up/down ++ fragment@24 { ++ target = <&gpio>; ++ __dormant__ { ++ spi0_0_int_pins: spi0_0_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi0-0-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi0.1 as a input with no pull-up/down ++ fragment@25 { ++ target = <&gpio>; ++ __dormant__ { ++ spi0_1_int_pins: spi0_1_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi0-1-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi1.0 as a input with no pull-up/down ++ fragment@26 { ++ target = <&gpio>; ++ __dormant__ { ++ spi1_0_int_pins: spi1_0_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi1-0-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi1.1 as a input with no pull-up/down ++ fragment@27 { ++ target = <&gpio>; ++ __dormant__ { ++ spi1_1_int_pins: spi1_1_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi1-1-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi1.2 as a input with no pull-up/down ++ fragment@28 { ++ target = <&gpio>; ++ __dormant__ { ++ spi1_2_int_pins: spi1_2_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi1-2-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi2.0 as a input with no pull-up/down ++ fragment@29 { ++ target = <&gpio>; ++ __dormant__ { ++ spi2_0_int_pins: spi2_0_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi2-0-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi2.1 as a input with no pull-up/down ++ fragment@30 { ++ target = <&gpio>; ++ __dormant__ { ++ spi2_1_int_pins: spi2_1_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi2-1-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Configure GPIO pin connected to INT(A/B) output of mcp23s08/17 on spi2.2 as a input with no pull-up/down ++ fragment@31 { ++ target = <&gpio>; ++ __dormant__ { ++ spi2_2_int_pins: spi2_2_int_pins { ++ brcm,pins = <0>; /* overwritten by mcp23s08/17-spi2-2-int-gpio parameter */ ++ brcm,function = <0>; ++ brcm,pull = <0>; ++ }; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi0.0. ++ // Use default active low interrupt signalling. ++ fragment@32 { ++ target = <&mcp23s08_00>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi0.1. ++ // Use default active low interrupt signalling. ++ fragment@33 { ++ target = <&mcp23s08_01>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi1.0. ++ // Use default active low interrupt signalling. ++ fragment@34 { ++ target = <&mcp23s08_10>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi1.1. ++ // Use default active low interrupt signalling. ++ fragment@35 { ++ target = <&mcp23s08_11>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi1.2. ++ // Use default active low interrupt signalling. ++ fragment@36 { ++ target = <&mcp23s08_12>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi2.0. ++ // Use default active low interrupt signalling. ++ fragment@37 { ++ target = <&mcp23s08_20>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi2.1. ++ // Use default active low interrupt signalling. ++ fragment@38 { ++ target = <&mcp23s08_21>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s08 on spi2.2. ++ // Use default active low interrupt signalling. ++ fragment@39 { ++ target = <&mcp23s08_22>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi0.0. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Use default active low interrupt signalling. ++ fragment@40 { ++ target = <&mcp23s17_00>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi0.1. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Configure INTA/B outputs of mcp23s08/17 as active low. ++ fragment@41 { ++ target = <&mcp23s17_01>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi1.0. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Configure INTA/B outputs of mcp23s08/17 as active low. ++ fragment@42 { ++ target = <&mcp23s17_10>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi1.1. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Configure INTA/B outputs of mcp23s08/17 as active low. ++ fragment@43 { ++ target = <&mcp23s17_11>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi1.2. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Configure INTA/B outputs of mcp23s08/17 as active low. ++ fragment@44 { ++ target = <&mcp23s17_12>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi2.0. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Configure INTA/B outputs of mcp23s08/17 as active low. ++ fragment@45 { ++ target = <&mcp23s17_20>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi2.1. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Configure INTA/B outputs of mcp23s08/17 as active low. ++ fragment@46 { ++ target = <&mcp23s17_21>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ // Enable interrupts for a mcp23s17 on spi2.2. ++ // Enable mirroring so that either INTA or INTB output of mcp23s17 can be connected to the GPIO pin. ++ // Configure INTA/B outputs of mcp23s08/17 as active low. ++ fragment@47 { ++ target = <&mcp23s17_22>; ++ __dormant__ { ++ interrupt-parent = <&gpio>; ++ interrupt-controller; ++ microchip,irq-mirror; ++ }; ++ }; ++ ++ __overrides__ { ++ s08-spi0-0-present = <0>,"+0+8", <&mcp23s08_00>,"microchip,spi-present-mask:0"; ++ s08-spi0-1-present = <0>,"+1+9", <&mcp23s08_01>,"microchip,spi-present-mask:0"; ++ s08-spi1-0-present = <0>,"+2+10", <&mcp23s08_10>,"microchip,spi-present-mask:0"; ++ s08-spi1-1-present = <0>,"+3+11", <&mcp23s08_11>,"microchip,spi-present-mask:0"; ++ s08-spi1-2-present = <0>,"+4+12", <&mcp23s08_12>,"microchip,spi-present-mask:0"; ++ s08-spi2-0-present = <0>,"+5+13", <&mcp23s08_20>,"microchip,spi-present-mask:0"; ++ s08-spi2-1-present = <0>,"+6+14", <&mcp23s08_21>,"microchip,spi-present-mask:0"; ++ s08-spi2-2-present = <0>,"+7+15", <&mcp23s08_22>,"microchip,spi-present-mask:0"; ++ s17-spi0-0-present = <0>,"+0+16", <&mcp23s17_00>,"microchip,spi-present-mask:0"; ++ s17-spi0-1-present = <0>,"+1+17", <&mcp23s17_01>,"microchip,spi-present-mask:0"; ++ s17-spi1-0-present = <0>,"+2+18", <&mcp23s17_10>,"microchip,spi-present-mask:0"; ++ s17-spi1-1-present = <0>,"+3+19", <&mcp23s17_11>,"microchip,spi-present-mask:0"; ++ s17-spi1-2-present = <0>,"+4+20", <&mcp23s17_12>,"microchip,spi-present-mask:0"; ++ s17-spi2-0-present = <0>,"+5+21", <&mcp23s17_20>,"microchip,spi-present-mask:0"; ++ s17-spi2-1-present = <0>,"+6+22", <&mcp23s17_21>,"microchip,spi-present-mask:0"; ++ s17-spi2-2-present = <0>,"+7+23", <&mcp23s17_22>,"microchip,spi-present-mask:0"; ++ s08-spi0-0-int-gpio = <0>,"+24+32", <&spi0_0_int_pins>,"brcm,pins:0", <&mcp23s08_00>,"interrupts:0"; ++ s08-spi0-1-int-gpio = <0>,"+25+33", <&spi0_1_int_pins>,"brcm,pins:0", <&mcp23s08_01>,"interrupts:0"; ++ s08-spi1-0-int-gpio = <0>,"+26+34", <&spi1_0_int_pins>,"brcm,pins:0", <&mcp23s08_10>,"interrupts:0"; ++ s08-spi1-1-int-gpio = <0>,"+27+35", <&spi1_1_int_pins>,"brcm,pins:0", <&mcp23s08_11>,"interrupts:0"; ++ s08-spi1-2-int-gpio = <0>,"+28+36", <&spi1_2_int_pins>,"brcm,pins:0", <&mcp23s08_12>,"interrupts:0"; ++ s08-spi2-0-int-gpio = <0>,"+29+37", <&spi2_0_int_pins>,"brcm,pins:0", <&mcp23s08_20>,"interrupts:0"; ++ s08-spi2-1-int-gpio = <0>,"+30+38", <&spi2_1_int_pins>,"brcm,pins:0", <&mcp23s08_21>,"interrupts:0"; ++ s08-spi2-2-int-gpio = <0>,"+31+39", <&spi2_2_int_pins>,"brcm,pins:0", <&mcp23s08_22>,"interrupts:0"; ++ s17-spi0-0-int-gpio = <0>,"+24+40", <&spi0_0_int_pins>,"brcm,pins:0", <&mcp23s17_00>,"interrupts:0"; ++ s17-spi0-1-int-gpio = <0>,"+25+41", <&spi0_1_int_pins>,"brcm,pins:0", <&mcp23s17_01>,"interrupts:0"; ++ s17-spi1-0-int-gpio = <0>,"+26+42", <&spi1_0_int_pins>,"brcm,pins:0", <&mcp23s17_10>,"interrupts:0"; ++ s17-spi1-1-int-gpio = <0>,"+27+43", <&spi1_1_int_pins>,"brcm,pins:0", <&mcp23s17_11>,"interrupts:0"; ++ s17-spi1-2-int-gpio = <0>,"+28+44", <&spi1_2_int_pins>,"brcm,pins:0", <&mcp23s17_12>,"interrupts:0"; ++ s17-spi2-0-int-gpio = <0>,"+29+45", <&spi2_0_int_pins>,"brcm,pins:0", <&mcp23s17_20>,"interrupts:0"; ++ s17-spi2-1-int-gpio = <0>,"+30+46", <&spi2_1_int_pins>,"brcm,pins:0", <&mcp23s17_21>,"interrupts:0"; ++ s17-spi2-2-int-gpio = <0>,"+31+47", <&spi2_2_int_pins>,"brcm,pins:0", <&mcp23s17_22>,"interrupts:0"; ++ }; ++}; ++ diff --git a/target/linux/brcm2708/patches-4.4/0487-BCM270X_DT-Add-audio_pins-to-CM-dtb.patch b/target/linux/brcm2708/patches-4.4/0487-BCM270X_DT-Add-audio_pins-to-CM-dtb.patch new file mode 100644 index 0000000000..1f73e52198 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0487-BCM270X_DT-Add-audio_pins-to-CM-dtb.patch @@ -0,0 +1,24 @@ +From e34eb065a125fae5814256d77c03226a46083f87 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 19 Aug 2016 11:12:28 +0100 +Subject: [PATCH] BCM270X_DT: Add audio_pins to CM dtb + +Bring the CM .dtb in line with other others. +--- + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -35,6 +35,11 @@ + brcm,pins = <18 19 20 21>; + brcm,function = <4>; /* alt0 */ + }; ++ ++ audio_pins: audio_pins { ++ brcm,pins; ++ brcm,function; ++ }; + }; + + &spi0 { diff --git a/target/linux/brcm2708/patches-4.4/0488-BCM270X_DT-Don-t-enable-UART0-in-CM3-dtb.patch b/target/linux/brcm2708/patches-4.4/0488-BCM270X_DT-Don-t-enable-UART0-in-CM3-dtb.patch new file mode 100644 index 0000000000..f8a2be971a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0488-BCM270X_DT-Don-t-enable-UART0-in-CM3-dtb.patch @@ -0,0 +1,37 @@ +From ec662a26071a7aa2d7617ac366ce91beebaf2ad1 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 19 Aug 2016 11:19:02 +0100 +Subject: [PATCH] BCM270X_DT: Don't enable UART0 in CM3 dtb + +--- + arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 12 ------------ + 1 file changed, 12 deletions(-) + +--- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts +@@ -40,12 +40,6 @@ + brcm,function = <4>; /* alt0 */ + }; + +- uart0_pins: uart0_pins { +- brcm,pins; +- brcm,function; +- brcm,pull = <0 2>; +- }; +- + audio_pins: audio_pins { + brcm,pins; + brcm,function; +@@ -75,12 +69,6 @@ + status = "okay"; + }; + +-&uart0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&uart0_pins>; +- status = "okay"; +-}; +- + &spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins &spi0_cs_pins>; diff --git a/target/linux/brcm2708/patches-4.4/0489-overlays-Add-audremap-overlay.patch b/target/linux/brcm2708/patches-4.4/0489-overlays-Add-audremap-overlay.patch new file mode 100644 index 0000000000..e8d3976a29 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0489-overlays-Add-audremap-overlay.patch @@ -0,0 +1,56 @@ +From 612d9be3d6aa73b018005a182bd55a551abfc271 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 19 Aug 2016 11:26:57 +0100 +Subject: [PATCH] overlays: Add audremap overlay + +The audremap overlay switches the PWM audio outputs to GPIO pins +12 (L) and 13 (R). +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 ++++++ + arch/arm/boot/dts/overlays/audremap-overlay.dts | 14 ++++++++++++++ + 3 files changed, 21 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/audremap-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -18,6 +18,7 @@ dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo + dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo + dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo + dtbo-$(RPI_DT_OVERLAYS) += audioinjector-wm8731-audio.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += audremap.dtbo + dtbo-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dht11.dtbo + dtbo-$(RPI_DT_OVERLAYS) += dionaudio-loco.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -253,6 +253,12 @@ Load: dtoverlay=audioinjector-wm8731-a + Params: + + ++Name: audremap ++Info: Switches PWM sound output to pins 12 & 13 ++Load: dtoverlay=audremap ++Params: ++ ++ + Name: bmp085_i2c-sensor + Info: Configures the BMP085/BMP180 digital barometric pressure and temperature + sensors from Bosch Sensortec +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/audremap-overlay.dts +@@ -0,0 +1,14 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&audio_pins>; ++ __overlay__ { ++ brcm,pins = < 12 13 >; ++ brcm,function = < 4 >; /* alt0 alt0 */ ++ }; ++ }; ++}; diff --git a/target/linux/brcm2708/patches-4.4/0490-overlays-Add-swap_lr-and-enable_jack-to-audremap.patch b/target/linux/brcm2708/patches-4.4/0490-overlays-Add-swap_lr-and-enable_jack-to-audremap.patch new file mode 100644 index 0000000000..7261163354 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0490-overlays-Add-swap_lr-and-enable_jack-to-audremap.patch @@ -0,0 +1,50 @@ +From f8e026145de28acf5e36183f5c8b489bf172e9c8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 19 Aug 2016 15:39:01 +0100 +Subject: [PATCH] overlays: Add swap_lr and enable_jack to audremap + +swap_lr causes the channels to be reversed, and enable_jack prevents the +headphone output from being disabled. + +See: https://github.com/raspberrypi/linux/issues/1473 +--- + arch/arm/boot/dts/overlays/README | 9 ++++++--- + arch/arm/boot/dts/overlays/audremap-overlay.dts | 7 ++++++- + 2 files changed, 12 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -254,9 +254,12 @@ Params: + + + Name: audremap +-Info: Switches PWM sound output to pins 12 & 13 +-Load: dtoverlay=audremap +-Params: ++Info: Switches PWM sound output to pins 12 (Right) & 13 (Left) ++Load: dtoverlay=audremap,= ++Params: swap_lr Reverse the channel allocation, which will also ++ swap the audio jack outputs (default off) ++ enable_jack Don't switch off the audio jack output ++ (default off) + + + Name: bmp085_i2c-sensor +--- a/arch/arm/boot/dts/overlays/audremap-overlay.dts ++++ b/arch/arm/boot/dts/overlays/audremap-overlay.dts +@@ -6,9 +6,14 @@ + + fragment@0 { + target = <&audio_pins>; +- __overlay__ { ++ frag0: __overlay__ { + brcm,pins = < 12 13 >; + brcm,function = < 4 >; /* alt0 alt0 */ + }; + }; ++ ++ __overrides__ { ++ swap_lr = <&frag0>, "swap_lr?"; ++ enable_jack = <&frag0>, "enable_jack?"; ++ }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0491-overlays-Clarify-gpio-poweroff-semantics-in-README.patch b/target/linux/brcm2708/patches-4.4/0491-overlays-Clarify-gpio-poweroff-semantics-in-README.patch new file mode 100644 index 0000000000..915c9983b8 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0491-overlays-Clarify-gpio-poweroff-semantics-in-README.patch @@ -0,0 +1,24 @@ +From 5b3a11f39bb1b0f9b43044c8109bd6a19b92cebe Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 22 Aug 2016 11:56:04 +0100 +Subject: [PATCH] overlays: Clarify gpio-poweroff semantics in README + +1) GPIO pin is signalled on poweroff, not reboot. +2) In RPi kernels, halt is equivalent to poweroff. + +See: https://github.com/raspberrypi/linux/issues/1600 +--- + arch/arm/boot/dts/overlays/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -340,7 +340,7 @@ Params: gpio_pin Input pi + + + Name: gpio-poweroff +-Info: Drives a GPIO high or low on reboot ++Info: Drives a GPIO high or low on poweroff (including halt) + Load: dtoverlay=gpio-poweroff,= + Params: gpiopin GPIO for signalling (default 26) + diff --git a/target/linux/brcm2708/patches-4.4/0492-overlays-added-sc16is750-UART-over-I2C-1617.patch b/target/linux/brcm2708/patches-4.4/0492-overlays-added-sc16is750-UART-over-I2C-1617.patch new file mode 100644 index 0000000000..db88579917 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0492-overlays-added-sc16is750-UART-over-I2C-1617.patch @@ -0,0 +1,81 @@ +From 2de4b29019b167f079ea48e30d641f7d0370bf08 Mon Sep 17 00:00:00 2001 +From: Georgii Staroselskii +Date: Tue, 23 Aug 2016 17:40:05 +0400 +Subject: [PATCH] overlays: added sc16is750 UART over I2C (#1617) + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 10 ++++++ + .../boot/dts/overlays/sc16is750-i2c-overlay.dts | 37 ++++++++++++++++++++++ + 3 files changed, 48 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts + +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -75,6 +75,7 @@ dtbo-$(RPI_DT_OVERLAYS) += rpi-ft5406.dt + dtbo-$(RPI_DT_OVERLAYS) += rpi-proto.dtbo + dtbo-$(RPI_DT_OVERLAYS) += rpi-sense.dtbo + dtbo-$(RPI_DT_OVERLAYS) += rra-digidac1-wm8741-audio.dtbo ++dtbo-$(RPI_DT_OVERLAYS) += sc16is750-i2c.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sc16is752-spi1.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdhost.dtbo + dtbo-$(RPI_DT_OVERLAYS) += sdio.dtbo +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -935,6 +935,16 @@ Load: dtoverlay=rra-digidac1-wm8741-au + Params: + + ++Name: sc16is750-i2c ++Info: Overlay for the NXP SC16IS750 UART with I2C Interface ++ Enables the chip on I2C1 at 0x48. To select another address, ++ please refer to table 10 in reference manual. ++ ++Load: dtoverlay=sc16is750-i2c,= ++Params: int_pin GPIO used for IRQ (default 24) ++ addr Address (default 0x48) ++ ++ + Name: sc16is752-spi1 + Info: Overlay for the NXP SC16IS752 Dual UART with SPI Interface + Enables the chip on SPI1. +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts +@@ -0,0 +1,37 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ sc16is750: sc16is750@48 { ++ compatible = "nxp,sc16is750"; ++ reg = <0x48>; /* address */ ++ clocks = <&sc16is750_clk>; ++ interrupt-parent = <&gpio>; ++ interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */ ++ #gpio-cells = <2>; ++ ++ sc16is750_clk: sc16is750_clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <14745600>; ++ }; ++ }; ++ }; ++ }; ++ ++ ++ __overrides__ { ++ int_pin = <&sc16is750>,"interrupts:0"; ++ addr = <&sc16is750>,"reg:0"; ++ }; ++ ++}; diff --git a/target/linux/brcm2708/patches-4.4/0493-Bluetooth-Fix-l2cap_sock_setsockopt-with-optname-BT_.patch b/target/linux/brcm2708/patches-4.4/0493-Bluetooth-Fix-l2cap_sock_setsockopt-with-optname-BT_.patch new file mode 100644 index 0000000000..a5062975e1 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0493-Bluetooth-Fix-l2cap_sock_setsockopt-with-optname-BT_.patch @@ -0,0 +1,33 @@ +From 2b3cf031dfcef6f4fc803ae451364c70482404a8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= + +Date: Thu, 14 Jul 2016 10:50:23 +0200 +Subject: [PATCH] Bluetooth: Fix l2cap_sock_setsockopt() with optname BT_RCVMTU +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 23bc6ab0a0912146fd674a0becc758c3162baabc upstream. + +When we retrieve imtu value from userspace we should use 16 bit pointer +cast instead of 32 as it's defined that way in headers. Fixes setsockopt +calls on big-endian platforms. + +Signed-off-by: Amadeusz Sławiński +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/l2cap_sock.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/bluetooth/l2cap_sock.c ++++ b/net/bluetooth/l2cap_sock.c +@@ -817,7 +817,7 @@ static int l2cap_sock_setsockopt(struct + break; + } + +- if (get_user(opt, (u32 __user *) optval)) { ++ if (get_user(opt, (u16 __user *) optval)) { + err = -EFAULT; + break; + } diff --git a/target/linux/brcm2708/patches-4.4/0494-config-Add-CONFIG_IPVLAN-module.patch b/target/linux/brcm2708/patches-4.4/0494-config-Add-CONFIG_IPVLAN-module.patch new file mode 100644 index 0000000000..a585a58893 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0494-config-Add-CONFIG_IPVLAN-module.patch @@ -0,0 +1,30 @@ +From 0ae26a9c13742759f83f94678e23a4b1ff87c92e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 23 Aug 2016 14:07:29 +0100 +Subject: [PATCH] config: Add CONFIG_IPVLAN module + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -448,6 +448,7 @@ CONFIG_BONDING=m + CONFIG_DUMMY=m + CONFIG_IFB=m + CONFIG_MACVLAN=m ++CONFIG_IPVLAN=m + CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -441,6 +441,7 @@ CONFIG_BONDING=m + CONFIG_DUMMY=m + CONFIG_IFB=m + CONFIG_MACVLAN=m ++CONFIG_IPVLAN=m + CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m diff --git a/target/linux/brcm2708/patches-4.4/0495-config-Add-CONFIG_VXLAN-module.patch b/target/linux/brcm2708/patches-4.4/0495-config-Add-CONFIG_VXLAN-module.patch new file mode 100644 index 0000000000..7993c9277f --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0495-config-Add-CONFIG_VXLAN-module.patch @@ -0,0 +1,30 @@ +From 77861bfabc7b84513c6ccbbd2efbeaaca8e7e022 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 23 Aug 2016 14:08:55 +0100 +Subject: [PATCH] config: Add CONFIG_VXLAN module + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -449,6 +449,7 @@ CONFIG_DUMMY=m + CONFIG_IFB=m + CONFIG_MACVLAN=m + CONFIG_IPVLAN=m ++CONFIG_VXLAN=m + CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -442,6 +442,7 @@ CONFIG_DUMMY=m + CONFIG_IFB=m + CONFIG_MACVLAN=m + CONFIG_IPVLAN=m ++CONFIG_VXLAN=m + CONFIG_NETCONSOLE=m + CONFIG_TUN=m + CONFIG_VETH=m diff --git a/target/linux/brcm2708/patches-4.4/0496-Fixes-i2c_bcm2708-Write-to-FIFO-correctly-v2-1574.patch b/target/linux/brcm2708/patches-4.4/0496-Fixes-i2c_bcm2708-Write-to-FIFO-correctly-v2-1574.patch new file mode 100644 index 0000000000..da46d86f09 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0496-Fixes-i2c_bcm2708-Write-to-FIFO-correctly-v2-1574.patch @@ -0,0 +1,48 @@ +From 1b6ee2ac8f1d55cb7ceeaa606e3d4868cfde363d Mon Sep 17 00:00:00 2001 +From: Simon Maes +Date: Mon, 29 Aug 2016 21:11:01 +0200 +Subject: [PATCH] Fixes i2c_bcm2708: Write to FIFO correctly - v2 (#1574) + +* i2c: fix i2c_bcm2708: Clear FIFO before sending data + +Make sure FIFO gets cleared before trying to send +data in case of a repeated start (COMBINED=Y). + +* i2c: fix i2c_bcm2708: Only write to FIFO when not full + +Check if FIFO can accept data before writing. +To avoid a peripheral read on the last iteration of a loop, +both bcm2708_bsc_fifo_fill and ~drain are changed as well. +--- + drivers/i2c/busses/i2c-bcm2708.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -115,13 +115,13 @@ static inline void bcm2708_bsc_reset(str + + static inline void bcm2708_bsc_fifo_drain(struct bcm2708_i2c *bi) + { +- while ((bcm2708_rd(bi, BSC_S) & BSC_S_RXD) && (bi->pos < bi->msg->len)) ++ while ((bi->pos < bi->msg->len) && (bcm2708_rd(bi, BSC_S) & BSC_S_RXD)) + bi->msg->buf[bi->pos++] = bcm2708_rd(bi, BSC_FIFO); + } + + static inline void bcm2708_bsc_fifo_fill(struct bcm2708_i2c *bi) + { +- while ((bcm2708_rd(bi, BSC_S) & BSC_S_TXD) && (bi->pos < bi->msg->len)) ++ while ((bi->pos < bi->msg->len) && (bcm2708_rd(bi, BSC_S) & BSC_S_TXD)) + bcm2708_wr(bi, BSC_FIFO, bi->msg->buf[bi->pos++]); + } + +@@ -155,6 +155,10 @@ static inline int bcm2708_bsc_setup(stru + if ( (bi->nmsgs > 1) && + !(bi->msg[0].flags & I2C_M_RD) && (bi->msg[1].flags & I2C_M_RD) && + (bi->msg[0].addr == bi->msg[1].addr) && (bi->msg[0].len <= 16)) { ++ ++ /* Clear FIFO */ ++ bcm2708_wr(bi, BSC_C, BSC_C_CLEAR_1); ++ + /* Fill FIFO with entire write message (16 byte FIFO) */ + while (bi->pos < bi->msg->len) { + bcm2708_wr(bi, BSC_FIFO, bi->msg->buf[bi->pos++]); diff --git a/target/linux/brcm2708/patches-4.4/0497-bcm2835-sdhost-Don-t-exit-cmd-wait-loop-on-error.patch b/target/linux/brcm2708/patches-4.4/0497-bcm2835-sdhost-Don-t-exit-cmd-wait-loop-on-error.patch new file mode 100644 index 0000000000..564b65d89c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0497-bcm2835-sdhost-Don-t-exit-cmd-wait-loop-on-error.patch @@ -0,0 +1,63 @@ +From 0ca1a9040cff3ace3d7fce5cdd83f1cbaa8da50c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 2 Sep 2016 17:21:42 +0100 +Subject: [PATCH] bcm2835-sdhost: Don't exit cmd wait loop on error + +The FAIL flag can be set in the CMD register before command processing +is complete, leading to spurious "failed to complete" errors. This has +the effect of promoting harmless CRC7 errors during CMD1 processing +into errors that can delay and even prevent booting. + +Also: +1) Convert the last KERN_ERROR message in the register dumping to + KERN_INFO. +2) Remove an unnecessary reset call from bcm2835_sdhost_add_host. + +See: https://github.com/raspberrypi/linux/pull/1492 + +Signed-off-by: Phil Elwell +--- + drivers/mmc/host/bcm2835-sdhost.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -373,7 +373,7 @@ static void bcm2835_sdhost_dumpregs(stru + pr_info("%s: SDRSP2 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP2)); +- pr_err("%s: SDRSP3 0x%08x\n", ++ pr_info("%s: SDRSP3 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP3)); + pr_info("%s: SDHSTS 0x%08x\n", +@@ -1183,9 +1183,8 @@ static void bcm2835_sdhost_finish_comman + retries = 1; // We've already waited long enough this time + } + +- retries = host->cmd_quick_poll_retries; + for (sdcmd = bcm2835_sdhost_read(host, SDCMD); +- (sdcmd & SDCMD_NEW_FLAG) && !(sdcmd & SDCMD_FAIL_FLAG) && retries; ++ (sdcmd & SDCMD_NEW_FLAG) && retries; + retries--) { + cpu_relax(); + sdcmd = bcm2835_sdhost_read(host, SDCMD); +@@ -1208,8 +1207,7 @@ static void bcm2835_sdhost_finish_comman + usleep_range(1, 10); + spin_lock_irqsave(&host->lock, *irq_flags); + sdcmd = bcm2835_sdhost_read(host, SDCMD); +- if (!(sdcmd & SDCMD_NEW_FLAG) || +- (sdcmd & SDCMD_FAIL_FLAG)) ++ if (!(sdcmd & SDCMD_NEW_FLAG)) + break; + } + } +@@ -1892,8 +1890,6 @@ int bcm2835_sdhost_add_host(struct bcm28 + + mmc = host->mmc; + +- bcm2835_sdhost_reset_internal(host); +- + mmc->f_max = host->max_clk; + mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV; + diff --git a/target/linux/brcm2708/patches-4.4/0498-BCM270X_DT-Use-bcm2835-sdhost-on-Compute-Module.patch b/target/linux/brcm2708/patches-4.4/0498-BCM270X_DT-Use-bcm2835-sdhost-on-Compute-Module.patch new file mode 100644 index 0000000000..bb2895c576 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0498-BCM270X_DT-Use-bcm2835-sdhost-on-Compute-Module.patch @@ -0,0 +1,30 @@ +From 6288d4a7b700cbb8c1c72210c9b2017cf8bc7dd2 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 2 Sep 2016 14:35:37 +0100 +Subject: [PATCH] BCM270X_DT: Use bcm2835-sdhost on Compute Module + +With the preceding commit: + + bcm2835-sdhost: Don't exit cmd wait loop on error + +it is safe to use the bcm2835-sdhost driver on the Compute Module. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +@@ -23,9 +23,9 @@ + }; + + +-&mmc { ++&sdhost { + pinctrl-names = "default"; +- pinctrl-0 = <&mmc_pins>; ++ pinctrl-0 = <&sdhost_pins>; + non-removable; + bus-width = <4>; + status = "okay"; diff --git a/target/linux/brcm2708/patches-4.4/0499-fbmem-Ensure-that-parameters-are-properly-checked-wi.patch b/target/linux/brcm2708/patches-4.4/0499-fbmem-Ensure-that-parameters-are-properly-checked-wi.patch new file mode 100644 index 0000000000..186f29bef2 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0499-fbmem-Ensure-that-parameters-are-properly-checked-wi.patch @@ -0,0 +1,27 @@ +From 7c8c6f113e1169690dbfbfc486360d10452e5a85 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 7 Sep 2016 16:57:59 +0100 +Subject: [PATCH] fbmem: Ensure that parameters are properly checked within + fb_copyarea_user + +--- + drivers/video/fbdev/core/fbmem.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/video/fbdev/core/fbmem.c ++++ b/drivers/video/fbdev/core/fbmem.c +@@ -1090,7 +1090,13 @@ static int fb_copyarea_user(struct fb_in + int ret = 0; + if (!lock_fb_info(info)) + return -ENODEV; +- if (copy->dx + copy->width > info->var.xres || ++ if (copy->dx >= info->var.xres || ++ copy->sx >= info->var.xres || ++ copy->width > info->var.xres || ++ copy->dy >= info->var.yres || ++ copy->sy >= info->var.yres || ++ copy->height > info->var.yres || ++ copy->dx + copy->width > info->var.xres || + copy->sx + copy->width > info->var.xres || + copy->dy + copy->height > info->var.yres || + copy->sy + copy->height > info->var.yres) { diff --git a/target/linux/brcm2708/patches-4.4/0500-config-Enabled-SENSORS_INA2XX-module.patch b/target/linux/brcm2708/patches-4.4/0500-config-Enabled-SENSORS_INA2XX-module.patch new file mode 100644 index 0000000000..49e637e498 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0500-config-Enabled-SENSORS_INA2XX-module.patch @@ -0,0 +1,30 @@ +From a2aac70ca118d0a4cc7321cfcc4bf7884dd4208c Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 9 Sep 2016 19:35:13 +0100 +Subject: [PATCH] config: Enabled SENSORS_INA2XX module + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -649,6 +649,7 @@ CONFIG_HWMON=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m ++CONFIG_SENSORS_INA2XX=m + CONFIG_THERMAL=y + CONFIG_THERMAL_BCM2835=y + CONFIG_WATCHDOG=y +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -641,6 +641,7 @@ CONFIG_HWMON=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m ++CONFIG_SENSORS_INA2XX=m + CONFIG_THERMAL=y + CONFIG_THERMAL_BCM2835=y + CONFIG_WATCHDOG=y