From: John Crispin Date: Thu, 25 Feb 2016 10:14:01 +0000 (+0000) Subject: brcm2708: switch to linux 4.4 and update patches X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b3dc9566a46efa67951ff6ae28e4397da9db92af;p=openwrt%2Fstaging%2Fkaloz.git brcm2708: switch to linux 4.4 and update patches As usual these patches were extracted from: https://github.com/raspberrypi/linux/commits/rpi-4.4.y Signed-off-by: Álvaro Fernández Rojas SVN-Revision: 48765 --- diff --git a/target/linux/brcm2708/Makefile b/target/linux/brcm2708/Makefile index 0c3cee5701..f26da4f9db 100644 --- a/target/linux/brcm2708/Makefile +++ b/target/linux/brcm2708/Makefile @@ -14,7 +14,7 @@ FEATURES:=ext4 audio usb usbgadget display gpio fpu MAINTAINER:=Florian Fainelli SUBTARGETS:=bcm2708 bcm2709 -KERNEL_PATCHVER:=4.1 +KERNEL_PATCHVER:=4.4 include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += brcm2708-gpu-fw kmod-usb-hid kmod-sound-core kmod-sound-arm-bcm2835 kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 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 48cb8132aa..38f237ff8c 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 8c2c0f30ef9ee0eccd3e56c6aeb110097569d5aa Mon Sep 17 00:00:00 2001 +From e01f4314ca3bad1a9e6e75011e096b2e7c9ae9c1 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/127] smsx95xx: fix crimes against truesize +Subject: [PATCH 001/156] 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 185da76159..39a776510e 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 96f6fc6f990423f39b73013cd91f00a615315a90 Mon Sep 17 00:00:00 2001 +From 53c281914c7bb489a5dba2559bdbbdbdc25bd515 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 002/127] smsc95xx: Disable turbo mode by default +Subject: [PATCH 002/156] 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 4361b544ce..c3f30fa1a7 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,7 +1,7 @@ -From 3ea06ff9ba42a29f37b46ced2fb90ff9e06da445 Mon Sep 17 00:00:00 2001 +From 570a13246efbcaf5f0952f8b2382166ab7677f7d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 003/127] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 003/156] vmstat: Workaround for issue where dirty page count goes negative See: 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 1b4a0867be..6542217b0c 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 6c72a609c205138b739a1484aa1a4ce6dd395c43 Mon Sep 17 00:00:00 2001 +From 030a4127de50633f29388f7cc5170537baa8a46b Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 004/127] BCM2835_DT: Fix I2S register map +Subject: [PATCH 004/156] 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 a0dc4e7261..59c65dd0e8 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,7 +1,7 @@ -From 38395f1ae1258743c3e0081c86bb4b65ad06dd69 Mon Sep 17 00:00:00 2001 +From 0e31e724041c5aa97de901e88eb889697605a543 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 005/127] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 005/156] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the 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 28ba48b34c..79e337b881 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 44b5e890373665231d9a5876966ef3a670b9efd7 Mon Sep 17 00:00:00 2001 +From 05e41ed8765557174e13c868e6bdead409452b9a 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/127] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 006/156] 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 9fa768ca9b..dd99a22f98 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 e3e8c56abfe6a036025f75908b63ae69d8eaed11 Mon Sep 17 00:00:00 2001 +From f5c7fd23e80638ed98babafb2c7d97df569e2bce 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/127] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 007/156] 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 46bc447a88..ed035d219c 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 4bff078f28e6a2d55d18e06c0a92b0b78b8ea6cb Mon Sep 17 00:00:00 2001 +From 4db60442326172e590b3c34ab5f75f1359d42ec8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 008/127] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 008/156] 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 96381b6154..7b701bfd02 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,7 +1,7 @@ -From 91ea61bbf9285586d27442dc3b85ea34805ccf38 Mon Sep 17 00:00:00 2001 +From e1239426241dc0af5bf9c7eb25b3b5b91f8072f2 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 009/127] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 009/156] 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 c3a051fdf2..45bf009839 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,7 +1,7 @@ -From 15367f46e17775c4d736ed1cfc318218362c6a4d Mon Sep 17 00:00:00 2001 +From 0b7c13febba234187396a3a9a5af92e20deeab88 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 010/127] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 010/156] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has 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 0ef4ba2a84..3e751bda70 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,7 +1,7 @@ -From 167da31b9a7d3111c83993e4d614bb95bbefdcbb Mon Sep 17 00:00:00 2001 +From a5cbd1b6abdf86be640d0f312e69046c3e4907f8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 011/127] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 011/156] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting 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 73e27817b3..d9aeadc5a8 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 bc9d2c297e886dfcc340414a61de970942ad7319 Mon Sep 17 00:00:00 2001 +From dd2680dc2e5fd417101093c6618cc5c14ad8f949 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 012/127] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 012/156] 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 e2b55b654d..4244563271 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 e04c4837cde13f4782fc5a274599f580d8a29715 Mon Sep 17 00:00:00 2001 +From 95d71f47cc485c5d0030291b9388bbdbdc335437 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/127] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 013/156] 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 0c36bda8bf..d1138538de 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 c8225021ad8a8e8d2b4560bed644c5552f9f6684 Mon Sep 17 00:00:00 2001 +From 5d6a70aac1ff4f0c898131100599340c1c3aba25 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 16:44:05 +0200 -Subject: [PATCH 014/127] bcm2835-i2s: get base address for DMA from devicetree +Subject: [PATCH 014/156] 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 b6273271e1..f7e4711e11 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,7 +1,7 @@ -From 328b2e8b8a38fe62431c2ad5ae22cee31740b10d Mon Sep 17 00:00:00 2001 +From e7f330a7e837e0d6e31cb85dbaeace60ebd8cad1 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:21:16 +0200 -Subject: [PATCH 015/127] bcm2835-i2s: add 24bit support, update bclk_ratio to +Subject: [PATCH 015/156] 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 e096656335..33746cc449 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 fce554c6331b34458db54722cb06eb517a32b305 Mon Sep 17 00:00:00 2001 +From 19ed56e06d7b9342227ccf5942471d3c265a1685 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:25:51 +0200 -Subject: [PATCH 016/127] bcm2835-i2s: setup clock only if CPU is clock master +Subject: [PATCH 016/156] 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 1caa347237..a7277ce14d 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 45995262bd8d5194e9430d2a826c84ed28c408eb Mon Sep 17 00:00:00 2001 +From cdc4ea613c38dc44e44dabba95b2eb594c22cd29 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:49:51 +0200 -Subject: [PATCH 017/127] bcm2835-i2s: Eliminate debugfs directory error +Subject: [PATCH 017/156] 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 eeb7d61b5d..13b6785680 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 b58d4ef09eca4674d1530f0c8e1ca074b269ebea Mon Sep 17 00:00:00 2001 +From f74c822d357e64c2da9d116a532bd581522efc06 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:35:20 +0200 -Subject: [PATCH 018/127] bcm2835-i2s: Register PCM device +Subject: [PATCH 018/156] 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 c422cc7224..4ea245b732 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 61f155e164c5dbfa5cec9a099e4aa802c2155423 Mon Sep 17 00:00:00 2001 +From 72e07a497854cf8f63ffafc84e016ed859cb7d31 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 15:55:21 +0200 -Subject: [PATCH 019/127] bcm2835-i2s: Enable MMAP support via a DT property +Subject: [PATCH 019/156] 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 c49e4826af..6da23d4fe1 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 780a1039ccfd293d583742a4f2326997b15f5aff Mon Sep 17 00:00:00 2001 +From 79923137826ff02cad3536d7984626065f42ce6d 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/127] dmaengine: bcm2835: Add slave dma support +Subject: [PATCH 020/156] 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 1e562ce8f6..7b41e9252d 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 6ff0d626e7d84df71f6bc75e2c5ed35c42858bcc Mon Sep 17 00:00:00 2001 +From b6906312ccc7e18a0d8608c1d1bc318ab6f84656 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/127] dmaengine: bcm2835: set residue_granularity field +Subject: [PATCH 021/156] 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 e3c9595423..59a7d2810a 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,7 +1,7 @@ -From 16dc5e0535e48ce3e9c6995c87118e9e7b5b775a Mon Sep 17 00:00:00 2001 +From 53fcf558378cab445edc70a2a03a4ec7e1498107 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/127] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 022/156] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 42cf9fd795..ae6c222534 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 50eef5c715b894683aebf81332c82426dc10f8cb Mon Sep 17 00:00:00 2001 +From a8f6a0a5ad90dd940fffcd73311abb1aae8acfcc Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sat, 10 Oct 2015 12:29:18 +0200 -Subject: [PATCH 023/127] bcm2835-dma: Fix dreq not set for slave transfers +Subject: [PATCH 023/156] 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 4461fec7a9..b34657103e 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,7 +1,7 @@ -From c7e464c38d38ad59899c94dfad6c3455c18f7d76 Mon Sep 17 00:00:00 2001 +From 0ab04f220a909d20f991f3392d65aceb0ec7e774 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 11 Oct 2015 12:28:30 +0200 -Subject: [PATCH 024/127] bcm2835-dma: Limit cyclic transfers on lite channels +Subject: [PATCH 024/156] bcm2835-dma: Limit cyclic transfers on lite channels to 32k Transfers larger than 32k cause repeated clicking with I2S soundcards. 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 cd7f242f5a..1703ac4745 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 34cb40cb97cd3080d3d0f314b2b063939b90c069 Mon Sep 17 00:00:00 2001 +From 71b7745f15495d3f9fd59be9e5789c18581d60a0 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/127] bcm2835: Add support for uart1 +Subject: [PATCH 025/156] 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 8bd7be9a25..1701234579 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 40946ea47dd52c827b30d3601f7b393c46fbfcf3 Mon Sep 17 00:00:00 2001 +From e289839705c709e9c4479566cef5605466f6a648 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/127] firmware: bcm2835: Add missing property tags +Subject: [PATCH 026/156] 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 56120c6ca2..7a4c34dae9 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 75ae3f717d7598a6eb1582097923ee0838a02a8b Mon Sep 17 00:00:00 2001 +From e6b5eb84f3342be4dd3838279802b43521cd419f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 027/127] Main bcm2708/bcm2709 linux port +Subject: [PATCH 027/156] 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 53fc54507a..707d8ce926 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 ceefa4e6b0d4b529eed6666120674cccde24d59a Mon Sep 17 00:00:00 2001 +From eb50bdd77b032b204591287bd7b5881ab31162a3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 11 Nov 2015 21:01:15 +0000 -Subject: [PATCH 028/127] squash: include ARCH_BCM2708 / ARCH_BCM2709 +Subject: [PATCH 028/156] 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 ee8c4fa4a1..909cffe8ad 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 3fa74ccc327ddeb8f718cf4c42d61b43cc0a9626 Mon Sep 17 00:00:00 2001 +From 9a08cd1f14fd6e6797ddf99303175088bdb0ff90 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 029/127] Add dwc_otg driver +Subject: [PATCH 029/156] 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 cfebca260e..598cf5f718 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 fdf40ab8630e6a5a370b8d938957709f6f8f8324 Mon Sep 17 00:00:00 2001 +From 5722cc32ff8ec100e2f0490d4b94a257085871ff Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 030/127] bcm2708 framebuffer driver +Subject: [PATCH 030/156] 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 38d70d923f..536f77c01f 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 51d9f11052d8e51931b1c5f816d737e64e1caa22 Mon Sep 17 00:00:00 2001 +From 04c9e1905ed9aae6208650d81c26baa142fc9e7c Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 031/127] dmaengine: Add support for BCM2708 +Subject: [PATCH 031/156] 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-Add-blk_pos-parameter-to-mmc-multi_io_quirk-callback.patch b/target/linux/brcm2708/patches-4.4/0032-Add-blk_pos-parameter-to-mmc-multi_io_quirk-callback.patch index 9e697e882f..269a7be61e 100644 --- a/target/linux/brcm2708/patches-4.4/0032-Add-blk_pos-parameter-to-mmc-multi_io_quirk-callback.patch +++ b/target/linux/brcm2708/patches-4.4/0032-Add-blk_pos-parameter-to-mmc-multi_io_quirk-callback.patch @@ -1,7 +1,7 @@ -From 664c65e9a1191f4123b3d88595735d9ab56839e6 Mon Sep 17 00:00:00 2001 +From 8883ad2926f389ee00f33ef52b1a8d7ecdad085f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 032/127] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 032/156] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0033-MMC-added-alternative-MMC-driver.patch b/target/linux/brcm2708/patches-4.4/0033-MMC-added-alternative-MMC-driver.patch index c0ae1a23cc..e42602cf9a 100644 --- a/target/linux/brcm2708/patches-4.4/0033-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0033-MMC-added-alternative-MMC-driver.patch @@ -1,7 +1,7 @@ -From d44fe69d1a40ccd48ca963476ae6a1d4378349fd Mon Sep 17 00:00:00 2001 +From 118e1dbbd1a750304eaf53ed97f05ee86e6f4d52 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 033/127] MMC: added alternative MMC driver +Subject: [PATCH 033/156] 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/0034-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch b/target/linux/brcm2708/patches-4.4/0034-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch index c53bea399e..4e4a548ca5 100644 --- a/target/linux/brcm2708/patches-4.4/0034-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch +++ b/target/linux/brcm2708/patches-4.4/0034-Adding-bcm2835-sdhost-driver-and-an-overlay-to-enabl.patch @@ -1,7 +1,7 @@ -From 9fccc853c4977f9a125de717e7eee0f25895362e Mon Sep 17 00:00:00 2001 +From d29928fd47f28cf8ee0221c4979da984203503a1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 034/127] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 034/156] 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/0035-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch b/target/linux/brcm2708/patches-4.4/0035-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch index f41db1a98e..b825c7a241 100644 --- a/target/linux/brcm2708/patches-4.4/0035-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch +++ b/target/linux/brcm2708/patches-4.4/0035-cma-Add-vc_cma-driver-to-enable-use-of-CMA.patch @@ -1,7 +1,7 @@ -From 596a45736af7c7721bd7b8a9cbd04cbcd6c11b53 Mon Sep 17 00:00:00 2001 +From c6f15fd48c94d179e6e829cee2c36c2b4dc9a07d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 035/127] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 035/156] 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/0036-bcm2708-alsa-sound-driver.patch b/target/linux/brcm2708/patches-4.4/0036-bcm2708-alsa-sound-driver.patch index 47cb91207a..57d4ba0dad 100644 --- a/target/linux/brcm2708/patches-4.4/0036-bcm2708-alsa-sound-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0036-bcm2708-alsa-sound-driver.patch @@ -1,7 +1,7 @@ -From d3e64892070a0399dad4cdae9e72bb9c7801b86d Mon Sep 17 00:00:00 2001 +From 26d9897700046c008240842bafec44eed727df89 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 036/127] bcm2708: alsa sound driver +Subject: [PATCH 036/156] 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/0037-bcm2708-vchiq-driver.patch b/target/linux/brcm2708/patches-4.4/0037-bcm2708-vchiq-driver.patch index b2c3ee0c67..554fdc7775 100644 --- a/target/linux/brcm2708/patches-4.4/0037-bcm2708-vchiq-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0037-bcm2708-vchiq-driver.patch @@ -1,7 +1,7 @@ -From 01551caa3e4d71d3a75703b063a871f18541f38d Mon Sep 17 00:00:00 2001 +From ad0b56e0e4c45cbc6014f6befcb53ffc05dff857 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 037/127] bcm2708 vchiq driver +Subject: [PATCH 037/156] 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/0038-vc_mem-Add-vc_mem-driver.patch b/target/linux/brcm2708/patches-4.4/0038-vc_mem-Add-vc_mem-driver.patch index f7cc213b68..3a02267d53 100644 --- a/target/linux/brcm2708/patches-4.4/0038-vc_mem-Add-vc_mem-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0038-vc_mem-Add-vc_mem-driver.patch @@ -1,7 +1,7 @@ -From bb0a865b1cbbb1dd887378111af03727884e3476 Mon Sep 17 00:00:00 2001 +From 431b30a19d76bc784aa609481c43121092b81f86 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 038/127] vc_mem: Add vc_mem driver +Subject: [PATCH 038/156] 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/0039-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch b/target/linux/brcm2708/patches-4.4/0039-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch index a67c9b210f..2298b68f45 100644 --- a/target/linux/brcm2708/patches-4.4/0039-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch +++ b/target/linux/brcm2708/patches-4.4/0039-vcsm-VideoCore-shared-memory-service-for-BCM2835.patch @@ -1,7 +1,7 @@ -From 40793263e733bd6fa4b2a063891661ae59076430 Mon Sep 17 00:00:00 2001 +From d70f57c3da95fc54dfd702cb3d521cc3a9cc9850 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 039/127] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 039/156] 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/0040-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch b/target/linux/brcm2708/patches-4.4/0040-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch index cf964e1b8f..240aab9530 100644 --- a/target/linux/brcm2708/patches-4.4/0040-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch +++ b/target/linux/brcm2708/patches-4.4/0040-Add-dev-gpiomem-device-for-rootless-user-GPIO-access.patch @@ -1,7 +1,7 @@ -From 6ddd3a6f0a8a3e4506b4fe4e1b410d9d945c5df2 Mon Sep 17 00:00:00 2001 +From a582dfc468cbb9176054bdcc02dce40a0e0441e6 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 040/127] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 040/156] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren diff --git a/target/linux/brcm2708/patches-4.4/0041-Add-SMI-driver.patch b/target/linux/brcm2708/patches-4.4/0041-Add-SMI-driver.patch index 7075ddb586..a0da87a748 100644 --- a/target/linux/brcm2708/patches-4.4/0041-Add-SMI-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0041-Add-SMI-driver.patch @@ -1,7 +1,7 @@ -From 9e50bbd976d3c77770fe98e7e1465012aa2d19d4 Mon Sep 17 00:00:00 2001 +From 7ccd5e32f6e98f1522a3e471e4afeef564497264 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 041/127] Add SMI driver +Subject: [PATCH 041/156] Add SMI driver Signed-off-by: Luke Wren --- diff --git a/target/linux/brcm2708/patches-4.4/0042-Add-SMI-NAND-driver.patch b/target/linux/brcm2708/patches-4.4/0042-Add-SMI-NAND-driver.patch index 091e33343d..2807310a4a 100644 --- a/target/linux/brcm2708/patches-4.4/0042-Add-SMI-NAND-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0042-Add-SMI-NAND-driver.patch @@ -1,7 +1,7 @@ -From 142af590ca0a7fc36905f5bd123103c730d22a07 Mon Sep 17 00:00:00 2001 +From 06301e219cb176ca2917ad7e51fc9cf9897cf52b Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 042/127] Add SMI NAND driver +Subject: [PATCH 042/156] Add SMI NAND driver Signed-off-by: Luke Wren --- diff --git a/target/linux/brcm2708/patches-4.4/0043-lirc-added-support-for-RaspberryPi-GPIO.patch b/target/linux/brcm2708/patches-4.4/0043-lirc-added-support-for-RaspberryPi-GPIO.patch index 728ac37644..466bea373c 100644 --- a/target/linux/brcm2708/patches-4.4/0043-lirc-added-support-for-RaspberryPi-GPIO.patch +++ b/target/linux/brcm2708/patches-4.4/0043-lirc-added-support-for-RaspberryPi-GPIO.patch @@ -1,7 +1,7 @@ -From b9a3e6cbf575d0463af4b47ce48f76624bae10a1 Mon Sep 17 00:00:00 2001 +From 38d02987b33c187e2a02794c0b97c28d270f1d9b Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 043/127] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 043/156] 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/0044-Add-cpufreq-driver.patch b/target/linux/brcm2708/patches-4.4/0044-Add-cpufreq-driver.patch index 00be38f5e8..3d48bf9091 100644 --- a/target/linux/brcm2708/patches-4.4/0044-Add-cpufreq-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0044-Add-cpufreq-driver.patch @@ -1,7 +1,7 @@ -From 21e72e1f417fe2c097fe8f8ba4963abdde88a6ca Mon Sep 17 00:00:00 2001 +From c2a1eecef94520be7c785cf6d23aca9c695122f5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 044/127] Add cpufreq driver +Subject: [PATCH 044/156] Add cpufreq driver Signed-off-by: popcornmix --- diff --git a/target/linux/brcm2708/patches-4.4/0045-Added-hwmon-thermal-driver-for-reporting-core-temper.patch b/target/linux/brcm2708/patches-4.4/0045-Added-hwmon-thermal-driver-for-reporting-core-temper.patch index bcb7550361..72af401f47 100644 --- a/target/linux/brcm2708/patches-4.4/0045-Added-hwmon-thermal-driver-for-reporting-core-temper.patch +++ b/target/linux/brcm2708/patches-4.4/0045-Added-hwmon-thermal-driver-for-reporting-core-temper.patch @@ -1,7 +1,7 @@ -From ffe7f669c4106fafe86597774697048258cedbc9 Mon Sep 17 00:00:00 2001 +From 76ad29cef7e6dc73d7f9c3cd3578783d1daefa6d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 045/127] Added hwmon/thermal driver for reporting core +Subject: [PATCH 045/156] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/target/linux/brcm2708/patches-4.4/0046-Add-Chris-Boot-s-i2c-driver.patch b/target/linux/brcm2708/patches-4.4/0046-Add-Chris-Boot-s-i2c-driver.patch index c3e8b0c7f3..dec288d1c0 100644 --- a/target/linux/brcm2708/patches-4.4/0046-Add-Chris-Boot-s-i2c-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0046-Add-Chris-Boot-s-i2c-driver.patch @@ -1,7 +1,7 @@ -From 052aa5593d1cd52bbabc0985e9630f8272f3226a Mon Sep 17 00:00:00 2001 +From aac476eac7be9830cbda14fe82afa7d4afbd41d2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 046/127] Add Chris Boot's i2c driver +Subject: [PATCH 046/156] 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/0047-char-broadcom-Add-vcio-module.patch b/target/linux/brcm2708/patches-4.4/0047-char-broadcom-Add-vcio-module.patch index b9a5c244b5..74b43038bc 100644 --- a/target/linux/brcm2708/patches-4.4/0047-char-broadcom-Add-vcio-module.patch +++ b/target/linux/brcm2708/patches-4.4/0047-char-broadcom-Add-vcio-module.patch @@ -1,7 +1,7 @@ -From 18ec30d7e1571af21c41b687bd12e22f05ffd0b2 Mon Sep 17 00:00:00 2001 +From 8e1245bf1c5553baec76ccb0deb521df84a3f48f 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 047/127] char: broadcom: Add vcio module +Subject: [PATCH 047/156] 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/0048-firmware-bcm2835-Support-ARCH_BCM270x.patch b/target/linux/brcm2708/patches-4.4/0048-firmware-bcm2835-Support-ARCH_BCM270x.patch index 78e8605378..e5740829e5 100644 --- a/target/linux/brcm2708/patches-4.4/0048-firmware-bcm2835-Support-ARCH_BCM270x.patch +++ b/target/linux/brcm2708/patches-4.4/0048-firmware-bcm2835-Support-ARCH_BCM270x.patch @@ -1,7 +1,7 @@ -From 1d1c3e9b18717f6510b67c582e93051a3a948eb6 Mon Sep 17 00:00:00 2001 +From bf182799da48b6072c783fed452a752715b9b479 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 048/127] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 048/156] 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/0049-bcm2835-add-v4l2-camera-device.patch b/target/linux/brcm2708/patches-4.4/0049-bcm2835-add-v4l2-camera-device.patch index b9f1746d65..ca6ddeba97 100644 --- a/target/linux/brcm2708/patches-4.4/0049-bcm2835-add-v4l2-camera-device.patch +++ b/target/linux/brcm2708/patches-4.4/0049-bcm2835-add-v4l2-camera-device.patch @@ -1,7 +1,7 @@ -From 1e7cf5d5acfaecbc92766c179dba544064fb94cc Mon Sep 17 00:00:00 2001 +From f4ccd72c0038efded59351ceb59dc0a1f227890c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 049/127] bcm2835: add v4l2 camera device +Subject: [PATCH 049/156] 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/0050-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch b/target/linux/brcm2708/patches-4.4/0050-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch index 93c267c910..a73ed2b722 100644 --- a/target/linux/brcm2708/patches-4.4/0050-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch +++ b/target/linux/brcm2708/patches-4.4/0050-scripts-Add-mkknlimg-and-knlinfo-scripts-from-tools-.patch @@ -1,7 +1,7 @@ -From 4ddb3fae0a5c5b6969168134b4352bceccf51b9c Mon Sep 17 00:00:00 2001 +From a98c2f7958c16abd5d1536f80c241ec83ee99b86 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 050/127] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 050/156] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to diff --git a/target/linux/brcm2708/patches-4.4/0051-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch b/target/linux/brcm2708/patches-4.4/0051-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch index c909369ab9..662834d453 100644 --- a/target/linux/brcm2708/patches-4.4/0051-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch +++ b/target/linux/brcm2708/patches-4.4/0051-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch @@ -1,7 +1,7 @@ -From 3f46d3627061688e50e24d5bfbc0adb5deb89b97 Mon Sep 17 00:00:00 2001 +From eafa669fc02f9d7aa9d6fb0376558217d5d432e1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 051/127] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 051/156] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- diff --git a/target/linux/brcm2708/patches-4.4/0052-BCM2708-Add-core-Device-Tree-support.patch b/target/linux/brcm2708/patches-4.4/0052-BCM2708-Add-core-Device-Tree-support.patch index 52bc6bd512..12e7b861f5 100644 --- a/target/linux/brcm2708/patches-4.4/0052-BCM2708-Add-core-Device-Tree-support.patch +++ b/target/linux/brcm2708/patches-4.4/0052-BCM2708-Add-core-Device-Tree-support.patch @@ -1,7 +1,7 @@ -From 46e100d54a3bef01345aaffd1d722f6d2087a170 Mon Sep 17 00:00:00 2001 +From 1bf87715f0e3eb28ca753ec6cc4d189e8bc0de66 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 052/127] BCM2708: Add core Device Tree support +Subject: [PATCH 052/156] 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/0053-bcm2835-Match-with-BCM2708-Device-Trees.patch b/target/linux/brcm2708/patches-4.4/0053-bcm2835-Match-with-BCM2708-Device-Trees.patch index 6105e467b8..25e0c6b012 100644 --- a/target/linux/brcm2708/patches-4.4/0053-bcm2835-Match-with-BCM2708-Device-Trees.patch +++ b/target/linux/brcm2708/patches-4.4/0053-bcm2835-Match-with-BCM2708-Device-Trees.patch @@ -1,7 +1,7 @@ -From 1cb8b3610957f9c892a7eb6e18b99eca0ac7a77d Mon Sep 17 00:00:00 2001 +From 3ee2870ef7f0aa7c48a7cd1ae532aa9e1ac4f6ce 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 053/127] bcm2835: Match with BCM2708 Device Trees +Subject: [PATCH 053/156] 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/0054-fbdev-add-FBIOCOPYAREA-ioctl.patch b/target/linux/brcm2708/patches-4.4/0054-fbdev-add-FBIOCOPYAREA-ioctl.patch index 151b5cf7eb..6f6ebb5c33 100644 --- a/target/linux/brcm2708/patches-4.4/0054-fbdev-add-FBIOCOPYAREA-ioctl.patch +++ b/target/linux/brcm2708/patches-4.4/0054-fbdev-add-FBIOCOPYAREA-ioctl.patch @@ -1,7 +1,7 @@ -From 6faba148320fb8fc49b5cf5e5ef7864d9a1c0fd9 Mon Sep 17 00:00:00 2001 +From 1d6ca03eff36dc3d5675554fb1cb4db6ebeb7e74 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 054/127] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 054/156] 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/0058-Speed-up-console-framebuffer-imageblit-function.patch b/target/linux/brcm2708/patches-4.4/0058-Speed-up-console-framebuffer-imageblit-function.patch index ab45773dd8..dc3fb8175e 100644 --- a/target/linux/brcm2708/patches-4.4/0058-Speed-up-console-framebuffer-imageblit-function.patch +++ b/target/linux/brcm2708/patches-4.4/0058-Speed-up-console-framebuffer-imageblit-function.patch @@ -1,7 +1,7 @@ -From a205b536eaf4693151d5f375426b470ed1eaa4ed Mon Sep 17 00:00:00 2001 +From b070d3d1d6e0896607f3f4978c072cc33af62f80 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 058/127] Speed up console framebuffer imageblit function +Subject: [PATCH 058/156] 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/0059-Allow-mac-address-to-be-set-in-smsc95xx.patch b/target/linux/brcm2708/patches-4.4/0059-Allow-mac-address-to-be-set-in-smsc95xx.patch index afe937d7ca..e3d26876e4 100644 --- a/target/linux/brcm2708/patches-4.4/0059-Allow-mac-address-to-be-set-in-smsc95xx.patch +++ b/target/linux/brcm2708/patches-4.4/0059-Allow-mac-address-to-be-set-in-smsc95xx.patch @@ -1,7 +1,7 @@ -From 43512b5f55e891f325a7619fa9103e6d6566ce81 Mon Sep 17 00:00:00 2001 +From 4a5e988e0730b19eaca3df7c279d9b38f69e9860 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 059/127] Allow mac address to be set in smsc95xx +Subject: [PATCH 059/156] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- diff --git a/target/linux/brcm2708/patches-4.4/0060-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch b/target/linux/brcm2708/patches-4.4/0060-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch index 367a9bc3ac..8ed4c085d7 100644 --- a/target/linux/brcm2708/patches-4.4/0060-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch +++ b/target/linux/brcm2708/patches-4.4/0060-enabling-the-realtime-clock-1-wire-chip-DS1307-and-1.patch @@ -1,7 +1,7 @@ -From 1dde78801877dc5280b7b1b156a2784d7e2bf982 Mon Sep 17 00:00:00 2001 +From 4d386cf6aeac54f49224ac0b400cf58c6ba227d9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 060/127] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 060/156] 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 diff --git a/target/linux/brcm2708/patches-4.4/0061-Added-Device-IDs-for-August-DVB-T-205.patch b/target/linux/brcm2708/patches-4.4/0061-Added-Device-IDs-for-August-DVB-T-205.patch index 130b77edde..915cac75a7 100644 --- a/target/linux/brcm2708/patches-4.4/0061-Added-Device-IDs-for-August-DVB-T-205.patch +++ b/target/linux/brcm2708/patches-4.4/0061-Added-Device-IDs-for-August-DVB-T-205.patch @@ -1,7 +1,7 @@ -From 61a3c58b47a8a2b970a1ca50db15c402874eb8fd Mon Sep 17 00:00:00 2001 +From dbdc294a9b911c943d5214fefb5143e40dba056d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:54:08 +0100 -Subject: [PATCH 061/127] Added Device IDs for August DVB-T 205 +Subject: [PATCH 061/156] 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/0062-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch b/target/linux/brcm2708/patches-4.4/0062-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch index 4d0f6926fe..03a603c500 100644 --- a/target/linux/brcm2708/patches-4.4/0062-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch +++ b/target/linux/brcm2708/patches-4.4/0062-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch @@ -1,7 +1,7 @@ -From bbc71e816c6bf3d945e67a70db005d1f58b2b064 Mon Sep 17 00:00:00 2001 +From 3bbfaaf97f167d4f889c41822c4e767947fd1995 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 062/127] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 062/156] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- diff --git a/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-PCM5102A-codec.patch b/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-PCM5102A-codec.patch index cb8a5f5ee7..689c341194 100644 --- a/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-PCM5102A-codec.patch +++ b/target/linux/brcm2708/patches-4.4/0063-ASoC-Add-support-for-PCM5102A-codec.patch @@ -1,7 +1,7 @@ -From 7ae297c051ae9052562cd97de4b19d05afb4c9ee Mon Sep 17 00:00:00 2001 +From 58218d451343867c4b18909c7c11cd348a6ce343 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 063/127] ASoC: Add support for PCM5102A codec +Subject: [PATCH 063/156] 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/0064-ASoC-Add-support-for-HifiBerry-DAC.patch b/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-HifiBerry-DAC.patch index 77507e65c6..f9721f7a02 100644 --- a/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-HifiBerry-DAC.patch +++ b/target/linux/brcm2708/patches-4.4/0064-ASoC-Add-support-for-HifiBerry-DAC.patch @@ -1,7 +1,7 @@ -From 7376e0edee3df655d9176ee83f21c58b8f067207 Mon Sep 17 00:00:00 2001 +From 062c5f7da781aac9e13c959e6b84359cc71e790e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 064/127] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 064/156] 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/0065-ASoC-Add-support-for-Rpi-DAC.patch b/target/linux/brcm2708/patches-4.4/0065-ASoC-Add-support-for-Rpi-DAC.patch index 705e7960a6..e4885f704c 100644 --- a/target/linux/brcm2708/patches-4.4/0065-ASoC-Add-support-for-Rpi-DAC.patch +++ b/target/linux/brcm2708/patches-4.4/0065-ASoC-Add-support-for-Rpi-DAC.patch @@ -1,7 +1,7 @@ -From e6877f42823f6acd80d27b86816a0d87f35ea004 Mon Sep 17 00:00:00 2001 +From 698c90d19c77b07426d8b5825d7053b8ba5d8bc3 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 065/127] ASoC: Add support for Rpi-DAC +Subject: [PATCH 065/156] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ diff --git a/target/linux/brcm2708/patches-4.4/0066-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch b/target/linux/brcm2708/patches-4.4/0066-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch index b19458795a..944812bd3f 100644 --- a/target/linux/brcm2708/patches-4.4/0066-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch +++ b/target/linux/brcm2708/patches-4.4/0066-ASoC-wm8804-Implement-MCLK-configuration-options-add.patch @@ -1,7 +1,7 @@ -From 10534ba846800325cf08f6e2479dbebecda00d2d Mon Sep 17 00:00:00 2001 +From 41b19bff4474377f327d058488e1424ad74452e3 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 066/127] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 066/156] 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 diff --git a/target/linux/brcm2708/patches-4.4/0067-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch b/target/linux/brcm2708/patches-4.4/0067-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch index a69667c96d..d70bf53323 100644 --- a/target/linux/brcm2708/patches-4.4/0067-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch +++ b/target/linux/brcm2708/patches-4.4/0067-ASoC-BCM-Add-support-for-HiFiBerry-Digi.-Driver-is-b.patch @@ -1,7 +1,7 @@ -From bbeffde8da0be5674342d1f2301d8d9bdc56d2d5 Mon Sep 17 00:00:00 2001 +From 7408f4b6cc7b535f9af624a5a7da7e8012448acd Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 067/127] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 067/156] 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/0068-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch b/target/linux/brcm2708/patches-4.4/0068-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch index a2af8c29c6..9ede8fdf7b 100644 --- a/target/linux/brcm2708/patches-4.4/0068-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch +++ b/target/linux/brcm2708/patches-4.4/0068-ASoC-wm8804-Set-idle_bias_off-to-false-Idle-bias-has.patch @@ -1,7 +1,7 @@ -From 931556f39a5c08c682d31b0b8c25bf1c712a909f Mon Sep 17 00:00:00 2001 +From b44c52875239b2e3ae992ca27212f71b8f77765f Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 068/127] ASoC: wm8804: Set idle_bias_off to false Idle bias +Subject: [PATCH 068/156] 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/0069-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch b/target/linux/brcm2708/patches-4.4/0069-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch index 8d5d4cee8f..42bbb41d61 100644 --- a/target/linux/brcm2708/patches-4.4/0069-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch +++ b/target/linux/brcm2708/patches-4.4/0069-Add-IQaudIO-Sound-Card-support-for-Raspberry-Pi.patch @@ -1,7 +1,7 @@ -From 288238307a79e6978bb475bac7098832ca3de373 Mon Sep 17 00:00:00 2001 +From 5c7f1224804dd5dc7d5dbcd208432261266f7595 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 069/127] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 069/156] 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/0070-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch b/target/linux/brcm2708/patches-4.4/0070-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch index ac9ba9f0b3..98704e5e28 100644 --- a/target/linux/brcm2708/patches-4.4/0070-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch +++ b/target/linux/brcm2708/patches-4.4/0070-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch @@ -1,7 +1,7 @@ -From 7f78dfe7e00d426d90be5f98ac9683c83c024b28 Mon Sep 17 00:00:00 2001 +From 6804db582a5c59d572eb0d4b5fb84204928e33bf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 070/127] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 070/156] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- diff --git a/target/linux/brcm2708/patches-4.4/0071-Added-support-for-HiFiBerry-DAC.patch b/target/linux/brcm2708/patches-4.4/0071-Added-support-for-HiFiBerry-DAC.patch index 2c2ed05b63..dc88906af2 100644 --- a/target/linux/brcm2708/patches-4.4/0071-Added-support-for-HiFiBerry-DAC.patch +++ b/target/linux/brcm2708/patches-4.4/0071-Added-support-for-HiFiBerry-DAC.patch @@ -1,7 +1,7 @@ -From 21d1427a7563d56ca1fdcee66cb80e7f2879c6b8 Mon Sep 17 00:00:00 2001 +From cfa429e2830a4a720740098790f4a5fe8fca0486 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 071/127] Added support for HiFiBerry DAC+ +Subject: [PATCH 071/156] 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/0072-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch b/target/linux/brcm2708/patches-4.4/0072-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch index 34502a672b..d50ff6a142 100644 --- a/target/linux/brcm2708/patches-4.4/0072-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch +++ b/target/linux/brcm2708/patches-4.4/0072-Added-driver-for-HiFiBerry-Amp-amplifier-add-on-boar.patch @@ -1,7 +1,7 @@ -From f9201b45dcaa09fc1e85ca9fe011db801c0c12b5 Mon Sep 17 00:00:00 2001 +From eb7a554225c0ac786a6795f330b8ccf7454b5ff8 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 072/127] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 072/156] 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/0073-Update-ds1307-driver-for-device-tree-support.patch b/target/linux/brcm2708/patches-4.4/0073-Update-ds1307-driver-for-device-tree-support.patch index e2c5b2ee47..956b053757 100644 --- a/target/linux/brcm2708/patches-4.4/0073-Update-ds1307-driver-for-device-tree-support.patch +++ b/target/linux/brcm2708/patches-4.4/0073-Update-ds1307-driver-for-device-tree-support.patch @@ -1,7 +1,7 @@ -From 0a44043b0586ca2ea7f4af174ba18188c8dced82 Mon Sep 17 00:00:00 2001 +From 0944a852d7cc31e1112559b6f6bc2d81724c96a3 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 073/127] Update ds1307 driver for device-tree support +Subject: [PATCH 073/156] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- diff --git a/target/linux/brcm2708/patches-4.4/0074-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch b/target/linux/brcm2708/patches-4.4/0074-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch index c9c4569887..506068e976 100644 --- a/target/linux/brcm2708/patches-4.4/0074-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch +++ b/target/linux/brcm2708/patches-4.4/0074-BCM270x_DT-Add-pwr_led-and-the-required-input-trigge.patch @@ -1,7 +1,7 @@ -From 8629cfc983fbca391421dec0644a34ffe29b5c9e Mon Sep 17 00:00:00 2001 +From 70cae40081cad507c562148d047afe05334675ad Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 074/127] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 074/156] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support diff --git a/target/linux/brcm2708/patches-4.4/0075-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch b/target/linux/brcm2708/patches-4.4/0075-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch index 5dba231e13..7aa80d23fd 100644 --- a/target/linux/brcm2708/patches-4.4/0075-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch +++ b/target/linux/brcm2708/patches-4.4/0075-enc28j60-Add-device-tree-compatible-string-and-an-ov.patch @@ -1,7 +1,7 @@ -From 5bdfbb8eafe9c92e60031502980207f55c0092ce Mon Sep 17 00:00:00 2001 +From e697bb5943f0c2c51bedc7b194059ea4da1e26f7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 075/127] enc28j60: Add device tree compatible string and an +Subject: [PATCH 075/156] enc28j60: Add device tree compatible string and an overlay --- diff --git a/target/linux/brcm2708/patches-4.4/0076-Add-driver-for-rpi-proto.patch b/target/linux/brcm2708/patches-4.4/0076-Add-driver-for-rpi-proto.patch index 8940e414aa..4b57a99566 100644 --- a/target/linux/brcm2708/patches-4.4/0076-Add-driver-for-rpi-proto.patch +++ b/target/linux/brcm2708/patches-4.4/0076-Add-driver-for-rpi-proto.patch @@ -1,7 +1,7 @@ -From e3dc96afd80658ed5ad61c6f58dd45979abdcc61 Mon Sep 17 00:00:00 2001 +From 8a8d68121ff5145452a0645123119847ddba9396 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 076/127] Add driver for rpi-proto +Subject: [PATCH 076/156] 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/0077-config-Add-default-configs.patch b/target/linux/brcm2708/patches-4.4/0077-config-Add-default-configs.patch index 333990dc39..2b6e42c3f2 100644 --- a/target/linux/brcm2708/patches-4.4/0077-config-Add-default-configs.patch +++ b/target/linux/brcm2708/patches-4.4/0077-config-Add-default-configs.patch @@ -1,7 +1,7 @@ -From 18e76baf8723e54c2fb7303d07e797960b61d399 Mon Sep 17 00:00:00 2001 +From adc027efa7b5703f0d452fff7a821570776da786 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 077/127] config: Add default configs +Subject: [PATCH 077/156] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1254 +++++++++++++++++++++++++++++++++++ diff --git a/target/linux/brcm2708/patches-4.4/0078-bcm2835-bcm2835_defconfig.patch b/target/linux/brcm2708/patches-4.4/0078-bcm2835-bcm2835_defconfig.patch index 781be5b817..87c57daf59 100644 --- a/target/linux/brcm2708/patches-4.4/0078-bcm2835-bcm2835_defconfig.patch +++ b/target/linux/brcm2708/patches-4.4/0078-bcm2835-bcm2835_defconfig.patch @@ -1,7 +1,7 @@ -From 8c70059859aa757f8b1ea04bc4b27e62bb038059 Mon Sep 17 00:00:00 2001 +From d36556c5965dacf7335068a3c4af4613be6268ed 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 078/127] bcm2835: bcm2835_defconfig +Subject: [PATCH 078/156] 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/0079-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch b/target/linux/brcm2708/patches-4.4/0079-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch index f1721f8f17..399435c1cc 100644 --- a/target/linux/brcm2708/patches-4.4/0079-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch +++ b/target/linux/brcm2708/patches-4.4/0079-rpi-ft5406-Add-touchscreen-driver-for-pi-LCD-display.patch @@ -1,7 +1,7 @@ -From 5152e89db66a2004ebd3d1629b4c1656672c3c37 Mon Sep 17 00:00:00 2001 +From 3a15b5f0db3f90c4534a01a8631d1d0be94e3957 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 079/127] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 079/156] 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/0080-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.4/0080-Improve-__copy_to_user-and-__copy_from_user-performa.patch index 10f1184436..001e34d815 100644 --- a/target/linux/brcm2708/patches-4.4/0080-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/brcm2708/patches-4.4/0080-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -1,7 +1,7 @@ -From 61d24c12473972a4eb6b259f297d65a03fc09bda Mon Sep 17 00:00:00 2001 +From 2195d7057b15258644aa186dc4784757dfc2291a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 080/127] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 080/156] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use diff --git a/target/linux/brcm2708/patches-4.4/0081-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch b/target/linux/brcm2708/patches-4.4/0081-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch index 72b7697de8..90c25d915f 100644 --- a/target/linux/brcm2708/patches-4.4/0081-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch +++ b/target/linux/brcm2708/patches-4.4/0081-gpio-poweroff-Allow-it-to-work-on-Raspberry-Pi.patch @@ -1,7 +1,7 @@ -From 5a7fddeb5dfd0dd291363dcab556006a02297d13 Mon Sep 17 00:00:00 2001 +From 4a8b44e4db451f80235221dd558d95aface19148 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 081/127] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 081/156] 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/0082-spidev-Add-spidev-compatible-string-to-silence-warni.patch b/target/linux/brcm2708/patches-4.4/0082-spidev-Add-spidev-compatible-string-to-silence-warni.patch index 4aaa46895e..7673a8104b 100644 --- a/target/linux/brcm2708/patches-4.4/0082-spidev-Add-spidev-compatible-string-to-silence-warni.patch +++ b/target/linux/brcm2708/patches-4.4/0082-spidev-Add-spidev-compatible-string-to-silence-warni.patch @@ -1,7 +1,7 @@ -From ab8626a92ca2308de52a1db26b10ab4ecc3a1be7 Mon Sep 17 00:00:00 2001 +From 1aae6581fac6cf69e0772d13338b44c90eeab969 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 082/127] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 082/156] 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/0083-scripts-dtc-Add-overlay-support.patch b/target/linux/brcm2708/patches-4.4/0083-scripts-dtc-Add-overlay-support.patch index 27f9c8ab8c..aa03cee237 100644 --- a/target/linux/brcm2708/patches-4.4/0083-scripts-dtc-Add-overlay-support.patch +++ b/target/linux/brcm2708/patches-4.4/0083-scripts-dtc-Add-overlay-support.patch @@ -1,7 +1,7 @@ -From 311f1f1043c31d5e0101cd304e521a12c1acffd5 Mon Sep 17 00:00:00 2001 +From 1f1e162b80815e9cb308c14ad4425a314686a813 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 17:00:18 +0100 -Subject: [PATCH 083/127] scripts/dtc: Add overlay support +Subject: [PATCH 083/156] scripts/dtc: Add overlay support --- scripts/dtc/checks.c | 119 ++- diff --git a/target/linux/brcm2708/patches-4.4/0084-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch b/target/linux/brcm2708/patches-4.4/0084-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch index cbb3c489ae..d07af4d0ed 100644 --- a/target/linux/brcm2708/patches-4.4/0084-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0084-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch @@ -1,7 +1,7 @@ -From 933c347e34871491afd9d53c7a9d0bf3c283c41f Mon Sep 17 00:00:00 2001 +From b3ca8734955b9bbf611e58444f7e4ab239f5c54a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 084/127] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 084/156] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + diff --git a/target/linux/brcm2708/patches-4.4/0085-RaspiDAC3-support.patch b/target/linux/brcm2708/patches-4.4/0085-RaspiDAC3-support.patch index fc3c488f96..1531848779 100644 --- a/target/linux/brcm2708/patches-4.4/0085-RaspiDAC3-support.patch +++ b/target/linux/brcm2708/patches-4.4/0085-RaspiDAC3-support.patch @@ -1,7 +1,7 @@ -From c0121c68fb1b9242907546191008deb49123729a Mon Sep 17 00:00:00 2001 +From 305847dcc80fa3e3ffccd0e6c77b45d0a54ed185 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 085/127] RaspiDAC3 support +Subject: [PATCH 085/156] RaspiDAC3 support Signed-off-by: Jan Grulich diff --git a/target/linux/brcm2708/patches-4.4/0086-tpa6130a2-Add-headphone-switch-control.patch b/target/linux/brcm2708/patches-4.4/0086-tpa6130a2-Add-headphone-switch-control.patch index 5cf76f0ddb..1ba13a5b1f 100644 --- a/target/linux/brcm2708/patches-4.4/0086-tpa6130a2-Add-headphone-switch-control.patch +++ b/target/linux/brcm2708/patches-4.4/0086-tpa6130a2-Add-headphone-switch-control.patch @@ -1,7 +1,7 @@ -From a7c37b3c36ccec8a089d576c55ad9ba1721cb0ef Mon Sep 17 00:00:00 2001 +From 1f384a47d40c8f7112d6ea3b9b20442a089f63bb Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:02:34 +0100 -Subject: [PATCH 086/127] tpa6130a2: Add headphone switch control +Subject: [PATCH 086/156] tpa6130a2: Add headphone switch control Signed-off-by: Jan Grulich --- diff --git a/target/linux/brcm2708/patches-4.4/0087-irq-bcm2835-Fix-building-with-2708.patch b/target/linux/brcm2708/patches-4.4/0087-irq-bcm2835-Fix-building-with-2708.patch index 523dca0c4a..a2d8290c6d 100644 --- a/target/linux/brcm2708/patches-4.4/0087-irq-bcm2835-Fix-building-with-2708.patch +++ b/target/linux/brcm2708/patches-4.4/0087-irq-bcm2835-Fix-building-with-2708.patch @@ -1,7 +1,7 @@ -From d4df36c7243c7fcf016278309a7fcf1e07bf8b7f Mon Sep 17 00:00:00 2001 +From e14cfb794033608cb17a1537d5cceaeb3842c41a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Sep 2015 23:38:59 +0100 -Subject: [PATCH 087/127] irq-bcm2835: Fix building with 2708 +Subject: [PATCH 087/156] irq-bcm2835: Fix building with 2708 --- drivers/irqchip/irq-bcm2835.c | 3 ++- diff --git a/target/linux/brcm2708/patches-4.4/0088-rpi_display-add-backlight-driver-and-overlay.patch b/target/linux/brcm2708/patches-4.4/0088-rpi_display-add-backlight-driver-and-overlay.patch index cb8808657d..9fa82905d6 100644 --- a/target/linux/brcm2708/patches-4.4/0088-rpi_display-add-backlight-driver-and-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0088-rpi_display-add-backlight-driver-and-overlay.patch @@ -1,7 +1,7 @@ -From 356081aede8e5bd1b9503c4510e1d4fc0d85b026 Mon Sep 17 00:00:00 2001 +From e6699e6b06d539e29869d751f1cb666192d045c0 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 088/127] rpi_display: add backlight driver and overlay +Subject: [PATCH 088/156] 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/0089-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch b/target/linux/brcm2708/patches-4.4/0089-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch index 031f4c6ad5..4ab11d4ef7 100644 --- a/target/linux/brcm2708/patches-4.4/0089-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch +++ b/target/linux/brcm2708/patches-4.4/0089-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch @@ -1,7 +1,7 @@ -From 83a58ceb78952a15b2a14716e2099cb548cd9081 Mon Sep 17 00:00:00 2001 +From 66bd6f87c5477a16d94c8cf8879919632508813f Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Mon, 16 Nov 2015 14:05:35 +0000 -Subject: [PATCH 089/127] bcm2835-dma: Fix up convert to DMA pool +Subject: [PATCH 089/156] bcm2835-dma: Fix up convert to DMA pool --- drivers/dma/bcm2835-dma.c | 36 ++++++++++++++++++++++++++---------- diff --git a/target/linux/brcm2708/patches-4.4/0090-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch b/target/linux/brcm2708/patches-4.4/0090-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch index 12f1290d0d..10bd75fe5d 100644 --- a/target/linux/brcm2708/patches-4.4/0090-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch +++ b/target/linux/brcm2708/patches-4.4/0090-scripts-Multi-platform-support-for-mkknlimg-and-knli.patch @@ -1,7 +1,7 @@ -From 7740825fc5e8324d362566ecc61f95fbdc38370a Mon Sep 17 00:00:00 2001 +From 6e5a9e29f92463a7c3e0230f8c8ea9001bda2bff Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Nov 2015 11:38:59 +0000 -Subject: [PATCH 090/127] scripts: Multi-platform support for mkknlimg and +Subject: [PATCH 090/156] scripts: Multi-platform support for mkknlimg and knlinfo The firmware uses tags in the kernel trailer to choose which dtb file diff --git a/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch b/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch index 2a2125f4cc..3814f7b4fb 100644 --- a/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch +++ b/target/linux/brcm2708/patches-4.4/0091-drm-vc4-Add-suport-for-3D-rendering-using-the-V3D-en.patch @@ -1,7 +1,7 @@ -From e8c7a56d86c676b4665edc50762fd737a7b56ff5 Mon Sep 17 00:00:00 2001 +From 9fcd3d8e07364a62bc57770f54a2e1b0b232bb17 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 2 Mar 2015 13:01:12 -0800 -Subject: [PATCH 091/127] drm/vc4: Add suport for 3D rendering using the V3D +Subject: [PATCH 091/156] drm/vc4: Add suport for 3D rendering using the V3D engine. This is a squash of the out-of-tree development series. Since that diff --git a/target/linux/brcm2708/patches-4.4/0092-drm-vc4-Force-HDMI-to-connected.patch b/target/linux/brcm2708/patches-4.4/0092-drm-vc4-Force-HDMI-to-connected.patch index ff316d3179..188b518264 100644 --- a/target/linux/brcm2708/patches-4.4/0092-drm-vc4-Force-HDMI-to-connected.patch +++ b/target/linux/brcm2708/patches-4.4/0092-drm-vc4-Force-HDMI-to-connected.patch @@ -1,7 +1,7 @@ -From c2b464e766dc1fa6fe28f2292f8258b64f468d7f Mon Sep 17 00:00:00 2001 +From 4fae622e03263fa61e1d56ba13ea8d8802d5e64f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Oct 2015 11:32:14 -0700 -Subject: [PATCH 092/127] drm/vc4: Force HDMI to connected. +Subject: [PATCH 092/156] 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/0093-drm-vc4-bo-cache-locking-fixes.patch b/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-fixes.patch index 923d393edf..f73a115b58 100644 --- a/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-fixes.patch +++ b/target/linux/brcm2708/patches-4.4/0093-drm-vc4-bo-cache-locking-fixes.patch @@ -1,7 +1,7 @@ -From 084567d656e2876ed867c0a030dab0c2c4e38522 Mon Sep 17 00:00:00 2001 +From ca6e3e079d54eae4839bd5d4cf16ed504be66d96 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:23:18 -0700 -Subject: [PATCH 093/127] drm/vc4: bo cache locking fixes. +Subject: [PATCH 093/156] drm/vc4: bo cache locking fixes. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0094-drm-vc4-bo-cache-locking-cleanup.patch b/target/linux/brcm2708/patches-4.4/0094-drm-vc4-bo-cache-locking-cleanup.patch index 1d797a13a4..e6d917b300 100644 --- a/target/linux/brcm2708/patches-4.4/0094-drm-vc4-bo-cache-locking-cleanup.patch +++ b/target/linux/brcm2708/patches-4.4/0094-drm-vc4-bo-cache-locking-cleanup.patch @@ -1,7 +1,7 @@ -From a62d7adb16fdd9c450a0a255a3e0946c62b30b20 Mon Sep 17 00:00:00 2001 +From 05987e4b471d4408e11e218886015bbd09b13edf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:29:41 -0700 -Subject: [PATCH 094/127] drm/vc4: bo cache locking cleanup. +Subject: [PATCH 094/156] drm/vc4: bo cache locking cleanup. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch b/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch index f3b9839739..a970d04243 100644 --- a/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch +++ b/target/linux/brcm2708/patches-4.4/0095-drm-vc4-Use-job_lock-to-protect-seqno_cb_list.patch @@ -1,7 +1,7 @@ -From c5200dcf1298dc6789a88640ab581e364d92282b Mon Sep 17 00:00:00 2001 +From 72d3af528b1ac1e2606d252d49f3f50281976f5c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:32:24 -0700 -Subject: [PATCH 095/127] drm/vc4: Use job_lock to protect seqno_cb_list. +Subject: [PATCH 095/156] 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/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 7796399453..468ac5ae20 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 6a9940a2bde49eda470e58f19a6bde3ded87d7fb Mon Sep 17 00:00:00 2001 +From 1eba33023a05b04c591b212fbd5d3f19115c49b3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:44:35 -0700 -Subject: [PATCH 096/127] drm/vc4: Drop struct_mutex around CL validation. +Subject: [PATCH 096/156] 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-Drop-struct_mutex-around-CL-validation.patch b/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Drop-struct_mutex-around-CL-validation.patch index 5275fb5e17..7f14eb72d8 100644 --- a/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Drop-struct_mutex-around-CL-validation.patch +++ b/target/linux/brcm2708/patches-4.4/0097-drm-vc4-Drop-struct_mutex-around-CL-validation.patch @@ -1,7 +1,7 @@ -From 4cc42228e828c8cba5e2f712fd92fe3e0bb8b09d Mon Sep 17 00:00:00 2001 +From ec1275865fd40eff9420aa4475da0a09a065e381 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2015 08:44:35 -0700 -Subject: [PATCH 097/127] drm/vc4: Drop struct_mutex around CL validation. +Subject: [PATCH 097/156] 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/0098-drm-vc4-Add-support-for-more-display-plane-formats.patch b/target/linux/brcm2708/patches-4.4/0098-drm-vc4-Add-support-for-more-display-plane-formats.patch index b2328d12cc..a71e3fff3a 100644 --- a/target/linux/brcm2708/patches-4.4/0098-drm-vc4-Add-support-for-more-display-plane-formats.patch +++ b/target/linux/brcm2708/patches-4.4/0098-drm-vc4-Add-support-for-more-display-plane-formats.patch @@ -1,7 +1,7 @@ -From 7ad1b03ccca2d3c81ee97edfd1141b31331a0076 Mon Sep 17 00:00:00 2001 +From 605806b44e12f9e9a88bfab65b5af00c2319edef Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Oct 2015 13:59:15 +0100 -Subject: [PATCH 098/127] drm/vc4: Add support for more display plane formats. +Subject: [PATCH 098/156] drm/vc4: Add support for more display plane formats. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0099-drm-vc4-No-need-to-stop-the-stopped-threads.patch b/target/linux/brcm2708/patches-4.4/0099-drm-vc4-No-need-to-stop-the-stopped-threads.patch index d4d8c0705f..e4b0572ad5 100644 --- a/target/linux/brcm2708/patches-4.4/0099-drm-vc4-No-need-to-stop-the-stopped-threads.patch +++ b/target/linux/brcm2708/patches-4.4/0099-drm-vc4-No-need-to-stop-the-stopped-threads.patch @@ -1,7 +1,7 @@ -From 7fdb9332f996fbaa26eaa805ce72a6afa590a302 Mon Sep 17 00:00:00 2001 +From 97a02955d447e975998b6e57febd7c304cac4ab1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Oct 2015 12:31:56 +0100 -Subject: [PATCH 099/127] drm/vc4: No need to stop the stopped threads. +Subject: [PATCH 099/156] 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/0100-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch b/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch index 0ea1ee7234..753259d975 100644 --- a/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch +++ b/target/linux/brcm2708/patches-4.4/0100-drm-vc4-Remove-extra-barrier-s-aroudn-CTnCA-CTnEA-se.patch @@ -1,7 +1,7 @@ -From 65854b72066317cb2896df184794890c32f5f1bb Mon Sep 17 00:00:00 2001 +From 5a0dd0a09aab3f1f82c70ec298d86c794ee65097 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Oct 2015 12:33:43 +0100 -Subject: [PATCH 100/127] drm/vc4: Remove extra barrier()s aroudn CTnCA/CTnEA +Subject: [PATCH 100/156] 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/0101-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch b/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch index 4cf4dc1a69..70f64d8994 100644 --- a/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch +++ b/target/linux/brcm2708/patches-4.4/0101-drm-vc4-Fix-a-typo-in-a-V3D-debug-register.patch @@ -1,7 +1,7 @@ -From 8566dcb0b278a12d9aad06e8b85b94e9d797d66e Mon Sep 17 00:00:00 2001 +From f966476880d65aea0246d0d1f04377dd628a79fd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Oct 2015 14:57:22 +0100 -Subject: [PATCH 101/127] drm/vc4: Fix a typo in a V3D debug register. +Subject: [PATCH 101/156] drm/vc4: Fix a typo in a V3D debug register. Signed-off-by: Eric Anholt --- diff --git a/target/linux/brcm2708/patches-4.4/0102-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch b/target/linux/brcm2708/patches-4.4/0102-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch index fe05bae8ae..d306d84ec2 100644 --- a/target/linux/brcm2708/patches-4.4/0102-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch +++ b/target/linux/brcm2708/patches-4.4/0102-drm-vc4-Enable-VC4-modules-and-increase-CMA-size-wit.patch @@ -1,7 +1,7 @@ -From e7c59032e2b16f07a4e836b6f417a7cea5d66b2d Mon Sep 17 00:00:00 2001 +From 885697c1ff9e687315f0be69b775782aa135e663 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 2 Nov 2015 17:07:33 +0000 -Subject: [PATCH 102/127] drm/vc4: Enable VC4 modules, and increase CMA size +Subject: [PATCH 102/156] 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, diff --git a/target/linux/brcm2708/patches-4.4/0103-squash-fixups.patch b/target/linux/brcm2708/patches-4.4/0103-squash-fixups.patch index cd21a7e77e..3a9ca62ee0 100644 --- a/target/linux/brcm2708/patches-4.4/0103-squash-fixups.patch +++ b/target/linux/brcm2708/patches-4.4/0103-squash-fixups.patch @@ -1,7 +1,7 @@ -From 88f275f67c6816cad5aec510074bacea409d78cd Mon Sep 17 00:00:00 2001 +From 80eea644edd68fdac2cea19c872099442c19e1a9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Nov 2015 18:29:58 +0000 -Subject: [PATCH 103/127] squash: fixups +Subject: [PATCH 103/156] squash: fixups --- drivers/gpu/drm/vc4/Kconfig | 2 +- diff --git a/target/linux/brcm2708/patches-4.4/0104-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch b/target/linux/brcm2708/patches-4.4/0104-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch index cb1c2675d5..2a85650469 100644 --- a/target/linux/brcm2708/patches-4.4/0104-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch +++ b/target/linux/brcm2708/patches-4.4/0104-squash-add-missing-vc4-kms-v3d-overlay.dtb-to-makefi.patch @@ -1,7 +1,7 @@ -From 37a66cf4c337c439330ffd6316e421d0603ce936 Mon Sep 17 00:00:00 2001 +From 904d9d3406dab59220fd39d217cde63ba19db742 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Nov 2015 20:26:03 +0000 -Subject: [PATCH 104/127] squash: add missing vc4-kms-v3d-overlay.dtb to +Subject: [PATCH 104/156] squash: add missing vc4-kms-v3d-overlay.dtb to makefile --- diff --git a/target/linux/brcm2708/patches-4.4/0105-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch b/target/linux/brcm2708/patches-4.4/0105-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch index c297bb7b72..4badc1f4bb 100644 --- a/target/linux/brcm2708/patches-4.4/0105-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch +++ b/target/linux/brcm2708/patches-4.4/0105-clk-bcm2835-Also-build-the-driver-for-downstream-ker.patch @@ -1,7 +1,7 @@ -From fc0a178addf1cae65245e129e9bbe4a5daeb2cfd Mon Sep 17 00:00:00 2001 +From 0f26b51ac18a46df8d12ba38754b865e77cda370 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Oct 2015 11:23:34 -0700 -Subject: [PATCH 105/127] clk: bcm2835: Also build the driver for downstream +Subject: [PATCH 105/156] clk: bcm2835: Also build the driver for downstream kernels. Signed-off-by: Eric Anholt diff --git a/target/linux/brcm2708/patches-4.4/0106-dts-Added-overlay-for-gpio_ir_recv-driver.patch b/target/linux/brcm2708/patches-4.4/0106-dts-Added-overlay-for-gpio_ir_recv-driver.patch index 356b7789a4..a80d2a5cc2 100644 --- a/target/linux/brcm2708/patches-4.4/0106-dts-Added-overlay-for-gpio_ir_recv-driver.patch +++ b/target/linux/brcm2708/patches-4.4/0106-dts-Added-overlay-for-gpio_ir_recv-driver.patch @@ -1,7 +1,7 @@ -From d97e7fdedbc15a25985dfa73f7e1c63e2b4ca4c8 Mon Sep 17 00:00:00 2001 +From d85c99545b883d49484f834b191472f079badc0e Mon Sep 17 00:00:00 2001 From: Holger Steinhaus Date: Sat, 14 Nov 2015 18:37:43 +0100 -Subject: [PATCH 106/127] dts: Added overlay for gpio_ir_recv driver +Subject: [PATCH 106/156] dts: Added overlay for gpio_ir_recv driver --- arch/arm/boot/dts/overlays/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0107-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch b/target/linux/brcm2708/patches-4.4/0107-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch index 4a501a2719..435a52327e 100644 --- a/target/linux/brcm2708/patches-4.4/0107-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch +++ b/target/linux/brcm2708/patches-4.4/0107-Build-i2c_gpio-module-and-add-a-device-tree-overlay-.patch @@ -1,7 +1,7 @@ -From 5371d757db191f77f115b1248184e2f1a15dfa4b Mon Sep 17 00:00:00 2001 +From 12fed1205023386a5b87d8215f35a2a3ac10ba7d Mon Sep 17 00:00:00 2001 From: Alistair Buxton Date: Sun, 1 Nov 2015 22:27:56 +0000 -Subject: [PATCH 107/127] Build i2c_gpio module and add a device tree overlay +Subject: [PATCH 107/156] Build i2c_gpio module and add a device tree overlay to configure it. --- diff --git a/target/linux/brcm2708/patches-4.4/0108-New-overlay-for-PiScreen2r.patch b/target/linux/brcm2708/patches-4.4/0108-New-overlay-for-PiScreen2r.patch index 28df3eb723..dcb5086cd9 100644 --- a/target/linux/brcm2708/patches-4.4/0108-New-overlay-for-PiScreen2r.patch +++ b/target/linux/brcm2708/patches-4.4/0108-New-overlay-for-PiScreen2r.patch @@ -1,7 +1,7 @@ -From 872bf9aa8073bb571ecb3fe502afd39257f4ba20 Mon Sep 17 00:00:00 2001 +From 22e4c6ba056df97c6cacf0510b6cb06c52b11a9a Mon Sep 17 00:00:00 2001 From: mwilliams03 Date: Sun, 18 Oct 2015 17:07:24 -0700 -Subject: [PATCH 108/127] New overlay for PiScreen2r +Subject: [PATCH 108/156] New overlay for PiScreen2r --- arch/arm/boot/dts/overlays/Makefile | 1 + diff --git a/target/linux/brcm2708/patches-4.4/0109-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch b/target/linux/brcm2708/patches-4.4/0109-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch index 0fd1f55b90..929fcdf922 100644 --- a/target/linux/brcm2708/patches-4.4/0109-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch +++ b/target/linux/brcm2708/patches-4.4/0109-dts-Added-overlay-for-Adafruit-PiTFT-2.8-capacitive-.patch @@ -1,7 +1,7 @@ -From aa474d100ec0ad7647935ffaf5bd2272d4a57249 Mon Sep 17 00:00:00 2001 +From 1ad530e17f7d114b4c0b73d2c5f9a332e59f5b6e Mon Sep 17 00:00:00 2001 From: Ondrej Wisniewski Date: Fri, 6 Nov 2015 15:01:28 +0100 -Subject: [PATCH 109/127] dts: Added overlay for Adafruit PiTFT 2.8" capacitive +Subject: [PATCH 109/156] dts: Added overlay for Adafruit PiTFT 2.8" capacitive touch screen --- diff --git a/target/linux/brcm2708/patches-4.4/0110-Add-support-for-the-HiFiBerry-DAC-Pro.patch b/target/linux/brcm2708/patches-4.4/0110-Add-support-for-the-HiFiBerry-DAC-Pro.patch index b492c1686c..421b18abc1 100644 --- a/target/linux/brcm2708/patches-4.4/0110-Add-support-for-the-HiFiBerry-DAC-Pro.patch +++ b/target/linux/brcm2708/patches-4.4/0110-Add-support-for-the-HiFiBerry-DAC-Pro.patch @@ -1,7 +1,7 @@ -From 7b841ce695094a46ff36b977a714fb60c19346d0 Mon Sep 17 00:00:00 2001 +From 92a639f7362cb40bce4eb0019967e7d84aed90d1 Mon Sep 17 00:00:00 2001 From: Stuart MacLean Date: Fri, 2 Oct 2015 15:12:59 +0100 -Subject: [PATCH 110/127] Add support for the HiFiBerry DAC+ Pro. +Subject: [PATCH 110/156] 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/0111-BCM270X_DT-Add-at86rf233-overlay.patch b/target/linux/brcm2708/patches-4.4/0111-BCM270X_DT-Add-at86rf233-overlay.patch index dfb067aaa5..16178ac3ed 100644 --- a/target/linux/brcm2708/patches-4.4/0111-BCM270X_DT-Add-at86rf233-overlay.patch +++ b/target/linux/brcm2708/patches-4.4/0111-BCM270X_DT-Add-at86rf233-overlay.patch @@ -1,7 +1,7 @@ -From d0219e9506be92eb12b2a303e5cbb2261e0dc05a Mon Sep 17 00:00:00 2001 +From aae673201fa2bd432a47654d9bcd9edc872d456f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 5 Oct 2015 10:47:45 +0100 -Subject: [PATCH 111/127] BCM270X_DT: Add at86rf233 overlay +Subject: [PATCH 111/156] 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/0112-mm-Remove-the-PFN-busy-warning.patch b/target/linux/brcm2708/patches-4.4/0112-mm-Remove-the-PFN-busy-warning.patch index 1254547947..e57507287d 100644 --- a/target/linux/brcm2708/patches-4.4/0112-mm-Remove-the-PFN-busy-warning.patch +++ b/target/linux/brcm2708/patches-4.4/0112-mm-Remove-the-PFN-busy-warning.patch @@ -1,7 +1,7 @@ -From f65e7507069d858d619883fccd2d92b2783e07b3 Mon Sep 17 00:00:00 2001 +From a9a5e18e7a34a6a34e917c8f74b935697ea5f641 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 112/127] mm: Remove the PFN busy warning +Subject: [PATCH 112/156] 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/0113-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch b/target/linux/brcm2708/patches-4.4/0113-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch index ab7c3abac9..6849a3f941 100644 --- a/target/linux/brcm2708/patches-4.4/0113-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch +++ b/target/linux/brcm2708/patches-4.4/0113-drm-Put-an-optional-field-in-the-driver-struct-for-G.patch @@ -1,7 +1,7 @@ -From daf1a4e97b6eb0c0576d895c9496025e8cd84a0f Mon Sep 17 00:00:00 2001 +From 486a03e437e2472aa0d88cd77ef4a4394d895085 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 19 Nov 2014 12:06:38 -0800 -Subject: [PATCH 113/127] drm: Put an optional field in the driver struct for +Subject: [PATCH 113/156] 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 diff --git a/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch b/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch index 97cce3d2a9..5d52f3e130 100644 --- a/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch +++ b/target/linux/brcm2708/patches-4.4/0114-drm-vc4-Add-an-interface-for-capturing-the-GPU-state.patch @@ -1,7 +1,7 @@ -From 7839c603643699a8f4f061e1ab2eeb970af00802 Mon Sep 17 00:00:00 2001 +From 26f5cbc4987fd09baddaf390ba9ce63de92481c5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2015 10:09:02 -0700 -Subject: [PATCH 114/127] drm/vc4: Add an interface for capturing the GPU state +Subject: [PATCH 114/156] 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 diff --git a/target/linux/brcm2708/patches-4.4/0115-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch b/target/linux/brcm2708/patches-4.4/0115-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch index 54e6698b6a..c42a1f0a0a 100644 --- a/target/linux/brcm2708/patches-4.4/0115-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch +++ b/target/linux/brcm2708/patches-4.4/0115-drm-vc4-Update-a-bunch-of-code-to-match-upstream-sub.patch @@ -1,7 +1,7 @@ -From 06dbf5f7d41615b40de35ddab611d92c2a9dd1c1 Mon Sep 17 00:00:00 2001 +From 3643e31e7808587e5f4a2619bdd355848ac88737 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 4 Dec 2015 11:35:34 -0800 -Subject: [PATCH 115/127] drm/vc4: Update a bunch of code to match upstream +Subject: [PATCH 115/156] drm/vc4: Update a bunch of code to match upstream submission. This gets almost everything matching, except for the MSAA support and diff --git a/target/linux/brcm2708/patches-4.4/0116-drm-Use-the-driver-s-gem_object_free-function-from-C.patch b/target/linux/brcm2708/patches-4.4/0116-drm-Use-the-driver-s-gem_object_free-function-from-C.patch index 472beb57ff..4589ebb13d 100644 --- a/target/linux/brcm2708/patches-4.4/0116-drm-Use-the-driver-s-gem_object_free-function-from-C.patch +++ b/target/linux/brcm2708/patches-4.4/0116-drm-Use-the-driver-s-gem_object_free-function-from-C.patch @@ -1,7 +1,7 @@ -From 78fdb6a7b1de6a345dacf81ef514f94daf44d3da Mon Sep 17 00:00:00 2001 +From 95ab064c34db2cc7e99a003277e824aa29a60d98 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 11 Dec 2015 19:45:03 -0800 -Subject: [PATCH 116/127] drm: Use the driver's gem_object_free function from +Subject: [PATCH 116/156] 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 diff --git a/target/linux/brcm2708/patches-4.4/0117-drm-vc4-Add-support-for-MSAA-rendering.patch b/target/linux/brcm2708/patches-4.4/0117-drm-vc4-Add-support-for-MSAA-rendering.patch index d4e222dc9f..ff487a3d46 100644 --- a/target/linux/brcm2708/patches-4.4/0117-drm-vc4-Add-support-for-MSAA-rendering.patch +++ b/target/linux/brcm2708/patches-4.4/0117-drm-vc4-Add-support-for-MSAA-rendering.patch @@ -1,7 +1,7 @@ -From b66efe927216251ae27f9213e6b92b3a49deb73e Mon Sep 17 00:00:00 2001 +From fe77db4395ed0fbceb058f7b49dc3b3db57c2868 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 17 Jul 2015 13:15:50 -0700 -Subject: [PATCH 117/127] drm/vc4: Add support for MSAA rendering. +Subject: [PATCH 117/156] 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/0118-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch b/target/linux/brcm2708/patches-4.4/0118-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch index 7edf7a38e4..33db01d22a 100644 --- a/target/linux/brcm2708/patches-4.4/0118-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch +++ b/target/linux/brcm2708/patches-4.4/0118-drm-vc4-A-few-more-non-functional-changes-to-sync-to.patch @@ -1,7 +1,7 @@ -From 8b0e1ce37709125edeb9851307e24ba563749382 Mon Sep 17 00:00:00 2001 +From ea95a310d42c86fa9ebd87d01d486c81770868b9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 8 Dec 2015 14:00:43 -0800 -Subject: [PATCH 118/127] drm/vc4: A few more non-functional changes to sync to +Subject: [PATCH 118/156] 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/0119-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch b/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch index 3cb53984a9..ff82c531e1 100644 --- a/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch +++ b/target/linux/brcm2708/patches-4.4/0119-drm-vc4-Use-hpd-gpios-for-HDMI-GPIO-like-what-landed.patch @@ -1,7 +1,7 @@ -From d0afa9ee62039105ac62f350b168f3ac4c013734 Mon Sep 17 00:00:00 2001 +From bcf38dfc39fe93414a48efd6a1455605c678922e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 15 Dec 2015 23:46:32 +0000 -Subject: [PATCH 119/127] drm/vc4: Use "hpd-gpios" for HDMI GPIO, like what +Subject: [PATCH 119/156] 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/0120-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch b/target/linux/brcm2708/patches-4.4/0120-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch index 89001b8ef4..a1bb4bdc7f 100644 --- a/target/linux/brcm2708/patches-4.4/0120-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch +++ b/target/linux/brcm2708/patches-4.4/0120-drm-vc4-Synchronize-validation-code-for-v2-submissio.patch @@ -1,7 +1,7 @@ -From 1de82ff3a47093ed2ff41a0288c6ebe21d6bfcb7 Mon Sep 17 00:00:00 2001 +From 9f0ff9b7b05f3cc8b644f3976f24ba1779687578 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 7 Dec 2015 12:35:01 -0800 -Subject: [PATCH 120/127] drm/vc4: Synchronize validation code for v2 +Subject: [PATCH 120/156] drm/vc4: Synchronize validation code for v2 submission upstream. Signed-off-by: Eric Anholt diff --git a/target/linux/brcm2708/patches-4.4/0121-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch b/target/linux/brcm2708/patches-4.4/0121-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch index 07db922c4a..74640abc37 100644 --- a/target/linux/brcm2708/patches-4.4/0121-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch +++ b/target/linux/brcm2708/patches-4.4/0121-MMC-Do-not-use-mmc_debug-if-CONFIG_MMC_BCM2835-is-no.patch @@ -1,7 +1,7 @@ -From 5fc7b3491b5961dcb35251fc908c0fd5988eecde Mon Sep 17 00:00:00 2001 +From b39af51026fc692ecc3e2155d4012bd4449ab686 Mon Sep 17 00:00:00 2001 From: janluca Date: Sun, 27 Dec 2015 14:34:04 +0100 -Subject: [PATCH 121/127] MMC: Do not use mmc_debug if CONFIG_MMC_BCM2835 is +Subject: [PATCH 121/156] 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 diff --git a/target/linux/brcm2708/patches-4.4/0122-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch b/target/linux/brcm2708/patches-4.4/0122-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch index 8f578ab71e..eb8d284d88 100644 --- a/target/linux/brcm2708/patches-4.4/0122-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch +++ b/target/linux/brcm2708/patches-4.4/0122-Extend-clock-timeout-fix-modprobe-baudrate-parameter.patch @@ -1,7 +1,7 @@ -From ba2e42fe23631e6cf1f2e1167618ab1c13d9b3ba Mon Sep 17 00:00:00 2001 +From dcca9b8b2f79033b8d0bbaacacc2726c74fc094e Mon Sep 17 00:00:00 2001 From: Devon Fyson Date: Wed, 30 Dec 2015 16:40:47 -0500 -Subject: [PATCH 122/127] Extend clock timeout, fix modprobe baudrate +Subject: [PATCH 122/156] 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/0123-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch b/target/linux/brcm2708/patches-4.4/0123-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch index 6be1dc34ae..96349dbd14 100644 --- a/target/linux/brcm2708/patches-4.4/0123-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch +++ b/target/linux/brcm2708/patches-4.4/0123-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch @@ -1,7 +1,7 @@ -From 0416b50ebe6a25e512e34f3e11cdfaec045fc5e3 Mon Sep 17 00:00:00 2001 +From 48f5e9485618e81c4559429a07faafe854cd39c0 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 123/127] bcm270x_dt: Add dwc2 and dwc-otg overlays +Subject: [PATCH 123/156] bcm270x_dt: Add dwc2 and dwc-otg overlays --- arch/arm/boot/dts/overlays/Makefile | 2 ++ @@ -41,9 +41,9 @@ Subject: [PATCH 123/127] bcm270x_dt: Add dwc2 and dwc-otg overlays +Load: dtoverlay=dwc2,= +Params: dr_mode Dual role mode: "host", "peripheral" or "otg" + -+ g-np-tx-fifo-size Size of rx fifo size in gadget mode ++ g-rx-fifo-size Size of rx fifo size in gadget mode + -+ g-rx-fifo-size Size of non-periodic tx fifo size in gadget ++ g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget + mode + + g-tx-fifo-size Size of periodic tx fifo per endpoint diff --git a/target/linux/brcm2708/patches-4.4/0124-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch b/target/linux/brcm2708/patches-4.4/0124-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch index ac3a86e08e..4fc55078bc 100644 --- a/target/linux/brcm2708/patches-4.4/0124-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch +++ b/target/linux/brcm2708/patches-4.4/0124-BCM270X_DT-Add-the-sdtweak-overlay-for-tuning-sdhost.patch @@ -1,7 +1,7 @@ -From b7d6f1b965c5de2dd01d6719bee283dffa176362 Mon Sep 17 00:00:00 2001 +From 1c2a3feefc21f0d4050de15d54a07219c90d6ef1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 4 Jan 2016 14:42:17 +0000 -Subject: [PATCH 124/127] BCM270X_DT: Add the sdtweak overlay, for tuning +Subject: [PATCH 124/156] BCM270X_DT: Add the sdtweak overlay, for tuning sdhost The sdhost overlay declares the sdhost interface and allows parameters diff --git a/target/linux/brcm2708/patches-4.4/0125-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch b/target/linux/brcm2708/patches-4.4/0125-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch index d2505b387a..4ca386dfc3 100644 --- a/target/linux/brcm2708/patches-4.4/0125-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch +++ b/target/linux/brcm2708/patches-4.4/0125-bcm2835-mmc-Don-t-override-bus-width-capabilities-fr.patch @@ -1,7 +1,7 @@ -From 70243224e92a2c75e01451a5ed002e76ec211c0d Mon Sep 17 00:00:00 2001 +From 318f2b30c2d6760e17a68580370fe62cc65b6db7 Mon Sep 17 00:00:00 2001 From: Andrew Litt Date: Mon, 11 Jan 2016 07:54:21 +0000 -Subject: [PATCH 125/127] bcm2835-mmc: Don't override bus width capabilities +Subject: [PATCH 125/156] bcm2835-mmc: Don't override bus width capabilities from devicetree Take out the force setting of the MMC_CAP_4_BIT_DATA host capability diff --git a/target/linux/brcm2708/patches-4.4/0126-SDIO-overlay-add-bus_width-parameter.patch b/target/linux/brcm2708/patches-4.4/0126-SDIO-overlay-add-bus_width-parameter.patch index 080cd27e1b..661b923f52 100644 --- a/target/linux/brcm2708/patches-4.4/0126-SDIO-overlay-add-bus_width-parameter.patch +++ b/target/linux/brcm2708/patches-4.4/0126-SDIO-overlay-add-bus_width-parameter.patch @@ -1,7 +1,7 @@ -From 2b72fe5d7c71e77e5fd0b5c81aa14177843a59a8 Mon Sep 17 00:00:00 2001 +From 2716dea6b98618f690884fcb8569fd381888f515 Mon Sep 17 00:00:00 2001 From: Andrew Litt Date: Mon, 11 Jan 2016 07:55:54 +0000 -Subject: [PATCH 126/127] SDIO-overlay: add bus_width parameter +Subject: [PATCH 126/156] 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/0127-FIXUP-BCM270X_DT-random-HWRNG-dtparam-default-is-on.patch b/target/linux/brcm2708/patches-4.4/0127-FIXUP-BCM270X_DT-random-HWRNG-dtparam-default-is-on.patch new file mode 100644 index 0000000000..5990b7c569 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0127-FIXUP-BCM270X_DT-random-HWRNG-dtparam-default-is-on.patch @@ -0,0 +1,21 @@ +From 489fa9a9725c1c1512b6427a7a3d805e6c6c80df Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 8 Jan 2016 13:42:06 +0000 +Subject: [PATCH 127/156] FIXUP BCM270X_DT: "random" (HWRNG) dtparam default is + on + +--- + 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 +@@ -110,7 +110,7 @@ Params: + (default "off") + + random Set to "on" to enable the hardware random +- number generator (default "off") ++ number generator (default "on") + + uart0 Set to "off" to disable uart0 (default "on") + diff --git a/target/linux/brcm2708/patches-4.4/0127-fixup-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch b/target/linux/brcm2708/patches-4.4/0127-fixup-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch deleted file mode 100644 index 467badc53f..0000000000 --- a/target/linux/brcm2708/patches-4.4/0127-fixup-bcm270x_dt-Add-dwc2-and-dwc-otg-overlays.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 18c241c9e14f85fac03beab507b69980f9b33bfc Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 13 Jan 2016 15:49:06 +0000 -Subject: [PATCH 127/127] fixup! bcm270x_dt: Add dwc2 and dwc-otg overlays - ---- - arch/arm/boot/dts/overlays/README | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -210,9 +210,9 @@ Info: Selects the dwc2 USB controller - Load: dtoverlay=dwc2,= - Params: dr_mode Dual role mode: "host", "peripheral" or "otg" - -- g-np-tx-fifo-size Size of rx fifo size in gadget mode -+ g-rx-fifo-size Size of rx fifo size in gadget mode - -- g-rx-fifo-size Size of non-periodic tx fifo size in gadget -+ g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget - mode - - g-tx-fifo-size Size of periodic tx fifo per endpoint diff --git a/target/linux/brcm2708/patches-4.4/0128-bcm2835-extend-allowed-range-of-channels-and-sampler.patch b/target/linux/brcm2708/patches-4.4/0128-bcm2835-extend-allowed-range-of-channels-and-sampler.patch new file mode 100644 index 0000000000..f867570534 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0128-bcm2835-extend-allowed-range-of-channels-and-sampler.patch @@ -0,0 +1,37 @@ +From 5b4731b45fa872e21bca7cba7d11b656bbd0f2a0 Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:41:45 +0100 +Subject: [PATCH 128/156] bcm2835: extend allowed range of channels and + samplerates + +Allow everything the videocore accepts. +--- + sound/arm/bcm2835-pcm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/sound/arm/bcm2835-pcm.c ++++ b/sound/arm/bcm2835-pcm.c +@@ -26,9 +26,9 @@ static struct snd_pcm_hardware snd_bcm28 + .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, + .rate_min = 8000, +- .rate_max = 48000, ++ .rate_max = 192000, + .channels_min = 1, +- .channels_max = 2, ++ .channels_max = 8, + .buffer_bytes_max = 128 * 1024, + .period_bytes_min = 1 * 1024, + .period_bytes_max = 128 * 1024, +@@ -43,9 +43,9 @@ static struct snd_pcm_hardware snd_bcm28 + .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_44100 | + SNDRV_PCM_RATE_48000, + .rate_min = 44100, +- .rate_max = 48000, ++ .rate_max = 192000, + .channels_min = 2, +- .channels_max = 2, ++ .channels_max = 8, + .buffer_bytes_max = 128 * 1024, + .period_bytes_min = 1 * 1024, + .period_bytes_max = 128 * 1024, diff --git a/target/linux/brcm2708/patches-4.4/0129-bcm2835-restrict-channels-rate-to-8-960000.patch b/target/linux/brcm2708/patches-4.4/0129-bcm2835-restrict-channels-rate-to-8-960000.patch new file mode 100644 index 0000000000..3a3653b8a2 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0129-bcm2835-restrict-channels-rate-to-8-960000.patch @@ -0,0 +1,80 @@ +From 49e46ec03b6dafecec9b2380a3a4444e6d0ea726 Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:42:18 +0100 +Subject: [PATCH 129/156] 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 +underruns. Supposedly the hardware isn't designed to output +higher rates, but it can still resample it down to supported +rates. + +Some code is based on ac97_pcm.c. +--- + sound/arm/bcm2835-pcm.c | 41 +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 41 insertions(+) + +--- a/sound/arm/bcm2835-pcm.c ++++ b/sound/arm/bcm2835-pcm.c +@@ -19,6 +19,9 @@ + + #include "bcm2835.h" + ++/* The hardware can not do much more num_channels*samplerate then this value */ ++#define MAX_COMBINED_RATE 768000 ++ + /* hardware definition */ + static struct snd_pcm_hardware snd_bcm2835_playback_hw = { + .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | +@@ -107,6 +110,31 @@ static irqreturn_t bcm2835_playback_fifo + return IRQ_HANDLED; + } + ++ ++static int rate_hw_constraint_rate(struct snd_pcm_hw_params *params, ++ struct snd_pcm_hw_rule *rule) ++{ ++ struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); ++ struct snd_interval rates = { ++ .min = 8000, ++ .max = min(192000u, MAX_COMBINED_RATE / max(channels->min, 1u)), ++ }; ++ struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); ++ return snd_interval_refine(rate, &rates); ++} ++ ++static int rate_hw_constraint_channels(struct snd_pcm_hw_params *params, ++ struct snd_pcm_hw_rule *rule) ++{ ++ struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); ++ struct snd_interval channels_interval = { ++ .min = 1, ++ .max = min(8u, MAX_COMBINED_RATE / max(rate->min, 1u)), ++ }; ++ struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); ++ return snd_interval_refine(channels, &channels_interval); ++} ++ + /* open callback */ + static int snd_bcm2835_playback_open_generic( + struct snd_pcm_substream *substream, int spdif) +@@ -188,6 +216,19 @@ static int snd_bcm2835_playback_open_gen + snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, + 16); + ++ /* When playing PCM, pretend that we support the full range of channels ++ * and sample rates. The GPU can't output it, but is able to resample ++ * the data to a rate the hardware can handle it. This won't work with ++ * compressed data; the resampler would just destroy it. */ ++ if (spdif) { ++ err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, ++ rate_hw_constraint_rate, NULL, ++ SNDRV_PCM_HW_PARAM_CHANNELS, -1); ++ err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, ++ rate_hw_constraint_channels, NULL, ++ SNDRV_PCM_HW_PARAM_RATE, -1); ++ } ++ + chip->alsa_stream[idx] = alsa_stream; + + chip->opened |= (1 << idx); diff --git a/target/linux/brcm2708/patches-4.4/0130-rpi-update-vc_vchi_audioserv_defs.h.patch b/target/linux/brcm2708/patches-4.4/0130-rpi-update-vc_vchi_audioserv_defs.h.patch new file mode 100644 index 0000000000..7f08cee9ca --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0130-rpi-update-vc_vchi_audioserv_defs.h.patch @@ -0,0 +1,66 @@ +From 8d0fb551420eb11b534a106573e1fb262593175a Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:42:48 +0100 +Subject: [PATCH 130/156] rpi: update vc_vchi_audioserv_defs.h + +Add audioserv 3 extensions. The changes were taken from the paste +linked here: + +https://github.com/raspberrypi/linux/pull/1166#issuecomment-151917067 +--- + sound/arm/vc_vchi_audioserv_defs.h | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 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 2 ++#define VC_AUDIOSERV_VER 3 + + // FourCC code used for VCHI connection + #define VC_AUDIO_SERVER_NAME MAKE_FOURCC("AUDS") +@@ -36,6 +36,7 @@ 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; + +@@ -44,6 +45,7 @@ typedef struct { + uint32_t channels; + uint32_t samplerate; + uint32_t bps; ++ uint32_t channelmap; + + } VC_AUDIO_CONFIG_T; + +@@ -84,6 +86,12 @@ 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 +@@ -108,9 +116,10 @@ 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_ ++#endif // _VC_AUDIO_DEFS_H_ +\ No newline at end of file diff --git a/target/linux/brcm2708/patches-4.4/0131-bcm2835-implement-channel-map-API.patch b/target/linux/brcm2708/patches-4.4/0131-bcm2835-implement-channel-map-API.patch new file mode 100644 index 0000000000..99de1e317a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0131-bcm2835-implement-channel-map-API.patch @@ -0,0 +1,421 @@ +From a437f8b7abb2e016b199d964de926fa390d0552c Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:43:12 +0100 +Subject: [PATCH 131/156] 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 +userspace request. + +Some code taken from patch_hdmi.c. In particular, the HDMI channel +layout table was copied without changes - with the idea in mind that +hopefully it can be shared one day. Or at least updating it will be +simpler. + +In my tests, everything appears to work, except when outputting +FL FR RL RR. Then my receiver outputs RL on both the RL and RR +speakers, while RR is never heard. +--- + sound/arm/bcm2835-ctl.c | 276 ++++++++++++++++++++++++++++++++++++++++++++++ + sound/arm/bcm2835-pcm.c | 22 +++- + sound/arm/bcm2835-vchiq.c | 13 +++ + sound/arm/bcm2835.h | 4 + + 4 files changed, 311 insertions(+), 4 deletions(-) + +--- a/sound/arm/bcm2835-ctl.c ++++ b/sound/arm/bcm2835-ctl.c +@@ -300,6 +300,281 @@ static struct snd_kcontrol_new snd_bcm28 + }, + }; + ++struct cea_channel_speaker_allocation { ++ int ca_index; ++ int speakers[8]; ++}; ++ ++#define FL SNDRV_CHMAP_FL ++#define FR SNDRV_CHMAP_FR ++#define RL SNDRV_CHMAP_RL ++#define RR SNDRV_CHMAP_RR ++#define LFE SNDRV_CHMAP_LFE ++#define FC SNDRV_CHMAP_FC ++#define RLC SNDRV_CHMAP_RLC ++#define RRC SNDRV_CHMAP_RRC ++#define RC SNDRV_CHMAP_RC ++#define FLC SNDRV_CHMAP_FLC ++#define FRC SNDRV_CHMAP_FRC ++#define FLH SNDRV_CHMAP_TFL ++#define FRH SNDRV_CHMAP_TFR ++#define FLW SNDRV_CHMAP_FLW ++#define FRW SNDRV_CHMAP_FRW ++#define TC SNDRV_CHMAP_TC ++#define FCH SNDRV_CHMAP_TFC ++ ++/* ++ * CEA-861 channel maps ++ * ++ * Stolen from sound/pci/hda/patch_hdmi.c ++ * (unlike the source, this uses SNDRV_* constants directly, as by the ++ * map_tables array in patch_hdmi.c) ++ * Unknown entries use 0, which unfortunately is SNDRV_CHMAP_UNKNOWN instead ++ * of SNDRV_CHMAP_NA. ++ */ ++static struct cea_channel_speaker_allocation channel_allocations[] = { ++/* channel: 7 6 5 4 3 2 1 0 */ ++{ .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } }, ++ /* 2.1 */ ++{ .ca_index = 0x01, .speakers = { 0, 0, 0, 0, 0, LFE, FR, FL } }, ++ /* Dolby Surround */ ++{ .ca_index = 0x02, .speakers = { 0, 0, 0, 0, FC, 0, FR, FL } }, ++ /* surround40 */ ++{ .ca_index = 0x08, .speakers = { 0, 0, RR, RL, 0, 0, FR, FL } }, ++ /* surround41 */ ++{ .ca_index = 0x09, .speakers = { 0, 0, RR, RL, 0, LFE, FR, FL } }, ++ /* surround50 */ ++{ .ca_index = 0x0a, .speakers = { 0, 0, RR, RL, FC, 0, FR, FL } }, ++ /* surround51 */ ++{ .ca_index = 0x0b, .speakers = { 0, 0, RR, RL, FC, LFE, FR, FL } }, ++ /* 6.1 */ ++{ .ca_index = 0x0f, .speakers = { 0, RC, RR, RL, FC, LFE, FR, FL } }, ++ /* surround71 */ ++{ .ca_index = 0x13, .speakers = { RRC, RLC, RR, RL, FC, LFE, FR, FL } }, ++ ++{ .ca_index = 0x03, .speakers = { 0, 0, 0, 0, FC, LFE, FR, FL } }, ++{ .ca_index = 0x04, .speakers = { 0, 0, 0, RC, 0, 0, FR, FL } }, ++{ .ca_index = 0x05, .speakers = { 0, 0, 0, RC, 0, LFE, FR, FL } }, ++{ .ca_index = 0x06, .speakers = { 0, 0, 0, RC, FC, 0, FR, FL } }, ++{ .ca_index = 0x07, .speakers = { 0, 0, 0, RC, FC, LFE, FR, FL } }, ++{ .ca_index = 0x0c, .speakers = { 0, RC, RR, RL, 0, 0, FR, FL } }, ++{ .ca_index = 0x0d, .speakers = { 0, RC, RR, RL, 0, LFE, FR, FL } }, ++{ .ca_index = 0x0e, .speakers = { 0, RC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x10, .speakers = { RRC, RLC, RR, RL, 0, 0, FR, FL } }, ++{ .ca_index = 0x11, .speakers = { RRC, RLC, RR, RL, 0, LFE, FR, FL } }, ++{ .ca_index = 0x12, .speakers = { RRC, RLC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x14, .speakers = { FRC, FLC, 0, 0, 0, 0, FR, FL } }, ++{ .ca_index = 0x15, .speakers = { FRC, FLC, 0, 0, 0, LFE, FR, FL } }, ++{ .ca_index = 0x16, .speakers = { FRC, FLC, 0, 0, FC, 0, FR, FL } }, ++{ .ca_index = 0x17, .speakers = { FRC, FLC, 0, 0, FC, LFE, FR, FL } }, ++{ .ca_index = 0x18, .speakers = { FRC, FLC, 0, RC, 0, 0, FR, FL } }, ++{ .ca_index = 0x19, .speakers = { FRC, FLC, 0, RC, 0, LFE, FR, FL } }, ++{ .ca_index = 0x1a, .speakers = { FRC, FLC, 0, RC, FC, 0, FR, FL } }, ++{ .ca_index = 0x1b, .speakers = { FRC, FLC, 0, RC, FC, LFE, FR, FL } }, ++{ .ca_index = 0x1c, .speakers = { FRC, FLC, RR, RL, 0, 0, FR, FL } }, ++{ .ca_index = 0x1d, .speakers = { FRC, FLC, RR, RL, 0, LFE, FR, FL } }, ++{ .ca_index = 0x1e, .speakers = { FRC, FLC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x1f, .speakers = { FRC, FLC, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x20, .speakers = { 0, FCH, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x21, .speakers = { 0, FCH, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x22, .speakers = { TC, 0, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x23, .speakers = { TC, 0, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x24, .speakers = { FRH, FLH, RR, RL, 0, 0, FR, FL } }, ++{ .ca_index = 0x25, .speakers = { FRH, FLH, RR, RL, 0, LFE, FR, FL } }, ++{ .ca_index = 0x26, .speakers = { FRW, FLW, RR, RL, 0, 0, FR, FL } }, ++{ .ca_index = 0x27, .speakers = { FRW, FLW, RR, RL, 0, LFE, FR, FL } }, ++{ .ca_index = 0x28, .speakers = { TC, RC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x29, .speakers = { TC, RC, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x2a, .speakers = { FCH, RC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x2b, .speakers = { FCH, RC, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x2c, .speakers = { TC, FCH, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x2d, .speakers = { TC, FCH, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x2e, .speakers = { FRH, FLH, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x2f, .speakers = { FRH, FLH, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x30, .speakers = { FRW, FLW, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x31, .speakers = { FRW, FLW, RR, RL, FC, LFE, FR, FL } }, ++}; ++ ++static int snd_bcm2835_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag, ++ unsigned int size, unsigned int __user *tlv) ++{ ++ unsigned int __user *dst; ++ int count = 0; ++ int i; ++ ++ if (size < 8) ++ return -ENOMEM; ++ if (put_user(SNDRV_CTL_TLVT_CONTAINER, tlv)) ++ return -EFAULT; ++ size -= 8; ++ dst = tlv + 2; ++ for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { ++ struct cea_channel_speaker_allocation *ch = &channel_allocations[i]; ++ int num_chs = 0; ++ int chs_bytes; ++ int c; ++ ++ for (c = 0; c < 8; c++) { ++ if (ch->speakers[c]) ++ num_chs++; ++ } ++ ++ chs_bytes = num_chs * 4; ++ if (size < 8) ++ return -ENOMEM; ++ if (put_user(SNDRV_CTL_TLVT_CHMAP_FIXED, dst) || ++ put_user(chs_bytes, dst + 1)) ++ return -EFAULT; ++ dst += 2; ++ size -= 8; ++ count += 8; ++ if (size < chs_bytes) ++ return -ENOMEM; ++ size -= chs_bytes; ++ count += chs_bytes; ++ for (c = 0; c < 8; c++) { ++ int sp = ch->speakers[7 - c]; ++ if (sp) { ++ if (put_user(sp, dst)) ++ return -EFAULT; ++ dst++; ++ } ++ } ++ } ++ if (put_user(count, tlv + 1)) ++ return -EFAULT; ++ return 0; ++} ++ ++static int snd_bcm2835_chmap_ctl_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol); ++ bcm2835_chip_t *chip = info->private_data; ++ unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); ++ struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx); ++ struct cea_channel_speaker_allocation *ch = NULL; ++ int cur = 0; ++ int i; ++ ++ if (!substream || !substream->runtime) ++ return -ENODEV; ++ ++ for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { ++ if (channel_allocations[i].ca_index == chip->cea_chmap) ++ ch = &channel_allocations[i]; ++ } ++ ++ /* If no layout was set yet, return a dummy. Apparently the userspace ++ * API will be confused if we don't. */ ++ if (!ch) ++ ch = &channel_allocations[0]; ++ ++ for (i = 0; i < 8; i++) { ++ if (ch->speakers[7 - i]) ++ ucontrol->value.integer.value[cur++] = ch->speakers[7 - i]; ++ } ++ while (cur < 8) ++ ucontrol->value.integer.value[cur++] = SNDRV_CHMAP_NA; ++ return 0; ++} ++ ++static int snd_bcm2835_chmap_ctl_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol); ++ bcm2835_chip_t *chip = info->private_data; ++ unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); ++ struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx); ++ int i, prepared = 0, cea_chmap = -1; ++ int remap[8]; ++ ++ if (!substream || !substream->runtime) ++ return -ENODEV; ++ ++ switch (substream->runtime->status->state) { ++ case SNDRV_PCM_STATE_OPEN: ++ case SNDRV_PCM_STATE_SETUP: ++ break; ++ case SNDRV_PCM_STATE_PREPARED: ++ prepared = 1; ++ break; ++ default: ++ return -EBUSY; ++ } ++ ++ for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { ++ struct cea_channel_speaker_allocation *ch = &channel_allocations[i]; ++ int matches = 1; ++ int cur = 0; ++ int x; ++ memset(remap, 0, sizeof(remap)); ++ for (x = 0; x < substream->runtime->channels; x++) { ++ int sp = ucontrol->value.integer.value[x]; ++ while (cur < 8 && !ch->speakers[7 - cur]) ++ cur++; ++ if (cur >= 8) { ++ /* user has more channels than ch */ ++ matches = 0; ++ break; ++ } ++ if (ch->speakers[7 - cur] != sp) { ++ matches = 0; ++ break; ++ } ++ remap[x] = cur; ++ cur++; ++ } ++ for (x = cur; x < 8; x++) { ++ if (ch->speakers[7 - x]) { ++ /* ch has more channels than user */ ++ matches = 0; ++ break; ++ } ++ } ++ if (matches) { ++ cea_chmap = ch->ca_index; ++ break; ++ } ++ } ++ ++ if (cea_chmap < 0) ++ return -EINVAL; ++ ++ /* don't change the layout if another substream is active */ ++ if (chip->opened != (1 << substream->number) && chip->cea_chmap != cea_chmap) ++ return -EBUSY; /* unsure whether this is a good error code */ ++ ++ chip->cea_chmap = cea_chmap; ++ for (i = 0; i < 8; i++) ++ chip->map_channels[i] = remap[i]; ++ if (prepared) ++ snd_bcm2835_pcm_prepare_again(substream); ++ return 0; ++} ++ ++static int snd_bcm2835_add_chmap_ctl(bcm2835_chip_t * chip) ++{ ++ struct snd_pcm_chmap *chmap; ++ struct snd_kcontrol *kctl; ++ int err, i; ++ ++ err = snd_pcm_add_chmap_ctls(chip->pcm, ++ SNDRV_PCM_STREAM_PLAYBACK, ++ NULL, 8, 0, &chmap); ++ if (err < 0) ++ return err; ++ /* override handlers */ ++ chmap->private_data = chip; ++ kctl = chmap->kctl; ++ for (i = 0; i < kctl->count; i++) ++ kctl->vd[i].access |= SNDRV_CTL_ELEM_ACCESS_WRITE; ++ kctl->get = snd_bcm2835_chmap_ctl_get; ++ kctl->put = snd_bcm2835_chmap_ctl_put; ++ kctl->tlv.c = snd_bcm2835_chmap_ctl_tlv; ++ return 0; ++} ++ + int snd_bcm2835_new_ctl(bcm2835_chip_t * chip) + { + int err; +@@ -313,6 +588,7 @@ int snd_bcm2835_new_ctl(bcm2835_chip_t * + if (err < 0) + return err; + } ++ snd_bcm2835_add_chmap_ctl(chip); + for (idx = 0; idx < ARRAY_SIZE(snd_bcm2835_spdif); idx++) { + err = snd_ctl_add(chip->card, + snd_ctl_new1(&snd_bcm2835_spdif[idx], chip)); +--- a/sound/arm/bcm2835-pcm.c ++++ b/sound/arm/bcm2835-pcm.c +@@ -231,6 +231,9 @@ static int snd_bcm2835_playback_open_gen + + chip->alsa_stream[idx] = alsa_stream; + ++ if (!chip->opened) ++ chip->cea_chmap = -1; ++ + chip->opened |= (1 << idx); + alsa_stream->open = 1; + alsa_stream->draining = 1; +@@ -341,8 +344,7 @@ static int snd_bcm2835_pcm_hw_free(struc + return snd_pcm_lib_free_pages(substream); + } + +-/* prepare callback */ +-static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream) ++int snd_bcm2835_pcm_prepare_again(struct snd_pcm_substream *substream) + { + bcm2835_chip_t *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; +@@ -350,8 +352,6 @@ static int snd_bcm2835_pcm_prepare(struc + int channels; + int err; + +- audio_info(" .. IN\n"); +- + /* notify the vchiq that it should enter spdif passthrough mode by + * setting channels=0 (see + * https://github.com/raspberrypi/linux/issues/528) */ +@@ -367,6 +367,20 @@ static int snd_bcm2835_pcm_prepare(struc + audio_error(" error setting hw params\n"); + } + ++ return err; ++} ++ ++/* prepare callback */ ++static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream) ++{ ++ bcm2835_chip_t *chip = snd_pcm_substream_chip(substream); ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ bcm2835_alsa_stream_t *alsa_stream = runtime->private_data; ++ ++ audio_info(" .. IN\n"); ++ ++ snd_bcm2835_pcm_prepare_again(substream); ++ + bcm2835_audio_setup(alsa_stream); + + /* in preparation of the stream, set the controls (volume level) of the stream */ +--- a/sound/arm/bcm2835-vchiq.c ++++ b/sound/arm/bcm2835-vchiq.c +@@ -570,6 +570,8 @@ int bcm2835_audio_set_params(bcm2835_als + VC_AUDIO_MSG_T m; + AUDIO_INSTANCE_T *instance = alsa_stream->instance; + int32_t success; ++ uint32_t chmap_value; ++ int i; + int ret; + LOG_DBG(" .. IN\n"); + +@@ -593,10 +595,21 @@ int bcm2835_audio_set_params(bcm2835_als + + instance->result = -1; + ++ if (alsa_stream->chip->cea_chmap >= 0) { ++ chmap_value = (unsigned)alsa_stream->chip->cea_chmap << 24; ++ } else { ++ chmap_value = 0; /* force stereo */ ++ for (i = 0; i < 8; i++) ++ alsa_stream->chip->map_channels[i] = i; ++ } ++ for (i = 0; i < 8; i++) ++ chmap_value |= alsa_stream->chip->map_channels[i] << (i * 3); ++ + m.type = VC_AUDIO_MSG_TYPE_CONFIG; + m.u.config.channels = channels; + m.u.config.samplerate = samplerate; + m.u.config.bps = bps; ++ m.u.config.channelmap = chmap_value; + + /* Create the message available completion */ + init_completion(&instance->msg_avail_comp); +--- a/sound/arm/bcm2835.h ++++ b/sound/arm/bcm2835.h +@@ -107,6 +107,8 @@ typedef struct bcm2835_chip { + int old_volume; /* stores the volume value whist muted */ + int dest; + int mute; ++ int cea_chmap; /* currently requested Audio InfoFrame Data Byte 4 */ ++ int map_channels[8]; + + unsigned int opened; + unsigned int spdif_status; +@@ -149,6 +151,8 @@ int snd_bcm2835_new_ctl(bcm2835_chip_t * + int snd_bcm2835_new_pcm(bcm2835_chip_t * chip); + int snd_bcm2835_new_spdif_pcm(bcm2835_chip_t * chip); + ++int snd_bcm2835_pcm_prepare_again(struct snd_pcm_substream *substream); ++ + int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream); + int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream); + int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream, diff --git a/target/linux/brcm2708/patches-4.4/0132-bcm2835-access-controls-under-the-audio-mutex.patch b/target/linux/brcm2708/patches-4.4/0132-bcm2835-access-controls-under-the-audio-mutex.patch new file mode 100644 index 0000000000..76b3d0cfc1 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0132-bcm2835-access-controls-under-the-audio-mutex.patch @@ -0,0 +1,237 @@ +From 9c1692e00be5be644aef95ca6e16b3b50be05e39 Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:43:35 +0100 +Subject: [PATCH 132/156] 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 +to ensure this manually, so add locking around all access to shared +mutable data. In particular, bcm2835_audio_set_ctls() should +probably always be called under our own audio lock. +--- + sound/arm/bcm2835-ctl.c | 74 +++++++++++++++++++++++++++++++++++++++++-------- + sound/arm/bcm2835-pcm.c | 4 +++ + 2 files changed, 66 insertions(+), 12 deletions(-) + +--- a/sound/arm/bcm2835-ctl.c ++++ b/sound/arm/bcm2835-ctl.c +@@ -94,6 +94,9 @@ static int snd_bcm2835_ctl_get(struct sn + { + struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); + ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ + BUG_ON(!chip && !(chip->avail_substreams & AVAIL_SUBSTREAMS_MASK)); + + if (kcontrol->private_value == PCM_PLAYBACK_VOLUME) +@@ -103,6 +106,7 @@ static int snd_bcm2835_ctl_get(struct sn + else if (kcontrol->private_value == PCM_PLAYBACK_DEVICE) + ucontrol->value.integer.value[0] = chip->dest; + ++ mutex_unlock(&chip->audio_mutex); + return 0; + } + +@@ -112,11 +116,15 @@ static int snd_bcm2835_ctl_put(struct sn + struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); + int changed = 0; + ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ + if (kcontrol->private_value == PCM_PLAYBACK_VOLUME) { + audio_info("Volume change attempted.. volume = %d new_volume = %d\n", chip->volume, (int)ucontrol->value.integer.value[0]); + if (chip->mute == CTRL_VOL_MUTE) { + /* changed = toggle_mute(chip, CTRL_VOL_UNMUTE); */ +- return 1; /* should return 0 to signify no change but the mixer takes this as the opposite sign (no idea why) */ ++ changed = 1; /* should return 0 to signify no change but the mixer takes this as the opposite sign (no idea why) */ ++ goto unlock; + } + if (changed + || (ucontrol->value.integer.value[0] != chip2alsa(chip->volume))) { +@@ -142,6 +150,8 @@ static int snd_bcm2835_ctl_put(struct sn + printk(KERN_ERR "Failed to set ALSA controls..\n"); + } + ++unlock: ++ mutex_unlock(&chip->audio_mutex); + return changed; + } + +@@ -198,10 +208,14 @@ static int snd_bcm2835_spdif_default_get + struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); + int i; + ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ + for (i = 0; i < 4; i++) + ucontrol->value.iec958.status[i] = + (chip->spdif_status >> (i * 8)) && 0xff; + ++ mutex_unlock(&chip->audio_mutex); + return 0; + } + +@@ -212,12 +226,16 @@ static int snd_bcm2835_spdif_default_put + unsigned int val = 0; + int i, change; + ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ + for (i = 0; i < 4; i++) + val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8); + + change = val != chip->spdif_status; + chip->spdif_status = val; + ++ mutex_unlock(&chip->audio_mutex); + return change; + } + +@@ -253,9 +271,14 @@ static int snd_bcm2835_spdif_stream_get( + struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); + int i; + ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ + for (i = 0; i < 4; i++) + ucontrol->value.iec958.status[i] = + (chip->spdif_status >> (i * 8)) & 0xff; ++ ++ mutex_unlock(&chip->audio_mutex); + return 0; + } + +@@ -266,11 +289,15 @@ static int snd_bcm2835_spdif_stream_put( + unsigned int val = 0; + int i, change; + ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ + for (i = 0; i < 4; i++) + val |= (unsigned int)ucontrol->value.iec958.status[i] << (i * 8); + change = val != chip->spdif_status; + chip->spdif_status = val; + ++ mutex_unlock(&chip->audio_mutex); + return change; + } + +@@ -454,11 +481,17 @@ static int snd_bcm2835_chmap_ctl_get(str + unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); + struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx); + struct cea_channel_speaker_allocation *ch = NULL; ++ int res = 0; + int cur = 0; + int i; + +- if (!substream || !substream->runtime) +- return -ENODEV; ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ ++ if (!substream || !substream->runtime) { ++ res = -ENODEV; ++ goto unlock; ++ } + + for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { + if (channel_allocations[i].ca_index == chip->cea_chmap) +@@ -476,7 +509,10 @@ static int snd_bcm2835_chmap_ctl_get(str + } + while (cur < 8) + ucontrol->value.integer.value[cur++] = SNDRV_CHMAP_NA; +- return 0; ++ ++unlock: ++ mutex_unlock(&chip->audio_mutex); ++ return res; + } + + static int snd_bcm2835_chmap_ctl_put(struct snd_kcontrol *kcontrol, +@@ -487,10 +523,16 @@ static int snd_bcm2835_chmap_ctl_put(str + unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); + struct snd_pcm_substream *substream = snd_pcm_chmap_substream(info, idx); + int i, prepared = 0, cea_chmap = -1; ++ int res = 0; + int remap[8]; + +- if (!substream || !substream->runtime) +- return -ENODEV; ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ ++ if (!substream || !substream->runtime) { ++ res = -ENODEV; ++ goto unlock; ++ } + + switch (substream->runtime->status->state) { + case SNDRV_PCM_STATE_OPEN: +@@ -500,7 +542,8 @@ static int snd_bcm2835_chmap_ctl_put(str + prepared = 1; + break; + default: +- return -EBUSY; ++ res = -EBUSY; ++ goto unlock; + } + + for (i = 0; i < ARRAY_SIZE(channel_allocations); i++) { +@@ -538,19 +581,26 @@ static int snd_bcm2835_chmap_ctl_put(str + } + } + +- if (cea_chmap < 0) +- return -EINVAL; ++ if (cea_chmap < 0) { ++ res = -EINVAL; ++ goto unlock; ++ } + + /* don't change the layout if another substream is active */ +- if (chip->opened != (1 << substream->number) && chip->cea_chmap != cea_chmap) +- return -EBUSY; /* unsure whether this is a good error code */ ++ if (chip->opened != (1 << substream->number) && chip->cea_chmap != cea_chmap) { ++ res = -EBUSY; /* unsure whether this is a good error code */ ++ goto unlock; ++ } + + chip->cea_chmap = cea_chmap; + for (i = 0; i < 8; i++) + chip->map_channels[i] = remap[i]; + if (prepared) + snd_bcm2835_pcm_prepare_again(substream); +- return 0; ++ ++unlock: ++ mutex_unlock(&chip->audio_mutex); ++ return res; + } + + static int snd_bcm2835_add_chmap_ctl(bcm2835_chip_t * chip) +--- a/sound/arm/bcm2835-pcm.c ++++ b/sound/arm/bcm2835-pcm.c +@@ -379,6 +379,9 @@ static int snd_bcm2835_pcm_prepare(struc + + audio_info(" .. IN\n"); + ++ if (mutex_lock_interruptible(&chip->audio_mutex)) ++ return -EINTR; ++ + snd_bcm2835_pcm_prepare_again(substream); + + bcm2835_audio_setup(alsa_stream); +@@ -401,6 +404,7 @@ static int snd_bcm2835_pcm_prepare(struc + alsa_stream->buffer_size, alsa_stream->period_size, + alsa_stream->pos, runtime->frame_bits); + ++ mutex_unlock(&chip->audio_mutex); + audio_info(" .. OUT\n"); + return 0; + } diff --git a/target/linux/brcm2708/patches-4.4/0133-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch b/target/linux/brcm2708/patches-4.4/0133-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch new file mode 100644 index 0000000000..aecc0b8e96 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0133-bcm2835-always-use-2-4-8-channels-for-multichannel-l.patch @@ -0,0 +1,139 @@ +From 77f9e51079d33d5a84c1b737e13ed6e6a9fd3903 Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:44:03 +0100 +Subject: [PATCH 133/156] 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 +than noise. + +Works around noise at the following channel counts: 3, 5, 6, 7 +--- + sound/arm/bcm2835-ctl.c | 89 +++++++++++++++++++++++++------------------------ + 1 file changed, 45 insertions(+), 44 deletions(-) + +--- a/sound/arm/bcm2835-ctl.c ++++ b/sound/arm/bcm2835-ctl.c +@@ -349,6 +349,7 @@ struct cea_channel_speaker_allocation { + #define FRW SNDRV_CHMAP_FRW + #define TC SNDRV_CHMAP_TC + #define FCH SNDRV_CHMAP_TFC ++#define NA SNDRV_CHMAP_NA + + /* + * CEA-861 channel maps +@@ -356,69 +357,69 @@ struct cea_channel_speaker_allocation { + * Stolen from sound/pci/hda/patch_hdmi.c + * (unlike the source, this uses SNDRV_* constants directly, as by the + * map_tables array in patch_hdmi.c) +- * Unknown entries use 0, which unfortunately is SNDRV_CHMAP_UNKNOWN instead +- * of SNDRV_CHMAP_NA. ++ * Entries which do not have a physical output channel use 0. Entries which ++ * require userspace to output silence use NA (SNDRV_CHMAP_NA). + */ + static struct cea_channel_speaker_allocation channel_allocations[] = { + /* channel: 7 6 5 4 3 2 1 0 */ + { .ca_index = 0x00, .speakers = { 0, 0, 0, 0, 0, 0, FR, FL } }, + /* 2.1 */ +-{ .ca_index = 0x01, .speakers = { 0, 0, 0, 0, 0, LFE, FR, FL } }, ++{ .ca_index = 0x01, .speakers = { 0, 0, 0, 0, NA, LFE, FR, FL } }, + /* Dolby Surround */ +-{ .ca_index = 0x02, .speakers = { 0, 0, 0, 0, FC, 0, FR, FL } }, ++{ .ca_index = 0x02, .speakers = { 0, 0, 0, 0, FC, NA, FR, FL } }, + /* surround40 */ +-{ .ca_index = 0x08, .speakers = { 0, 0, RR, RL, 0, 0, FR, FL } }, ++{ .ca_index = 0x08, .speakers = { NA, NA, RR, RL, NA, NA, FR, FL } }, + /* surround41 */ +-{ .ca_index = 0x09, .speakers = { 0, 0, RR, RL, 0, LFE, FR, FL } }, ++{ .ca_index = 0x09, .speakers = { NA, NA, RR, RL, NA, LFE, FR, FL } }, + /* surround50 */ +-{ .ca_index = 0x0a, .speakers = { 0, 0, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x0a, .speakers = { NA, NA, RR, RL, FC, NA, FR, FL } }, + /* surround51 */ +-{ .ca_index = 0x0b, .speakers = { 0, 0, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x0b, .speakers = { NA, NA, RR, RL, FC, LFE, FR, FL } }, + /* 6.1 */ +-{ .ca_index = 0x0f, .speakers = { 0, RC, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x0f, .speakers = { NA, RC, RR, RL, FC, LFE, FR, FL } }, + /* surround71 */ + { .ca_index = 0x13, .speakers = { RRC, RLC, RR, RL, FC, LFE, FR, FL } }, + +-{ .ca_index = 0x03, .speakers = { 0, 0, 0, 0, FC, LFE, FR, FL } }, +-{ .ca_index = 0x04, .speakers = { 0, 0, 0, RC, 0, 0, FR, FL } }, +-{ .ca_index = 0x05, .speakers = { 0, 0, 0, RC, 0, LFE, FR, FL } }, +-{ .ca_index = 0x06, .speakers = { 0, 0, 0, RC, FC, 0, FR, FL } }, +-{ .ca_index = 0x07, .speakers = { 0, 0, 0, RC, FC, LFE, FR, FL } }, +-{ .ca_index = 0x0c, .speakers = { 0, RC, RR, RL, 0, 0, FR, FL } }, +-{ .ca_index = 0x0d, .speakers = { 0, RC, RR, RL, 0, LFE, FR, FL } }, +-{ .ca_index = 0x0e, .speakers = { 0, RC, RR, RL, FC, 0, FR, FL } }, +-{ .ca_index = 0x10, .speakers = { RRC, RLC, RR, RL, 0, 0, FR, FL } }, +-{ .ca_index = 0x11, .speakers = { RRC, RLC, RR, RL, 0, LFE, FR, FL } }, +-{ .ca_index = 0x12, .speakers = { RRC, RLC, RR, RL, FC, 0, FR, FL } }, +-{ .ca_index = 0x14, .speakers = { FRC, FLC, 0, 0, 0, 0, FR, FL } }, +-{ .ca_index = 0x15, .speakers = { FRC, FLC, 0, 0, 0, LFE, FR, FL } }, +-{ .ca_index = 0x16, .speakers = { FRC, FLC, 0, 0, FC, 0, FR, FL } }, +-{ .ca_index = 0x17, .speakers = { FRC, FLC, 0, 0, FC, LFE, FR, FL } }, +-{ .ca_index = 0x18, .speakers = { FRC, FLC, 0, RC, 0, 0, FR, FL } }, +-{ .ca_index = 0x19, .speakers = { FRC, FLC, 0, RC, 0, LFE, FR, FL } }, +-{ .ca_index = 0x1a, .speakers = { FRC, FLC, 0, RC, FC, 0, FR, FL } }, +-{ .ca_index = 0x1b, .speakers = { FRC, FLC, 0, RC, FC, LFE, FR, FL } }, +-{ .ca_index = 0x1c, .speakers = { FRC, FLC, RR, RL, 0, 0, FR, FL } }, +-{ .ca_index = 0x1d, .speakers = { FRC, FLC, RR, RL, 0, LFE, FR, FL } }, +-{ .ca_index = 0x1e, .speakers = { FRC, FLC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x03, .speakers = { NA, NA, NA, NA, FC, LFE, FR, FL } }, ++{ .ca_index = 0x04, .speakers = { NA, NA, NA, RC, NA, NA, FR, FL } }, ++{ .ca_index = 0x05, .speakers = { NA, NA, NA, RC, NA, LFE, FR, FL } }, ++{ .ca_index = 0x06, .speakers = { NA, NA, NA, RC, FC, NA, FR, FL } }, ++{ .ca_index = 0x07, .speakers = { NA, NA, NA, RC, FC, LFE, FR, FL } }, ++{ .ca_index = 0x0c, .speakers = { NA, RC, RR, RL, NA, NA, FR, FL } }, ++{ .ca_index = 0x0d, .speakers = { NA, RC, RR, RL, NA, LFE, FR, FL } }, ++{ .ca_index = 0x0e, .speakers = { NA, RC, RR, RL, FC, NA, FR, FL } }, ++{ .ca_index = 0x10, .speakers = { RRC, RLC, RR, RL, NA, NA, FR, FL } }, ++{ .ca_index = 0x11, .speakers = { RRC, RLC, RR, RL, NA, LFE, FR, FL } }, ++{ .ca_index = 0x12, .speakers = { RRC, RLC, RR, RL, FC, NA, FR, FL } }, ++{ .ca_index = 0x14, .speakers = { FRC, FLC, NA, NA, NA, NA, FR, FL } }, ++{ .ca_index = 0x15, .speakers = { FRC, FLC, NA, NA, NA, LFE, FR, FL } }, ++{ .ca_index = 0x16, .speakers = { FRC, FLC, NA, NA, FC, NA, FR, FL } }, ++{ .ca_index = 0x17, .speakers = { FRC, FLC, NA, NA, FC, LFE, FR, FL } }, ++{ .ca_index = 0x18, .speakers = { FRC, FLC, NA, RC, NA, NA, FR, FL } }, ++{ .ca_index = 0x19, .speakers = { FRC, FLC, NA, RC, NA, LFE, FR, FL } }, ++{ .ca_index = 0x1a, .speakers = { FRC, FLC, NA, RC, FC, NA, FR, FL } }, ++{ .ca_index = 0x1b, .speakers = { FRC, FLC, NA, RC, FC, LFE, FR, FL } }, ++{ .ca_index = 0x1c, .speakers = { FRC, FLC, RR, RL, NA, NA, FR, FL } }, ++{ .ca_index = 0x1d, .speakers = { FRC, FLC, RR, RL, NA, LFE, FR, FL } }, ++{ .ca_index = 0x1e, .speakers = { FRC, FLC, RR, RL, FC, NA, FR, FL } }, + { .ca_index = 0x1f, .speakers = { FRC, FLC, RR, RL, FC, LFE, FR, FL } }, +-{ .ca_index = 0x20, .speakers = { 0, FCH, RR, RL, FC, 0, FR, FL } }, +-{ .ca_index = 0x21, .speakers = { 0, FCH, RR, RL, FC, LFE, FR, FL } }, +-{ .ca_index = 0x22, .speakers = { TC, 0, RR, RL, FC, 0, FR, FL } }, +-{ .ca_index = 0x23, .speakers = { TC, 0, RR, RL, FC, LFE, FR, FL } }, +-{ .ca_index = 0x24, .speakers = { FRH, FLH, RR, RL, 0, 0, FR, FL } }, +-{ .ca_index = 0x25, .speakers = { FRH, FLH, RR, RL, 0, LFE, FR, FL } }, +-{ .ca_index = 0x26, .speakers = { FRW, FLW, RR, RL, 0, 0, FR, FL } }, +-{ .ca_index = 0x27, .speakers = { FRW, FLW, RR, RL, 0, LFE, FR, FL } }, +-{ .ca_index = 0x28, .speakers = { TC, RC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x20, .speakers = { NA, FCH, RR, RL, FC, NA, FR, FL } }, ++{ .ca_index = 0x21, .speakers = { NA, FCH, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x22, .speakers = { TC, NA, RR, RL, FC, NA, FR, FL } }, ++{ .ca_index = 0x23, .speakers = { TC, NA, RR, RL, FC, LFE, FR, FL } }, ++{ .ca_index = 0x24, .speakers = { FRH, FLH, RR, RL, NA, NA, FR, FL } }, ++{ .ca_index = 0x25, .speakers = { FRH, FLH, RR, RL, NA, LFE, FR, FL } }, ++{ .ca_index = 0x26, .speakers = { FRW, FLW, RR, RL, NA, NA, FR, FL } }, ++{ .ca_index = 0x27, .speakers = { FRW, FLW, RR, RL, NA, LFE, FR, FL } }, ++{ .ca_index = 0x28, .speakers = { TC, RC, RR, RL, FC, NA, FR, FL } }, + { .ca_index = 0x29, .speakers = { TC, RC, RR, RL, FC, LFE, FR, FL } }, +-{ .ca_index = 0x2a, .speakers = { FCH, RC, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x2a, .speakers = { FCH, RC, RR, RL, FC, NA, FR, FL } }, + { .ca_index = 0x2b, .speakers = { FCH, RC, RR, RL, FC, LFE, FR, FL } }, +-{ .ca_index = 0x2c, .speakers = { TC, FCH, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x2c, .speakers = { TC, FCH, RR, RL, FC, NA, FR, FL } }, + { .ca_index = 0x2d, .speakers = { TC, FCH, RR, RL, FC, LFE, FR, FL } }, +-{ .ca_index = 0x2e, .speakers = { FRH, FLH, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x2e, .speakers = { FRH, FLH, RR, RL, FC, NA, FR, FL } }, + { .ca_index = 0x2f, .speakers = { FRH, FLH, RR, RL, FC, LFE, FR, FL } }, +-{ .ca_index = 0x30, .speakers = { FRW, FLW, RR, RL, FC, 0, FR, FL } }, ++{ .ca_index = 0x30, .speakers = { FRW, FLW, RR, RL, FC, NA, FR, FL } }, + { .ca_index = 0x31, .speakers = { FRW, FLW, RR, RL, FC, LFE, FR, FL } }, + }; + diff --git a/target/linux/brcm2708/patches-4.4/0134-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch b/target/linux/brcm2708/patches-4.4/0134-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch new file mode 100644 index 0000000000..e7bdfc7a3c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0134-bcm2835-only-allow-stereo-if-analogue-jack-is-select.patch @@ -0,0 +1,62 @@ +From 22606ad9e0d809ce0d4e12b51d5b4c6507f89c2d Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:44:24 +0100 +Subject: [PATCH 134/156] 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 +hack: if analogue is explicitly selected as destination, do not +reporting support for anything other than stereo. + +I'm not sure how to deal with the auto case (destination 0). There's +probably way to retrieve this and even to listen to plug events, but +I didn't find one yet, and it's probably not worth the trouble. Just +don't use this setting, I guess. Unless you like noise. + +Changing the setting while an audio stream is active also doesn't +work properly. We could probably interrupt running streams by +returning ENODEV or using kernel hotplug stuff (maybe), but that +also doesn't seem worth the trouble. +--- + sound/arm/bcm2835-ctl.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/sound/arm/bcm2835-ctl.c ++++ b/sound/arm/bcm2835-ctl.c +@@ -423,9 +423,16 @@ static struct cea_channel_speaker_alloca + { .ca_index = 0x31, .speakers = { FRW, FLW, RR, RL, FC, LFE, FR, FL } }, + }; + ++static int uses_analogue(bcm2835_chip_t *chip) ++{ ++ return chip->dest == 1; ++} ++ + static int snd_bcm2835_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag, + unsigned int size, unsigned int __user *tlv) + { ++ struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol); ++ bcm2835_chip_t *chip = info->private_data; + unsigned int __user *dst; + int count = 0; + int i; +@@ -442,6 +449,9 @@ static int snd_bcm2835_chmap_ctl_tlv(str + int chs_bytes; + int c; + ++ if (i > 0 && uses_analogue(chip)) ++ break; ++ + for (c = 0; c < 8; c++) { + if (ch->speakers[c]) + num_chs++; +@@ -552,6 +562,8 @@ static int snd_bcm2835_chmap_ctl_put(str + int matches = 1; + int cur = 0; + int x; ++ if (i > 0 && uses_analogue(chip)) ++ break; + memset(remap, 0, sizeof(remap)); + for (x = 0; x < substream->runtime->channels; x++) { + int sp = ucontrol->value.integer.value[x]; diff --git a/target/linux/brcm2708/patches-4.4/0135-bcm2835-interpolate-audio-delay.patch b/target/linux/brcm2708/patches-4.4/0135-bcm2835-interpolate-audio-delay.patch new file mode 100644 index 0000000000..0c49841d40 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0135-bcm2835-interpolate-audio-delay.patch @@ -0,0 +1,90 @@ +From d53d9217b5906b4046c12c7ddd56911e447de9f2 Mon Sep 17 00:00:00 2001 +From: wm4 +Date: Wed, 13 Jan 2016 19:44:47 +0100 +Subject: [PATCH 135/156] 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 +(what SNDRV_PCM_IOCTL_DELAY will return) is not updated at all. +Userspace will see jitter up to 10ms in the audio position. + +Make this a bit nicer for userspace by interpolating the +position using the CPU clock. + +I'm not sure if setting snd_pcm_runtime.delay is the right +approach for this. Or if there is maybe an already existing +mechanism for position interpolation in the ALSA core. + +I only set SNDRV_PCM_INFO_BATCH because this appears to remove +at least one situation snd_pcm_runtime.delay is used, so I have +to worry less in which place I have to update this field, or +how it interacts with the rest of ALSA. + +In the future, it might be nice to use VC_AUDIO_MSG_TYPE_LATENCY. +One problem is that it requires sending a videocore message, and +waiting for a reply, which could make the implementation much +harder due to locking and synchronization requirements. +--- + sound/arm/bcm2835-pcm.c | 12 +++++++++++- + sound/arm/bcm2835.h | 1 + + 2 files changed, 12 insertions(+), 1 deletion(-) + +--- a/sound/arm/bcm2835-pcm.c ++++ b/sound/arm/bcm2835-pcm.c +@@ -25,7 +25,7 @@ + /* hardware definition */ + static struct snd_pcm_hardware snd_bcm2835_playback_hw = { + .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | +- SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), ++ SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_BATCH), + .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, + .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, + .rate_min = 8000, +@@ -99,6 +99,8 @@ static irqreturn_t bcm2835_playback_fifo + alsa_stream->pos %= alsa_stream->buffer_size; + } + ++ alsa_stream->interpolate_start = ktime_get_ns(); ++ + if (alsa_stream->substream) { + if (new_period) + snd_pcm_period_elapsed(alsa_stream->substream); +@@ -399,6 +401,7 @@ static int snd_bcm2835_pcm_prepare(struc + alsa_stream->buffer_size = snd_pcm_lib_buffer_bytes(substream); + alsa_stream->period_size = snd_pcm_lib_period_bytes(substream); + alsa_stream->pos = 0; ++ alsa_stream->interpolate_start = ktime_get_ns(); + + audio_debug("buffer_size=%d, period_size=%d pos=%d frame_bits=%d\n", + alsa_stream->buffer_size, alsa_stream->period_size, +@@ -495,6 +498,7 @@ snd_bcm2835_pcm_pointer(struct snd_pcm_s + { + struct snd_pcm_runtime *runtime = substream->runtime; + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data; ++ u64 now = ktime_get_ns(); + + audio_info(" .. IN\n"); + +@@ -503,6 +507,12 @@ snd_bcm2835_pcm_pointer(struct snd_pcm_s + frames_to_bytes(runtime, runtime->control->appl_ptr), + alsa_stream->pos); + ++ /* Give userspace better delay reporting by interpolating between GPU ++ * notifications, assuming audio speed is close enough to the clock ++ * used for ktime */ ++ if (alsa_stream->interpolate_start && alsa_stream->interpolate_start < now) ++ runtime->delay = -(int)div_u64((now - alsa_stream->interpolate_start) * runtime->rate, 1000000000); ++ + audio_info(" .. OUT\n"); + return snd_pcm_indirect_playback_pointer(substream, + &alsa_stream->pcm_indirect, +--- a/sound/arm/bcm2835.h ++++ b/sound/arm/bcm2835.h +@@ -137,6 +137,7 @@ typedef struct bcm2835_alsa_stream { + unsigned int pos; + unsigned int buffer_size; + unsigned int period_size; ++ u64 interpolate_start; + + uint32_t enable_fifo_irq; + irq_handler_t fifo_irq_handler; diff --git a/target/linux/brcm2708/patches-4.4/0136-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch b/target/linux/brcm2708/patches-4.4/0136-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch new file mode 100644 index 0000000000..bbfcbfa74c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0136-bcm2835-sdhost-Add-workaround-for-odd-behaviour-on-s.patch @@ -0,0 +1,137 @@ +From f99bed36f644ebf32e90f49559aac7a663a9fa59 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 19 Jan 2016 17:16:38 +0000 +Subject: [PATCH 136/156] 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 +be related to the similar issue that reading the final sector +of any card as part of a multiple read never completes, and the +workaround is an extension of the mechanism introduced to solve +that problem which ensures those sectors are always read singly. +--- + drivers/mmc/host/bcm2835-sdhost.c | 61 +++++++++++++++++++++++++++++++++------ + 1 file changed, 52 insertions(+), 9 deletions(-) + +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -173,6 +173,9 @@ struct bcm2835_host { + 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) */ ++ ++ u32 sectors; /* Cached card size in sectors */ ++ u32 single_read_sectors[8]; + }; + + +@@ -277,6 +280,9 @@ static void bcm2835_sdhost_reset_interna + { + u32 temp; + ++ if (host->debug) ++ pr_info("%s: reset\n", mmc_hostname(host->mmc)); ++ + bcm2835_sdhost_set_power(host, false); + + bcm2835_sdhost_write(host, 0, SDCMD); +@@ -299,6 +305,8 @@ static void bcm2835_sdhost_reset_interna + bcm2835_sdhost_set_power(host, true); + mdelay(10); + host->clock = 0; ++ host->sectors = 0; ++ host->single_read_sectors[0] = ~0; + bcm2835_sdhost_write(host, host->hcfg, SDHCFG); + bcm2835_sdhost_write(host, host->cdiv, SDCDIV); + mmiowb(); +@@ -309,8 +317,6 @@ static void bcm2835_sdhost_reset(struct + { + struct bcm2835_host *host = mmc_priv(mmc); + unsigned long flags; +- if (host->debug) +- pr_info("%s: reset\n", mmc_hostname(mmc)); + spin_lock_irqsave(&host->lock, flags); + + bcm2835_sdhost_reset_internal(host); +@@ -676,6 +682,32 @@ static void bcm2835_sdhost_prepare_data( + host->flush_fifo = 0; + host->data->bytes_xfered = 0; + ++ if (!host->sectors && host->mmc->card) ++ { ++ struct mmc_card *card = host->mmc->card; ++ if (!mmc_card_sd(card) && mmc_card_blockaddr(card)) { ++ /* ++ * The EXT_CSD sector count is in number of 512 byte ++ * sectors. ++ */ ++ host->sectors = card->ext_csd.sectors; ++ pr_err("%s: using ext_csd!\n", mmc_hostname(host->mmc)); ++ } else { ++ /* ++ * The CSD capacity field is in units of read_blkbits. ++ * set_capacity takes units of 512 bytes. ++ */ ++ host->sectors = card->csd.capacity << ++ (card->csd.read_blkbits - 9); ++ } ++ host->single_read_sectors[0] = host->sectors - 65; ++ host->single_read_sectors[1] = host->sectors - 64; ++ host->single_read_sectors[2] = host->sectors - 33; ++ host->single_read_sectors[3] = host->sectors - 32; ++ host->single_read_sectors[4] = host->sectors - 1; ++ host->single_read_sectors[5] = ~0; /* Safety net */ ++ } ++ + host->use_dma = host->have_dma && (data->blocks > host->pio_limit); + if (!host->use_dma) { + int flags; +@@ -1246,6 +1278,10 @@ static u32 bcm2835_sdhost_block_irq(stru + + bcm2835_sdhost_finish_data(host); + } else { ++ /* Reset the timer */ ++ mod_timer(&host->pio_timer, ++ jiffies + host->pio_timeout); ++ + bcm2835_sdhost_transfer_pio(host); + + /* Reset the timer */ +@@ -1450,8 +1486,8 @@ void bcm2835_sdhost_set_clock(struct bcm + host->cdiv = div; + bcm2835_sdhost_write(host, host->cdiv, SDCDIV); + +- /* Set the timeout to 500ms */ +- bcm2835_sdhost_write(host, host->mmc->actual_clock/2, SDTOUT); ++ /* Set the timeout to 250ms */ ++ bcm2835_sdhost_write(host, host->mmc->actual_clock/4, SDTOUT); + + if (host->debug) + pr_info("%s: clock=%d -> max_clk=%d, cdiv=%x (actual clock %d)\n", +@@ -1566,13 +1602,20 @@ static int bcm2835_sdhost_multi_io_quirk + reading the final sector of the card as part of a multiple read + problematic. Detect that case and shorten the read accordingly. + */ +- /* csd.capacity is in weird units - convert to sectors */ +- u32 card_sectors = (card->csd.capacity << (card->csd.read_blkbits - 9)); ++ struct bcm2835_host *host; ++ ++ host = mmc_priv(card->host); + +- if ((direction == MMC_DATA_READ) && +- ((blk_pos + blk_size) == card_sectors)) +- blk_size--; ++ if (direction == MMC_DATA_READ) ++ { ++ int i; ++ int sector; ++ for (i = 0; blk_pos > (sector = host->single_read_sectors[i]); i++) ++ continue; + ++ if ((blk_pos + blk_size) > sector) ++ blk_size = (blk_pos == sector) ? 1 : (sector - blk_pos); ++ } + return blk_size; + } + diff --git a/target/linux/brcm2708/patches-4.4/0137-bcm2835-sdhost-Add-debug_flags-dtparam.patch b/target/linux/brcm2708/patches-4.4/0137-bcm2835-sdhost-Add-debug_flags-dtparam.patch new file mode 100644 index 0000000000..099ec19b62 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0137-bcm2835-sdhost-Add-debug_flags-dtparam.patch @@ -0,0 +1,120 @@ +From 14c85ba09ef4df26073d9430c1a42fd39a1e3019 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 22 Jan 2016 16:03:24 +0000 +Subject: [PATCH 137/156] bcm2835-sdhost: Add debug_flags dtparam + +Bit zero disables the single-read-sectors map: + +If the default MMC driver is bcm2835-mmc: + dtoverlay=sdhost,debug_flags=1 +If the default MMC driver is bcm2835-sdhost: + dtoverlay=sdtweak,debug_flags=1 +(although the sdhost overlay may also work, sdtweak is +less invasive and will work in more circumstances). + +Also revert the timeout change, just in case. +--- + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 2 ++ + arch/arm/boot/dts/overlays/sdtweak-overlay.dts | 2 ++ + drivers/mmc/host/bcm2835-sdhost.c | 26 +++++++++++++++++++++----- + 3 files changed, 25 insertions(+), 5 deletions(-) + +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -16,6 +16,7 @@ + frag1: __overlay__ { + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; ++ brcm,debug-flags = <0>; + status = "okay"; + }; + }; +@@ -25,5 +26,6 @@ + force_pio = <&frag1>,"brcm,force-pio?"; + pio_limit = <&frag1>,"brcm,pio-limit:0"; + debug = <&frag1>,"brcm,debug?"; ++ debug_flags = <&frag1>,"brcm,debug-flags:0"; + }; + }; +--- a/arch/arm/boot/dts/overlays/sdtweak-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdtweak-overlay.dts +@@ -9,6 +9,7 @@ + frag1: __overlay__ { + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; ++ brcm,debug-flags = <0>; + }; + }; + +@@ -17,5 +18,6 @@ + force_pio = <&frag1>,"brcm,force-pio?"; + pio_limit = <&frag1>,"brcm,pio-limit:0"; + debug = <&frag1>,"brcm,debug?"; ++ debug_flags = <&frag1>,"brcm,debug-flags:0"; + }; + }; +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -174,6 +174,8 @@ struct bcm2835_host { + u32 overclock; /* Current frequency if overclocked, else zero */ + u32 pio_limit; /* Maximum block count for PIO (0 = always DMA) */ + ++ u32 debug_flags; ++ + u32 sectors; /* Cached card size in sectors */ + u32 single_read_sectors[8]; + }; +@@ -682,7 +684,7 @@ static void bcm2835_sdhost_prepare_data( + host->flush_fifo = 0; + host->data->bytes_xfered = 0; + +- if (!host->sectors && host->mmc->card) ++ if (!host->sectors && host->mmc->card && !(host->debug_flags & 1)) + { + struct mmc_card *card = host->mmc->card; + if (!mmc_card_sd(card) && mmc_card_blockaddr(card)) { +@@ -1486,8 +1488,8 @@ void bcm2835_sdhost_set_clock(struct bcm + host->cdiv = div; + bcm2835_sdhost_write(host, host->cdiv, SDCDIV); + +- /* Set the timeout to 250ms */ +- bcm2835_sdhost_write(host, host->mmc->actual_clock/4, SDTOUT); ++ /* Set the timeout to 500ms */ ++ bcm2835_sdhost_write(host, host->mmc->actual_clock/2, SDTOUT); + + if (host->debug) + pr_info("%s: clock=%d -> max_clk=%d, cdiv=%x (actual clock %d)\n", +@@ -1606,8 +1608,16 @@ static int bcm2835_sdhost_multi_io_quirk + + host = mmc_priv(card->host); + +- if (direction == MMC_DATA_READ) +- { ++ if (!host->sectors) { ++ /* csd.capacity is in weird units - convert to sectors */ ++ u32 card_sectors = (card->csd.capacity << (card->csd.read_blkbits - 9)); ++ if ((direction == MMC_DATA_READ) && ++ ((blk_pos + blk_size) == card_sectors)) ++ blk_size--; ++ return blk_size; ++ } ++ ++ if (direction == MMC_DATA_READ) { + int i; + int sector; + for (i = 0; blk_pos > (sector = host->single_read_sectors[i]); i++) +@@ -1838,8 +1848,14 @@ static int bcm2835_sdhost_probe(struct p + host->allow_dma = ALLOW_DMA && + !of_property_read_bool(node, "brcm,force-pio"); + host->debug = of_property_read_bool(node, "brcm,debug"); ++ of_property_read_u32(node, ++ "brcm,debug-flags", ++ &host->debug_flags); + } + ++ if (host->debug_flags) ++ dev_err(dev, "debug_flags=%x\n", host->debug_flags); ++ + if (host->allow_dma) { + if (node) { + host->dma_chan_tx = diff --git a/target/linux/brcm2708/patches-4.4/0138-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch b/target/linux/brcm2708/patches-4.4/0138-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch new file mode 100644 index 0000000000..9d0e83a31c --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0138-BCM270X_DT-Add-sdio_overclock-parameter-to-sdio-over.patch @@ -0,0 +1,69 @@ +From 94dab6838e9ba91d6da49d864b0f408a89f08ce5 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 25 Jan 2016 09:12:06 +0000 +Subject: [PATCH 138/156] 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 +requests 50MHz, except that it applies to the SDIO bus. + +Be aware that the actual frequencies achievable are limited to even integer +divisions of 250MHz, and that the driver will round up to include fractions +(e.g. 62 will include 62.5) but then round down to the nearest frequency. +In other words, the chosen frequency is the highest possible that is less than +the parameter value + 1. In practise this means that 62 is the only sensible +value. + +Examples: + 250MHz/4 = 62.5MHz (sdio_overclock=62) + 250MHz/2 = 125MHz (sdio_overclock=125) # Too fast +--- + arch/arm/boot/dts/overlays/README | 9 ++++++--- + arch/arm/boot/dts/overlays/sdio-overlay.dts | 2 ++ + 2 files changed, 8 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -53,8 +53,8 @@ have its contents deleted (or commented + Using Overlays + ============== + +-Overlays are loaded using the "dtoverlay" directive. As an example, consider the +-popular lirc-rpi module, the Linux Infrared Remote Control driver. In the ++Overlays are loaded using the "dtoverlay" directive. As an example, consider ++the popular lirc-rpi module, the Linux Infrared Remote Control driver. In the + pre-DT world this would be loaded from /etc/modules, with an explicit + "modprobe lirc-rpi" command, or programmatically by lircd. With DT enabled, + this becomes a line in config.txt: +@@ -621,9 +621,12 @@ Name: sdio + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, + and enables SDIO via GPIOs 22-27. + Load: dtoverlay=sdio,= +-Params: overclock_50 Clock (in MHz) to use when the MMC framework ++Params: overclock_50 SD Clock (in MHz) to use when the MMC framework + requests 50MHz + ++ sdio_overclock SDIO Clock (in MHz) to use when the MMC ++ framework requests 50MHz ++ + force_pio Disable DMA support (default off) + + pio_limit Number of blocks above which to use DMA +--- a/arch/arm/boot/dts/overlays/sdio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts +@@ -12,6 +12,7 @@ + pinctrl-0 = <&sdio_pins>; + non-removable; + bus-width = <4>; ++ brcm,overclock-50 = <0>; + status = "okay"; + }; + }; +@@ -30,5 +31,6 @@ + __overrides__ { + poll_once = <&sdio_mmc>,"non-removable?"; + bus_width = <&sdio_mmc>,"bus-width:0"; ++ sdio_overclock = <&sdio_mmc>,"brcm,overclock-50:0"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0139-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch b/target/linux/brcm2708/patches-4.4/0139-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch new file mode 100644 index 0000000000..8e93021b90 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0139-rtc-ds1307-add-support-for-the-DT-property-wakeup-so.patch @@ -0,0 +1,94 @@ +From 480a2a2365b4fda2c6bdb96a6ce8bc0b64899fe4 Mon Sep 17 00:00:00 2001 +From: Michael Lange +Date: Thu, 21 Jan 2016 18:10:16 +0100 +Subject: [PATCH 139/156] 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 +the device's .dts file using the "wakeup-source" boolean property. +This will guarantee the 'wakealarm' sysfs entry is available on the +device, if supported by the RTC. + +With these changes to the driver rtc-ds1307 and the necessary entries +in the .dts file, I get an working ds1337 RTC on the Witty Pi extension +board by UUGear for the Raspberry Pi. + +An example for the entry in the .dts file: + + rtc: ds1337@68 { + compatible = "dallas,ds1337"; + reg = <0x68>; + wakeup-source; + +If the "wakeup-source" property is set, do not request an IRQ. +Set also UIE mode to unsupported, to get a working 'hwclock' binary. + +Signed-off-by: Michael Lange +Signed-off-by: Alexandre Belloni +--- + drivers/rtc/rtc-ds1307.c | 29 +++++++++++++++++++++++++++-- + 1 file changed, 27 insertions(+), 2 deletions(-) + +--- a/drivers/rtc/rtc-ds1307.c ++++ b/drivers/rtc/rtc-ds1307.c +@@ -860,6 +860,7 @@ static int ds1307_probe(struct i2c_clien + struct chip_desc *chip = &chips[id->driver_data]; + struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); + bool want_irq = false; ++ bool ds1307_can_wakeup_device = false; + unsigned char *buf; + struct ds1307_platform_data *pdata = dev_get_platdata(&client->dev); + irq_handler_t irq_handler = ds1307_irq; +@@ -907,6 +908,20 @@ static int ds1307_probe(struct i2c_clien + ds1307->write_block_data = ds1307_write_block_data; + } + ++#ifdef CONFIG_OF ++/* ++ * For devices with no IRQ directly connected to the SoC, the RTC chip ++ * can be forced as a wakeup source by stating that explicitly in ++ * the device's .dts file using the "wakeup-source" boolean property. ++ * If the "wakeup-source" property is set, don't request an IRQ. ++ * This will guarantee the 'wakealarm' sysfs entry is available on the device, ++ * if supported by the RTC. ++ */ ++ if (of_property_read_bool(client->dev.of_node, "wakeup-source")) { ++ ds1307_can_wakeup_device = true; ++ } ++#endif ++ + switch (ds1307->type) { + case ds_1337: + case ds_1339: +@@ -925,11 +940,13 @@ static int ds1307_probe(struct i2c_clien + ds1307->regs[0] &= ~DS1337_BIT_nEOSC; + + /* +- * Using IRQ? Disable the square wave and both alarms. ++ * Using IRQ or defined as wakeup-source? ++ * Disable the square wave and both alarms. + * For some variants, be sure alarms can trigger when we're + * running on Vbackup (BBSQI/BBSQW) + */ +- if (ds1307->client->irq > 0 && chip->alarm) { ++ if (chip->alarm && (ds1307->client->irq > 0 || ++ ds1307_can_wakeup_device)) { + ds1307->regs[0] |= DS1337_BIT_INTCN + | bbsqi_bitpos[ds1307->type]; + ds1307->regs[0] &= ~(DS1337_BIT_A2IE | DS1337_BIT_A1IE); +@@ -1144,6 +1161,14 @@ read_rtc: + return PTR_ERR(ds1307->rtc); + } + ++ if (ds1307_can_wakeup_device) { ++ /* Disable request for an IRQ */ ++ want_irq = false; ++ dev_info(&client->dev, "'wakeup-source' is set, request for an IRQ is disabled!\n"); ++ /* We cannot support UIE mode if we do not have an IRQ line */ ++ ds1307->rtc->uie_unsupported = 1; ++ } ++ + if (want_irq) { + err = devm_request_threaded_irq(&client->dev, + client->irq, NULL, irq_handler, diff --git a/target/linux/brcm2708/patches-4.4/0140-dt-overlay-add-wittypi-overlay.dts.patch b/target/linux/brcm2708/patches-4.4/0140-dt-overlay-add-wittypi-overlay.dts.patch new file mode 100644 index 0000000000..5036a24cf0 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0140-dt-overlay-add-wittypi-overlay.dts.patch @@ -0,0 +1,57 @@ +From 267ba829941af9b8be4faa22067d24bdef85f4a3 Mon Sep 17 00:00:00 2001 +From: vitalogy +Date: Tue, 19 Jan 2016 07:02:02 +0100 +Subject: [PATCH 140/156] dt-overlay: add wittypi-overlay.dts + +--- + arch/arm/boot/dts/overlays/wittypi-overlay.dts | 44 ++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/wittypi-overlay.dts + +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/wittypi-overlay.dts +@@ -0,0 +1,44 @@ ++/* ++ * Device Tree overlay for Witty Pi extension board by UUGear ++ * ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&leds>; ++ __overlay__ { ++ compatible = "gpio-leds"; ++ wittypi_led: wittypi_led { ++ label = "wittypi_led"; ++ linux,default-trigger = "default-on"; ++ gpios = <&gpio 17 0>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ rtc: ds1337@68 { ++ compatible = "dallas,ds1337"; ++ reg = <0x68>; ++ wakeup-source; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ led_gpio = <&wittypi_led>,"gpios:4"; ++ led_trigger = <&wittypi_led>,"linux,default-trigger"; ++ }; ++ ++}; diff --git a/target/linux/brcm2708/patches-4.4/0141-BCM270X_DT-Disable-DMA-for-bcm2835-sdhost-on-Pi2.patch b/target/linux/brcm2708/patches-4.4/0141-BCM270X_DT-Disable-DMA-for-bcm2835-sdhost-on-Pi2.patch new file mode 100644 index 0000000000..40624dbbfe --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0141-BCM270X_DT-Disable-DMA-for-bcm2835-sdhost-on-Pi2.patch @@ -0,0 +1,28 @@ +From 403252ab4bc6c77f2859410e6fa22f3c2bded3e5 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 3 Feb 2016 16:12:54 +0000 +Subject: [PATCH 141/156] BCM270X_DT: Disable DMA for bcm2835-sdhost on Pi2 + +This is an interim patch to verify that problems seen with +some cards can be worked around at the expense of an increased +CPU load by forcing PIO mode. + +Although this could have used the brcm,force-pio attribute, that +is a boolean (true if present, false if absent) and attributes +can't be deleted by overlays. Instead, make brcm,pio-limit +unfeasibly high instead to allow DMA to be re-enabled using the +pio_limit parameter of the sdhost or sdtweak overlays. +--- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -43,6 +43,7 @@ + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_pins>; + bus-width = <4>; ++ brcm,pio-limit = <0x7fffffff>; + status = "okay"; + }; + diff --git a/target/linux/brcm2708/patches-4.4/0142-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch b/target/linux/brcm2708/patches-4.4/0142-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch new file mode 100644 index 0000000000..e2f4ba46ac --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0142-FIXUP-i2c_bcm2708-Don-t-change-module-baudrate-param.patch @@ -0,0 +1,99 @@ +From 3b0e6758d12a326405c257fe074dab570b1de92e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 19 Jan 2016 16:28:05 +0000 +Subject: [PATCH 142/156] 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 +override the baudrate from DT it also prevents the bus ID from +being initialised. + +Also fix whitespace errors. +--- + drivers/i2c/busses/i2c-bcm2708.c | 48 +++++++++++++++++++++------------------- + 1 file changed, 25 insertions(+), 23 deletions(-) + +--- a/drivers/i2c/busses/i2c-bcm2708.c ++++ b/drivers/i2c/busses/i2c-bcm2708.c +@@ -71,7 +71,6 @@ + + #define DRV_NAME "bcm2708_i2c" + +-static unsigned int baudrate_default = CONFIG_I2C_BCM2708_BAUDRATE; + static unsigned int baudrate; + module_param(baudrate, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); + MODULE_PARM_DESC(baudrate, "The I2C baudrate"); +@@ -317,25 +316,28 @@ static int bcm2708_i2c_probe(struct plat + struct i2c_adapter *adap; + unsigned long bus_hz; + u32 cdiv, clk_tout; +- +- if (!baudrate) { +- baudrate = baudrate_default; +- if (pdev->dev.of_node) { +- u32 bus_clk_rate; +- pdev->id = of_alias_get_id(pdev->dev.of_node, "i2c"); +- if (pdev->id < 0) { +- dev_err(&pdev->dev, "alias is missing\n"); +- return -EINVAL; +- } +- if (!of_property_read_u32(pdev->dev.of_node, +- "clock-frequency", &bus_clk_rate)) +- baudrate = bus_clk_rate; +- else +- dev_warn(&pdev->dev, +- "Could not read clock-frequency property\n"); ++ u32 baud; ++ ++ baud = CONFIG_I2C_BCM2708_BAUDRATE; ++ ++ if (pdev->dev.of_node) { ++ u32 bus_clk_rate; ++ pdev->id = of_alias_get_id(pdev->dev.of_node, "i2c"); ++ if (pdev->id < 0) { ++ dev_err(&pdev->dev, "alias is missing\n"); ++ return -EINVAL; + } ++ if (!of_property_read_u32(pdev->dev.of_node, ++ "clock-frequency", &bus_clk_rate)) ++ baud = bus_clk_rate; ++ else ++ dev_warn(&pdev->dev, ++ "Could not read clock-frequency property\n"); + } + ++ if (baudrate) ++ baud = baudrate; ++ + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!regs) { + dev_err(&pdev->dev, "could not get IO memory\n"); +@@ -419,21 +421,21 @@ static int bcm2708_i2c_probe(struct plat + } + + bus_hz = clk_get_rate(bi->clk); +- cdiv = bus_hz / baudrate; ++ cdiv = bus_hz / baud; + if (cdiv > 0xffff) { + cdiv = 0xffff; +- baudrate = bus_hz / cdiv; ++ baud = bus_hz / cdiv; + } +- +- clk_tout = 35/1000*baudrate; //35ms timeout as per SMBus specs. +- if (clk_tout > 0xffff) ++ ++ clk_tout = 35/1000*baud; //35ms timeout as per SMBus specs. ++ if (clk_tout > 0xffff) + clk_tout = 0xffff; + + bi->cdiv = cdiv; + bi->clk_tout = clk_tout; + + dev_info(&pdev->dev, "BSC%d Controller at 0x%08lx (irq %d) (baudrate %d)\n", +- pdev->id, (unsigned long)regs->start, irq, baudrate); ++ pdev->id, (unsigned long)regs->start, irq, baud); + + return 0; + diff --git a/target/linux/brcm2708/patches-4.4/0143-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch b/target/linux/brcm2708/patches-4.4/0143-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch new file mode 100644 index 0000000000..258210bd42 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0143-Allow-up-to-24dB-digital-gain-to-be-applied-when-usi.patch @@ -0,0 +1,99 @@ +From e7fc348fed61518907205603a7d0d6038cecfa1f Mon Sep 17 00:00:00 2001 +From: Digital Dreamtime +Date: Thu, 4 Feb 2016 14:14:44 +0000 +Subject: [PATCH 143/156] 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. +--- + arch/arm/boot/dts/overlays/README | 17 +++++++++++++++-- + .../boot/dts/overlays/iqaudio-dacplus-overlay.dts | 6 +++++- + sound/soc/bcm/iqaudio-dac.c | 20 ++++++++++++++------ + 3 files changed, 34 insertions(+), 9 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -362,8 +362,21 @@ Params: + + Name: iqaudio-dacplus + Info: Configures the IQaudio DAC+ audio card +-Load: dtoverlay=iqaudio-dacplus +-Params: ++Load: dtoverlay=iqaudio-dacplus,= ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. Enable with ++ "dtoverlay=iqaudio-dacplus,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: lirc-rpi +--- a/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts ++++ b/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts +@@ -7,7 +7,7 @@ + + fragment@0 { + target = <&sound>; +- __overlay__ { ++ frag0: __overlay__ { + compatible = "iqaudio,iqaudio-dac"; + i2s-controller = <&i2s>; + status = "okay"; +@@ -36,4 +36,8 @@ + }; + }; + }; ++ ++ __overrides__ { ++ 24db_digital_gain = <&frag0>,"iqaudio,24db_digital_gain?"; ++ }; + }; +--- a/sound/soc/bcm/iqaudio-dac.c ++++ b/sound/soc/bcm/iqaudio-dac.c +@@ -23,14 +23,19 @@ + #include + #include + ++static bool digital_gain_0db_limit = true; ++ + static int snd_rpi_iqaudio_dac_init(struct snd_soc_pcm_runtime *rtd) + { +- 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); ++ 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; + } +@@ -94,6 +99,9 @@ static int snd_rpi_iqaudio_dac_probe(str + 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"); + } + + ret = snd_soc_register_card(&snd_rpi_iqaudio_dac); diff --git a/target/linux/brcm2708/patches-4.4/0144-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch b/target/linux/brcm2708/patches-4.4/0144-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch new file mode 100644 index 0000000000..539449d0e6 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0144-Limit-PCM512x-Digital-gain-to-0dB-by-default-with-Hi.patch @@ -0,0 +1,98 @@ +From 9084d0c769be7aaf552eeaa27eac948226bc10cc Mon Sep 17 00:00:00 2001 +From: Digital Dreamtime +Date: Thu, 4 Feb 2016 20:04:00 +0000 +Subject: [PATCH 144/156] 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, +and if specified will allow the full 24dB gain. +--- + arch/arm/boot/dts/overlays/README | 17 +++++++++++++++-- + .../arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts | 6 +++++- + sound/soc/bcm/hifiberry_dacplus.c | 14 ++++++++++++++ + 3 files changed, 34 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -273,8 +273,21 @@ Params: + + Name: hifiberry-dacplus + Info: Configures the HifiBerry DAC+ audio card +-Load: dtoverlay=hifiberry-dacplus +-Params: ++Load: dtoverlay=hifiberry-dacplus,= ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. Enable with ++ "dtoverlay=hifiberry-dacplus,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: hifiberry-digi +--- a/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts ++++ b/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts +@@ -17,7 +17,7 @@ + + fragment@1 { + target = <&sound>; +- __overlay__ { ++ frag1: __overlay__ { + compatible = "hifiberry,hifiberry-dacplus"; + i2s-controller = <&i2s>; + status = "okay"; +@@ -47,4 +47,8 @@ + }; + }; + }; ++ ++ __overrides__ { ++ 24db_digital_gain = <&frag1>,"hifiberry,24db_digital_gain?"; ++ }; + }; +--- a/sound/soc/bcm/hifiberry_dacplus.c ++++ b/sound/soc/bcm/hifiberry_dacplus.c +@@ -48,6 +48,7 @@ struct pcm512x_priv { + #define CLK_48EN_RATE 24576000UL + + static bool snd_rpi_hifiberry_is_dacpro; ++static bool digital_gain_0db_limit = true; + + static void snd_rpi_hifiberry_dacplus_select_clk(struct snd_soc_codec *codec, + int clk_id) +@@ -167,6 +168,16 @@ static int snd_rpi_hifiberry_dacplus_ini + snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0x0f, 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; + } + +@@ -299,6 +310,9 @@ static int snd_rpi_hifiberry_dacplus_pro + dai->platform_name = NULL; + dai->platform_of_node = i2s_node; + } ++ ++ digital_gain_0db_limit = !of_property_read_bool( ++ pdev->dev.of_node, "hifiberry,24db_digital_gain"); + } + + ret = snd_soc_register_card(&snd_rpi_hifiberry_dacplus); diff --git a/target/linux/brcm2708/patches-4.4/0145-BCM270X_DT-Adjust-overlay-README-formatting.patch b/target/linux/brcm2708/patches-4.4/0145-BCM270X_DT-Adjust-overlay-README-formatting.patch new file mode 100644 index 0000000000..77cd99dd54 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0145-BCM270X_DT-Adjust-overlay-README-formatting.patch @@ -0,0 +1,746 @@ +From 009cff59681047c60bf29cbdb8bb323b8d52e020 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 8 Feb 2016 09:46:33 +0000 +Subject: [PATCH 145/156] BCM270X_DT: Adjust overlay README formatting + +--- + arch/arm/boot/dts/overlays/README | 420 +++++++++++++++++++------------------- + 1 file changed, 210 insertions(+), 210 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -83,58 +83,58 @@ Name: + Info: Configures the base Raspberry Pi hardware + Load: + Params: +- audio Set to "on" to enable the onboard ALSA audio +- interface (default "off") ++ audio Set to "on" to enable the onboard ALSA audio ++ interface (default "off") + +- i2c_arm Set to "on" to enable the ARM's i2c interface +- (default "off") ++ i2c_arm Set to "on" to enable the ARM's i2c interface ++ (default "off") + +- i2c_vc Set to "on" to enable the i2c interface +- usually reserved for the VideoCore processor +- (default "off") ++ i2c_vc Set to "on" to enable the i2c interface ++ usually reserved for the VideoCore processor ++ (default "off") + +- i2c An alias for i2c_arm ++ i2c An alias for i2c_arm + +- i2c_arm_baudrate Set the baudrate of the ARM's i2c interface +- (default "100000") ++ i2c_arm_baudrate Set the baudrate of the ARM's i2c interface ++ (default "100000") + +- i2c_vc_baudrate Set the baudrate of the VideoCore i2c interface +- (default "100000") ++ i2c_vc_baudrate Set the baudrate of the VideoCore i2c interface ++ (default "100000") + +- i2c_baudrate An alias for i2c_arm_baudrate ++ i2c_baudrate An alias for i2c_arm_baudrate + +- i2s Set to "on" to enable the i2s interface +- (default "off") ++ i2s Set to "on" to enable the i2s interface ++ (default "off") + +- spi Set to "on" to enable the spi interfaces +- (default "off") ++ spi Set to "on" to enable the spi interfaces ++ (default "off") + +- random Set to "on" to enable the hardware random +- number generator (default "on") ++ random Set to "on" to enable the hardware random ++ number generator (default "on") + +- uart0 Set to "off" to disable uart0 (default "on") ++ uart0 Set to "off" to disable uart0 (default "on") + +- watchdog Set to "on" to enable the hardware watchdog +- (default "off") ++ watchdog Set to "on" to enable the hardware watchdog ++ (default "off") + +- act_led_trigger Choose which activity the LED tracks. +- Use "heartbeat" for a nice load indicator. +- (default "mmc") ++ act_led_trigger Choose which activity the LED tracks. ++ Use "heartbeat" for a nice load indicator. ++ (default "mmc") + +- act_led_activelow Set to "on" to invert the sense of the LED +- (default "off") ++ act_led_activelow Set to "on" to invert the sense of the LED ++ (default "off") + +- act_led_gpio Set which GPIO to use for the activity LED +- (in case you want to connect it to an external +- device) +- (default "16" on a non-Plus board, "47" on a +- Plus or Pi 2) ++ act_led_gpio Set which GPIO to use for the activity LED ++ (in case you want to connect it to an external ++ device) ++ (default "16" on a non-Plus board, "47" on a ++ Plus or Pi 2) + + pwr_led_trigger + pwr_led_activelow + pwr_led_gpio +- As for act_led_*, but using the PWR LED. +- Not available on Model A/B boards. ++ As for act_led_*, but using the PWR LED. ++ Not available on Model A/B boards. + + N.B. It is recommended to only enable those interfaces that are needed. + Leaving all interfaces enabled can lead to unwanted behaviour (i2c_vc +@@ -149,19 +149,19 @@ Params: + Name: ads7846 + Info: ADS7846 Touch controller + Load: dtoverlay=ads7846,= +-Params: cs SPI bus Chip Select (default 1) +- speed SPI bus speed (default 2MHz, max 3.25MHz) +- penirq GPIO used for PENIRQ. REQUIRED +- penirq_pull Set GPIO pull (default 0=none, 2=pullup) +- swapxy Swap x and y axis +- xmin Minimum value on the X axis (default 0) +- ymin Minimum value on the Y axis (default 0) +- xmax Maximum value on the X axis (default 4095) +- ymax Maximum value on the Y axis (default 4095) +- pmin Minimum reported pressure value (default 0) +- pmax Maximum reported pressure value (default 65535) +- xohms Touchpanel sensitivity (X-plate resistance) +- (default 400) ++Params: cs SPI bus Chip Select (default 1) ++ speed SPI bus speed (default 2MHz, max 3.25MHz) ++ penirq GPIO used for PENIRQ. REQUIRED ++ penirq_pull Set GPIO pull (default 0=none, 2=pullup) ++ swapxy Swap x and y axis ++ xmin Minimum value on the X axis (default 0) ++ ymin Minimum value on the Y axis (default 0) ++ xmax Maximum value on the X axis (default 4095) ++ ymax Maximum value on the Y axis (default 4095) ++ pmin Minimum reported pressure value (default 0) ++ pmax Maximum reported pressure value (default 65535) ++ xohms Touchpanel sensitivity (X-plate resistance) ++ (default 400) + + penirq is required and usually xohms (60-100) has to be set as well. + Apart from that, pmax (255) and swapxy are also common. +@@ -175,12 +175,12 @@ Name: at86rf233 + Info: Configures the Atmel AT86RF233 802.15.4 low-power WPAN transceiver, + connected to spi0.0 + Load: dtoverlay=at86rf233,= +-Params: interrupt GPIO used for INT (default 23) +- reset GPIO used for Reset (default 24) +- sleep GPIO used for Sleep (default 25) +- speed SPI bus speed in Hz (default 6000000) +- trim Fine tuning of the internal capacitance +- arrays (0=+0pF, 15=+4.5pF, default 15) ++Params: interrupt GPIO used for INT (default 23) ++ reset GPIO used for Reset (default 24) ++ sleep GPIO used for Sleep (default 25) ++ speed SPI bus speed in Hz (default 6000000) ++ trim Fine tuning of the internal capacitance ++ arrays (0=+0pF, 15=+4.5pF, default 15) + + + Name: bmp085_i2c-sensor +@@ -194,8 +194,8 @@ Name: dht11 + Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors + Also sometimes found with the part number(s) AM230x. + Load: dtoverlay=dht11,= +-Params: gpiopin GPIO connected to the sensor's DATA output. +- (default 4) ++Params: gpiopin GPIO connected to the sensor's DATA output. ++ (default 4) + + + Name: dwc-otg +@@ -208,15 +208,15 @@ Params: + Name: dwc2 + Info: Selects the dwc2 USB controller driver + Load: dtoverlay=dwc2,= +-Params: dr_mode Dual role mode: "host", "peripheral" or "otg" ++Params: dr_mode Dual role mode: "host", "peripheral" or "otg" + +- g-rx-fifo-size Size of rx fifo size in gadget mode ++ g-rx-fifo-size Size of rx fifo size in gadget mode + +- g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget +- mode ++ g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget ++ mode + +- g-tx-fifo-size Size of periodic tx fifo per endpoint +- (except ep0) in gadget mode ++ g-tx-fifo-size Size of periodic tx fifo per endpoint ++ (except ep0) in gadget mode + + + [ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] +@@ -225,9 +225,9 @@ Params: dr_mode Dual ro + Name: enc28j60 + Info: Overlay for the Microchip ENC28J60 Ethernet Controller (SPI) + Load: dtoverlay=enc28j60,= +-Params: int_pin GPIO used for INT (default 25) ++Params: int_pin GPIO used for INT (default 25) + +- speed SPI bus speed (default 12000000) ++ speed SPI bus speed (default 12000000) + + + Name: gpio-ir +@@ -237,26 +237,26 @@ Info: Use GPIO pin as rc-core style in + not required! The key mapping and other decoding parameters can be + configured by "ir-keytable" tool. + Load: dtoverlay=gpio-ir,= +-Params: gpio_pin Input pin number. Default is 18. ++Params: gpio_pin Input pin number. Default is 18. + +- gpio_pull Desired pull-up/down state (off, down, up) +- Default is "down". ++ gpio_pull Desired pull-up/down state (off, down, up) ++ Default is "down". + +- rc-map-name Default rc keymap (can also be changed by +- ir-keytable), defaults to "rc-rc6-mce" ++ rc-map-name Default rc keymap (can also be changed by ++ ir-keytable), defaults to "rc-rc6-mce" + + + Name: gpio-poweroff + Info: Drives a GPIO high or low on reboot + Load: dtoverlay=gpio-poweroff,= +-Params: gpiopin GPIO for signalling (default 26) ++Params: gpiopin GPIO for signalling (default 26) + +- active_low Set if the power control device requires a +- high->low transition to trigger a power-down. +- Note that this will require the support of a +- custom dt-blob.bin to prevent a power-down +- during the boot process, and that a reboot +- will also cause the pin to go low. ++ active_low Set if the power control device requires a ++ high->low transition to trigger a power-down. ++ Note that this will require the support of a ++ custom dt-blob.bin to prevent a power-down ++ during the boot process, and that a reboot ++ will also cause the pin to go low. + + + Name: hifiberry-amp +@@ -300,65 +300,65 @@ Name: hy28a + Info: HY28A - 2.8" TFT LCD Display Module by HAOYU Electronics + Default values match Texy's display shield + Load: dtoverlay=hy28a,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- xohms Touchpanel sensitivity (X-plate resistance) ++ xohms Touchpanel sensitivity (X-plate resistance) + +- resetgpio GPIO used to reset controller ++ resetgpio GPIO used to reset controller + +- ledgpio GPIO used to control backlight ++ ledgpio GPIO used to control backlight + + + Name: hy28b + Info: HY28B - 2.8" TFT LCD Display Module by HAOYU Electronics + Default values match Texy's display shield + Load: dtoverlay=hy28b,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- xohms Touchpanel sensitivity (X-plate resistance) ++ xohms Touchpanel sensitivity (X-plate resistance) + +- resetgpio GPIO used to reset controller ++ resetgpio GPIO used to reset controller + +- ledgpio GPIO used to control backlight ++ ledgpio GPIO used to control backlight + + + Name: i2c-gpio + Info: Adds support for software i2c controller on gpio pins + Load: dtoverlay=i2c-gpio,= +-Params: i2c_gpio_sda GPIO used for I2C data (default "23") ++Params: i2c_gpio_sda GPIO used for I2C data (default "23") + +- i2c_gpio_scl GPIO used for I2C clock (default "24") ++ i2c_gpio_scl GPIO used for I2C clock (default "24") + +- i2c_gpio_delay_us Clock delay in microseconds +- (default "2" = ~100kHz) ++ i2c_gpio_delay_us Clock delay in microseconds ++ (default "2" = ~100kHz) + + + Name: i2c-rtc + Info: Adds support for a number of I2C Real Time Clock devices + Load: dtoverlay=i2c-rtc,= +-Params: ds1307 Select the DS1307 device ++Params: ds1307 Select the DS1307 device + +- ds3231 Select the DS3231 device ++ ds3231 Select the DS3231 device + +- mcp7941x Select the MCP7941x device ++ mcp7941x Select the MCP7941x device + +- pcf2127 Select the PCF2127 device ++ pcf2127 Select the PCF2127 device + +- pcf8523 Select the PCF8523 device ++ pcf8523 Select the PCF8523 device + +- pcf8563 Select the PCF8563 device ++ pcf8563 Select the PCF8563 device + + + Name: i2s-mmap +@@ -396,70 +396,70 @@ Name: lirc-rpi + Info: Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi) + Consult the module documentation for more details. + Load: dtoverlay=lirc-rpi,= +-Params: gpio_out_pin GPIO for output (default "17") ++Params: gpio_out_pin GPIO for output (default "17") + +- gpio_in_pin GPIO for input (default "18") ++ gpio_in_pin GPIO for input (default "18") + +- gpio_in_pull Pull up/down/off on the input pin +- (default "down") ++ gpio_in_pull Pull up/down/off on the input pin ++ (default "down") + +- sense Override the IR receive auto-detection logic: +- "0" = force active-high +- "1" = force active-low +- "-1" = use auto-detection +- (default "-1") ++ sense Override the IR receive auto-detection logic: ++ "0" = force active-high ++ "1" = force active-low ++ "-1" = use auto-detection ++ (default "-1") + +- softcarrier Turn the software carrier "on" or "off" +- (default "on") ++ softcarrier Turn the software carrier "on" or "off" ++ (default "on") + +- invert "on" = invert the output pin (default "off") ++ invert "on" = invert the output pin (default "off") + +- debug "on" = enable additional debug messages +- (default "off") ++ debug "on" = enable additional debug messages ++ (default "off") + + + Name: mcp2515-can0 + Info: Configures the MCP2515 CAN controller on spi0.0 + Load: dtoverlay=mcp2515-can0,= +-Params: oscillator Clock frequency for the CAN controller (Hz) ++Params: oscillator Clock frequency for the CAN controller (Hz) + +- spimaxfrequency Maximum SPI frequence (Hz) ++ spimaxfrequency Maximum SPI frequence (Hz) + +- interrupt GPIO for interrupt signal ++ interrupt GPIO for interrupt signal + + + Name: mcp2515-can1 + Info: Configures the MCP2515 CAN controller on spi0.1 + Load: dtoverlay=mcp2515-can1,= +-Params: oscillator Clock frequency for the CAN controller (Hz) ++Params: oscillator Clock frequency for the CAN controller (Hz) + +- spimaxfrequency Maximum SPI frequence (Hz) ++ spimaxfrequency Maximum SPI frequence (Hz) + +- interrupt GPIO for interrupt signal ++ interrupt GPIO for interrupt signal + + + Name: mmc + Info: Selects the bcm2835-mmc SD/MMC driver, optionally with overclock + Load: dtoverlay=mmc,= +-Params: overclock_50 Clock (in MHz) to use when the MMC framework +- requests 50MHz +- force_pio Disable DMA support ++Params: overclock_50 Clock (in MHz) to use when the MMC framework ++ requests 50MHz ++ force_pio Disable DMA support + + + Name: mz61581 + Info: MZ61581 display by Tontec + Load: dtoverlay=mz61581,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- txbuflen Transmit buffer length (default 32768) ++ txbuflen Transmit buffer length (default 32768) + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- xohms Touchpanel sensitivity (X-plate resistance) ++ xohms Touchpanel sensitivity (X-plate resistance) + + + [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ] +@@ -474,69 +474,69 @@ Params: speed Display + Name: piscreen + Info: PiScreen display by OzzMaker.com + Load: dtoverlay=piscreen,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- xohms Touchpanel sensitivity (X-plate resistance) ++ xohms Touchpanel sensitivity (X-plate resistance) + + + Name: piscreen2r + Info: PiScreen 2 with resistive TP display by OzzMaker.com + Load: dtoverlay=piscreen2r,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- xohms Touchpanel sensitivity (X-plate resistance) ++ xohms Touchpanel sensitivity (X-plate resistance) + + + Name: pitft28-capacitive + Info: Adafruit PiTFT 2.8" capacitive touch screen + Load: dtoverlay=pitft28-capacitive,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- touch-sizex Touchscreen size x (default 240) ++ touch-sizex Touchscreen size x (default 240) + +- touch-sizey Touchscreen size y (default 320) ++ touch-sizey Touchscreen size y (default 320) + +- touch-invx Touchscreen inverted x axis ++ touch-invx Touchscreen inverted x axis + +- touch-invy Touchscreen inverted y axis ++ touch-invy Touchscreen inverted y axis + +- touch-swapxy Touchscreen swapped x y axis ++ touch-swapxy Touchscreen swapped x y axis + + + Name: pitft28-resistive + Info: Adafruit PiTFT 2.8" resistive touch screen + Load: dtoverlay=pitft28-resistive,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + + + 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") ++Params: gpiopin Input GPIO (default "18") + + + Name: pwm +@@ -550,12 +550,12 @@ Info: Configures a single PWM channel + Pins 12 and 13 might be better choices on an A+, B+ or Pi2. + 2) The onboard analogue audio output uses both PWM channels. + 3) So be careful mixing audio and PWM. +- 4) Currently the clock must have been enabled and configured ++ 4) Currently the clockmust have been enabled and configured + by other means. + Load: dtoverlay=pwm,= +-Params: pin Output pin (default 18) - see table +- func Pin function (default 2 = Alt5) - see above +- clock PWM clock frequency (informational) ++Params: pin Output pin (default 18) - see table ++ func Pin function (default 2 = Alt5) - see above ++ clock PWM clock frequency (informational) + + + Name: pwm-2chan +@@ -569,14 +569,14 @@ Info: Configures both PWM channels + Pins 12 and 13 might be better choices on an A+, B+ or Pi2. + 2) The onboard analogue audio output uses both PWM channels. + 3) So be careful mixing audio and PWM. +- 4) Currently the clock must have been enabled and configured ++ 4) Currently the clockmust have been enabled and configured + by other means. + Load: dtoverlay=pwm-2chan,= +-Params: pin Output pin (default 18) - see table +- pin2 Output pin for other channel (default 19) +- func Pin function (default 2 = Alt5) - see above +- func2 Function for pin2 (default 2 = Alt5) +- clock PWM clock frequency (informational) ++Params: pin Output pin (default 18) - see table ++ pin2 Output pin for other channel (default 19) ++ func Pin function (default 2 = Alt5) - see above ++ func2 Function for pin2 (default 2 = Alt5) ++ clock PWM clock frequency (informational) + + + Name: raspidac3 +@@ -600,15 +600,15 @@ Params: + Name: rpi-display + Info: RPi-Display - 2.8" Touch Display by Watterott + Load: dtoverlay=rpi-display,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- xohms Touchpanel sensitivity (X-plate resistance) ++ xohms Touchpanel sensitivity (X-plate resistance) + + + Name: rpi-ft5406 +@@ -632,52 +632,52 @@ Params: + Name: sdhost + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock + Load: dtoverlay=sdhost,= +-Params: overclock_50 Clock (in MHz) to use when the MMC framework +- requests 50MHz ++Params: overclock_50 Clock (in MHz) to use when the MMC framework ++ requests 50MHz + +- force_pio Disable DMA support (default off) ++ force_pio Disable DMA support (default off) + +- pio_limit Number of blocks above which to use DMA +- (default 1) ++ pio_limit Number of blocks above which to use DMA ++ (default 1) + +- debug Enable debug output (default off) ++ debug Enable debug output (default off) + + + Name: sdio + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, + and enables SDIO via GPIOs 22-27. + Load: dtoverlay=sdio,= +-Params: overclock_50 SD Clock (in MHz) to use when the MMC framework +- requests 50MHz ++Params: overclock_50 SD Clock (in MHz) to use when the MMC framework ++ requests 50MHz + +- sdio_overclock SDIO Clock (in MHz) to use when the MMC +- framework requests 50MHz ++ sdio_overclock SDIO Clock (in MHz) to use when the MMC ++ framework requests 50MHz + +- force_pio Disable DMA support (default off) ++ force_pio Disable DMA support (default off) + +- pio_limit Number of blocks above which to use DMA +- (default 1) ++ pio_limit Number of blocks above which to use DMA ++ (default 1) + +- debug Enable debug output (default off) ++ debug Enable debug output (default off) + +- poll_once Disable SDIO-device polling every second +- (default on: polling once at boot-time) ++ poll_once Disable SDIO-device polling every second ++ (default on: polling once at boot-time) + +- bus_width Set the SDIO host bus width (default 4 bits) ++ bus_width Set the SDIO host bus width (default 4 bits) + + + Name: sdtweak + Info: Tunes the bcm2835-sdhost SD/MMC driver + Load: dtoverlay=sdtweak,= +-Params: overclock_50 Clock (in MHz) to use when the MMC framework +- requests 50MHz ++Params: overclock_50 Clock (in MHz) to use when the MMC framework ++ requests 50MHz + +- force_pio Disable DMA support (default off) ++ force_pio Disable DMA support (default off) + +- pio_limit Number of blocks above which to use DMA +- (default 1) ++ pio_limit Number of blocks above which to use DMA ++ (default 1) + +- debug Enable debug output (default off) ++ debug Enable debug output (default off) + + + Name: smi +@@ -708,25 +708,25 @@ Name: tinylcd35 + Info: 3.5" Color TFT Display by www.tinylcd.com + Options: Touch, RTC, keypad + Load: dtoverlay=tinylcd35,= +-Params: speed Display SPI bus speed ++Params: speed Display SPI bus speed + +- rotate Display rotation {0,90,180,270} ++ rotate Display rotation {0,90,180,270} + +- fps Delay between frame updates ++ fps Delay between frame updates + +- debug Debug output level {0-7} ++ debug Debug output level {0-7} + +- touch Enable touch panel ++ touch Enable touch panel + +- touchgpio Touch controller IRQ GPIO ++ touchgpio Touch controller IRQ GPIO + +- xohms Touchpanel: Resistance of X-plate in ohms ++ xohms Touchpanel: Resistance of X-plate in ohms + +- rtc-pcf PCF8563 Real Time Clock ++ rtc-pcf PCF8563 Real Time Clock + +- rtc-ds DS1307 Real Time Clock ++ rtc-ds DS1307 Real Time Clock + +- keypad Enable keypad ++ keypad Enable keypad + + Examples: + Display with touchpanel, PCF8563 RTC and keypad: +@@ -738,9 +738,9 @@ Params: speed Display + Name: uart1 + Info: Enable uart1 in place of uart0 + Load: dtoverlay=uart1,= +-Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14) ++Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14) + +- rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15) ++ rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15) + + + Name: vc4-kms-v3d +@@ -753,7 +753,7 @@ Params: + + Name: vga666 + Info: Overlay for the Fen Logic VGA666 board +- This uses GPIOs 2-21 (so no I2C), and activates the output 2-3 seconds ++ This uses GPIOs 2-21 (sono I2C), and activates the output 2-3 seconds + after the kernel has started. + Load: dtoverlay=vga666 + Params: +@@ -763,22 +763,22 @@ Name: w1-gpio + Info: Configures the w1-gpio Onewire interface module. + Use this overlay if you *don't* need a GPIO to drive an external pullup. + Load: dtoverlay=w1-gpio,= +-Params: gpiopin GPIO for I/O (default "4") ++Params: gpiopin GPIO for I/O (default "4") + +- pullup Non-zero, "on", or "y" to enable the parasitic +- power (2-wire, power-on-data) feature ++ pullup Non-zero, "on", or "y" to enable the parasitic ++ power (2-wire, power-on-data) feature + + + Name: w1-gpio-pullup + Info: Configures the w1-gpio Onewire interface module. + Use this overlay if you *do* need a GPIO to drive an external pullup. + Load: dtoverlay=w1-gpio-pullup,= +-Params: gpiopin GPIO for I/O (default "4") ++Params: gpiopin GPIO for I/O (default "4") + +- pullup Non-zero, "on", or "y" to enable the parasitic +- power (2-wire, power-on-data) feature ++ pullup Non-zero, "on", or "y" to enable the parasitic ++ power (2-wire, power-on-data) feature + +- extpullup GPIO for external pullup (default "5") ++ extpullup GPIO for external pullup (default "5") + + + Troubleshooting diff --git a/target/linux/brcm2708/patches-4.4/0146-FIXUP-Overlay-README-Restore-spaces-deleted-in-error.patch b/target/linux/brcm2708/patches-4.4/0146-FIXUP-Overlay-README-Restore-spaces-deleted-in-error.patch new file mode 100644 index 0000000000..0373cf035a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0146-FIXUP-Overlay-README-Restore-spaces-deleted-in-error.patch @@ -0,0 +1,39 @@ +From 88506d9d1ba9f40f613d77f3301621c7a29541a0 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 8 Feb 2016 12:53:44 +0000 +Subject: [PATCH 146/156] FIXUP: Overlay README - Restore spaces deleted in + error + +--- + arch/arm/boot/dts/overlays/README | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -550,7 +550,7 @@ Info: Configures a single PWM channel + Pins 12 and 13 might be better choices on an A+, B+ or Pi2. + 2) The onboard analogue audio output uses both PWM channels. + 3) So be careful mixing audio and PWM. +- 4) Currently the clockmust have been enabled and configured ++ 4) Currently the clock must have been enabled and configured + by other means. + Load: dtoverlay=pwm,= + Params: pin Output pin (default 18) - see table +@@ -569,7 +569,7 @@ Info: Configures both PWM channels + Pins 12 and 13 might be better choices on an A+, B+ or Pi2. + 2) The onboard analogue audio output uses both PWM channels. + 3) So be careful mixing audio and PWM. +- 4) Currently the clockmust have been enabled and configured ++ 4) Currently the clock must have been enabled and configured + by other means. + Load: dtoverlay=pwm-2chan,= + Params: pin Output pin (default 18) - see table +@@ -753,7 +753,7 @@ Params: + + Name: vga666 + Info: Overlay for the Fen Logic VGA666 board +- This uses GPIOs 2-21 (sono I2C), and activates the output 2-3 seconds ++ This uses GPIOs 2-21 (so no I2C), and activates the output 2-3 seconds + after the kernel has started. + Load: dtoverlay=vga666 + Params: diff --git a/target/linux/brcm2708/patches-4.4/0147-pinctrl-bcm2835-Fix-cut-and-paste-error-in-pull-pars.patch b/target/linux/brcm2708/patches-4.4/0147-pinctrl-bcm2835-Fix-cut-and-paste-error-in-pull-pars.patch new file mode 100644 index 0000000000..405499bfd6 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0147-pinctrl-bcm2835-Fix-cut-and-paste-error-in-pull-pars.patch @@ -0,0 +1,25 @@ +From adebf09ba85b5844c24fa3bde1c78d836454209c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 9 Feb 2016 09:52:13 +0000 +Subject: [PATCH 147/156] pinctrl-bcm2835: Fix cut-and-paste error in "pull" + parsing + +The DT bindings for pinctrl-bcm2835 allow both the function and pull +to contain either one entry or one per pin. However, an error in the +DT parsing can cause failures if the number of pulls differs from the +number of functions. +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -802,7 +802,7 @@ static int bcm2835_pctl_dt_node_to_map(s + } + if (num_pulls) { + err = of_property_read_u32_index(np, "brcm,pull", +- (num_funcs > 1) ? i : 0, &pull); ++ (num_pulls > 1) ? i : 0, &pull); + if (err) + goto out; + err = bcm2835_pctl_dt_node_to_map_pull(pc, np, pin, diff --git a/target/linux/brcm2708/patches-4.4/0148-Revert-BCM270X_DT-Disable-DMA-for-bcm2835-sdhost-on-.patch b/target/linux/brcm2708/patches-4.4/0148-Revert-BCM270X_DT-Disable-DMA-for-bcm2835-sdhost-on-.patch new file mode 100644 index 0000000000..a7e37e047a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0148-Revert-BCM270X_DT-Disable-DMA-for-bcm2835-sdhost-on-.patch @@ -0,0 +1,21 @@ +From a961bf36c70269046bba0a62e3fa96398f2ba4c7 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 11 Feb 2016 17:30:49 +0000 +Subject: [PATCH 148/156] Revert "BCM270X_DT: Disable DMA for bcm2835-sdhost on + Pi2" + +This reverts commit 9c1adcc07a40f762fd4ac580f07646784de135e1. +--- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -43,7 +43,6 @@ + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_pins>; + bus-width = <4>; +- brcm,pio-limit = <0x7fffffff>; + status = "okay"; + }; + diff --git a/target/linux/brcm2708/patches-4.4/0149-bcm2835-sdhost-Major-revision.patch b/target/linux/brcm2708/patches-4.4/0149-bcm2835-sdhost-Major-revision.patch new file mode 100644 index 0000000000..b2c7e76d9b --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0149-bcm2835-sdhost-Major-revision.patch @@ -0,0 +1,2070 @@ +From a4f91101191bacec678b5aab26f3d5a23880731d Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 11 Feb 2016 16:51:01 +0000 +Subject: [PATCH 149/156] bcm2835-sdhost: Major revision + +This is a significant revision of the bcm2835-sdhost driver. It +improves on the original in a number of ways: + +1) Through the use of CMD23 for reads it appears to avoid problems + reading some sectors on certain high speed cards. +2) Better atomicity to prevent crashes. +3) Higher performance. +4) Activity logging included, for easier diagnosis in the event + of a problem. + +Signed-off-by: Phil Elwell +--- + drivers/mmc/host/bcm2835-sdhost.c | 1284 ++++++++++++++++++++----------------- + 1 file changed, 686 insertions(+), 598 deletions(-) + +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -2,7 +2,7 @@ + * BCM2835 SD host driver. + * + * Author: Phil Elwell +- * Copyright 2015 ++ * Copyright (C) 2015-2016 Raspberry Pi (Trading) Ltd. + * + * Based on + * mmc-bcm2835.c by Gellert Weisz +@@ -24,12 +24,13 @@ + * along with this program. If not, see . + */ + +-#define SAFE_READ_THRESHOLD 4 +-#define SAFE_WRITE_THRESHOLD 4 +-#define ALLOW_DMA 1 +-#define ALLOW_CMD23 0 +-#define ALLOW_FAST 1 +-#define USE_BLOCK_IRQ 1 ++#define FIFO_READ_THRESHOLD 4 ++#define FIFO_WRITE_THRESHOLD 4 ++#define ALLOW_CMD23_READ 1 ++#define ALLOW_CMD23_WRITE 0 ++#define ENABLE_LOG 1 ++#define SDDATA_FIFO_PIO_BURST 8 ++#define CMD_DALLY_US 1 + + #include + #include +@@ -48,6 +49,7 @@ + #include + #include + #include ++#include + + #define DRIVER_NAME "sdhost-bcm2835" + +@@ -110,6 +112,28 @@ + #define SDEDM_READ_THRESHOLD_SHIFT 14 + #define SDEDM_THRESHOLD_MASK 0x1f + ++#define SDEDM_FSM_MASK 0xf ++#define SDEDM_FSM_IDENTMODE 0x0 ++#define SDEDM_FSM_DATAMODE 0x1 ++#define SDEDM_FSM_READDATA 0x2 ++#define SDEDM_FSM_WRITEDATA 0x3 ++#define SDEDM_FSM_READWAIT 0x4 ++#define SDEDM_FSM_READCRC 0x5 ++#define SDEDM_FSM_WRITECRC 0x6 ++#define SDEDM_FSM_WRITEWAIT1 0x7 ++#define SDEDM_FSM_POWERDOWN 0x8 ++#define SDEDM_FSM_POWERUP 0x9 ++#define SDEDM_FSM_WRITESTART1 0xa ++#define SDEDM_FSM_WRITESTART2 0xb ++#define SDEDM_FSM_GENPULSES 0xc ++#define SDEDM_FSM_WRITEWAIT2 0xd ++#define SDEDM_FSM_STARTPOWDOWN 0xf ++ ++#define SDDATA_FIFO_WORDS 16 ++ ++#define USE_CMD23_FLAGS ((ALLOW_CMD23_READ * MMC_DATA_READ) | \ ++ (ALLOW_CMD23_WRITE * MMC_DATA_WRITE)) ++ + #define MHZ 1000000 + + +@@ -131,15 +155,17 @@ struct bcm2835_host { + + struct tasklet_struct finish_tasklet; /* Tasklet structures */ + +- struct timer_list timer; /* Timer for timeouts */ ++ struct work_struct cmd_wait_wq; /* Workqueue function */ + +- struct timer_list pio_timer; /* PIO error detection timer */ ++ struct timer_list timer; /* Timer for timeouts */ + + struct sg_mapping_iter sg_miter; /* SG state for PIO */ + unsigned int blocks; /* remaining PIO blocks */ + + int irq; /* Device IRQ */ + ++ u32 cmd_quick_poll_retries; ++ u32 ns_per_fifo_word; + + /* cached registers */ + u32 hcfg; +@@ -154,16 +180,21 @@ struct bcm2835_host { + + unsigned int use_busy:1; /* Wait for busy interrupt */ + +- unsigned int debug:1; /* Enable debug output */ ++ unsigned int use_sbc:1; /* Send CMD23 */ + +- u32 thread_isr; ++ unsigned int debug:1; /* Enable debug output */ + + /*DMA part*/ + struct dma_chan *dma_chan_rx; /* DMA channel for reads */ + struct dma_chan *dma_chan_tx; /* DMA channel for writes */ ++ struct dma_chan *dma_chan; /* Channel in used */ ++ struct dma_async_tx_descriptor *dma_desc; ++ u32 dma_dir; ++ u32 drain_words; ++ struct page *drain_page; ++ u32 drain_offset; + + bool allow_dma; +- bool have_dma; + bool use_dma; + /*end of DMA part*/ + +@@ -173,13 +204,98 @@ struct bcm2835_host { + 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) */ ++}; + +- u32 debug_flags; ++#if ENABLE_LOG + +- u32 sectors; /* Cached card size in sectors */ +- u32 single_read_sectors[8]; ++struct log_entry_struct { ++ char event[4]; ++ u32 timestamp; ++ u32 param1; ++ u32 param2; + }; + ++typedef struct log_entry_struct LOG_ENTRY_T; ++ ++LOG_ENTRY_T *sdhost_log_buf; ++dma_addr_t sdhost_log_addr; ++static u32 sdhost_log_idx; ++static spinlock_t log_lock; ++static void __iomem *timer_base; ++ ++#define LOG_ENTRIES (256*1) ++#define LOG_SIZE (sizeof(LOG_ENTRY_T)*LOG_ENTRIES) ++ ++static void log_init(u32 bus_to_phys) ++{ ++ spin_lock_init(&log_lock); ++ sdhost_log_buf = dma_zalloc_coherent(NULL, LOG_SIZE, &sdhost_log_addr, ++ GFP_KERNEL); ++ if (sdhost_log_buf) { ++ pr_err("sdhost: log_buf @ %p (%x)\n", ++ sdhost_log_buf, sdhost_log_addr); ++ timer_base = ioremap_nocache(bus_to_phys + 0x7e003000, SZ_4K); ++ if (!timer_base) ++ pr_err("sdhost: failed to remap timer\n"); ++ } ++ else ++ pr_err("sdhost: failed to allocate log buf\n"); ++} ++ ++static void log_event_impl(const char *event, u32 param1, u32 param2) ++{ ++ if (sdhost_log_buf) { ++ LOG_ENTRY_T *entry; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&log_lock, flags); ++ ++ entry = sdhost_log_buf + sdhost_log_idx; ++ memcpy(entry->event, event, 4); ++ entry->timestamp = (readl(timer_base + 4) & 0x3fffffff) + ++ (smp_processor_id()<<30); ++ entry->param1 = param1; ++ entry->param2 = param2; ++ sdhost_log_idx = (sdhost_log_idx + 1) % LOG_ENTRIES; ++ ++ spin_unlock_irqrestore(&log_lock, flags); ++ } ++} ++ ++static void log_dump(void) ++{ ++ if (sdhost_log_buf) { ++ LOG_ENTRY_T *entry; ++ unsigned long flags; ++ int idx; ++ ++ spin_lock_irqsave(&log_lock, flags); ++ ++ idx = sdhost_log_idx; ++ do { ++ entry = sdhost_log_buf + idx; ++ if (entry->event[0] != '\0') ++ pr_err("[%08x] %.4s %x %x\n", ++ entry->timestamp, ++ entry->event, ++ entry->param1, ++ entry->param2); ++ idx = (idx + 1) % LOG_ENTRIES; ++ } while (idx != sdhost_log_idx); ++ ++ spin_unlock_irqrestore(&log_lock, flags); ++ } ++} ++ ++#define log_event(event, param1, param2) log_event_impl(event, param1, param2) ++ ++#else ++ ++#define log_init(x) (void)0 ++#define log_event(event, param1, param2) (void)0 ++#define log_dump() (void)0 ++ ++#endif + + static inline void bcm2835_sdhost_write(struct bcm2835_host *host, u32 val, int reg) + { +@@ -201,7 +317,7 @@ static void bcm2835_sdhost_dumpcmd(struc + const char *label) + { + if (cmd) +- pr_info("%s:%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", ++ pr_err("%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, +@@ -211,73 +327,74 @@ static void bcm2835_sdhost_dumpcmd(struc + + static void bcm2835_sdhost_dumpregs(struct bcm2835_host *host) + { +- 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", +- mmc_hostname(host->mmc), +- host->mrq->data->blocks, +- host->mrq->data->blksz, +- host->mrq->data->error); +- bcm2835_sdhost_dumpcmd(host, host->mrq->stop, "stop"); ++ if (host->mrq) ++ { ++ 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", ++ mmc_hostname(host->mmc), ++ host->mrq->data->blocks, ++ host->mrq->data->blksz, ++ host->mrq->data->error); ++ bcm2835_sdhost_dumpcmd(host, host->mrq->stop, "stop"); ++ } + +- pr_info("%s: =========== REGISTER DUMP ===========\n", ++ pr_err("%s: =========== REGISTER DUMP ===========\n", + mmc_hostname(host->mmc)); + +- pr_info("%s: SDCMD 0x%08x\n", ++ pr_err("%s: SDCMD 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCMD)); +- pr_info("%s: SDARG 0x%08x\n", ++ pr_err("%s: SDARG 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDARG)); +- pr_info("%s: SDTOUT 0x%08x\n", ++ pr_err("%s: SDTOUT 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDTOUT)); +- pr_info("%s: SDCDIV 0x%08x\n", ++ pr_err("%s: SDCDIV 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCDIV)); +- pr_info("%s: SDRSP0 0x%08x\n", ++ pr_err("%s: SDRSP0 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP0)); +- pr_info("%s: SDRSP1 0x%08x\n", ++ pr_err("%s: SDRSP1 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP1)); +- pr_info("%s: SDRSP2 0x%08x\n", ++ pr_err("%s: SDRSP2 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP2)); +- pr_info("%s: SDRSP3 0x%08x\n", ++ pr_err("%s: SDRSP3 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP3)); +- pr_info("%s: SDHSTS 0x%08x\n", ++ pr_err("%s: SDHSTS 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHSTS)); +- pr_info("%s: SDVDD 0x%08x\n", ++ pr_err("%s: SDVDD 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDVDD)); +- pr_info("%s: SDEDM 0x%08x\n", ++ pr_err("%s: SDEDM 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDEDM)); +- pr_info("%s: SDHCFG 0x%08x\n", ++ pr_err("%s: SDHCFG 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHCFG)); +- pr_info("%s: SDHBCT 0x%08x\n", ++ pr_err("%s: SDHBCT 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBCT)); +- pr_info("%s: SDHBLC 0x%08x\n", ++ pr_err("%s: SDHBLC 0x%08x\n", + mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBLC)); + +- pr_info("%s: ===========================================\n", ++ pr_err("%s: ===========================================\n", + mmc_hostname(host->mmc)); + } + +- + static void bcm2835_sdhost_set_power(struct bcm2835_host *host, bool on) + { + bcm2835_sdhost_write(host, on ? 1 : 0, SDVDD); + } + +- + static void bcm2835_sdhost_reset_internal(struct bcm2835_host *host) + { + u32 temp; +@@ -300,26 +417,24 @@ static void bcm2835_sdhost_reset_interna + temp = bcm2835_sdhost_read(host, SDEDM); + temp &= ~((SDEDM_THRESHOLD_MASK<clock = 0; +- host->sectors = 0; +- host->single_read_sectors[0] = ~0; + bcm2835_sdhost_write(host, host->hcfg, SDHCFG); + bcm2835_sdhost_write(host, host->cdiv, SDCDIV); + mmiowb(); + } + +- + static void bcm2835_sdhost_reset(struct mmc_host *mmc) + { + struct bcm2835_host *host = mmc_priv(mmc); + unsigned long flags; + spin_lock_irqsave(&host->lock, flags); ++ log_event("RST<", 0, 0); + + bcm2835_sdhost_reset_internal(host); + +@@ -344,82 +459,48 @@ static void bcm2835_sdhost_init(struct b + } + } + +-static bool bcm2835_sdhost_is_write_complete(struct bcm2835_host *host) ++static void bcm2835_sdhost_wait_transfer_complete(struct bcm2835_host *host) + { +- bool write_complete = ((bcm2835_sdhost_read(host, SDEDM) & 0xf) == 1); ++ int timediff; ++ u32 alternate_idle; ++ u32 edm; + +- if (!write_complete) { +- /* Request an IRQ for the last block */ +- host->hcfg |= SDHCFG_BLOCK_IRPT_EN; +- bcm2835_sdhost_write(host, host->hcfg, SDHCFG); +- if ((bcm2835_sdhost_read(host, SDEDM) & 0xf) == 1) { +- /* The write has now completed. Disable the interrupt +- and clear the status flag */ +- host->hcfg &= ~SDHCFG_BLOCK_IRPT_EN; +- bcm2835_sdhost_write(host, host->hcfg, SDHCFG); +- bcm2835_sdhost_write(host, SDHSTS_BLOCK_IRPT, SDHSTS); +- write_complete = true; +- } +- } ++ alternate_idle = (host->mrq->data->flags & MMC_DATA_READ) ? ++ SDEDM_FSM_READWAIT : SDEDM_FSM_WRITESTART1; + +- return write_complete; +-} ++ edm = bcm2835_sdhost_read(host, SDEDM); + +-static void bcm2835_sdhost_wait_write_complete(struct bcm2835_host *host) +-{ +- int timediff; +-#ifdef DEBUG +- static struct timeval start_time; +- static int max_stall_time = 0; +- static int total_stall_time = 0; +- struct timeval before, after; +- +- do_gettimeofday(&before); +- if (max_stall_time == 0) +- start_time = before; +-#endif ++ log_event("WTC<", edm, 0); + + timediff = 0; + + while (1) { +- u32 edm = bcm2835_sdhost_read(host, SDEDM); +- if ((edm & 0xf) == 1) ++ u32 fsm = edm & SDEDM_FSM_MASK; ++ if ((fsm == SDEDM_FSM_IDENTMODE) || ++ (fsm == SDEDM_FSM_DATAMODE)) + break; +- timediff++; +- if (timediff > 5000000) { +-#ifdef DEBUG +- do_gettimeofday(&after); +- timediff = (after.tv_sec - before.tv_sec)*1000000 + +- (after.tv_usec - before.tv_usec); ++ if (fsm == alternate_idle) { ++ bcm2835_sdhost_write(host, ++ edm | SDEDM_FORCE_DATA_MODE, ++ SDEDM); ++ break; ++ } + +- pr_err(" wait_write_complete - still waiting after %dus\n", +- timediff); +-#else +- pr_err(" wait_write_complete - still waiting after %d retries\n", ++ timediff++; ++ if (timediff == 100000) { ++ pr_err("%s: wait_transfer_complete - still waiting after %d retries\n", ++ mmc_hostname(host->mmc), + timediff); +-#endif ++ log_dump(); + bcm2835_sdhost_dumpregs(host); +- host->data->error = -ETIMEDOUT; ++ host->mrq->data->error = -ETIMEDOUT; ++ log_event("WTC!", edm, 0); + return; + } ++ cpu_relax(); ++ edm = bcm2835_sdhost_read(host, SDEDM); + } +- +-#ifdef DEBUG +- do_gettimeofday(&after); +- timediff = (after.tv_sec - before.tv_sec)*1000000 + (after.tv_usec - before.tv_usec); +- +- total_stall_time += timediff; +- if (timediff > max_stall_time) +- max_stall_time = timediff; +- +- if ((after.tv_sec - start_time.tv_sec) > 10) { +- pr_debug(" wait_write_complete - max wait %dus, total %dus\n", +- max_stall_time, total_stall_time); +- start_time = after; +- max_stall_time = 0; +- total_stall_time = 0; +- } +-#endif ++ log_event("WTC>", edm, 0); + } + + static void bcm2835_sdhost_finish_data(struct bcm2835_host *host); +@@ -427,65 +508,44 @@ static void bcm2835_sdhost_finish_data(s + static void bcm2835_sdhost_dma_complete(void *param) + { + struct bcm2835_host *host = param; +- struct dma_chan *dma_chan; ++ struct mmc_data *data = host->data; + unsigned long flags; +- u32 dir_data; + + spin_lock_irqsave(&host->lock, flags); ++ log_event("DMA<", (u32)host->data, bcm2835_sdhost_read(host, SDHSTS)); ++ log_event("DMA ", bcm2835_sdhost_read(host, SDCMD), ++ bcm2835_sdhost_read(host, SDEDM)); + +- if (host->data) { +- bool write_complete; +- if (USE_BLOCK_IRQ) +- write_complete = bcm2835_sdhost_is_write_complete(host); +- else { +- bcm2835_sdhost_wait_write_complete(host); +- write_complete = true; +- } +- pr_debug("dma_complete() - write_complete=%d\n", +- write_complete); +- +- if (write_complete || (host->data->flags & MMC_DATA_READ)) +- { +- if (write_complete) { +- dma_chan = host->dma_chan_tx; +- dir_data = DMA_TO_DEVICE; +- } else { +- dma_chan = host->dma_chan_rx; +- dir_data = DMA_FROM_DEVICE; +- } +- +- dma_unmap_sg(dma_chan->device->dev, +- host->data->sg, host->data->sg_len, +- dir_data); ++ if (host->dma_chan) { ++ dma_unmap_sg(host->dma_chan->device->dev, ++ data->sg, data->sg_len, ++ host->dma_dir); + +- bcm2835_sdhost_finish_data(host); +- } ++ host->dma_chan = NULL; + } + +- spin_unlock_irqrestore(&host->lock, flags); +-} ++ if (host->drain_words) { ++ void *page; ++ u32 *buf; + +-static bool data_transfer_wait(struct bcm2835_host *host) +-{ +- unsigned long timeout = 1000000; +- while (timeout) +- { +- u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); +- if (sdhsts & SDHSTS_DATA_FLAG) { +- bcm2835_sdhost_write(host, SDHSTS_DATA_FLAG, SDHSTS); +- break; ++ page = kmap_atomic(host->drain_page); ++ buf = page + host->drain_offset; ++ ++ while (host->drain_words) { ++ u32 edm = bcm2835_sdhost_read(host, SDEDM); ++ if ((edm >> 4) & 0x1f) ++ *(buf++) = bcm2835_sdhost_read(host, ++ SDDATA); ++ host->drain_words--; + } +- timeout--; +- } +- if (timeout == 0) { +- pr_err("%s: Data %s timeout\n", +- mmc_hostname(host->mmc), +- (host->data->flags & MMC_DATA_READ) ? "read" : "write"); +- bcm2835_sdhost_dumpregs(host); +- host->data->error = -ETIMEDOUT; +- return false; ++ ++ kunmap_atomic(page); + } +- return true; ++ ++ bcm2835_sdhost_finish_data(host); ++ ++ log_event("DMA>", (u32)host->data, 0); ++ spin_unlock_irqrestore(&host->lock, flags); + } + + static void bcm2835_sdhost_read_block_pio(struct bcm2835_host *host) +@@ -493,32 +553,83 @@ static void bcm2835_sdhost_read_block_pi + unsigned long flags; + size_t blksize, len; + u32 *buf; ++ unsigned long wait_max; + + blksize = host->data->blksz; + ++ wait_max = jiffies + msecs_to_jiffies(host->pio_timeout); ++ + local_irq_save(flags); + + while (blksize) { +- if (!sg_miter_next(&host->sg_miter)) +- BUG(); ++ int copy_words; ++ u32 hsts = 0; ++ ++ if (!sg_miter_next(&host->sg_miter)) { ++ host->data->error = -EINVAL; ++ break; ++ } + + len = min(host->sg_miter.length, blksize); +- BUG_ON(len % 4); ++ if (len % 4) { ++ host->data->error = -EINVAL; ++ break; ++ } + + blksize -= len; + host->sg_miter.consumed = len; + + buf = (u32 *)host->sg_miter.addr; + +- while (len) { +- if (!data_transfer_wait(host)) +- break; ++ copy_words = len/4; ++ ++ while (copy_words) { ++ int burst_words, words; ++ u32 edm; ++ ++ burst_words = SDDATA_FIFO_PIO_BURST; ++ if (burst_words > copy_words) ++ burst_words = copy_words; ++ edm = bcm2835_sdhost_read(host, SDEDM); ++ words = ((edm >> 4) & 0x1f); ++ ++ if (words < burst_words) { ++ int fsm_state = (edm & SDEDM_FSM_MASK); ++ if ((fsm_state != SDEDM_FSM_READDATA) && ++ (fsm_state != SDEDM_FSM_READWAIT) && ++ (fsm_state != SDEDM_FSM_READCRC)) { ++ hsts = bcm2835_sdhost_read(host, ++ SDHSTS); ++ pr_err("%s: fsm %x, hsts %x\n", ++ mmc_hostname(host->mmc), ++ fsm_state, hsts); ++ if (hsts & SDHSTS_ERROR_MASK) ++ break; ++ } ++ ++ if (time_after(jiffies, wait_max)) { ++ pr_err("%s: PIO read timeout - EDM %x\n", ++ mmc_hostname(host->mmc), ++ edm); ++ hsts = SDHSTS_REW_TIME_OUT; ++ break; ++ } ++ ndelay((burst_words - words) * ++ host->ns_per_fifo_word); ++ continue; ++ } else if (words > copy_words) { ++ words = copy_words; ++ } ++ ++ copy_words -= words; + +- *(buf++) = bcm2835_sdhost_read(host, SDDATA); +- len -= 4; ++ while (words) { ++ *(buf++) = bcm2835_sdhost_read(host, SDDATA); ++ words--; ++ } + } + +- if (host->data->error) ++ if (hsts & SDHSTS_ERROR_MASK) + break; + } + +@@ -532,32 +643,83 @@ static void bcm2835_sdhost_write_block_p + unsigned long flags; + size_t blksize, len; + u32 *buf; ++ unsigned long wait_max; + + blksize = host->data->blksz; + ++ wait_max = jiffies + msecs_to_jiffies(host->pio_timeout); ++ + local_irq_save(flags); + + while (blksize) { +- if (!sg_miter_next(&host->sg_miter)) +- BUG(); ++ int copy_words; ++ u32 hsts = 0; ++ ++ if (!sg_miter_next(&host->sg_miter)) { ++ host->data->error = -EINVAL; ++ break; ++ } + + len = min(host->sg_miter.length, blksize); +- BUG_ON(len % 4); ++ if (len % 4) { ++ host->data->error = -EINVAL; ++ break; ++ } + + blksize -= len; + host->sg_miter.consumed = len; + +- buf = host->sg_miter.addr; ++ buf = (u32 *)host->sg_miter.addr; + +- while (len) { +- if (!data_transfer_wait(host)) +- break; ++ copy_words = len/4; ++ ++ while (copy_words) { ++ int burst_words, words; ++ u32 edm; ++ ++ burst_words = SDDATA_FIFO_PIO_BURST; ++ if (burst_words > copy_words) ++ burst_words = copy_words; ++ edm = bcm2835_sdhost_read(host, SDEDM); ++ words = SDDATA_FIFO_WORDS - ((edm >> 4) & 0x1f); ++ ++ if (words < burst_words) { ++ int fsm_state = (edm & SDEDM_FSM_MASK); ++ if ((fsm_state != SDEDM_FSM_WRITEDATA) && ++ (fsm_state != SDEDM_FSM_WRITESTART1) && ++ (fsm_state != SDEDM_FSM_WRITESTART2)) { ++ hsts = bcm2835_sdhost_read(host, ++ SDHSTS); ++ pr_err("%s: fsm %x, hsts %x\n", ++ mmc_hostname(host->mmc), ++ fsm_state, hsts); ++ if (hsts & SDHSTS_ERROR_MASK) ++ break; ++ } + +- bcm2835_sdhost_write(host, *(buf++), SDDATA); +- len -= 4; ++ if (time_after(jiffies, wait_max)) { ++ pr_err("%s: PIO write timeout - EDM %x\n", ++ mmc_hostname(host->mmc), ++ edm); ++ hsts = SDHSTS_REW_TIME_OUT; ++ break; ++ } ++ ndelay((burst_words - words) * ++ host->ns_per_fifo_word); ++ continue; ++ } else if (words > copy_words) { ++ words = copy_words; ++ } ++ ++ copy_words -= words; ++ ++ while (words) { ++ bcm2835_sdhost_write(host, *(buf++), SDDATA); ++ words--; ++ } + } + +- if (host->data->error) ++ if (hsts & SDHSTS_ERROR_MASK) + break; + } + +@@ -566,12 +728,12 @@ static void bcm2835_sdhost_write_block_p + local_irq_restore(flags); + } + +- + static void bcm2835_sdhost_transfer_pio(struct bcm2835_host *host) + { + u32 sdhsts; + bool is_read; + BUG_ON(!host->data); ++ log_event("XFP<", (u32)host->data, host->blocks); + + is_read = (host->data->flags & MMC_DATA_READ) != 0; + if (is_read) +@@ -595,28 +757,21 @@ static void bcm2835_sdhost_transfer_pio( + is_read ? "read" : "write", + sdhsts); + host->data->error = -ETIMEDOUT; +- } else if (!is_read && !host->data->error) { +- /* Start a timer in case a transfer error occurs because +- there is no error interrupt */ +- mod_timer(&host->pio_timer, jiffies + host->pio_timeout); + } ++ log_event("XFP>", (u32)host->data, host->blocks); + } + +- +-static void bcm2835_sdhost_transfer_dma(struct bcm2835_host *host) ++static void bcm2835_sdhost_prepare_dma(struct bcm2835_host *host, ++ struct mmc_data *data) + { +- u32 len, dir_data, dir_slave; ++ int len, dir_data, dir_slave; + struct dma_async_tx_descriptor *desc = NULL; + struct dma_chan *dma_chan; + +- pr_debug("bcm2835_sdhost_transfer_dma()\n"); +- +- WARN_ON(!host->data); ++ log_event("PRD<", (u32)data, 0); ++ pr_debug("bcm2835_sdhost_prepare_dma()\n"); + +- if (!host->data) +- return; +- +- if (host->data->flags & MMC_DATA_READ) { ++ if (data->flags & MMC_DATA_READ) { + dma_chan = host->dma_chan_rx; + dir_data = DMA_FROM_DEVICE; + dir_slave = DMA_DEV_TO_MEM; +@@ -625,35 +780,71 @@ static void bcm2835_sdhost_transfer_dma( + dir_data = DMA_TO_DEVICE; + dir_slave = DMA_MEM_TO_DEV; + } ++ log_event("PRD1", (u32)dma_chan, 0); + + BUG_ON(!dma_chan->device); + BUG_ON(!dma_chan->device->dev); +- BUG_ON(!host->data->sg); ++ BUG_ON(!data->sg); + +- len = dma_map_sg(dma_chan->device->dev, host->data->sg, +- host->data->sg_len, dir_data); +- if (len > 0) { +- desc = dmaengine_prep_slave_sg(dma_chan, host->data->sg, ++ /* The block doesn't manage the FIFO DREQs properly for multi-block ++ transfers, so don't attempt to DMA the final few words. ++ Unfortunately this requires the final sg entry to be trimmed. ++ N.B. This code demands that the overspill is contained in ++ a single sg entry. ++ */ ++ ++ host->drain_words = 0; ++ if ((data->blocks > 1) && (dir_data == DMA_FROM_DEVICE)) { ++ struct scatterlist *sg; ++ u32 len; ++ int i; ++ ++ len = min((u32)(FIFO_READ_THRESHOLD - 1) * 4, ++ (u32)data->blocks * data->blksz); ++ ++ for_each_sg(data->sg, sg, data->sg_len, i) { ++ if (sg_is_last(sg)) { ++ BUG_ON(sg->length < len); ++ sg->length -= len; ++ host->drain_page = (struct page *)sg->page_link; ++ host->drain_offset = sg->offset + sg->length; ++ } ++ } ++ host->drain_words = len/4; ++ } ++ ++ len = dma_map_sg(dma_chan->device->dev, data->sg, data->sg_len, ++ dir_data); ++ ++ log_event("PRD2", len, 0); ++ if (len > 0) ++ desc = dmaengine_prep_slave_sg(dma_chan, data->sg, + len, dir_slave, + DMA_PREP_INTERRUPT | DMA_CTRL_ACK); +- } else { +- dev_err(mmc_dev(host->mmc), "dma_map_sg returned zero length\n"); +- } ++ log_event("PRD3", (u32)desc, 0); ++ + if (desc) { + desc->callback = bcm2835_sdhost_dma_complete; + desc->callback_param = host; +- dmaengine_submit(desc); +- dma_async_issue_pending(dma_chan); ++ host->dma_desc = desc; ++ host->dma_chan = dma_chan; ++ host->dma_dir = dir_data; + } +- ++ log_event("PDM>", (u32)data, 0); + } + ++static void bcm2835_sdhost_start_dma(struct bcm2835_host *host) ++{ ++ log_event("SDMA", (u32)host->data, (u32)host->dma_chan); ++ dmaengine_submit(host->dma_desc); ++ dma_async_issue_pending(host->dma_chan); ++} + + static void bcm2835_sdhost_set_transfer_irqs(struct bcm2835_host *host) + { + u32 all_irqs = SDHCFG_DATA_IRPT_EN | SDHCFG_BLOCK_IRPT_EN | + SDHCFG_BUSY_IRPT_EN; +- if (host->use_dma) ++ if (host->dma_desc) + host->hcfg = (host->hcfg & ~all_irqs) | + SDHCFG_BUSY_IRPT_EN; + else +@@ -664,13 +855,13 @@ static void bcm2835_sdhost_set_transfer_ + bcm2835_sdhost_write(host, host->hcfg, SDHCFG); + } + +- + static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_command *cmd) + { + struct mmc_data *data = cmd->data; + + WARN_ON(host->data); + ++ host->data = data; + if (!data) + return; + +@@ -679,46 +870,19 @@ static void bcm2835_sdhost_prepare_data( + BUG_ON(data->blksz > host->mmc->max_blk_size); + BUG_ON(data->blocks > 65535); + +- host->data = data; + host->data_complete = 0; + host->flush_fifo = 0; + host->data->bytes_xfered = 0; + +- if (!host->sectors && host->mmc->card && !(host->debug_flags & 1)) +- { +- struct mmc_card *card = host->mmc->card; +- if (!mmc_card_sd(card) && mmc_card_blockaddr(card)) { +- /* +- * The EXT_CSD sector count is in number of 512 byte +- * sectors. +- */ +- host->sectors = card->ext_csd.sectors; +- pr_err("%s: using ext_csd!\n", mmc_hostname(host->mmc)); +- } else { +- /* +- * The CSD capacity field is in units of read_blkbits. +- * set_capacity takes units of 512 bytes. +- */ +- host->sectors = card->csd.capacity << +- (card->csd.read_blkbits - 9); +- } +- host->single_read_sectors[0] = host->sectors - 65; +- host->single_read_sectors[1] = host->sectors - 64; +- host->single_read_sectors[2] = host->sectors - 33; +- host->single_read_sectors[3] = host->sectors - 32; +- host->single_read_sectors[4] = host->sectors - 1; +- host->single_read_sectors[5] = ~0; /* Safety net */ +- } + +- host->use_dma = host->have_dma && (data->blocks > host->pio_limit); +- if (!host->use_dma) { ++ if (!host->dma_desc) { ++ /* Use PIO */ + int flags; + +- flags = SG_MITER_ATOMIC; + if (data->flags & MMC_DATA_READ) +- flags |= SG_MITER_TO_SG; ++ flags = SG_MITER_TO_SG; + else +- flags |= SG_MITER_FROM_SG; ++ flags = SG_MITER_FROM_SG; + sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags); + host->blocks = data->blocks; + } +@@ -726,19 +890,20 @@ static void bcm2835_sdhost_prepare_data( + bcm2835_sdhost_set_transfer_irqs(host); + + bcm2835_sdhost_write(host, data->blksz, SDHBCT); +- bcm2835_sdhost_write(host, host->use_dma ? data->blocks : 0, SDHBLC); ++ bcm2835_sdhost_write(host, data->blocks, SDHBLC); + + BUG_ON(!host->data); + } + +- +-void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command *cmd) ++bool bcm2835_sdhost_send_command(struct bcm2835_host *host, ++ struct mmc_command *cmd) + { + u32 sdcmd, sdhsts; + unsigned long timeout; + int delay; + + WARN_ON(host->cmd); ++ log_event("CMD<", cmd->opcode, cmd->arg); + + if (cmd->data) + pr_debug("%s: send_command %d 0x%x " +@@ -761,9 +926,9 @@ void bcm2835_sdhost_send_command(struct + pr_err("%s: previous command never completed.\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); +- cmd->error = -EIO; ++ cmd->error = -EILSEQ; + tasklet_schedule(&host->finish_tasklet); +- return; ++ return false; + } + timeout--; + udelay(10); +@@ -791,23 +956,24 @@ void bcm2835_sdhost_send_command(struct + if (sdhsts & SDHSTS_ERROR_MASK) + bcm2835_sdhost_write(host, sdhsts, SDHSTS); + +- bcm2835_sdhost_prepare_data(host, cmd); +- +- bcm2835_sdhost_write(host, cmd->arg, SDARG); +- + if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { + pr_err("%s: unsupported response type!\n", + mmc_hostname(host->mmc)); + cmd->error = -EINVAL; + tasklet_schedule(&host->finish_tasklet); +- return; ++ return false; + } + ++ bcm2835_sdhost_prepare_data(host, cmd); ++ ++ bcm2835_sdhost_write(host, cmd->arg, SDARG); ++ + sdcmd = cmd->opcode & SDCMD_CMD_MASK; + +- if (!(cmd->flags & MMC_RSP_PRESENT)) ++ host->use_busy = 0; ++ if (!(cmd->flags & MMC_RSP_PRESENT)) { + sdcmd |= SDCMD_NO_RESPONSE; +- else { ++ } else { + if (cmd->flags & MMC_RSP_136) + sdcmd |= SDCMD_LONG_RESPONSE; + if (cmd->flags & MMC_RSP_BUSY) { +@@ -817,6 +983,7 @@ void bcm2835_sdhost_send_command(struct + } + + if (cmd->data) { ++ log_event("CMDD", cmd->data->blocks, cmd->data->blksz); + if (host->delay_after_stop) { + struct timeval now; + int time_since_stop; +@@ -839,10 +1006,12 @@ void bcm2835_sdhost_send_command(struct + } + + bcm2835_sdhost_write(host, sdcmd | SDCMD_NEW_FLAG, SDCMD); +-} + ++ return true; ++} + +-static void bcm2835_sdhost_finish_command(struct bcm2835_host *host); ++static void bcm2835_sdhost_finish_command(struct bcm2835_host *host, ++ unsigned long *irq_flags); + static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host); + + static void bcm2835_sdhost_finish_data(struct bcm2835_host *host) +@@ -852,6 +1021,7 @@ static void bcm2835_sdhost_finish_data(s + data = host->data; + BUG_ON(!data); + ++ log_event("FDA<", (u32)host->mrq, (u32)host->cmd); + pr_debug("finish_data(error %d, stop %d, sbc %d)\n", + data->error, data->stop ? 1 : 0, + host->mrq->sbc ? 1 : 0); +@@ -859,10 +1029,7 @@ static void bcm2835_sdhost_finish_data(s + host->hcfg &= ~(SDHCFG_DATA_IRPT_EN | SDHCFG_BLOCK_IRPT_EN); + bcm2835_sdhost_write(host, host->hcfg, SDHCFG); + +- if (data->error) { +- data->bytes_xfered = 0; +- } else +- data->bytes_xfered = data->blksz * data->blocks; ++ data->bytes_xfered = data->error ? 0 : (data->blksz * data->blocks); + + host->data_complete = 1; + +@@ -877,9 +1044,9 @@ static void bcm2835_sdhost_finish_data(s + } + else + bcm2835_sdhost_transfer_complete(host); ++ log_event("FDA>", (u32)host->mrq, (u32)host->cmd); + } + +- + static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host) + { + struct mmc_data *data; +@@ -891,6 +1058,7 @@ static void bcm2835_sdhost_transfer_comp + data = host->data; + host->data = NULL; + ++ log_event("TCM<", (u32)data, data->error); + pr_debug("transfer_complete(error %d, stop %d)\n", + data->error, data->stop ? 1 : 0); + +@@ -899,88 +1067,114 @@ static void bcm2835_sdhost_transfer_comp + * a) open-ended multiblock transfer (no CMD23) + * b) error in multiblock transfer + */ +- if (data->stop && +- (data->error || +- !host->mrq->sbc)) { +- host->flush_fifo = 1; +- bcm2835_sdhost_send_command(host, data->stop); +- if (host->delay_after_stop) +- do_gettimeofday(&host->stop_time); +- if (!host->use_busy) +- bcm2835_sdhost_finish_command(host); ++ if (host->mrq->stop && (data->error || !host->use_sbc)) { ++ if (bcm2835_sdhost_send_command(host, host->mrq->stop)) { ++ /* No busy, so poll for completion */ ++ if (!host->use_busy) ++ bcm2835_sdhost_finish_command(host, NULL); ++ ++ if (host->delay_after_stop) ++ do_gettimeofday(&host->stop_time); ++ } + } else { ++ bcm2835_sdhost_wait_transfer_complete(host); + tasklet_schedule(&host->finish_tasklet); + } ++ log_event("TCM>", (u32)data, 0); + } + +-static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) ++/* If irq_flags is valid, the caller is in a thread context and is allowed ++ to sleep */ ++static void bcm2835_sdhost_finish_command(struct bcm2835_host *host, ++ unsigned long *irq_flags) + { + u32 sdcmd; +- unsigned long timeout; ++ u32 retries; + #ifdef DEBUG + struct timeval before, after; + int timediff = 0; + #endif + ++ log_event("FCM<", (u32)host->mrq, (u32)host->cmd); + pr_debug("finish_command(%x)\n", bcm2835_sdhost_read(host, SDCMD)); + + BUG_ON(!host->cmd || !host->mrq); + +-#ifdef DEBUG +- do_gettimeofday(&before); +-#endif +- /* Wait max 100 ms */ +- timeout = 10000; ++ /* Poll quickly at first */ ++ ++ retries = host->cmd_quick_poll_retries; ++ if (!retries) { ++ /* Work out how many polls take 1us by timing 10us */ ++ struct timeval start, now; ++ int us_diff; ++ ++ retries = 1; ++ do { ++ int i; ++ ++ retries *= 2; ++ ++ do_gettimeofday(&start); ++ ++ for (i = 0; i < retries; i++) { ++ cpu_relax(); ++ sdcmd = bcm2835_sdhost_read(host, SDCMD); ++ } ++ ++ do_gettimeofday(&now); ++ us_diff = (now.tv_sec - start.tv_sec) * 1000000 + ++ (now.tv_usec - start.tv_usec); ++ } while (us_diff < 10); ++ ++ host->cmd_quick_poll_retries = ((retries * us_diff + 9)*CMD_DALLY_US)/10 + 1; ++ 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) && timeout; +- timeout--) { +- if (host->flush_fifo) { +- while (bcm2835_sdhost_read(host, SDHSTS) & +- SDHSTS_DATA_FLAG) +- (void)bcm2835_sdhost_read(host, SDDATA); +- } +- udelay(10); ++ (sdcmd & SDCMD_NEW_FLAG) && !(sdcmd & SDCMD_FAIL_FLAG) && retries; ++ retries--) { ++ cpu_relax(); + sdcmd = bcm2835_sdhost_read(host, SDCMD); + } +-#ifdef DEBUG +- do_gettimeofday(&after); +- timediff = (after.tv_sec - before.tv_sec)*1000000 + +- (after.tv_usec - before.tv_usec); + +- pr_debug(" finish_command - waited %dus\n", timediff); +-#endif ++ if (!retries) { ++ unsigned long wait_max; ++ ++ if (!irq_flags) { ++ /* Schedule the work */ ++ log_event("CWWQ", 0, 0); ++ schedule_work(&host->cmd_wait_wq); ++ return; ++ } ++ ++ /* Wait max 100 ms */ ++ wait_max = jiffies + msecs_to_jiffies(100); ++ while (time_before(jiffies, wait_max)) { ++ spin_unlock_irqrestore(&host->lock, *irq_flags); ++ 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)) ++ break; ++ } ++ } + +- if (timeout == 0) { ++ /* 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; + tasklet_schedule(&host->finish_tasklet); + return; +- } +- +- if (host->flush_fifo) { +- for (timeout = 100; +- (bcm2835_sdhost_read(host, SDHSTS) & SDHSTS_DATA_FLAG) && timeout; +- timeout--) { +- (void)bcm2835_sdhost_read(host, SDDATA); +- } +- host->flush_fifo = 0; +- if (timeout == 0) { +- pr_err("%s: FIFO never drained.\n", +- mmc_hostname(host->mmc)); +- bcm2835_sdhost_dumpregs(host); +- host->cmd->error = -EIO; +- tasklet_schedule(&host->finish_tasklet); +- return; +- } +- } +- +- /* Check for errors */ +- if (sdcmd & SDCMD_FAIL_FLAG) +- { ++ } else if (sdcmd & SDCMD_FAIL_FLAG) { + u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); + ++ /* Clear the errors */ ++ bcm2835_sdhost_write(host, SDHSTS_ERROR_MASK, SDHSTS); ++ + if (host->debug) + pr_info("%s: error detected - CMD %x, HSTS %03x, EDM %x\n", + mmc_hostname(host->mmc), sdcmd, sdhsts, +@@ -1003,7 +1197,7 @@ static void bcm2835_sdhost_finish_comman + mmc_hostname(host->mmc), + host->cmd->opcode); + bcm2835_sdhost_dumpregs(host); +- host->cmd->error = -EIO; ++ host->cmd->error = -EILSEQ; + } + tasklet_schedule(&host->finish_tasklet); + return; +@@ -1018,31 +1212,31 @@ static void bcm2835_sdhost_finish_comman + pr_debug("%s: finish_command %08x %08x %08x %08x\n", + mmc_hostname(host->mmc), + host->cmd->resp[0], host->cmd->resp[1], host->cmd->resp[2], host->cmd->resp[3]); ++ log_event("RSP ", host->cmd->resp[0], host->cmd->resp[1]); + } else { + host->cmd->resp[0] = bcm2835_sdhost_read(host, SDRSP0); + pr_debug("%s: finish_command %08x\n", + mmc_hostname(host->mmc), + host->cmd->resp[0]); ++ log_event("RSP ", host->cmd->resp[0], 0); + } + } + +- host->cmd->error = 0; +- + if (host->cmd == host->mrq->sbc) { + /* Finished CMD23, now send actual command. */ + host->cmd = NULL; +- bcm2835_sdhost_send_command(host, host->mrq->cmd); ++ if (bcm2835_sdhost_send_command(host, host->mrq->cmd)) { ++ if (host->data && host->dma_desc) ++ /* DMA transfer starts now, PIO starts after irq */ ++ bcm2835_sdhost_start_dma(host); + +- if (host->cmd->data && host->use_dma) +- /* DMA transfer starts now, PIO starts after irq */ +- bcm2835_sdhost_transfer_dma(host); +- +- if (!host->use_busy) +- bcm2835_sdhost_finish_command(host); +- } else if (host->cmd == host->mrq->stop) ++ if (!host->use_busy) ++ bcm2835_sdhost_finish_command(host, NULL); ++ } ++ } else if (host->cmd == host->mrq->stop) { + /* Finished CMD12 */ + tasklet_schedule(&host->finish_tasklet); +- else { ++ } else { + /* Processed actual command. */ + host->cmd = NULL; + if (!host->data) +@@ -1050,6 +1244,7 @@ static void bcm2835_sdhost_finish_comman + else if (host->data_complete) + bcm2835_sdhost_transfer_complete(host); + } ++ log_event("FCM>", (u32)host->mrq, (u32)host->cmd); + } + + static void bcm2835_sdhost_timeout(unsigned long data) +@@ -1060,10 +1255,12 @@ static void bcm2835_sdhost_timeout(unsig + host = (struct bcm2835_host *)data; + + spin_lock_irqsave(&host->lock, flags); ++ log_event("TIM<", 0, 0); + + if (host->mrq) { + pr_err("%s: timeout waiting for hardware interrupt.\n", + mmc_hostname(host->mmc)); ++ log_dump(); + bcm2835_sdhost_dumpregs(host); + + if (host->data) { +@@ -1084,74 +1281,15 @@ static void bcm2835_sdhost_timeout(unsig + spin_unlock_irqrestore(&host->lock, flags); + } + +-static void bcm2835_sdhost_pio_timeout(unsigned long data) +-{ +- struct bcm2835_host *host; +- unsigned long flags; +- +- host = (struct bcm2835_host *)data; +- +- spin_lock_irqsave(&host->lock, flags); +- +- if (host->data) { +- u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); +- +- if (sdhsts & SDHSTS_REW_TIME_OUT) { +- pr_err("%s: transfer timeout\n", +- mmc_hostname(host->mmc)); +- if (host->debug) +- bcm2835_sdhost_dumpregs(host); +- } else { +- pr_err("%s: unexpected transfer timeout\n", +- mmc_hostname(host->mmc)); +- bcm2835_sdhost_dumpregs(host); +- } +- +- bcm2835_sdhost_write(host, SDHSTS_TRANSFER_ERROR_MASK, +- SDHSTS); +- +- host->data->error = -ETIMEDOUT; +- +- bcm2835_sdhost_finish_data(host); +- } +- +- mmiowb(); +- spin_unlock_irqrestore(&host->lock, flags); +-} +- +-static void bcm2835_sdhost_enable_sdio_irq_nolock(struct bcm2835_host *host, int enable) +-{ +- if (enable) +- host->hcfg |= SDHCFG_SDIO_IRPT_EN; +- else +- host->hcfg &= ~SDHCFG_SDIO_IRPT_EN; +- bcm2835_sdhost_write(host, host->hcfg, SDHCFG); +- mmiowb(); +-} +- +-static void bcm2835_sdhost_enable_sdio_irq(struct mmc_host *mmc, int enable) +-{ +- struct bcm2835_host *host = mmc_priv(mmc); +- unsigned long flags; +- +- pr_debug("%s: enable_sdio_irq(%d)\n", mmc_hostname(mmc), enable); +- spin_lock_irqsave(&host->lock, flags); +- bcm2835_sdhost_enable_sdio_irq_nolock(host, enable); +- spin_unlock_irqrestore(&host->lock, flags); +-} +- +-static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) ++static void bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + { +- const u32 handled = (SDHSTS_REW_TIME_OUT | SDHSTS_CMD_TIME_OUT | +- SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR | +- SDHSTS_FIFO_ERROR); +- ++ log_event("IRQB", (u32)host->cmd, intmask); + if (!host->cmd) { + pr_err("%s: got command busy interrupt 0x%08x even " + "though no command operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); +- return 0; ++ return; + } + + if (!host->use_busy) { +@@ -1159,7 +1297,7 @@ static u32 bcm2835_sdhost_busy_irq(struc + "though not expecting one.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); +- return 0; ++ return; + } + host->use_busy = 0; + +@@ -1182,28 +1320,23 @@ static u32 bcm2835_sdhost_busy_irq(struc + } else if (intmask & SDHSTS_CMD_TIME_OUT) + host->cmd->error = -ETIMEDOUT; + ++ log_dump(); + bcm2835_sdhost_dumpregs(host); +- tasklet_schedule(&host->finish_tasklet); + } + else +- bcm2835_sdhost_finish_command(host); +- +- return handled; ++ bcm2835_sdhost_finish_command(host, NULL); + } + +-static u32 bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask) ++static void bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask) + { +- const u32 handled = (SDHSTS_REW_TIME_OUT | +- SDHSTS_CRC16_ERROR | +- SDHSTS_FIFO_ERROR); +- + /* There are no dedicated data/space available interrupt + status bits, so it is necessary to use the single shared + data/space available FIFO status bits. It is therefore not + an error to get here when there is no data transfer in + progress. */ ++ log_event("IRQD", (u32)host->data, intmask); + if (!host->data) +- return 0; ++ return; + + if (intmask & (SDHSTS_CRC16_ERROR | + SDHSTS_FIFO_ERROR | +@@ -1214,46 +1347,37 @@ static u32 bcm2835_sdhost_data_irq(struc + else + host->data->error = -ETIMEDOUT; + +- bcm2835_sdhost_dumpregs(host); +- tasklet_schedule(&host->finish_tasklet); +- return handled; ++ if (host->debug) { ++ log_dump(); ++ bcm2835_sdhost_dumpregs(host); ++ } + } + +- /* Use the block interrupt for writes after the first block */ +- if (host->data->flags & MMC_DATA_WRITE) { ++ if (host->data->error) { ++ bcm2835_sdhost_finish_data(host); ++ } else if (host->data->flags & MMC_DATA_WRITE) { ++ /* Use the block interrupt for writes after the first block */ + host->hcfg &= ~(SDHCFG_DATA_IRPT_EN); + host->hcfg |= SDHCFG_BLOCK_IRPT_EN; + bcm2835_sdhost_write(host, host->hcfg, SDHCFG); +- if (host->data->error) +- bcm2835_sdhost_finish_data(host); +- else +- bcm2835_sdhost_transfer_pio(host); ++ bcm2835_sdhost_transfer_pio(host); + } else { +- if (!host->data->error) { +- bcm2835_sdhost_transfer_pio(host); +- host->blocks--; +- } ++ bcm2835_sdhost_transfer_pio(host); ++ host->blocks--; + if ((host->blocks == 0) || host->data->error) + bcm2835_sdhost_finish_data(host); + } +- +- return handled; + } + +-static u32 bcm2835_sdhost_block_irq(struct bcm2835_host *host, u32 intmask) ++static void bcm2835_sdhost_block_irq(struct bcm2835_host *host, u32 intmask) + { +- struct dma_chan *dma_chan; +- u32 dir_data; +- const u32 handled = (SDHSTS_REW_TIME_OUT | +- SDHSTS_CRC16_ERROR | +- SDHSTS_FIFO_ERROR); +- ++ log_event("IRQK", (u32)host->data, intmask); + if (!host->data) { + pr_err("%s: got block interrupt 0x%08x even " + "though no data operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); +- return handled; ++ return; + } + + if (intmask & (SDHSTS_CRC16_ERROR | +@@ -1265,149 +1389,69 @@ static u32 bcm2835_sdhost_block_irq(stru + else + host->data->error = -ETIMEDOUT; + +- if (host->debug) ++ if (host->debug) { ++ log_dump(); + bcm2835_sdhost_dumpregs(host); +- tasklet_schedule(&host->finish_tasklet); +- return handled; ++ } + } + +- if (!host->use_dma) { ++ if (!host->dma_desc) { + BUG_ON(!host->blocks); +- host->blocks--; +- if ((host->blocks == 0) || host->data->error) { +- /* Cancel the timer */ +- del_timer(&host->pio_timer); +- ++ if (host->data->error || (--host->blocks == 0)) { + bcm2835_sdhost_finish_data(host); + } else { +- /* Reset the timer */ +- mod_timer(&host->pio_timer, +- jiffies + host->pio_timeout); +- + bcm2835_sdhost_transfer_pio(host); +- +- /* Reset the timer */ +- mod_timer(&host->pio_timer, +- jiffies + host->pio_timeout); + } + } else if (host->data->flags & MMC_DATA_WRITE) { +- dma_chan = host->dma_chan_tx; +- dir_data = DMA_TO_DEVICE; +- dma_unmap_sg(dma_chan->device->dev, +- host->data->sg, host->data->sg_len, +- dir_data); +- + bcm2835_sdhost_finish_data(host); + } +- +- return handled; + } + +- + static irqreturn_t bcm2835_sdhost_irq(int irq, void *dev_id) + { + irqreturn_t result = IRQ_NONE; + struct bcm2835_host *host = dev_id; +- u32 unexpected = 0, early = 0; +- int loops = 0; ++ u32 intmask; + + spin_lock(&host->lock); + +- for (loops = 0; loops < 1; loops++) { +- u32 intmask, handled; +- +- intmask = bcm2835_sdhost_read(host, SDHSTS); +- handled = intmask & (SDHSTS_BUSY_IRPT | +- SDHSTS_BLOCK_IRPT | +- SDHSTS_SDIO_IRPT | +- SDHSTS_DATA_FLAG); +- if ((handled == SDHSTS_DATA_FLAG) && +- (loops == 0) && !host->data) { +- pr_err("%s: sdhost_irq data interrupt 0x%08x even " +- "though no data operation was in progress.\n", +- mmc_hostname(host->mmc), +- (unsigned)intmask); +- +- bcm2835_sdhost_dumpregs(host); +- } +- +- if (!handled) +- break; ++ intmask = bcm2835_sdhost_read(host, SDHSTS); ++ log_event("IRQ<", intmask, 0); + +- if (loops) +- early |= handled; ++ bcm2835_sdhost_write(host, ++ SDHSTS_BUSY_IRPT | ++ SDHSTS_BLOCK_IRPT | ++ SDHSTS_SDIO_IRPT | ++ SDHSTS_DATA_FLAG, ++ SDHSTS); + ++ if (intmask & SDHSTS_BLOCK_IRPT) { ++ bcm2835_sdhost_block_irq(host, intmask); + result = IRQ_HANDLED; ++ } + +- /* Clear all interrupts and notifications */ +- bcm2835_sdhost_write(host, intmask, SDHSTS); +- +- if (intmask & SDHSTS_BUSY_IRPT) +- handled |= bcm2835_sdhost_busy_irq(host, intmask); +- +- /* There is no true data interrupt status bit, so it is +- necessary to qualify the data flag with the interrupt +- enable bit */ +- if ((intmask & SDHSTS_DATA_FLAG) && +- (host->hcfg & SDHCFG_DATA_IRPT_EN)) +- handled |= bcm2835_sdhost_data_irq(host, intmask); +- +- if (intmask & SDHSTS_BLOCK_IRPT) +- handled |= bcm2835_sdhost_block_irq(host, intmask); +- +- if (intmask & SDHSTS_SDIO_IRPT) { +- bcm2835_sdhost_enable_sdio_irq_nolock(host, false); +- host->thread_isr |= SDHSTS_SDIO_IRPT; +- result = IRQ_WAKE_THREAD; +- } ++ if (intmask & SDHSTS_BUSY_IRPT) { ++ bcm2835_sdhost_busy_irq(host, intmask); ++ result = IRQ_HANDLED; ++ } + +- unexpected |= (intmask & ~handled); ++ /* There is no true data interrupt status bit, so it is ++ necessary to qualify the data flag with the interrupt ++ enable bit */ ++ if ((intmask & SDHSTS_DATA_FLAG) && ++ (host->hcfg & SDHCFG_DATA_IRPT_EN)) { ++ bcm2835_sdhost_data_irq(host, intmask); ++ result = IRQ_HANDLED; + } + + mmiowb(); + ++ log_event("IRQ>", bcm2835_sdhost_read(host, SDHSTS), 0); + spin_unlock(&host->lock); + +- if (early) +- pr_debug("%s: early %x (loops %d)\n", +- mmc_hostname(host->mmc), early, loops); +- +- if (unexpected) { +- pr_err("%s: unexpected interrupt 0x%08x.\n", +- mmc_hostname(host->mmc), unexpected); +- bcm2835_sdhost_dumpregs(host); +- } +- + return result; + } + +-static irqreturn_t bcm2835_sdhost_thread_irq(int irq, void *dev_id) +-{ +- struct bcm2835_host *host = dev_id; +- unsigned long flags; +- u32 isr; +- +- spin_lock_irqsave(&host->lock, flags); +- isr = host->thread_isr; +- host->thread_isr = 0; +- spin_unlock_irqrestore(&host->lock, flags); +- +- if (isr & SDHSTS_SDIO_IRPT) { +- sdio_run_irqs(host->mmc); +- +-/* Is this necessary? Why re-enable an interrupt which is enabled? +- spin_lock_irqsave(&host->lock, flags); +- if (host->flags & SDHSTS_SDIO_IRPT_ENABLED) +- bcm2835_sdhost_enable_sdio_irq_nolock(host, true); +- spin_unlock_irqrestore(&host->lock, flags); +-*/ +- } +- +- return isr ? IRQ_HANDLED : IRQ_NONE; +-} +- +- +- + void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + { + int div = 0; /* Initialized for compiler warning */ +@@ -1417,9 +1461,8 @@ void bcm2835_sdhost_set_clock(struct bcm + pr_info("%s: set_clock(%d)\n", mmc_hostname(host->mmc), clock); + + if ((host->overclock_50 > 50) && +- (clock == 50*MHZ)) { ++ (clock == 50*MHZ)) + clock = host->overclock_50 * MHZ + (MHZ - 1); +- } + + /* The SDCDIV register has 11 bits, and holds (div - 2). + But in data mode the max is 50MHz wihout a minimum, and only the +@@ -1466,6 +1509,11 @@ void bcm2835_sdhost_set_clock(struct bcm + clock = host->max_clk / (div + 2); + host->mmc->actual_clock = clock; + ++ /* Calibrate some delays */ ++ ++ host->ns_per_fifo_word = (1000000000/clock) * ++ ((host->mmc->caps & MMC_CAP_4_BIT_DATA) ? 8 : 32); ++ + if (clock > input_clock) { + /* Save the closest value, to make it easier + to reduce in the event of error */ +@@ -1501,6 +1549,7 @@ static void bcm2835_sdhost_request(struc + { + struct bcm2835_host *host; + unsigned long flags; ++ u32 edm, fsm; + + host = mmc_priv(mmc); + +@@ -1521,6 +1570,8 @@ static void bcm2835_sdhost_request(struc + } + + /* Reset the error statuses in case this is a retry */ ++ if (mrq->sbc) ++ mrq->sbc->error = 0; + if (mrq->cmd) + mrq->cmd->error = 0; + if (mrq->data) +@@ -1536,28 +1587,58 @@ static void bcm2835_sdhost_request(struc + return; + } + ++ if (host->use_dma && mrq->data && ++ (mrq->data->blocks > host->pio_limit)) ++ bcm2835_sdhost_prepare_dma(host, mrq->data); ++ + spin_lock_irqsave(&host->lock, flags); + + WARN_ON(host->mrq != NULL); +- + host->mrq = mrq; + +- if (mrq->sbc) +- bcm2835_sdhost_send_command(host, mrq->sbc); +- else +- bcm2835_sdhost_send_command(host, mrq->cmd); ++ edm = bcm2835_sdhost_read(host, SDEDM); ++ fsm = edm & SDEDM_FSM_MASK; + +- mmiowb(); +- spin_unlock_irqrestore(&host->lock, flags); ++ 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); ++ mrq->cmd->error = -EILSEQ; ++ tasklet_schedule(&host->finish_tasklet); ++ mmiowb(); ++ spin_unlock_irqrestore(&host->lock, flags); ++ return; ++ } ++ ++ host->use_sbc = !!mrq->sbc && ++ (host->mrq->data->flags & USE_CMD23_FLAGS); ++ if (host->use_sbc) { ++ if (bcm2835_sdhost_send_command(host, mrq->sbc)) { ++ if (!host->use_busy) ++ bcm2835_sdhost_finish_command(host, &flags); ++ } ++ } else if (bcm2835_sdhost_send_command(host, mrq->cmd)) { ++ if (host->data && host->dma_desc) ++ /* DMA transfer starts now, PIO starts after irq */ ++ bcm2835_sdhost_start_dma(host); + +- if (!mrq->sbc && mrq->cmd->data && host->use_dma) +- /* DMA transfer starts now, PIO starts after irq */ +- bcm2835_sdhost_transfer_dma(host); ++ if (!host->use_busy) ++ bcm2835_sdhost_finish_command(host, &flags); ++ } + +- if (!host->use_busy) +- bcm2835_sdhost_finish_command(host); +-} ++ log_event("CMD ", (u32)mrq->cmd->opcode, ++ mrq->data ? (u32)mrq->data->blksz : 0); ++ mmiowb(); + ++ log_event("REQ>", (u32)mrq, 0); ++ spin_unlock_irqrestore(&host->lock, flags); ++} + + static void bcm2835_sdhost_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) + { +@@ -1574,6 +1655,8 @@ static void bcm2835_sdhost_set_ios(struc + + spin_lock_irqsave(&host->lock, flags); + ++ log_event("IOS<", ios->clock, 0); ++ + if (!ios->clock || ios->clock != host->clock) { + bcm2835_sdhost_set_clock(host, ios->clock); + host->clock = ios->clock; +@@ -1596,59 +1679,53 @@ static void bcm2835_sdhost_set_ios(struc + spin_unlock_irqrestore(&host->lock, flags); + } + +-static int bcm2835_sdhost_multi_io_quirk(struct mmc_card *card, +- unsigned int direction, +- u32 blk_pos, int blk_size) +-{ +- /* There is a bug in the host controller hardware that makes +- reading the final sector of the card as part of a multiple read +- problematic. Detect that case and shorten the read accordingly. +- */ ++static struct mmc_host_ops bcm2835_sdhost_ops = { ++ .request = bcm2835_sdhost_request, ++ .set_ios = bcm2835_sdhost_set_ios, ++ .hw_reset = bcm2835_sdhost_reset, ++}; ++ ++static void bcm2835_sdhost_cmd_wait_work(struct work_struct *work) ++{ + struct bcm2835_host *host; ++ unsigned long flags; + +- host = mmc_priv(card->host); ++ host = container_of(work, struct bcm2835_host, cmd_wait_wq); + +- if (!host->sectors) { +- /* csd.capacity is in weird units - convert to sectors */ +- u32 card_sectors = (card->csd.capacity << (card->csd.read_blkbits - 9)); +- if ((direction == MMC_DATA_READ) && +- ((blk_pos + blk_size) == card_sectors)) +- blk_size--; +- return blk_size; +- } ++ spin_lock_irqsave(&host->lock, flags); + +- if (direction == MMC_DATA_READ) { +- int i; +- int sector; +- for (i = 0; blk_pos > (sector = host->single_read_sectors[i]); i++) +- continue; ++ log_event("CWK<", (u32)host->cmd, (u32)host->mrq); + +- if ((blk_pos + blk_size) > sector) +- blk_size = (blk_pos == sector) ? 1 : (sector - blk_pos); ++ /* ++ * If this tasklet gets rescheduled while running, it will ++ * be run again afterwards but without any active request. ++ */ ++ if (!host->mrq) { ++ spin_unlock_irqrestore(&host->lock, flags); ++ return; + } +- return blk_size; +-} + ++ bcm2835_sdhost_finish_command(host, &flags); + +-static struct mmc_host_ops bcm2835_sdhost_ops = { +- .request = bcm2835_sdhost_request, +- .set_ios = bcm2835_sdhost_set_ios, +- .enable_sdio_irq = bcm2835_sdhost_enable_sdio_irq, +- .hw_reset = bcm2835_sdhost_reset, +- .multi_io_quirk = bcm2835_sdhost_multi_io_quirk, +-}; ++ mmiowb(); ++ ++ log_event("CWK>", (u32)host->cmd, 0); + ++ spin_unlock_irqrestore(&host->lock, flags); ++} + + static void bcm2835_sdhost_tasklet_finish(unsigned long param) + { + struct bcm2835_host *host; + unsigned long flags; + struct mmc_request *mrq; ++ struct dma_chan *terminate_chan = NULL; + + host = (struct bcm2835_host *)param; + + spin_lock_irqsave(&host->lock, flags); + ++ log_event("TSK<", (u32)host->mrq, 0); + /* + * If this tasklet gets rescheduled while running, it will + * be run again afterwards but without any active request. +@@ -1683,11 +1760,23 @@ static void bcm2835_sdhost_tasklet_finis + + mmiowb(); + ++ host->dma_desc = NULL; ++ terminate_chan = host->dma_chan; ++ host->dma_chan = NULL; ++ + spin_unlock_irqrestore(&host->lock, flags); +- mmc_request_done(host->mmc, mrq); +-} + ++ if (terminate_chan) ++ { ++ int err = dmaengine_terminate_all(terminate_chan); ++ if (err) ++ pr_err("%s: failed to terminate DMA (%d)\n", ++ mmc_hostname(host->mmc), err); ++ } + ++ mmc_request_done(host->mmc, mrq); ++ log_event("TSK>", (u32)mrq, 0); ++} + + int bcm2835_sdhost_add_host(struct bcm2835_host *host) + { +@@ -1709,10 +1798,10 @@ int bcm2835_sdhost_add_host(struct bcm28 + mmc->f_max, mmc->f_min, mmc->max_busy_timeout); + + /* host controller capabilities */ +- mmc->caps |= /* MMC_CAP_SDIO_IRQ |*/ MMC_CAP_4_BIT_DATA | ++ mmc->caps |= + MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | + MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET | MMC_CAP_ERASE | +- (ALLOW_CMD23 * MMC_CAP_CMD23); ++ ((ALLOW_CMD23_READ|ALLOW_CMD23_WRITE) * MMC_CAP_CMD23); + + spin_lock_init(&host->lock); + +@@ -1722,9 +1811,9 @@ int bcm2835_sdhost_add_host(struct bcm28 + pr_err("%s: unable to initialise DMA channels. " + "Falling back to PIO\n", + mmc_hostname(mmc)); +- host->have_dma = false; ++ host->use_dma = false; + } else { +- host->have_dma = true; ++ host->use_dma = true; + + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; +@@ -1741,7 +1830,7 @@ int bcm2835_sdhost_add_host(struct bcm28 + ret = dmaengine_slave_config(host->dma_chan_rx, &cfg); + } + } else { +- host->have_dma = false; ++ host->use_dma = false; + } + + mmc->max_segs = 128; +@@ -1756,16 +1845,15 @@ int bcm2835_sdhost_add_host(struct bcm28 + tasklet_init(&host->finish_tasklet, + bcm2835_sdhost_tasklet_finish, (unsigned long)host); + +- setup_timer(&host->timer, bcm2835_sdhost_timeout, +- (unsigned long)host); ++ INIT_WORK(&host->cmd_wait_wq, bcm2835_sdhost_cmd_wait_work); + +- setup_timer(&host->pio_timer, bcm2835_sdhost_pio_timeout, ++ setup_timer(&host->timer, bcm2835_sdhost_timeout, + (unsigned long)host); + + bcm2835_sdhost_init(host, 0); +- ret = request_threaded_irq(host->irq, bcm2835_sdhost_irq, +- bcm2835_sdhost_thread_irq, +- IRQF_SHARED, mmc_hostname(mmc), host); ++ ++ ret = request_irq(host->irq, bcm2835_sdhost_irq, 0 /*IRQF_SHARED*/, ++ mmc_hostname(mmc), host); + if (ret) { + pr_err("%s: failed to request IRQ %d: %d\n", + mmc_hostname(mmc), host->irq, ret); +@@ -1776,11 +1864,11 @@ int bcm2835_sdhost_add_host(struct bcm28 + mmc_add_host(mmc); + + pio_limit_string[0] = '\0'; +- if (host->have_dma && (host->pio_limit > 0)) ++ if (host->use_dma && (host->pio_limit > 0)) + sprintf(pio_limit_string, " (>%d)", host->pio_limit); + pr_info("%s: %s loaded - DMA %s%s\n", + mmc_hostname(mmc), DRIVER_NAME, +- host->have_dma ? "enabled" : "disabled", ++ host->use_dma ? "enabled" : "disabled", + pio_limit_string); + + return 0; +@@ -1810,8 +1898,11 @@ static int bcm2835_sdhost_probe(struct p + mmc->ops = &bcm2835_sdhost_ops; + host = mmc_priv(mmc); + host->mmc = mmc; ++ host->cmd_quick_poll_retries = 0; + host->pio_timeout = msecs_to_jiffies(500); ++ host->pio_limit = 1; + host->max_delay = 1; /* Warn if over 1ms */ ++ host->allow_dma = 1; + spin_lock_init(&host->lock); + + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); +@@ -1827,13 +1918,12 @@ static int bcm2835_sdhost_probe(struct p + return -ENODEV; + } + host->bus_addr = be32_to_cpup(addr); ++ log_init(iomem->start - host->bus_addr); + pr_debug(" - ioaddr %lx, iomem->start %lx, bus_addr %lx\n", + (unsigned long)host->ioaddr, + (unsigned long)iomem->start, + (unsigned long)host->bus_addr); + +- host->allow_dma = ALLOW_DMA; +- + if (node) { + /* Read any custom properties */ + of_property_read_u32(node, +@@ -1845,16 +1935,17 @@ static int bcm2835_sdhost_probe(struct p + of_property_read_u32(node, + "brcm,pio-limit", + &host->pio_limit); +- host->allow_dma = ALLOW_DMA && ++ host->allow_dma = + !of_property_read_bool(node, "brcm,force-pio"); + host->debug = of_property_read_bool(node, "brcm,debug"); +- of_property_read_u32(node, +- "brcm,debug-flags", +- &host->debug_flags); + } + +- if (host->debug_flags) +- dev_err(dev, "debug_flags=%x\n", host->debug_flags); ++ host->dma_chan = NULL; ++ host->dma_desc = NULL; ++ ++ /* Formally recognise the other way of disabling DMA */ ++ if (host->pio_limit == 0x7fffffff) ++ host->allow_dma = false; + + if (host->allow_dma) { + if (node) { +@@ -1940,15 +2031,12 @@ static int bcm2835_sdhost_remove(struct + return 0; + } + +- + static const struct of_device_id bcm2835_sdhost_match[] = { + { .compatible = "brcm,bcm2835-sdhost" }, + { } + }; + MODULE_DEVICE_TABLE(of, bcm2835_sdhost_match); + +- +- + static struct platform_driver bcm2835_sdhost_driver = { + .probe = bcm2835_sdhost_probe, + .remove = bcm2835_sdhost_remove, diff --git a/target/linux/brcm2708/patches-4.4/0150-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch b/target/linux/brcm2708/patches-4.4/0150-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch new file mode 100644 index 0000000000..0a2c12917b --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0150-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch @@ -0,0 +1,235 @@ +From 21e15ef5922cdfeb205a633f8720fde9d01fa074 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 12 Feb 2016 15:38:00 +0000 +Subject: [PATCH 150/156] BCM270X_DT: Add dtparams for the SD interface + +Add new base dtparams sd_overclock, sd_force_pio, sd_pio_limit +and sd_debug. +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 4 ++++ + arch/arm/boot/dts/bcm2708-rpi-b.dts | 4 ++++ + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 1 - + arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 13 +++++++++++++ + arch/arm/boot/dts/bcm2708_common.dtsi | 2 ++ + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 4 ++++ + arch/arm/boot/dts/overlays/README | 11 ++++++++++- + arch/arm/boot/dts/overlays/mmc-overlay.dts | 1 - + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 27 +++++++++++++------------- + arch/arm/boot/dts/overlays/sdtweak-overlay.dts | 14 ++++++------- + 10 files changed, 58 insertions(+), 23 deletions(-) + +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -141,5 +141,9 @@ + 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"; + }; + }; +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -131,5 +131,9 @@ + 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"; + }; + }; +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -97,6 +97,5 @@ + 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"; + }; + }; +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +@@ -7,6 +7,13 @@ + }; + }; + ++&gpio { ++ sdhost_pins: sdhost_pins { ++ brcm,pins = <48 49 50 51 52 53>; ++ brcm,function = <4>; /* alt0 */ ++ }; ++}; ++ + &leds { + act_led: act { + label = "led0"; +@@ -29,6 +36,8 @@ + + / { + __overrides__ { ++ 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"; +@@ -36,5 +45,9 @@ + 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"; + }; + }; +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -135,6 +135,7 @@ + dmas = <&dma 13>, + <&dma 13>; + dma-names = "tx", "rx"; ++ brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; + status = "disabled"; + }; +@@ -203,6 +204,7 @@ + dmas = <&dma 11>, + <&dma 11>; + dma-names = "tx", "rx"; ++ brcm,overclock-50 = <0>; + status = "disabled"; + }; + +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -141,5 +141,9 @@ + 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"; + }; + }; +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -112,6 +112,16 @@ Params: + random Set to "on" to enable the hardware random + number generator (default "on") + ++ sd_overclock Clock (in MHz) to use when the MMC framework ++ requests 50MHz ++ ++ sd_force_pio Disable DMA support for SD driver (default off) ++ ++ sd_pio_limit Number of blocks above which to use DMA for ++ SD card (default 1) ++ ++ sd_debug Enable debug output from SD driver (default off) ++ + uart0 Set to "off" to disable uart0 (default "on") + + watchdog Set to "on" to enable the hardware watchdog +@@ -443,7 +453,6 @@ Info: Selects the bcm2835-mmc SD/MMC d + Load: dtoverlay=mmc,= + Params: overclock_50 Clock (in MHz) to use when the MMC framework + requests 50MHz +- force_pio Disable DMA support + + + Name: mz61581 +--- a/arch/arm/boot/dts/overlays/mmc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts +@@ -34,6 +34,5 @@ + + __overrides__ { + overclock_50 = <&frag0>,"brcm,overclock-50:0"; +- force_pio = <&frag0>,"brcm,force-pio?"; + }; + }; +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -1,19 +1,14 @@ + /dts-v1/; + /plugin/; + ++/* Provide backwards compatible aliases for the old sdhost dtparams. */ ++ + /{ + compatible = "brcm,bcm2708"; + + fragment@0 { +- target = <&mmc>; +- __overlay__ { +- status = "disabled"; +- }; +- }; +- +- fragment@1 { + target = <&sdhost>; +- frag1: __overlay__ { ++ frag0: __overlay__ { + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; + brcm,debug-flags = <0>; +@@ -21,11 +16,17 @@ + }; + }; + ++ fragment@1 { ++ target = <&mmc>; ++ __overlay__ { ++ status = "disabled"; ++ }; ++ }; ++ + __overrides__ { +- overclock_50 = <&frag1>,"brcm,overclock-50:0"; +- force_pio = <&frag1>,"brcm,force-pio?"; +- pio_limit = <&frag1>,"brcm,pio-limit:0"; +- debug = <&frag1>,"brcm,debug?"; +- debug_flags = <&frag1>,"brcm,debug-flags:0"; ++ overclock_50 = <&frag0>,"brcm,overclock-50:0"; ++ force_pio = <&frag0>,"brcm,force-pio?"; ++ pio_limit = <&frag0>,"brcm,pio-limit:0"; ++ debug = <&frag0>,"brcm,debug?"; + }; + }; +--- a/arch/arm/boot/dts/overlays/sdtweak-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdtweak-overlay.dts +@@ -1,23 +1,23 @@ + /dts-v1/; + /plugin/; + ++/* Provide backwards compatible aliases for the old sdhost dtparams. */ ++ + /{ + compatible = "brcm,bcm2708"; + + fragment@0 { + target = <&sdhost>; +- frag1: __overlay__ { ++ frag0: __overlay__ { + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; +- brcm,debug-flags = <0>; + }; + }; + + __overrides__ { +- overclock_50 = <&frag1>,"brcm,overclock-50:0"; +- force_pio = <&frag1>,"brcm,force-pio?"; +- pio_limit = <&frag1>,"brcm,pio-limit:0"; +- debug = <&frag1>,"brcm,debug?"; +- debug_flags = <&frag1>,"brcm,debug-flags:0"; ++ overclock_50 = <&frag0>,"brcm,overclock-50:0"; ++ force_pio = <&frag0>,"brcm,force-pio?"; ++ pio_limit = <&frag0>,"brcm,pio-limit:0"; ++ debug = <&frag0>,"brcm,debug?"; + }; + }; diff --git a/target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch b/target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch new file mode 100644 index 0000000000..62342c23d2 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0151-dcw_otg-trim-xfer-length-when-buffer-larger-than-all.patch @@ -0,0 +1,37 @@ +From 5c7f4533904206fc11e2073e709598a65da19e10 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 12 Feb 2016 14:50:25 +0000 +Subject: [PATCH 151/156] dcw_otg: trim xfer length when buffer larger than + allocated size is received + +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -737,6 +737,11 @@ static int update_urb_state_xfer_comp(dw + DWC_OTG_HC_XFER_COMPLETE, + &short_read); + ++ if (urb->actual_length + xfer_length > urb->length) { ++ DWC_WARN("%s(): trimming xfer length\n", __func__); ++ xfer_length = urb->length - urb->actual_length; ++ } ++ + /* non DWORD-aligned buffer case handling. */ + if (hc->align_buff && xfer_length && hc->ep_is_in) { + dwc_memcpy(urb->buf + urb->actual_length, hc->qh->dw_align_buf, +@@ -1423,6 +1428,12 @@ static void update_urb_state_xfer_intr(d + { + uint32_t bytes_transferred = get_actual_xfer_length(hc, hc_regs, qtd, + halt_status, NULL); ++ ++ if (urb->actual_length + bytes_transferred > urb->length) { ++ DWC_WARN("%s(): trimming xfer length\n", __func__); ++ bytes_transferred = urb->length - urb->actual_length; ++ } ++ + /* non DWORD-aligned buffer case handling. */ + if (hc->align_buff && bytes_transferred && hc->ep_is_in) { + dwc_memcpy(urb->buf + urb->actual_length, hc->qh->dw_align_buf, diff --git a/target/linux/brcm2708/patches-4.4/0152-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch b/target/linux/brcm2708/patches-4.4/0152-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch new file mode 100644 index 0000000000..a7fbc443d4 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0152-bcm2835-sdhost-Restore-ATOMIC-flag-to-PIO-sg-mapping.patch @@ -0,0 +1,32 @@ +From 8e6120c43831dc99923873d061c88355cc9bd7a2 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 15 Feb 2016 10:00:27 +0000 +Subject: [PATCH 152/156] 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. +--- + drivers/mmc/host/bcm2835-sdhost.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -874,15 +874,14 @@ static void bcm2835_sdhost_prepare_data( + host->flush_fifo = 0; + host->data->bytes_xfered = 0; + +- + if (!host->dma_desc) { + /* Use PIO */ +- int flags; ++ int flags = SG_MITER_ATOMIC; + + if (data->flags & MMC_DATA_READ) +- flags = SG_MITER_TO_SG; ++ flags |= SG_MITER_TO_SG; + else +- flags = SG_MITER_FROM_SG; ++ flags |= SG_MITER_FROM_SG; + sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags); + host->blocks = data->blocks; + } diff --git a/target/linux/brcm2708/patches-4.4/0153-Revert-Add-blk_pos-parameter-to-mmc-multi_io_quirk-c.patch b/target/linux/brcm2708/patches-4.4/0153-Revert-Add-blk_pos-parameter-to-mmc-multi_io_quirk-c.patch new file mode 100644 index 0000000000..d4e70ddbc5 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0153-Revert-Add-blk_pos-parameter-to-mmc-multi_io_quirk-c.patch @@ -0,0 +1,79 @@ +From 0d6fe4a3f833f52e53d3dd0150c41c6433a93827 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 16 Feb 2016 08:47:56 +0000 +Subject: [PATCH 153/156] Revert "Add blk_pos parameter to mmc multi_io_quirk + callback" + +This reverts commit aab95f9b10e8c3d32de2bf163b86f220c88214fe. + +The bcm2835-sdhost driver no longer needs this patch. +--- + drivers/mmc/card/block.c | 1 - + drivers/mmc/host/omap_hsmmc.c | 4 +--- + drivers/mmc/host/sh_mobile_sdhi.c | 4 +--- + drivers/mmc/host/tmio_mmc_pio.c | 4 +--- + include/linux/mmc/host.h | 4 +--- + 5 files changed, 4 insertions(+), 13 deletions(-) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -1510,7 +1510,6 @@ static void mmc_blk_rw_rq_prep(struct mm + brq->data.blocks = card->host->ops->multi_io_quirk(card, + (rq_data_dir(req) == READ) ? + MMC_DATA_READ : MMC_DATA_WRITE, +- blk_rq_pos(req), + brq->data.blocks); + } + +--- a/drivers/mmc/host/omap_hsmmc.c ++++ b/drivers/mmc/host/omap_hsmmc.c +@@ -1832,9 +1832,7 @@ static void omap_hsmmc_conf_bus_power(st + } + + static int omap_hsmmc_multi_io_quirk(struct mmc_card *card, +- unsigned int direction, +- u32 blk_pos, +- int blk_size) ++ unsigned int direction, int blk_size) + { + /* This controller can't do multiblock reads due to hw bugs */ + if (direction == MMC_DATA_READ) +--- a/drivers/mmc/host/sh_mobile_sdhi.c ++++ b/drivers/mmc/host/sh_mobile_sdhi.c +@@ -170,9 +170,7 @@ static int sh_mobile_sdhi_write16_hook(s + } + + static int sh_mobile_sdhi_multi_io_quirk(struct mmc_card *card, +- unsigned int direction, +- u32 blk_pos, +- int blk_size) ++ unsigned int direction, int blk_size) + { + /* + * In Renesas controllers, when performing a +--- a/drivers/mmc/host/tmio_mmc_pio.c ++++ b/drivers/mmc/host/tmio_mmc_pio.c +@@ -1003,9 +1003,7 @@ static int tmio_mmc_get_ro(struct mmc_ho + } + + static int tmio_multi_io_quirk(struct mmc_card *card, +- unsigned int direction, +- u32 blk_pos, +- int blk_size) ++ unsigned int direction, int blk_size) + { + struct tmio_mmc_host *host = mmc_priv(card->host); + +--- a/include/linux/mmc/host.h ++++ b/include/linux/mmc/host.h +@@ -143,9 +143,7 @@ struct mmc_host_ops { + * I/O. Returns the number of supported blocks for the request. + */ + int (*multi_io_quirk)(struct mmc_card *card, +- unsigned int direction, +- u32 blk_pos, +- int blk_size); ++ unsigned int direction, int blk_size); + }; + + struct mmc_card; diff --git a/target/linux/brcm2708/patches-4.4/0154-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch b/target/linux/brcm2708/patches-4.4/0154-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch new file mode 100644 index 0000000000..a0ad74e84a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0154-Updated-smsc95xx-driver-to-check-for-a-valid-MAC-add.patch @@ -0,0 +1,40 @@ +From 5d85ccece7da421c1453abe9e86d1717fa8d7ab7 Mon Sep 17 00:00:00 2001 +From: Craig Roberts +Date: Tue, 16 Feb 2016 10:03:42 +0000 +Subject: [PATCH 154/156] 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 +meaning they don't end up with the same MAC address as the built-in RPi adaptor. +--- + drivers/net/usb/smsc95xx.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -817,10 +817,6 @@ static int smsc95xx_is_macaddr_param(str + + static void smsc95xx_init_mac_address(struct usbnet *dev) + { +- /* Check module parameters */ +- if (smsc95xx_is_macaddr_param(dev, dev->net->dev_addr)) +- return; +- + /* try reading mac address from EEPROM */ + if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, + dev->net->dev_addr) == 0) { +@@ -831,7 +827,11 @@ static void smsc95xx_init_mac_address(st + } + } + +- /* no eeprom, or eeprom values are invalid. generate random MAC */ ++ /* Check module parameters */ ++ if (smsc95xx_is_macaddr_param(dev, dev->net->dev_addr)) ++ return; ++ ++ /* no eeprom, or eeprom values are invalid, and no module parameter specified to set MAC. Generate random MAC */ + eth_hw_addr_random(dev->net); + netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); + } diff --git a/target/linux/brcm2708/patches-4.4/0155-dcw_otg-Make-trimming-messages-less-noisy.patch b/target/linux/brcm2708/patches-4.4/0155-dcw_otg-Make-trimming-messages-less-noisy.patch new file mode 100644 index 0000000000..f9cf4abf3a --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0155-dcw_otg-Make-trimming-messages-less-noisy.patch @@ -0,0 +1,31 @@ +From 12c2b6ced08e0f96bee3522ed3a3eb38f1770291 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 17 Feb 2016 19:02:31 +0000 +Subject: [PATCH 155/156] dcw_otg: Make trimming messages less noisy + +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -738,7 +738,8 @@ static int update_urb_state_xfer_comp(dw + &short_read); + + if (urb->actual_length + xfer_length > urb->length) { +- DWC_WARN("%s(): trimming xfer length\n", __func__); ++ printk_once(KERN_DEBUG "dwc_otg: DEVICE:%03d : %s:%d:trimming xfer length\n", ++ hc->dev_addr, __func__, __LINE__); + xfer_length = urb->length - urb->actual_length; + } + +@@ -1430,7 +1431,8 @@ static void update_urb_state_xfer_intr(d + halt_status, NULL); + + if (urb->actual_length + bytes_transferred > urb->length) { +- DWC_WARN("%s(): trimming xfer length\n", __func__); ++ printk_once(KERN_DEBUG "dwc_otg: DEVICE:%03d : %s:%d:trimming xfer length\n", ++ hc->dev_addr, __func__, __LINE__); + bytes_transferred = urb->length - urb->actual_length; + } + diff --git a/target/linux/brcm2708/patches-4.4/0156-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch b/target/linux/brcm2708/patches-4.4/0156-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch new file mode 100644 index 0000000000..7df9187d67 --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0156-BCM270X_DT-at86rf233-overlay-drop-to-3MHz.patch @@ -0,0 +1,36 @@ +From 8941fe4985a1cc8f800be00224c6a2e741789d03 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 18 Feb 2016 15:28:14 +0000 +Subject: [PATCH 156/156] BCM270X_DT: at86rf233 overlay - drop to 3MHz + +The consensus is that 6MHz is too fast, but that 3MHz is OK. + +See: https://github.com/raspberrypi/linux/issues/1294 + https://github.com/raspberrypi/linux/issues/1151 +--- + arch/arm/boot/dts/overlays/README | 2 +- + arch/arm/boot/dts/overlays/at86rf233-overlay.dts | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -188,7 +188,7 @@ Load: dtoverlay=at86rf233,=; /* active high */ + reset-gpio = <&gpio 24 1>; + sleep-gpio = <&gpio 25 1>; +- spi-max-frequency = <6000000>; ++ spi-max-frequency = <3000000>; + xtal-trim = /bits/ 8 <0xf>; + }; + };