From ab6b5b3c3ec989452a005977592c8d71ac3091dd Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Fri, 9 Dec 2016 21:38:11 +0000 Subject: [PATCH 1/3] linux: update to linux-4.8.13 --- packages/linux/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 57778abd79..dd9908f452 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -56,7 +56,7 @@ case "$LINUX" in PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET imx6-status-led imx6-soc-fan irqbalanced" ;; *) - PKG_VERSION="4.8.12" + PKG_VERSION="4.8.13" PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz" PKG_PATCH_DIRS="default" ;; From a20a31281d1a88efa15bb84b310c5255c2276138 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Fri, 9 Dec 2016 21:39:41 +0000 Subject: [PATCH 2/3] RBP: Update firmware to 6d45dcf --- packages/graphics/bcm2835-driver/package.mk | 2 +- packages/tools/bcm2835-bootloader/package.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/graphics/bcm2835-driver/package.mk b/packages/graphics/bcm2835-driver/package.mk index e9ba4119ff..655ae902eb 100644 --- a/packages/graphics/bcm2835-driver/package.mk +++ b/packages/graphics/bcm2835-driver/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="bcm2835-driver" -PKG_VERSION="6ce98b9" +PKG_VERSION="6d45dcf" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="nonfree" diff --git a/packages/tools/bcm2835-bootloader/package.mk b/packages/tools/bcm2835-bootloader/package.mk index 25438d6abd..6c94feb7e4 100644 --- a/packages/tools/bcm2835-bootloader/package.mk +++ b/packages/tools/bcm2835-bootloader/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="bcm2835-bootloader" -PKG_VERSION="6ce98b9" +PKG_VERSION="6d45dcf" PKG_REV="1" PKG_ARCH="arm" PKG_LICENSE="nonfree" From 00930c197a5e315713bc2fb1cb6f74c2f8814ca5 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Fri, 9 Dec 2016 21:47:09 +0000 Subject: [PATCH 3/3] RPi/RPi2: update linux support patches for linux 4.8.13 --- .../patches/linux/linux-01-RPi_support.patch | 4863 ++++++++++++++--- .../patches/linux/linux-01-RPi_support.patch | 4863 ++++++++++++++--- 2 files changed, 7942 insertions(+), 1784 deletions(-) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index e54b6fceec..1c3a98131a 100644 --- a/projects/RPi/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ -From ba70c1e58bd4e7d36807c6bd018b79574108e208 Mon Sep 17 00:00:00 2001 +From 7d5fc6dc9e80848e3fb1dc99bf93e3fc6251aed4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 27 Apr 2016 17:43:28 +0100 -Subject: [PATCH 001/180] Revert "SUNRPC: Make NFS swap work with multipath" +Subject: [PATCH 001/208] Revert "SUNRPC: Make NFS swap work with multipath" This reverts commit 15001e5a7e1e207b6bd258cd8f187814cd15b6dc. --- @@ -95,10 +95,10 @@ index 66f23b376fa04a91134eddf6d8ee22a2f5de5808..f55fe2b0137e8fbefcd20c336b28ad48 EXPORT_SYMBOL_GPL(rpc_clnt_swap_deactivate); #endif /* CONFIG_SUNRPC_SWAP */ -From b21e7f16fda448748167898da4ba0d8630640d66 Mon Sep 17 00:00:00 2001 +From a076f856510da92d7b277dd9ad19b624ce02a559 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 002/180] smsx95xx: fix crimes against truesize +Subject: [PATCH 002/208] 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. @@ -145,10 +145,10 @@ index dc989a8b5afbd62b07cd65a2fa5edde67d3cc5fb..116680e3089f16e1e3e9113a3b93e62c usbnet_skb_return(dev, ax_skb); } -From 160c699e74e4c4dc720283669b6ff1a8b12bebe4 Mon Sep 17 00:00:00 2001 +From 1a57f996e9d7b4b9698abf85d2665f32c03a2ded Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 003/180] smsc95xx: Disable turbo mode by default +Subject: [PATCH 003/208] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -168,10 +168,10 @@ index 116680e3089f16e1e3e9113a3b93e62cb78cc1bb..aa4cb43dcd9ba83b042332bc15a4dce6 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 094b0be6e6b0e226d4ac06d672f30a5abf47d628 Mon Sep 17 00:00:00 2001 +From e256c71277d74a1115d9bd9844fcfb5860fec9b2 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 004/180] add smsc95xx packetsize module_param +Subject: [PATCH 004/208] add smsc95xx packetsize module_param Signed-off-by: Sam Nazarko --- @@ -213,10 +213,10 @@ index aa4cb43dcd9ba83b042332bc15a4dce68affce28..889bdabd9dea6cebccc361aa4ac569d7 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From dc922f128eebb4749e16900480c5129e063cf0b9 Mon Sep 17 00:00:00 2001 +From 919b66093359eca7e24223ecbba9e788111c841f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 005/180] Allow mac address to be set in smsc95xx +Subject: [PATCH 005/208] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -312,10 +312,10 @@ index 889bdabd9dea6cebccc361aa4ac569d73681396b..d22a2324085fbf61fbd8920362bfc7b9 eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From 9d04dac9afb497550f040e511777017ec49a2bf1 Mon Sep 17 00:00:00 2001 +From 6885eab792b8feb8c2329f2981453074fae14527 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Aug 2016 22:19:28 +0100 -Subject: [PATCH 006/180] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 006/208] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -346,10 +346,10 @@ index d22a2324085fbf61fbd8920362bfc7b9f72bebe3..c846c55075387398d9bcb0957e31f5c8 MODULE_PARM_DESC(packetsize, "Override the RX URB packet size"); -From 3f3627f10377d5318c47e78ddbaeb9fed4b392c4 Mon Sep 17 00:00:00 2001 +From f0bec5372fdc974676a90c5828dc73ac8df18bb9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 9 Mar 2016 13:28:24 +0000 -Subject: [PATCH 007/180] serial: Take care starting a hung-up tty's port +Subject: [PATCH 007/208] serial: Take care starting a hung-up tty's port tty_port_hangup sets a port's tty field to NULL (holding the port lock), but uart_tx_stopped, called from __uart_start (with the port lock), @@ -377,10 +377,10 @@ index 2f44e20136545162d15ee9a39c2eae38352580d1..6b0518ce13ad210b888b73dd6c02a555 return 0; } -From 8fe93916b4de87d5b99ddfae0a69bcaa496a2dd0 Mon Sep 17 00:00:00 2001 +From 7a4314314fefb3d4288ba4a245f08abd83334c9d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 008/180] Protect __release_resource against resources without +Subject: [PATCH 008/208] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -408,10 +408,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From f19547ae65f0f38e394caf5a0071d43e070a4660 Mon Sep 17 00:00:00 2001 +From b67c49a019770ea73d250e046faabd79df373fa9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 009/180] mm: Remove the PFN busy warning +Subject: [PATCH 009/208] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -436,10 +436,10 @@ index 7401e996009afa14cb6c3834b62ce8780e6e958a..7f48cd9228cd1c7c4fb9451729f7826d goto done; } -From 197ee377bef4f57dd919356c3fbf8ee8da636fca Mon Sep 17 00:00:00 2001 +From 606896cbfc13f4e43c502c30e9d07acaa77f80c3 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 010/180] BCM2835_DT: Fix I2S register map +Subject: [PATCH 010/208] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -477,10 +477,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 4677de54affbd916557d1e60410b9fa9a4bb9aee Mon Sep 17 00:00:00 2001 +From 59ffae373ced5b44abaa948286cb2e1b69fe9cf3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 011/180] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 011/208] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -507,10 +507,10 @@ index d96b2c947e74e3edab3917551c64fbd1ced0f34c..93e3f7660c4230c9f1dd3b195958cb49 #endif } else if (stat) { -From 5dcf50763199caaf5ac89d91464a8eb3fb950f92 Mon Sep 17 00:00:00 2001 +From 64abf4863e38961cfdc3c2b1680e3b7751cd7dee 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 012/180] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 012/208] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -639,10 +639,10 @@ index 44d7c38dde479d771f3552e914bf8c1c1f5019f7..42ff5e6a8e0d532f5b60a1e7af7cc4d9 } -From 43d02aba96aadeb5653469d6e837c8f6b215bfb2 Mon Sep 17 00:00:00 2001 +From 86a5fcd1b51a616ae46047631553503ad2b096c8 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 013/180] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 013/208] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -741,10 +741,10 @@ index 42ff5e6a8e0d532f5b60a1e7af7cc4d941bd5008..eccf6ed025299cb480884f5bcbe77abf for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From 3546c5f2d1bea3d8a1b7852b3088dc92993f8e83 Mon Sep 17 00:00:00 2001 +From dec587cf518f9b967b7ce5faa5fa2944a6e6c0cd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 014/180] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 014/208] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -765,10 +765,10 @@ index 2e05046f866bd01bf87edcdeff0d5b76d4d0aea7..d780491b8013a4e97fa843958964454e }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From f1317397a2b972787d978f899bb062a20f8794fd Mon Sep 17 00:00:00 2001 +From c142337d3ab8a9fbceb6d611e32b3a621d577cb5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 015/180] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 015/208] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -788,10 +788,10 @@ index dcf43f66404f12d2bd290a30adfe494dd056162e..0fba189c676ded310b92a09c4e7e8f76 for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From acf8090ecb31ce0745715dd7335d7ff17dce130c Mon Sep 17 00:00:00 2001 +From 967fd972c6351fed9598396aa68071d3699023d2 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 016/180] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 016/208] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -813,10 +813,10 @@ index fa77165fab2c1348163979da507df17e7168c49b..d11e2e4ea189466e686d762cb6c6fef9 .can_sleep = false, }; -From 13f2368474a2851238f53da44ecf48ddc39b6c94 Mon Sep 17 00:00:00 2001 +From c5d54043c247044a8ecdd7451b7a2fbc5650f114 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 017/180] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 017/208] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -962,10 +962,10 @@ index d11e2e4ea189466e686d762cb6c6fef9111ecf8e..107ad7d58de8f8a7f55e09c9cdcf7d66 }, }; -From 6b1802a03f9c2919cba7520899f9198197491625 Mon Sep 17 00:00:00 2001 +From f12b7d81a1109e470185f3392099dc89552e1545 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 018/180] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 018/208] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -992,10 +992,10 @@ index 107ad7d58de8f8a7f55e09c9cdcf7d66fa7ab66b..644bdecbcfcb79d3b84a33769265fca5 pc->irq_data[i].irqgroup = i; -From 217266cb12b8bf3040de62c2e058bf72cbbb248b Mon Sep 17 00:00:00 2001 +From 28c879d001bb5ab3fd6dbacdf0df76518b41dce1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 May 2016 12:32:47 +0100 -Subject: [PATCH 019/180] pinctrl-bcm2835: Return pins to inputs when freed +Subject: [PATCH 019/208] pinctrl-bcm2835: Return pins to inputs when freed When dynamically unloading overlays, it is important that freed pins are restored to being inputs to prevent functions from being enabled in @@ -1036,10 +1036,10 @@ index 644bdecbcfcb79d3b84a33769265fca5d3d0c9e5..81a66cba2ab0f7e3ae179de7edd10122 .get_function_name = bcm2835_pmx_get_function_name, .get_function_groups = bcm2835_pmx_get_function_groups, -From 5ede89de20a88609a03f448f95888f492ada717a Mon Sep 17 00:00:00 2001 +From 34a7ed67a97641610545f768e1fac116fb09f129 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 020/180] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 020/208] 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 @@ -1120,10 +1120,10 @@ index f35cc10772f6670397ea923ad30158270dd68578..5dfe20ffc2866fa6789825016c585175 /* and set up the "mode" and level */ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", -From f181f13eab079dc69b53f399b3ddcb1f4e326628 Mon Sep 17 00:00:00 2001 +From 164780791396998dfdc84cdd11ac0a57acb88c8d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 021/180] spi-bcm2835: Disable forced software CS +Subject: [PATCH 021/208] spi-bcm2835: Disable forced software CS Select software CS in bcm2708_common.dtsi, and disable the automatic conversion in the driver to allow hardware CS to be re-enabled with an @@ -1157,10 +1157,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From d6da912cfb7bb4baec25dfe8ee701f9f1192bfad Mon Sep 17 00:00:00 2001 +From 8f9c99a7bb5105f249f22244ee7c11c9491909d2 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 022/180] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 022/208] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1213,10 +1213,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From a3063f7c214e7619f608b20a87d25b5b4ba3e553 Mon Sep 17 00:00:00 2001 +From 0dcea622ab242228d2ac5492166f6cc83499596b 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 023/180] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 023/208] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1319,70 +1319,10 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From 04a9e9ea5b3f509d818471291ebb052824ba0c76 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 024/180] bcm2835: Add support for uart1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This is a hack until a proper solution is agreed upon. -Martin Sperl is doing some work in this area. - -Signed-off-by: Noralf Trønnes ---- - arch/arm/mach-bcm/board_bcm2835.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/arch/arm/mach-bcm/board_bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c -index 8f152266ba9b470df2eaaed9ebcf158ed2079834..0ef5cd3d1d6ec420360294acc98d40d698d38d8a 100644 ---- a/arch/arm/mach-bcm/board_bcm2835.c -+++ b/arch/arm/mach-bcm/board_bcm2835.c -@@ -21,6 +21,29 @@ - #include - #include - -+/* Use this hack until a proper solution is agreed upon */ -+static void __init bcm2835_init_uart1(void) -+{ -+ struct device_node *np; -+ -+ np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart"); -+ if (of_device_is_available(np)) { -+ np = of_find_compatible_node(NULL, NULL, -+ "bcrm,bcm2835-aux-enable"); -+ if (np) { -+ void __iomem *base = of_iomap(np, 0); -+ -+ if (!base) { -+ pr_err("bcm2835: Failed enabling Mini UART\n"); -+ return; -+ } -+ -+ writel(1, base); -+ pr_info("bcm2835: Mini UART enabled\n"); -+ } -+ } -+} -+ - static void __init bcm2835_init(void) - { - struct device_node *np = of_find_node_by_path("/system"); -@@ -33,6 +56,8 @@ static void __init bcm2835_init(void) - system_rev = val; - if (!of_property_read_u64(np, "linux,serial", &val64)) - system_serial_low = val64; -+ -+ bcm2835_init_uart1(); - } - - static const char * const bcm2835_compat[] = { - -From 6391b08aa3a23b99c9c22c3f3abf2bb5f892aa12 Mon Sep 17 00:00:00 2001 +From c4d9aa87d6bf7e07bcaa8559af6ad15ab0d2ed95 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 025/180] firmware: Updated mailbox header +Subject: [PATCH 024/208] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 11 +++++++++++ @@ -1445,10 +1385,10 @@ index 3fb357193f09914fe21f8555a4b8613f74f22bc3..227a107214a02deadcca3db202da265e RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From 8aca83a023d6f06615da0accda9ad1787ba7dccf Mon Sep 17 00:00:00 2001 +From 13a01898fca61986f9fbb5fb2e55477248b2037f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Apr 2016 11:44:59 -0700 -Subject: [PATCH 026/180] clk: bcm2835: Mark the VPU clock as critical +Subject: [PATCH 025/208] clk: bcm2835: Mark the VPU clock as critical The VPU clock is also the clock for our AXI bus, so we really can't disable it. This might have happened during boot if, for example, @@ -1494,10 +1434,10 @@ index 0fc71cbaa4404bddc1ca603a28a43425a7e5a341..085e5217d3b9f73c312dc7fd510ef55c /* clocks with per parent mux */ -From 4a1cf49953943b7fee51c32a4d71b826af37f2c2 Mon Sep 17 00:00:00 2001 +From a136d9a40644e151876c7aa36e971aad4b0dc799 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 027/180] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 026/208] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -1552,10 +1492,10 @@ index 085e5217d3b9f73c312dc7fd510ef55cddb4a27c..e527649ee5e32d20cebd762f4badbfca /* HDMI state machine */ [BCM2835_CLOCK_HSM] = REGISTER_PER_CLK( -From daf1e4606d963b98737158d57c08531c62bdecba Mon Sep 17 00:00:00 2001 +From 8c1cbf01341c3f78a107af5dc9b3190932a6c7b2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Jun 2016 12:05:35 -0700 -Subject: [PATCH 028/180] clk: bcm2835: Mark the CM SDRAM clock's parent as +Subject: [PATCH 027/208] clk: bcm2835: Mark the CM SDRAM clock's parent as critical While the SDRAM is being driven by its dedicated PLL most of the time, @@ -1629,10 +1569,10 @@ index e527649ee5e32d20cebd762f4badbfca06657a84..fbf616021704178a9d007219a0ea2a9f &cprman->onecell); } -From eb260956bd419af6593292e54e50b295de482a14 Mon Sep 17 00:00:00 2001 +From 8fabd4b2587c362117ced1337e5ade069e9a2955 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Oct 2016 13:58:40 +0100 -Subject: [PATCH 029/180] Enable upstream BCM2835 auxiliar mini UART support +Subject: [PATCH 028/208] Enable upstream BCM2835 auxiliar mini UART support --- drivers/tty/serial/8250/Kconfig | 2 +- @@ -1652,10 +1592,10 @@ index 7c6f7afca5ddeed7b25fa6272246fc539bf31b04..748098f900d3474b5d535b24da76ad06 help Support for the BCM2835 auxiliar mini UART. -From 5f52133514aac2a020a61e18676fa54bf11c9cdb Mon Sep 17 00:00:00 2001 +From 9f7ddb4f7342c03f3d921e48515f8c89a08efe27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 030/180] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 029/208] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1675,10 +1615,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From ab59cc7148961bdf0b5e326b28e9349b9bbd3e3f Mon Sep 17 00:00:00 2001 +From ca0a284e86c89410ce033ce4abaa0581465665eb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Apr 2016 15:55:02 -0700 -Subject: [PATCH 031/180] ARM: bcm2708: Enable building power domain driver. +Subject: [PATCH 030/208] ARM: bcm2708: Enable building power domain driver. Signed-off-by: Eric Anholt --- @@ -1699,10 +1639,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..7d11a44f36d2e6f8697773cd49a72e53 select PM_GENERIC_DOMAINS if PM help -From c4f1630a6ad6ddadb0f759cde95314ef63457b28 Mon Sep 17 00:00:00 2001 +From d2a8c66431d4a830d84aa61337e7cf75f7263e7a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 032/180] Main bcm2708/bcm2709 linux port +Subject: [PATCH 031/208] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -4227,10 +4167,10 @@ index aa4bfbf129e4585ebb89b25fca4b03c928925022..89f7a3a539b5a1b84ddcf0a1548160c0 mmc_pm_flag_t pm_caps; /* supported pm features */ -From 3ad26f55c09ad41bdd60cf372b3f0716ee0435f5 Mon Sep 17 00:00:00 2001 +From 7a75212664e74d790360674f0e9d589f967149cf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 033/180] reboot: Use power off rather than busy spinning when +Subject: [PATCH 032/208] reboot: Use power off rather than busy spinning when halt is requested --- @@ -4253,10 +4193,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From 7d82d8ab872f570890f26f9f897178f8e6dae056 Mon Sep 17 00:00:00 2001 +From f80a468706132177faffe0708b0cd0976ad6bf80 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 11 Nov 2015 21:01:15 +0000 -Subject: [PATCH 034/180] squash: include ARCH_BCM2708 / ARCH_BCM2709 +Subject: [PATCH 033/208] squash: include ARCH_BCM2708 / ARCH_BCM2709 --- drivers/char/hw_random/Kconfig | 2 +- @@ -4420,10 +4360,10 @@ index d528aaceaad95bc6bae2147ebe66249629d2512e..03a303e52d5fe57bbdd8769d24bca590 select REGMAP_MMIO help -From adc5115bfb8f5418ea6ea9e4ee44b5a0ed1cb7c5 Mon Sep 17 00:00:00 2001 +From 719e241414d5c0c769e3cec0a36701f43665032e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 035/180] Add dwc_otg driver +Subject: [PATCH 034/208] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -65449,10 +65389,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From 716fd0b10200d87a572b3f41d5d3888f5e71888f Mon Sep 17 00:00:00 2001 +From 8e1c17d3d0343deb70fe8cd422d6d3dc19a770fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 036/180] bcm2708 framebuffer driver +Subject: [PATCH 035/208] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68911,10 +68851,10 @@ index 3c14e43b82fefe1d32f591d1b2f61d2cd28d0fa8..7626beb6a5bb8df601ddf0f6e6909d1f +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -From a1d9f548d10bbc06945986ef3328cb3b9d974eed Mon Sep 17 00:00:00 2001 +From 153d404162b1f45c70ea0113ab3057c534cd9532 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 037/180] dmaengine: Add support for BCM2708 +Subject: [PATCH 036/208] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69536,10 +69476,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From 2bcb2ed96c63bc84e0e305cae5bbfa17e1704350 Mon Sep 17 00:00:00 2001 +From 7c69e53eea36e2bc92fb5d1e7e631aa0d4691a68 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 038/180] MMC: added alternative MMC driver +Subject: [PATCH 037/208] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -71286,10 +71226,10 @@ index 0000000000000000000000000000000000000000..ceb37930e167f47c9c848e8de757ad09 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 0d3f8eb8077749cdfdc6d26b34e1032c964882de Mon Sep 17 00:00:00 2001 +From 4acaf78a70bd0f9c2fd25d5c9cc229a397eafe06 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 039/180] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 038/208] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -73681,10 +73621,10 @@ index 0000000000000000000000000000000000000000..23dea422182534e248435aeaee3ecb5d +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From f2ddc6d2d9dd1ff0362f126572682cbc8bea2201 Mon Sep 17 00:00:00 2001 +From a93caaa8ea2e62422122b1a66434e42b56328838 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 040/180] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 039/208] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards Some SD cards have been found that corrupt data when small blocks are erased. Add a quirk to indicate that ERASE should not be used, @@ -73820,10 +73760,10 @@ index d8673ca968ba2d65fb3da39680583ca5152641e4..510c3872929b3267fb6665bb69d26f5a unsigned int erase_shift; /* if erase unit is power 2 */ unsigned int pref_erase; /* in sectors */ -From c061ec0aa23028e330881b9a8fc9325cff67458d Mon Sep 17 00:00:00 2001 +From a27a20db497c1caeba48369323b1821981851d35 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 041/180] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 040/208] 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 @@ -75166,10 +75106,10 @@ index 0000000000000000000000000000000000000000..be2819d5d41f9d5ed65daf8eedb94c9e + +#endif /* VC_CMA_H */ -From 86e142b7270bf953ec9a0b58a0cb83579e5cf113 Mon Sep 17 00:00:00 2001 +From 81396ee5aaaa0cdc1c4c7fadd11dd1d7a3e88fae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 042/180] bcm2708: alsa sound driver +Subject: [PATCH 041/208] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -77905,10 +77845,10 @@ index 0000000000000000000000000000000000000000..af3e6eb690113fc32ce9e06bd2f0f294 + +#endif // _VC_AUDIO_DEFS_H_ -From e99c1ef52da1cf3e11da2815ca5abf8351facb6a Mon Sep 17 00:00:00 2001 +From 5c7989bc7855400db08a481fef1a9caf9e32be2a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 043/180] bcm2708 vchiq driver +Subject: [PATCH 042/208] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -91273,10 +91213,10 @@ index 0000000000000000000000000000000000000000..b6bfa21155e431e93bfb2c149d324371 + return vchiq_build_time; +} -From d334c0056e7bd4448df594565e0892bf60b29922 Mon Sep 17 00:00:00 2001 +From 566c5c2c2ff0ad35cccf0ad61a4ebd9f9dfb2e4b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 044/180] vc_mem: Add vc_mem driver +Subject: [PATCH 043/208] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -92281,10 +92221,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From 20cea7292d4c9a869afcd8002c12b5aa782f1a29 Mon Sep 17 00:00:00 2001 +From 1a374ac5d04091feae0ddeca584c67ca348fcfae Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 045/180] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 044/208] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -96702,10 +96642,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From 1ee05985d1a6cc3b6ee9a4377f8017beff038bc8 Mon Sep 17 00:00:00 2001 +From 9a1ccb17b43b5109f5490c1d6bf5bacbf4e11a1b Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 046/180] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 045/208] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -97016,10 +96956,10 @@ index 0000000000000000000000000000000000000000..911f5b7393ed48ceed8751f06967ae64 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From 46bfbcb1b44f4b4f3da20b43f199fd626ada78da Mon Sep 17 00:00:00 2001 +From f4db6af82e4cb6535fa14fdf29b90769f2ce3f05 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 047/180] Add SMI driver +Subject: [PATCH 046/208] Add SMI driver Signed-off-by: Luke Wren --- @@ -98970,10 +98910,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 1914f05726311cc80498736036445d80bcd5e5e1 Mon Sep 17 00:00:00 2001 +From 5b3d8d4688eb4eeaea69a189323e9c5fc0354e69 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 048/180] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 047/208] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -99143,10 +99083,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 01e3d1f595e1a4ab735616f3f158de91a23601ee Mon Sep 17 00:00:00 2001 +From c6d205f0fe1e94bc2f07fd3c0891c79719fb4acb Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 049/180] Add SMI NAND driver +Subject: [PATCH 048/208] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -99511,10 +99451,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From b0d4b4d1fbe81ba467a57dd51e67a0842a52b99f Mon Sep 17 00:00:00 2001 +From feab27c42b831d89424f2efc1c5eb7a98972712d Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 050/180] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 049/208] 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 @@ -100377,10 +100317,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From f9d71c4cf42957db9b386ae6096785fe80f558f1 Mon Sep 17 00:00:00 2001 +From fff2289d895dbfc79c794d5a1cd1d8d24435c926 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 051/180] Add cpufreq driver +Subject: [PATCH 050/208] Add cpufreq driver Signed-off-by: popcornmix --- @@ -100642,10 +100582,10 @@ index 0000000000000000000000000000000000000000..3eb9e9326231b08e6ee95ad486485245 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 40829724551fc13fa1adc594cdc5a0c37062b47a Mon Sep 17 00:00:00 2001 +From 37aa96d5731f2657672c71c63c1e1a196b62be02 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 052/180] Added hwmon/thermal driver for reporting core +Subject: [PATCH 051/208] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -100811,10 +100751,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From 1bfb3480251e00e86eaf60d79a3d7c8a90fd624b Mon Sep 17 00:00:00 2001 +From e92628a6bd90876e0ccea0ac20eaa0ac2445c14c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 053/180] Add Chris Boot's i2c driver +Subject: [PATCH 052/208] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -101488,10 +101428,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 527e2d3baf7917de6c9ae75d33eb8a941cb4129a Mon Sep 17 00:00:00 2001 +From 10a9053f8e51e5f87b5e3b772c5785ea42971dd7 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 054/180] char: broadcom: Add vcio module +Subject: [PATCH 053/208] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -101717,10 +101657,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 70d6c1f50d485b81f6f8a06c26c45081f75571e4 Mon Sep 17 00:00:00 2001 +From d583497e3d8d54010157aed484835a06a45572e7 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 055/180] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 054/208] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -101826,10 +101766,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..b980d531b35b9981a88356ef1c8a7b86 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 133deb97f2295e037fe5f77a08ae4a02bd7e1acc Mon Sep 17 00:00:00 2001 +From 9296e7af762cee3eaeae26c298130bb2cffe4dae Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 056/180] bcm2835: add v4l2 camera device +Subject: [PATCH 055/208] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -109561,10 +109501,10 @@ index 0000000000000000000000000000000000000000..9d1d11e4a53e510c04a416d92d195a7d + +#endif /* MMAL_VCHIQ_H */ -From bad46e365b6b5c9125ccdbc8b8f9fe15afae3646 Mon Sep 17 00:00:00 2001 +From 11b448942d10a35fb98c8b1f91c78b8ede600c37 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 057/180] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 056/208] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -110076,10 +110016,10 @@ index 0000000000000000000000000000000000000000..78c5845d2f01deb04b477327d83fa606 + return $trailer; +} -From 1c0f7afb336da1adeddabfea801155ac46454629 Mon Sep 17 00:00:00 2001 +From 804f05236652ec5169092c4b102faa5979b92b27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 058/180] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH 057/208] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. @@ -112930,10 +112870,10 @@ index ad9b05ae698b0495ecbda42ffcf4743555313a27..2595dfda020fd9e03f0beff5006f229d -#define DTC_VERSION "DTC 1.4.1-g53bf130b" +#define DTC_VERSION "DTC 1.4.1-g25efc119" -From 99caef2633ab21c6d3ed73b796610c00b612961f Mon Sep 17 00:00:00 2001 +From 87dc2c03954f71140aa60b8e5a2f35ad8236cd08 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 059/180] BCM2708: Add core Device Tree support +Subject: [PATCH 058/208] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -122762,10 +122702,10 @@ index 0000000000000000000000000000000000000000..8498134fdbb3912e9ce18282b53084d8 + +}; -From 3e650bf55c04a42f4d9ce7ba6353a9b016bdb86f Mon Sep 17 00:00:00 2001 +From 65b456a37c0916b6315fec653abcfd712656d6c3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 060/180] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 059/208] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -122785,10 +122725,10 @@ index 179219845dfcdfbeb586d12c5ec1296095d9fbf4..e0743e44f84188667a0c322e8c3d36f1 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From a1808365c951c8c4843118e55cf92a2fe2098016 Mon Sep 17 00:00:00 2001 +From c648634cfedb6adbaf9e793e9fc1ba79dcf4bc9d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 20:00:21 +0000 -Subject: [PATCH 061/180] BCM270X_DT: Add a .dtbo target, use for overlays +Subject: [PATCH 060/208] BCM270X_DT: Add a .dtbo target, use for overlays Change the filenames and extensions to keep the pre-DDT style of overlay (-overlay.dtb) distinct from new ones that use a @@ -122871,10 +122811,10 @@ index 0a07f9014944ed92a8e2e42983ae43be60b3e471..b1513a7c175885137034b9f7225788c0 # Bzip2 -From fce38a0f3ac3541bbd3bdac608577b1d32fc8e2a Mon Sep 17 00:00:00 2001 +From c02bd18e6291de77eb37462f47ce78063975157f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 8 Apr 2016 17:43:27 +0100 -Subject: [PATCH 062/180] BCM270X_DT: Don't generate "linux,phandle" props +Subject: [PATCH 061/208] BCM270X_DT: Don't generate "linux,phandle" props The EPAPR standard says to use "phandle" properties to store phandles, rather than the deprecated "linux,phandle" version. By default, dtc @@ -122900,10 +122840,10 @@ index b1513a7c175885137034b9f7225788c0a7c35027..1d949b7410600dd3b04a3acde8c41cfe -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) -From 1cc64386d132c84a4c9b5d1b08e058fd610335e8 Mon Sep 17 00:00:00 2001 +From 397a180a518dd177c140287c66caf9ae4dcb4a1e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 063/180] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 062/208] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -123079,10 +123019,10 @@ index 8a3b5d29602ffe665cfb26522180f3a696664371..d067976ddc2f34d5476bcd9321856b1c /* Set LED brightness level * Must not sleep. Use brightness_set_blocking for drivers -From 448d8082265fef810f76db4630d04c982d5eb59b Mon Sep 17 00:00:00 2001 +From 43ca3a9b4fe3c10f5ce4a65732444c6df4f081f1 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 064/180] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 063/208] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -123181,10 +123121,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..fa72af0c981710fe80bacf4cf6612f6d #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From a014fcb2498f5585cf7803faf3859ab646cb0e39 Mon Sep 17 00:00:00 2001 +From 26923981303957954bcbc91fff432e1ac2633648 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 065/180] Speed up console framebuffer imageblit function +Subject: [PATCH 064/208] 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 @@ -123393,10 +123333,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From 9e8626decede4c3dcf83c8767a6f6be8878a5477 Mon Sep 17 00:00:00 2001 +From 71619935735369868d063609734855d0bdcc347d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 066/180] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 065/208] 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 @@ -123646,10 +123586,10 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From c5d6e3bf5b80deedebee48608f3a0a83741c3465 Mon Sep 17 00:00:00 2001 +From d3fec7c3a52ebf2123c4c379f48f349fbef17578 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 067/180] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 066/208] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -123699,10 +123639,10 @@ index d6b729beba4930bbb1a1ddc4a6a6b8533bbf94e0..69e8d214f663572319f784fe17032b1e * css_tryget_online_from_dir - get corresponding css from a cgroup dentry * @dentry: directory dentry of interest -From 6edf62767556f639d4f4b962307fc8f7ceeb2e46 Mon Sep 17 00:00:00 2001 +From 4a63703bb5d6cff1731ed710841ff6b3f62b3434 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 068/180] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 067/208] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -123738,10 +123678,10 @@ index ae83af649a607f67239f1a64bf45dd4b5770cc7d..4a7af9d0b910f59d17421ce14138400d ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From d9324c53cafedb02bda99ffd649b274f0ac7c5ad Mon Sep 17 00:00:00 2001 +From a9b48b08d46cfbfd35b45dc3738412a8d9ecf6d0 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 069/180] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 068/208] 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 @@ -124036,10 +123976,10 @@ index 0000000000000000000000000000000000000000..b27dbee8f56773dbd2a5503dc864747d +MODULE_DESCRIPTION("Touchscreen driver for memory based FT5406"); +MODULE_LICENSE("GPL"); -From d801506c2aebe2249bcd4c148a0c701ceae9ce68 Mon Sep 17 00:00:00 2001 +From 79bd07b796e2fc05512634cc0c80bd3d6e641c6b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 070/180] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 069/208] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -125595,10 +125535,10 @@ index 6bd1089b07e0960830ed6bd6a8345202b7efd8b0..cd17dd11ebe7bbe00089e70cd2ccea74 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 17e6fbab1c3e05a227d9517cef1bc34b2d5f940f Mon Sep 17 00:00:00 2001 +From 100203b956cc659d9e65a4086db54f28c304e1e8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 071/180] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 070/208] 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 @@ -125633,10 +125573,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From 0334429c23fcb2f01df2006bfb2cab53e37af273 Mon Sep 17 00:00:00 2001 +From 75e0aa61e26876991add914994a59a0ccf3e6e12 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 072/180] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 071/208] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -126501,10 +126441,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From c2fd6f23e2202934909f2a147ad75409df093a31 Mon Sep 17 00:00:00 2001 +From 396b0f4386372c8b2ca36a812bad656738b82fe2 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 073/180] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 072/208] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -126678,10 +126618,10 @@ index 0000000000000000000000000000000000000000..29ecc08a227cdd4b3c6141935d0c5d21 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From aae86c04c2edf88f8e0de3923c8d61366ec7b0df Mon Sep 17 00:00:00 2001 +From 39db6b2b07cc619b8f31e9698a1a3c6681d5b532 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 074/180] ASoC: Add support for Rpi-DAC +Subject: [PATCH 073/208] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -126965,10 +126905,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 7881eff02052a7a81de51084579d7f49d8fd2617 Mon Sep 17 00:00:00 2001 +From a17eab5f9fbde48aabcbecad1b4d173aecdd2287 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 075/180] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 074/208] 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 @@ -127017,10 +126957,10 @@ index 8d914702cae4a3fe2c0ca0599cd1ec79f7322c83..c846716b4ed1027ade5512e8be90801d .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From fb9ca0a22b86e1f710baed12130bca16bff12d8c Mon Sep 17 00:00:00 2001 +From c4240b894be6cb535c9a3260dc9071eb38ede175 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 076/180] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 075/208] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -127308,10 +127248,10 @@ index 0000000000000000000000000000000000000000..9840e15d3e2be6396bc3ce6e74749408 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 4641e9edaddf434740c51e97dd3e1428cb9cad03 Mon Sep 17 00:00:00 2001 +From d75574658dee579a87b081abf15d7b8f18006156 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 077/180] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 076/208] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -127641,10 +127581,10 @@ index 0000000000000000000000000000000000000000..4e8e6dec14bcf4a1ff286c43742d4097 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From d763fe4f4fa1f79a38d211810f5c704097defb68 Mon Sep 17 00:00:00 2001 +From ab9d6e71cd86d0b32c9100e19dd44a075e3e9645 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jul 2016 17:06:50 +0100 -Subject: [PATCH 078/180] iqaudio-dac: Compile fix - untested +Subject: [PATCH 077/208] iqaudio-dac: Compile fix - untested --- sound/soc/bcm/iqaudio-dac.c | 6 +++++- @@ -127668,10 +127608,10 @@ index 4e8e6dec14bcf4a1ff286c43742d4097249d6777..aa15bc4b49ca95edec905fddd8fd0a6d if (dapm->dev != codec_dai->dev) return 0; -From 4346909acf1c72098f4421acdb32a26a6f1b7856 Mon Sep 17 00:00:00 2001 +From 962edd733d593be9f0542a3aeb9a0591ab5ab5c1 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 079/180] Added support for HiFiBerry DAC+ +Subject: [PATCH 078/208] 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. @@ -128300,10 +128240,10 @@ index 047c48953a20cd4075000ac294a17fe59baedcde..090fe0ee08e8765f9edbb62777413bb6 dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From 81d03570790fd3cc43754ee8bc3f90673f00f545 Mon Sep 17 00:00:00 2001 +From 291d3872c447b25b51ad03f52787442cec78dd1f Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 080/180] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 079/208] 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. @@ -129135,10 +129075,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From 2abc1302d01008127cc8c4c66257abd44650f84f Mon Sep 17 00:00:00 2001 +From 11db210348ec63453d86cb144b3f5c17feedfacf Mon Sep 17 00:00:00 2001 From: "Daniel Matuschek (HiFiBerry)" Date: Tue, 26 Jul 2016 19:16:25 +0200 -Subject: [PATCH 081/180] Added HiFiBerry Digi+ Pro driver +Subject: [PATCH 080/208] Added HiFiBerry Digi+ Pro driver Signed-off-by: Daniel Matuschek --- @@ -129246,10 +129186,10 @@ index 9840e15d3e2be6396bc3ce6e74749408cc28c333..52ab9dea2e724c4238986ca53c59c849 ret = snd_soc_register_card(&snd_rpi_hifiberry_digi); -From 12891c3fed544325f37854d83594658a26cbacb4 Mon Sep 17 00:00:00 2001 +From ca49f7825bbd719ed413c05a07a4c004b598850c Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 082/180] Update ds1307 driver for device-tree support +Subject: [PATCH 081/208] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -129276,10 +129216,10 @@ index 8e1c5cb6ece6f60619e5cafcea4271e056d96778..f9536679b270a39a4d9639fdbd3420fe .driver = { .name = "rtc-ds1307", -From 09d6f0eca58c63b18b4f7b4fb80ab80ecd99f4f1 Mon Sep 17 00:00:00 2001 +From cbc94ab92e62b8628bd4648e2391ee1582c199ba Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 083/180] Add driver for rpi-proto +Subject: [PATCH 082/208] 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 @@ -129495,10 +129435,10 @@ index 0000000000000000000000000000000000000000..9db678e885efd63d84d60a098a84ed67 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 73674939be026499f88c5aee6ab40e1b8fbbe636 Mon Sep 17 00:00:00 2001 +From e31208717f0fc90e3e5d82e10408540c9272a69e Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 084/180] RaspiDAC3 support +Subject: [PATCH 083/208] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -129741,234 +129681,10 @@ index 0000000000000000000000000000000000000000..dd9eeea2af0382307f437e6db09d1546 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From cf64777c8227aa895d3ad133cdc83855378e84ea Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 9 Aug 2016 14:49:23 +0100 -Subject: [PATCH 085/180] tpa6130a2: Add headphone switch control - -Signed-off-by: Jan Grulich ---- - sound/soc/codecs/tpa6130a2.c | 60 ++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 60 insertions(+) - -diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c -index f1ea052a822e1f584eb55cbc876b8e079e813ccd..3bf0163956c5665683d7950798df527fa1b57b59 100644 ---- a/sound/soc/codecs/tpa6130a2.c -+++ b/sound/soc/codecs/tpa6130a2.c -@@ -4,6 +4,7 @@ - * Copyright (C) Nokia Corporation - * - * Author: Peter Ujfalusi -+ * Modified: Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License -@@ -50,6 +51,8 @@ struct tpa6130a2_data { - enum tpa_model id; - }; - -+static void tpa6130a2_channel_enable(u8 channel, int enable); -+ - static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable) - { - int ret; -@@ -109,6 +112,20 @@ static int tpa6130a2_power_event(struct snd_soc_dapm_widget *w, - return 0; - } - -+static int tpa6130a2_put_hp_sw(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ int enable = ucontrol->value.integer.value[0]; -+ unsigned int state; -+ -+ state = (tpa6130a2_read(TPA6130A2_REG_VOL_MUTE) & 0x80) == 0; -+ if (state == enable) -+ return 0; /* No change */ -+ -+ tpa6130a2_channel_enable(TPA6130A2_HP_EN_R | TPA6130A2_HP_EN_L, enable); -+ return 1; /* Changed */ -+} -+ - /* - * TPA6130 volume. From -59.5 to 4 dB with increasing step size when going - * down in gain. -@@ -130,6 +147,9 @@ static const struct snd_kcontrol_new tpa6130a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 0, 0x3f, 0, - tpa6130_tlv), -+ SOC_SINGLE_EXT("TPA6130A2 Headphone Playback Switch", -+ TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -+ tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - - static const DECLARE_TLV_DB_RANGE(tpa6140_tlv, -@@ -142,8 +162,48 @@ static const struct snd_kcontrol_new tpa6140a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 1, 0x1f, 0, - tpa6140_tlv), -+ SOC_SINGLE_EXT("TPA6140A2 Headphone Playback Switch", -+ TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -+ tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - -+/* -+ * Enable or disable channel (left or right) -+ * The bit number for mute and amplifier are the same per channel: -+ * bit 6: Right channel -+ * bit 7: Left channel -+ * in both registers. -+ */ -+static void tpa6130a2_channel_enable(u8 channel, int enable) -+{ -+ u8 val; -+ -+ if (enable) { -+ /* Enable channel */ -+ /* Enable amplifier */ -+ val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -+ val |= channel; -+ val &= ~TPA6130A2_SWS; -+ tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -+ -+ /* Unmute channel */ -+ val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -+ val &= ~channel; -+ tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -+ } else { -+ /* Disable channel */ -+ /* Mute channel */ -+ val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -+ val |= channel; -+ tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -+ -+ /* Disable amplifier */ -+ val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -+ val &= ~channel; -+ tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -+ } -+} -+ - static int tpa6130a2_component_probe(struct snd_soc_component *component) - { - struct tpa6130a2_data *data = snd_soc_component_get_drvdata(component); - -From 0d769e9278c8ebea5cbc3321952bf37e9f379e6b Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 9 Aug 2016 14:49:29 +0100 -Subject: [PATCH 086/180] Revert "tpa6130a2: Add headphone switch control" - -This reverts commit 860574af506a7a28782ca373feb880e7846943f9. ---- - sound/soc/codecs/tpa6130a2.c | 60 -------------------------------------------- - 1 file changed, 60 deletions(-) - -diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c -index 3bf0163956c5665683d7950798df527fa1b57b59..f1ea052a822e1f584eb55cbc876b8e079e813ccd 100644 ---- a/sound/soc/codecs/tpa6130a2.c -+++ b/sound/soc/codecs/tpa6130a2.c -@@ -4,7 +4,6 @@ - * Copyright (C) Nokia Corporation - * - * Author: Peter Ujfalusi -- * Modified: Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License -@@ -51,8 +50,6 @@ struct tpa6130a2_data { - enum tpa_model id; - }; - --static void tpa6130a2_channel_enable(u8 channel, int enable); -- - static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable) - { - int ret; -@@ -112,20 +109,6 @@ static int tpa6130a2_power_event(struct snd_soc_dapm_widget *w, - return 0; - } - --static int tpa6130a2_put_hp_sw(struct snd_kcontrol *kcontrol, -- struct snd_ctl_elem_value *ucontrol) --{ -- int enable = ucontrol->value.integer.value[0]; -- unsigned int state; -- -- state = (tpa6130a2_read(TPA6130A2_REG_VOL_MUTE) & 0x80) == 0; -- if (state == enable) -- return 0; /* No change */ -- -- tpa6130a2_channel_enable(TPA6130A2_HP_EN_R | TPA6130A2_HP_EN_L, enable); -- return 1; /* Changed */ --} -- - /* - * TPA6130 volume. From -59.5 to 4 dB with increasing step size when going - * down in gain. -@@ -147,9 +130,6 @@ static const struct snd_kcontrol_new tpa6130a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 0, 0x3f, 0, - tpa6130_tlv), -- SOC_SINGLE_EXT("TPA6130A2 Headphone Playback Switch", -- TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -- tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - - static const DECLARE_TLV_DB_RANGE(tpa6140_tlv, -@@ -162,48 +142,8 @@ static const struct snd_kcontrol_new tpa6140a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 1, 0x1f, 0, - tpa6140_tlv), -- SOC_SINGLE_EXT("TPA6140A2 Headphone Playback Switch", -- TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -- tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - --/* -- * Enable or disable channel (left or right) -- * The bit number for mute and amplifier are the same per channel: -- * bit 6: Right channel -- * bit 7: Left channel -- * in both registers. -- */ --static void tpa6130a2_channel_enable(u8 channel, int enable) --{ -- u8 val; -- -- if (enable) { -- /* Enable channel */ -- /* Enable amplifier */ -- val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -- val |= channel; -- val &= ~TPA6130A2_SWS; -- tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -- -- /* Unmute channel */ -- val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -- val &= ~channel; -- tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -- } else { -- /* Disable channel */ -- /* Mute channel */ -- val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -- val |= channel; -- tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -- -- /* Disable amplifier */ -- val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -- val &= ~channel; -- tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -- } --} -- - static int tpa6130a2_component_probe(struct snd_soc_component *component) - { - struct tpa6130a2_data *data = snd_soc_component_get_drvdata(component); - -From 1a5a67631ffce954b6ae7b5af635004f1b5d48ee Mon Sep 17 00:00:00 2001 +From 0dbf63d7ac2e0f2ccb758b7641bb24d75fa3e99e Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 087/180] Add Support for JustBoom Audio boards +Subject: [PATCH 084/208] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -130422,10 +130138,10 @@ index 0000000000000000000000000000000000000000..91acb666380faa3c0deb2230f8a0f8bb +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From 5945293ad4ccf3cb79662035aa9b042c9c183122 Mon Sep 17 00:00:00 2001 +From 3c1739ef8bbd37c97af637e792f7dc604eb0dbac Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 088/180] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 085/208] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -130607,10 +130323,10 @@ index 0000000000000000000000000000000000000000..6e2ee027926ee63c89222f75ceb89e3d +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From 0ade8243f1ebbc43c73939a8eb80eeac2ac7ff40 Mon Sep 17 00:00:00 2001 +From d653d98735f512ced56df4968813e513fd93afdb Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 089/180] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 086/208] New AudioInjector.net Pi soundcard with low jitter audio in and out. Contains the sound/soc/bcm ALSA machine driver and necessary alterations to the Kconfig and Makefile. @@ -130859,10 +130575,10 @@ index 0000000000000000000000000000000000000000..5ff0985e07efb96b95634a65995f09f7 +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From 84100a3d2aeb22dc6c5deac1ba6026ab12dafb98 Mon Sep 17 00:00:00 2001 +From 83acbad0b2688cd44fbb7293d219394a8ff4f435 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 090/180] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 087/208] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -131162,10 +130878,10 @@ index 0000000000000000000000000000000000000000..9b6e829bcb5b1762a853775e78163196 +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From dd3c6136e091b24c59e4b81e4fee6d66a3b0811e Mon Sep 17 00:00:00 2001 +From 6004b4aced007bc18f0bf6b2fe006cc23f537e5c Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 091/180] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 088/208] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -131638,10 +131354,10 @@ index 0000000000000000000000000000000000000000..446796e7e4c14a7d95b2f2a01211d9a0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From ed17130f82c5310c9af391791a5022a066554189 Mon Sep 17 00:00:00 2001 +From c9186592a8d8b0de5f1b198d154819283b3ff954 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 092/180] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 089/208] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -131814,10 +131530,10 @@ index 0000000000000000000000000000000000000000..89e65317512bc774453ac8d0d5b0ff98 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 4b53b3a79abec861e98334683df6e101cf3382e6 Mon Sep 17 00:00:00 2001 +From 20d707ddfb3d107dc828e607f181cce0a71d37de Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 093/180] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 090/208] Allo Piano DAC boards: Initial 2 channel (stereo) support (#1645) Add initial 2 channel (stereo) support for Allo Piano DAC (2.0/2.1) boards, @@ -132024,10 +131740,10 @@ index 0000000000000000000000000000000000000000..8e8e62e5a36a279b425ed4655cfbac99 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From f2fed4552bb4f6de09925db38cb32ff334300d2a Mon Sep 17 00:00:00 2001 +From 957b05e2d651db6c7da732440955cb6e3e87155f Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 094/180] rpi_display: add backlight driver and overlay +Subject: [PATCH 091/208] 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 @@ -132196,10 +131912,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From 4716cf35fe6891299cb15c314ae30b906904a6cb Mon Sep 17 00:00:00 2001 +From 20d35ff154f56e330bb4a3781721e271edecc54f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 095/180] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 092/208] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -132425,10 +132141,10 @@ index 0000000000000000000000000000000000000000..f3e0f1620b979e4fa3c7e556eb785ac2 +MODULE_DESCRIPTION("brcmvirt GPIO driver"); +MODULE_ALIAS("platform:brcmvirt-gpio"); -From 0cc872b27395703fa8e7934d9e0c573361d7499e Mon Sep 17 00:00:00 2001 +From ff297e81b17d7bc931554a8246fe3eae8e6f47ef Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 4 Mar 2016 12:49:09 +0000 -Subject: [PATCH 096/180] DRM_VC4: Allow to be built for ARCH_BCM270x +Subject: [PATCH 093/208] DRM_VC4: Allow to be built for ARCH_BCM270x --- drivers/gpu/drm/vc4/Kconfig | 2 +- @@ -132447,10 +132163,10 @@ index e53df59cb139f25f8e6ae916bca93abf0c49e063..f6e938208b73512f20eab46a383ca91b select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER -From 8b0a1be50fd370cf796f569ca140d739e9ff68ec Mon Sep 17 00:00:00 2001 +From 50174cb70458ba4c0c70e88d3cd21defdd156bbb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 097/180] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 094/208] amba_pl011: Don't use DT aliases for numbering The pl011 driver looks for DT aliases of the form "serial", and if found uses as the device ID. This can cause @@ -132479,10 +132195,10 @@ index 8a9e213387a79fcc335caad27520a68edf03f446..4a5a1c5cf9b345e255f4d79714a7ae46 uap->old_cr = 0; uap->port.dev = dev; -From 504d7f96916e8c6e9743f91199f9e471a4570dc8 Mon Sep 17 00:00:00 2001 +From 6a254068480d6ce7cc2ed93742c5412a8e46cda8 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 098/180] OF: DT-Overlay configfs interface +Subject: [PATCH 095/208] OF: DT-Overlay configfs interface This is a port of Pantelis Antoniou's v3 port that makes use of the new upstreamed configfs support for binary attributes. @@ -132914,10 +132630,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From a9b05a16b9f6d7870dc76020253dbe12225b5133 Mon Sep 17 00:00:00 2001 +From 1fddcd40ba81c10c6895d5f7450648d22f4ff015 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 099/180] brcm: adds support for BCM43341 wifi +Subject: [PATCH 096/208] brcm: adds support for BCM43341 wifi --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 ++ @@ -132957,10 +132673,10 @@ index 3cc42bef6245529c37320f0ec6ab5e7b77f1d2f6..2ae9d0c9dbaaab6bc16610ac012039cd #define BRCM_CC_4335_CHIP_ID 0x4335 #define BRCM_CC_4339_CHIP_ID 0x4339 -From ab47a779b65a2cacff54ef93da4ff5c027216e39 Mon Sep 17 00:00:00 2001 +From 4c93f16ed441b2c3ef4a6e4bbaf4da65d3947109 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 9 Mar 2016 17:25:59 +0000 -Subject: [PATCH 100/180] brcmfmac: Disable power management +Subject: [PATCH 097/208] brcmfmac: Disable power management Disable wireless power saving in the brcmfmac WLAN driver. This is a temporary measure until the connectivity loss resulting from power @@ -132985,10 +132701,10 @@ index abaf003a5b396f94e891c6569217ffbb595987e1..f6221c20ff8e2c07a9ddb329204cc59c if (!check_vif_up(ifp->vif)) { -From 4effcd528f7b6e4100e80cfb86828e05186f2159 Mon Sep 17 00:00:00 2001 +From 27a452d3be16848428312107b1281a3a1a3d3752 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 28 Apr 2016 17:13:47 +0100 -Subject: [PATCH 101/180] brcmfmac: Use original country code as a fallback +Subject: [PATCH 098/208] brcmfmac: Use original country code as a fallback Commit 73345fd212980d2e28a5c6d83801c903bd773680: @@ -133047,10 +132763,10 @@ index f6221c20ff8e2c07a9ddb329204cc59ce574117b..12bffe239e9d28ce8f73db48b3f5759f ccreq->country_abbrev[1] = alpha2[1]; ccreq->country_abbrev[2] = 0; -From b2baa23358462b6b595a371d914ee842ff70c9a3 Mon Sep 17 00:00:00 2001 +From fb426eaf2b6cb5e4383d36f1b00c74afbed85c7b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 13 Sep 2016 16:32:37 +0100 -Subject: [PATCH 102/180] brcmfmac: do not use internal roaming engine by +Subject: [PATCH 099/208] brcmfmac: do not use internal roaming engine by default Some evidence of curing disconnects with this disabled, so make it a default. @@ -133074,10 +132790,10 @@ index 3e15d64c64813513bc22202dd9e468588699abb0..4051780f64f44a5ce522babe6c371a1b MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); -From 499241ac9d5915154d97a6ac7a073b3e731bc571 Mon Sep 17 00:00:00 2001 +From 0b42c7b72a05fa0261c707571f0328fba44c8a9e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 31 Aug 2016 17:10:09 +0100 -Subject: [PATCH 103/180] brcmfmac: Change stop_ap sequence +Subject: [PATCH 100/208] brcmfmac: Change stop_ap sequence Patch from Broadcom/Cypress to resolve a customer error @@ -133110,10 +132826,10 @@ index 12bffe239e9d28ce8f73db48b3f5759ffe550162..0c3cecb22763db2db5ccbc1789f50b2b brcmf_fil_iovar_int_set(ifp, "mbss", 0); err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, -From 29dd3f528a391b358757609dd4c5ce00d6a8e3dd Mon Sep 17 00:00:00 2001 +From bae20097877011eea7b2342eee23788a14ceb380 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 104/180] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 101/208] hci_h5: Don't send conf_req when ACTIVE Without this patch, a modem and kernel can continuously bombard each other with conf_req and conf_rsp messages, in a demented game of tag. @@ -133136,73 +132852,10 @@ index 0879d64b1caf58afb6e5d494c07d9ab7e7cdf983..5161ab30fd533d50f516bb93d5b9f402 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From a4c1e4f40aa72fb3bb2b530bb76b2d9e2eb95990 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 22 Jan 2016 13:06:39 -0800 -Subject: [PATCH 105/180] drm/vc4: Add a debugfs node for tracking execution - state. - -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_gem.c | 14 ++++++++++++++ - 3 files changed, 16 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c -index 245115d49c46a1244ef3e460a03fde397f763de8..94f2154c3685255e2e67d225f77dea372eae371a 100644 ---- a/drivers/gpu/drm/vc4/vc4_debugfs.c -+++ b/drivers/gpu/drm/vc4/vc4_debugfs.c -@@ -18,6 +18,7 @@ - static const struct drm_info_list vc4_debugfs_list[] = { - {"bo_stats", vc4_bo_stats_debugfs, 0}, - {"dpi_regs", vc4_dpi_debugfs_regs, 0}, -+ {"gem_exec", vc4_gem_exec_debugfs, 0}, - {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, - {"hvs_regs", vc4_hvs_debugfs_regs, 0}, - {"crtc0_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)0}, -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index f696b752886b153c4654c0b8acca3fe46c9136cb..dbe2190f30757d4ec7fa56d03de6e261e7401eb7 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -481,6 +481,7 @@ void vc4_job_handle_completed(struct vc4_dev *vc4); - int vc4_queue_seqno_cb(struct drm_device *dev, - struct vc4_seqno_cb *cb, uint64_t seqno, - void (*func)(struct vc4_seqno_cb *cb)); -+int vc4_gem_exec_debugfs(struct seq_file *m, void *arg); - - /* vc4_hdmi.c */ - extern struct platform_driver vc4_hdmi_driver; -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index ae1609e739ef424d99207f830cd2bac41ce71557..26dc4f5b491e2e7fcd1a28dcc8ef0cbe88461851 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -32,6 +32,20 @@ - #include "vc4_regs.h" - #include "vc4_trace.h" - -+#ifdef CONFIG_DEBUG_FS -+int vc4_gem_exec_debugfs(struct seq_file *m, void *unused) -+{ -+ struct drm_info_node *node = (struct drm_info_node *)m->private; -+ struct drm_device *dev = node->minor->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); -+ -+ seq_printf(m, "Emitted seqno: 0x%016llx\n", vc4->emit_seqno); -+ seq_printf(m, "Finished seqno: 0x%016llx\n", vc4->finished_seqno); -+ -+ return 0; -+} -+#endif /* CONFIG_DEBUG_FS */ -+ - static void - vc4_queue_hangcheck(struct drm_device *dev) - { - -From 61dfed9df00b486a5806d33e80edcaf578932726 Mon Sep 17 00:00:00 2001 +From aa0a8cb875b64118fee48e451ea59561e3b18b1e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 13:03:33 -0800 -Subject: [PATCH 106/180] drm/vc4: Include vc4_drm.h in uapi in downstream +Subject: [PATCH 102/208] drm/vc4: Include vc4_drm.h in uapi in downstream build. Signed-off-by: Eric Anholt @@ -133223,36 +132876,10 @@ index 9355dd8eff3ba39401dfe37e7fbf7737f0397f11..68828bf586f05a8d9b0a6ab409ee91a7 header-y += vmwgfx_drm.h header-y += msm_drm.h -From 1b7e8d17a18e6b4757703cef13f4d8a27c79cff9 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 14 Oct 2015 11:32:14 -0700 -Subject: [PATCH 107/180] drm/vc4: Force HDMI to connected. - -For some reason on the downstream tree, the HPD GPIO isn't working. - -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 4452f3631cacea37bbd5dc8a594367631e308adc..3a622f70a077c2ebe214830f5d700cd8fe16e442 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -166,6 +166,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) - struct drm_device *dev = connector->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); - -+ return connector_status_connected; -+ - if (vc4->hdmi->hpd_gpio) { - if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^ - vc4->hdmi->hpd_active_low) - -From fa3339b7d7ca3c067f35c8e46bbde6752032c6d0 Mon Sep 17 00:00:00 2001 +From e6971437077eda153890c78e3428cd883499d7b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 108/180] config: Add default configs +Subject: [PATCH 103/208] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1294 +++++++++++++++++++++++++++++++++++ @@ -135871,10 +135498,10 @@ index 0000000000000000000000000000000000000000..cfe21355f7d95326b292be1b018b988f +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From f4553b93fada5ed2f16ea78d5835bc912926468c Mon Sep 17 00:00:00 2001 +From fba149883c98450421b61cac552394f43efbfda2 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 109/180] Add arm64 configuration and device tree differences. +Subject: [PATCH 104/208] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -137277,10 +136904,10 @@ index 0000000000000000000000000000000000000000..1fcde8c1329bbfd329245a8bb1769199 +CONFIG_LIBCRC32C=y +CONFIG_BCM2708_VCHIQ=n -From 61c595f2eac54afac0e96493e7285ea8625b8d4d Mon Sep 17 00:00:00 2001 +From 54f507bf54343e3d66964683f676cbfef1beed5f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Oct 2016 16:10:59 +0100 -Subject: [PATCH 110/180] bcm2835-cpufreq: Only report a single frequency when +Subject: [PATCH 105/208] bcm2835-cpufreq: Only report a single frequency when max and min frequencies are the same 4.8 kernel gives EINV error when max and min frequencies are the same (e.g. from using force_turbo=1) @@ -137349,10 +136976,10 @@ index 3eb9e9326231b08e6ee95ad486485245c71cf868..414fbdc10dfbfc6e4bb47870a7af3fd5 /* the CPUFreq driver */ -From 82f087bf5b21619701c31ad1e800573b61c4122c Mon Sep 17 00:00:00 2001 +From 4896a5fdcc6c95ae207070fe78e3aad60e597ce3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 7 Oct 2016 12:37:09 +0100 -Subject: [PATCH 111/180] scripts/mkknlimg: Change string for DDT detection +Subject: [PATCH 106/208] scripts/mkknlimg: Change string for DDT detection The old "of_overlay_apply" string does not appear in 4.8 kernel builds. "of_cfs_init" is both present and a more accurate indication of support @@ -137379,10 +137006,10 @@ index 78c5845d2f01deb04b477327d83fa60624f87f98..a21f7e31bc904233e980e66ae3e6337e my $res = try_extract($kernel_file, $tmpfile1); -From 718c0d7437fdb6d45350fec89b9002896010a6d9 Mon Sep 17 00:00:00 2001 +From dc56c6cc7558f783449f7ff3943aa7698d9a2144 Mon Sep 17 00:00:00 2001 From: Herve Jourdain Date: Fri, 20 May 2016 16:02:23 +0800 -Subject: [PATCH 112/180] build: support for .dtbo files for dtb overlays +Subject: [PATCH 107/208] build: support for .dtbo files for dtb overlays Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb. Patch the kernel, which has faulty rules to generate .dtbo the way yocto does @@ -137424,10 +137051,10 @@ index 1d949b7410600dd3b04a3acde8c41cfead15bfa4..1967878a843461c3ff1f473b9a030eb0 -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) -From 67a2b2c62042429639c5a988a094da1665f58b05 Mon Sep 17 00:00:00 2001 +From e8fc35c718297a56d13a92eb51d984ba28e5916e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 6 Oct 2016 19:42:55 -0700 -Subject: [PATCH 113/180] [media]bcm2835-camera: fix compilation warning/werror +Subject: [PATCH 108/208] [media]bcm2835-camera: fix compilation warning/werror | /a/builder/mnt/build/tmp-glibc/work-shared/raspberrypi3/kernel-source/drivers/media/platform/bcm2835/bcm2835-camera.c:656:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types ] @@ -137457,10 +137084,10 @@ index 70f4db2741037381e638d1dda5a95478809eb161..cb5bab642eaab2f60d641801dd0afdac struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq); unsigned long size; -From 6b552083c6c5f637532da8d50718811fe33896d4 Mon Sep 17 00:00:00 2001 +From 6c91352d35ed41686937484e2777a8af6652d2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 8 Oct 2016 16:26:46 +0200 -Subject: [PATCH 114/180] bcm2709: Drop platform smp and timer init code +Subject: [PATCH 109/208] bcm2709: Drop platform smp and timer init code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -137635,10 +137262,10 @@ index 90773a30b87abbfda1615326c6faf59b9db6d68e..d4c9d57d78a964fbbf799b534471462d .init_early = bcm2709_init_early, .reserve = board_reserve, -From 88f2148f6277381213cc5e4876c0802c9cac8ef9 Mon Sep 17 00:00:00 2001 +From b9634bc3431cbe7aa5157750ab5943024019a99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 3 Oct 2016 17:53:15 +0200 -Subject: [PATCH 115/180] BCM270X_DT: Use bcm283x.dtsi, bcm2835.dtsi and +Subject: [PATCH 110/208] BCM270X_DT: Use bcm283x.dtsi, bcm2835.dtsi and bcm2836.dtsi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -138767,10 +138394,10 @@ index 223bd9627b3dcaac5458909dc59c877eed751ce4..491594c918cf5da94fbb19a606edb0dd +}; +#endif -From 7115222b7fd98472249c78d6a798aea2db3692e7 Mon Sep 17 00:00:00 2001 +From 3011169b346afd96213eb70e42af510451aabfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 16:50:59 +0200 -Subject: [PATCH 116/180] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 111/208] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -138894,10 +138521,10 @@ index 4dddd8298a227d64862f2e92954a465f2e44b3f6..1f545e024422f59280932713e6a1b051 register_restart_handler(&wdt->restart_handler); if (pm_power_off == NULL) -From d20285ee433822c6a0d2ad7bec5a3fe404a5d356 Mon Sep 17 00:00:00 2001 +From 4bea90c43d3fd3e0594f3dc52746f42ca16b8eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 17:07:46 +0200 -Subject: [PATCH 117/180] bcm270x: Use watchdog for reboot/poweroff +Subject: [PATCH 112/208] bcm270x: Use watchdog for reboot/poweroff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139156,10 +138783,10 @@ index d4c9d57d78a964fbbf799b534471462d3c3b88f1..ed5c5414f7a3ad7284cda881e9e55077 module_param(serial, uint, 0644); -module_param(reboot_part, uint, 0644); -From c0b3074c99075a159a88f31869485da976771010 Mon Sep 17 00:00:00 2001 +From f384e2b3b12499f3677facd847263c2669f71d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:35:40 +0200 -Subject: [PATCH 118/180] bcm270x: Remove dead files +Subject: [PATCH 113/208] bcm270x: Remove dead files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139360,10 +138987,10 @@ index 6aa68260dd866c83527dffece8de483913231fb3..00000000000000000000000000000000 - */ -#define VMALLOC_END (0xff000000) -From 49d0e1524570f9a0a64c474d311695fd30ec4e6b Mon Sep 17 00:00:00 2001 +From 0b9d5789d2a90665ed8f46c3dcdff92d3da2e8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:37:43 +0200 -Subject: [PATCH 119/180] bcm270x: Drop bcm2835-aux-uart hack +Subject: [PATCH 114/208] bcm270x: Drop bcm2835-aux-uart hack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139443,71 +139070,10 @@ index ed5c5414f7a3ad7284cda881e9e550777cd29282..9a1ad48d13172856e3ec748db015cb95 system_serial_low = serial; } -From 21884a104351f15b92db7efa464289ff6fcc36fe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= -Date: Mon, 10 Oct 2016 17:39:30 +0200 -Subject: [PATCH 120/180] Revert "bcm2835: Add support for uart1" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit 86eba5c1a1089dc0bad01735f559e37d08525527. - -The gated bcm2835-aux clock is now used to enable uart1 so drop this hack. - -Signed-off-by: Noralf Trønnes ---- - arch/arm/mach-bcm/board_bcm2835.c | 25 ------------------------- - 1 file changed, 25 deletions(-) - -diff --git a/arch/arm/mach-bcm/board_bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c -index 0ef5cd3d1d6ec420360294acc98d40d698d38d8a..8f152266ba9b470df2eaaed9ebcf158ed2079834 100644 ---- a/arch/arm/mach-bcm/board_bcm2835.c -+++ b/arch/arm/mach-bcm/board_bcm2835.c -@@ -21,29 +21,6 @@ - #include - #include - --/* Use this hack until a proper solution is agreed upon */ --static void __init bcm2835_init_uart1(void) --{ -- struct device_node *np; -- -- np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart"); -- if (of_device_is_available(np)) { -- np = of_find_compatible_node(NULL, NULL, -- "bcrm,bcm2835-aux-enable"); -- if (np) { -- void __iomem *base = of_iomap(np, 0); -- -- if (!base) { -- pr_err("bcm2835: Failed enabling Mini UART\n"); -- return; -- } -- -- writel(1, base); -- pr_info("bcm2835: Mini UART enabled\n"); -- } -- } --} -- - static void __init bcm2835_init(void) - { - struct device_node *np = of_find_node_by_path("/system"); -@@ -56,8 +33,6 @@ static void __init bcm2835_init(void) - system_rev = val; - if (!of_property_read_u64(np, "linux,serial", &val64)) - system_serial_low = val64; -- -- bcm2835_init_uart1(); - } - - static const char * const bcm2835_compat[] = { - -From e2d9b9aba7df9ef67560ca521bab65c784522e81 Mon Sep 17 00:00:00 2001 +From 609fc508667ebfb25abaab84e856373ea13ad521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:41:26 +0200 -Subject: [PATCH 121/180] bcm270x: Remove unnecessary of_platform_populate +Subject: [PATCH 115/208] bcm270x: Remove unnecessary of_platform_populate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139582,10 +139148,10 @@ index 9a1ad48d13172856e3ec748db015cb95cd110b76..d2762f558f644ac87c56ba9402a638a3 system_serial_low = serial; } -From ebfd049e7c2432f98308f0390833402a1ffb8731 Mon Sep 17 00:00:00 2001 +From f24c1d7e84b995a5c72dcfeaa4dec996f816438e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:46:27 +0200 -Subject: [PATCH 122/180] bcm270x: Remove 4MB dma coherent pool +Subject: [PATCH 116/208] bcm270x: Remove 4MB dma coherent pool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139666,10 +139232,10 @@ index d2762f558f644ac87c56ba9402a638a3c7a26397..d0e43619669e851350c5d9d7bb7e9dd1 .dt_compat = bcm2709_compat, MACHINE_END -From e4e0035459c52a2014e77bdcf723043404b01a6d Mon Sep 17 00:00:00 2001 +From 0fcba7b96ea2778232431b7ae302e1473c1abdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 19:26:42 +0200 -Subject: [PATCH 123/180] bcm270x: Drop map_io device mapping +Subject: [PATCH 117/208] bcm270x: Drop map_io device mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -140618,10 +140184,10 @@ index de7504bfc20ba24be8707861b8389783860adb77..00000000000000000000000000000000 - */ -#define arch_decomp_wdog() -From 9ff2c622c446065b08d0f1ec4e5aef4eccad2591 Mon Sep 17 00:00:00 2001 +From 038f7a212a81706150142e5415ddb060d46c76bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 19:37:06 +0200 -Subject: [PATCH 124/180] bcm270x: Use DT_MACHINE_START +Subject: [PATCH 118/208] bcm270x: Use DT_MACHINE_START MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -140703,10 +140269,10 @@ index b52d949ee91d96eb7672fbbb4969bfa1e7afc376..2ed1b8a922ed02b9e3545991873af77b ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206 wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207 -From c8c5584711a50fdf44258456c27732e07d98c7f5 Mon Sep 17 00:00:00 2001 +From fde57b59c0e15f0416bc962bb82988aba3715acf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 11 Oct 2016 17:48:07 +0100 -Subject: [PATCH 125/180] Use DT rather than modules params for board rev and +Subject: [PATCH 119/208] Use DT rather than modules params for board rev and serial --- @@ -140800,10 +140366,10 @@ index 9cf36118e57b3c362de9adcf089425023d4a601d..9f113736627175bdcb362e0eda469e09 -module_param(boardrev, uint, 0644); -module_param(serial, uint, 0644); -From 3fc7a39e9cec76ca4bf174d7011a90aa95993c94 Mon Sep 17 00:00:00 2001 +From c687c89cf84f71ee3e67c3b965106b5f4d9aa774 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 126/180] Register the clocks early during the boot process, so +Subject: [PATCH 120/208] Register the clocks early during the boot process, so that special/critical clocks can get enabled early on in the boot process avoiding the risk of disabling a clock, pll_divider or pll when a claiming driver fails to install propperly - maybe it needs to defer. @@ -140849,10 +140415,10 @@ index fbf616021704178a9d007219a0ea2a9f1704f0a6..cbbc8d4ddcffc797268c0ecb6477005f MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From 35bc6637100501fc1b473315eff0966a5b1455dc Mon Sep 17 00:00:00 2001 +From fd03919a330c5acea88972ccb762f5786b9b13f2 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Tue, 27 Sep 2016 04:29:00 -0400 -Subject: [PATCH 127/180] Add Adafruit pitft35 touchscreen support (#1657) +Subject: [PATCH 121/208] Add Adafruit pitft35 touchscreen support (#1657) The dts comes from the Adafruit repository @@ -141057,10 +140623,10 @@ index 952104ab6c4cd0e9d8f7bd5f2fba7a72da75424e..26fa6c2b6b6d745178e666465ba226af CONFIG_FB_TFT_ILI9320=m CONFIG_FB_TFT_ILI9325=m -From d3aad2058e7d3eb2b17dc44ac2914e75ded5ae9b Mon Sep 17 00:00:00 2001 +From 0a83e0533ed80a1ae7f8dbbd570a2c245c9432de Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Oct 2016 15:06:20 +0100 -Subject: [PATCH 128/180] BCM270X_DT: Update CM3 to use sdhost interface +Subject: [PATCH 122/208] BCM270X_DT: Update CM3 to use sdhost interface --- arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 9 ++++----- @@ -141096,10 +140662,10 @@ index b5a5ae7747455438f8eabd28e8c11c6aeb0c1ecc..d13e3d4dac4e198c8cac451e3f64ef68 bus-width = <4>; status = "okay"; -From 4716ccd82b5bb98a472282de9d3409760dc56504 Mon Sep 17 00:00:00 2001 +From e729cf9692cd384eb83f1291714965624604b8c0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Oct 2016 15:10:14 +0100 -Subject: [PATCH 129/180] mmc: info (not err) msg on clock probe deferral +Subject: [PATCH 123/208] mmc: info (not err) msg on clock probe deferral --- drivers/mmc/host/bcm2835-mmc.c | 5 ++++- @@ -141141,10 +140707,10 @@ index 23dea422182534e248435aeaee3ecb5da69c0d33..9e55d5ac08b5809c40fe391ae6e685fd } -From 90bef0ddde4c379544d72673b6bbb1e25f58da7f Mon Sep 17 00:00:00 2001 +From 72b5f15453aca3a241e4fdc0751187f51d8d3f8e Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 15 Oct 2016 11:49:52 -0700 -Subject: [PATCH 130/180] ARM64: Modify default config to get raspbian to boot +Subject: [PATCH 124/208] ARM64: Modify default config to get raspbian to boot (#1686) 1. Enable emulation of deprecated instructions. @@ -141209,10 +140775,10 @@ index 1fcde8c1329bbfd329245a8bb17691999882ccfc..d7406f5a4620151044b8f716b4d10bb8 CONFIG_MFD_STMPE=y CONFIG_STMPE_SPI=y -From dd00846e7362d7f8e2dfa3f945c9557636b21193 Mon Sep 17 00:00:00 2001 +From 058069f821d2a205b7e0d8b9741aee5a19e71814 Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 131/180] Support for Blokas Labs pisound board +Subject: [PATCH 125/208] Support for Blokas Labs pisound board --- .../devicetree/bindings/vendor-prefixes.txt | 1 + @@ -142438,10 +142004,10 @@ index 0000000000000000000000000000000000000000..b156e5793e4c482385dedafd85bbf190 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From 7712510f8ad660023926fed17081c763de92ed7d Mon Sep 17 00:00:00 2001 +From 5c4d2949f96142001b815fb44e7a6aedec2d83c2 Mon Sep 17 00:00:00 2001 From: Giedrius Trainavicius Date: Tue, 25 Oct 2016 01:47:20 +0300 -Subject: [PATCH 132/180] FIXUP: pisound: Fix a warning in DEBUG builds +Subject: [PATCH 126/208] FIXUP: pisound: Fix a warning in DEBUG builds Also change a macro that enables debug level printing from DEBUG to PISOUND_DEBUG. @@ -142472,10 +142038,10 @@ index b156e5793e4c482385dedafd85bbf190acc8162b..a3cd089a01447bdb6741ed6bba3b21d4 } -From fd80f9a5a2d0e2bdeeb26e38525c9421519eb159 Mon Sep 17 00:00:00 2001 +From b50c2a9e07bcdf93ca4110cdba3792a9bfb93167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:25:41 +0200 -Subject: [PATCH 133/180] bcm270x: Remove bcm2708_reboot_mode parameter +Subject: [PATCH 127/208] bcm270x: Remove bcm2708_reboot_mode parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142509,10 +142075,10 @@ index 0a0332cb13a7475ee0c4d75a97685b7de6475c95..612eb530f33fcd19bc4539facb26fc30 { unsigned long flags; -From 3a774fd38004c269f0e8860a0d8c49b2ce1a50b5 Mon Sep 17 00:00:00 2001 +From 7c233a345d15064604d3194b35b0aa56ea2f9b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 15:54:41 +0200 -Subject: [PATCH 134/180] bcm270x: Remove NEED_MACH_IO_H +Subject: [PATCH 128/208] bcm270x: Remove NEED_MACH_IO_H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142629,10 +142195,10 @@ index e6eb84d71006db417dbd0afc4d08d3b19b09a619..00000000000000000000000000000000 - -#endif -From f35d4b56ee7f998f02fb8888d2907d54439ab8b9 Mon Sep 17 00:00:00 2001 +From f30338340fc8707bd44a054991d9bba94297ac80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:01:01 +0200 -Subject: [PATCH 135/180] dwc_otg: Pass struct device to dma_alloc*() +Subject: [PATCH 129/208] dwc_otg: Pass struct device to dma_alloc*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143257,10 +142823,10 @@ index 5624f32c9ea9117599df451af29fca2e3bca36de..50aaeacdd12fff93d7a9cf1c54612367 if (!otg_dev->pcd) { DWC_ERROR("dwc_otg_pcd_init failed\n"); -From 9ed7e85457a3a3f8c5507e7bbb0d2d7f330ddb43 Mon Sep 17 00:00:00 2001 +From 27dc18be13e874cdbe167edb6c2929ab4d2c2e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:05:36 +0200 -Subject: [PATCH 136/180] mmc: bcm2835-sdhost: Pass struct device to +Subject: [PATCH 130/208] mmc: bcm2835-sdhost: Pass struct device to dma_alloc*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -143310,10 +142876,10 @@ index 9e55d5ac08b5809c40fe391ae6e685fdb4d62df7..a9bc79bfdbb71807819dfe2d8f165144 mmc_of_parse(mmc); else -From 71e6580012e438de59b2676c9b0096acf70c3c85 Mon Sep 17 00:00:00 2001 +From 22d03d1b65d08b5ed7bea59d49f1a455a3636cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:16:48 +0200 -Subject: [PATCH 137/180] bcm270x: Drop NEED_MACH_MEMORY_H and use DT +Subject: [PATCH 131/208] bcm270x: Drop NEED_MACH_MEMORY_H and use DT dma-ranges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -143568,10 +143134,10 @@ index 7548a52dcf84affa4d1b0667e5e2f89f591891b8..00000000000000000000000000000000 - -#endif -From 4d259de890f3bf166dd163dceda6eb159d6f45c5 Mon Sep 17 00:00:00 2001 +From 26802db0c398a49668f6d029b50f59876a6f25f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 15:55:09 +0200 -Subject: [PATCH 138/180] dts: Remove bcm2835-rpi-cm.dts +Subject: [PATCH 132/208] dts: Remove bcm2835-rpi-cm.dts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143737,10 +143303,10 @@ index 9c4000fc686a9882b9ddde24fdcf937d52b0f86f..00000000000000000000000000000000 - }; -}; -From 5fad55b8dccf8ba5ba677aa3fc869d1b71e69d56 Mon Sep 17 00:00:00 2001 +From b709b3aa0d39d58479b4a579866ed27cebf3a9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 16:00:07 +0200 -Subject: [PATCH 139/180] bcm2708: Convert to ARCH_MULTIPLATFORM +Subject: [PATCH 133/208] bcm2708: Convert to ARCH_MULTIPLATFORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144061,10 +143627,10 @@ index 75da978fac0e06819d8a9740b95ee3d7035c1059..662790c8fa9c972bbf3ac7f41b9f5eac obj-$(CONFIG_ARCH_BCM2709) += irq-bcm2836.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o -From 6bf013d50367a5a725dda9c77c47532cfd5baa84 Mon Sep 17 00:00:00 2001 +From ef5da26a574bc300c0cffe21b7a1a041c0676465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 16:02:39 +0200 -Subject: [PATCH 140/180] bcm2709: Convert to ARCH_MULTIPLATFORM +Subject: [PATCH 134/208] bcm2709: Convert to ARCH_MULTIPLATFORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144334,10 +143900,10 @@ index 662790c8fa9c972bbf3ac7f41b9f5eace912b69c..4c203b6b816357dce8d7a768ac81feab obj-$(CONFIG_ARCH_HIP04) += irq-hip04.o obj-$(CONFIG_ARCH_LPC32XX) += irq-lpc32xx.o -From 8dea0d55600d8f63bad168fc112e2f59c7122db5 Mon Sep 17 00:00:00 2001 +From aba21f030087d28e7f8dc7177efe4632ea1a2e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 17:32:02 +0200 -Subject: [PATCH 141/180] kconfig: Just use ARCH_BCM2835 for depends on +Subject: [PATCH 135/208] kconfig: Just use ARCH_BCM2835 for depends on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144668,10 +144234,10 @@ index aed7b47d8736ea3fb1810b0c77916855082f3b2d..d024377e8450fb5402dcb5ea27161f77 select REGMAP_MMIO help -From 338e84cf2384243cb4e8bb13ddc1efcb00695029 Mon Sep 17 00:00:00 2001 +From d770fc68afb2244e1eae7cb99da07425244c500e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 28 Oct 2016 13:55:36 +0100 -Subject: [PATCH 142/180] bcm270x: Use dma-ranges unconditionally on bcm2710 +Subject: [PATCH 136/208] bcm270x: Use dma-ranges unconditionally on bcm2710 See: https://github.com/raspberrypi/linux/pull/1699 @@ -144705,10 +144271,10 @@ index 491594c918cf5da94fbb19a606edb0dd9a28c3a9..df1a4ce1cd4e570876b7785b357d6c31 interrupts = <8>; }; -From 721837dd34086b06a2fa8fbd5f18f48bff592196 Mon Sep 17 00:00:00 2001 +From 3c5d9cfdf541f1da85a407745d790a5cef1d9b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 27 Oct 2016 21:57:56 +0200 -Subject: [PATCH 143/180] BCM270X_DT: Use raspberrypi-power to turn on USB +Subject: [PATCH 137/208] BCM270X_DT: Use raspberrypi-power to turn on USB power MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -144734,10 +144300,10 @@ index d85c05901c8f55f822b89c32d198f15559a2b4b0..46cf8602c3b96e477b05b57dbfe5e349 + power-domains = <&power RPI_POWER_DOMAIN_USB>; +}; -From afeb7f661837302d8c9f51349aaa9b9812795d18 Mon Sep 17 00:00:00 2001 +From 3fc6c0966f06447cfabc8f5b220d32b59e9b7cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 27 Oct 2016 21:58:09 +0200 -Subject: [PATCH 144/180] firmware: bcm2835: Don't turn on USB power +Subject: [PATCH 138/208] firmware: bcm2835: Don't turn on USB power MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144793,10 +144359,10 @@ index b980d531b35b9981a88356ef1c8a7b868a85f2b5..3f070bd38a91511c986e3fb114b15bd4 } -From bd33aaa2ff70472fb7c9c46feb569d3d5f4a32f4 Mon Sep 17 00:00:00 2001 +From da310619ddd881d063323ee8e3bdc1c8b2b5d9a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 31 Oct 2016 17:35:31 +0000 -Subject: [PATCH 145/180] bcm2835: Increase coherent allocation to 1M for +Subject: [PATCH 139/208] bcm2835: Increase coherent allocation to 1M for dwc_otg bounce buffers --- @@ -144854,10 +144420,10 @@ index 6ce49dea7856b243b38f180231afd25b57dee729..efbd18020479c1cab40ce680446a4259 MACHINE_END #endif -From 188fb58e6b05f0ad6c44096fab31ec9b38d76204 Mon Sep 17 00:00:00 2001 +From 48080e34503d7f5433c56d78586691429a431cdb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 31 Oct 2016 17:35:57 +0000 -Subject: [PATCH 146/180] dwc_otg: Warn if dma_alloc_coherent fails +Subject: [PATCH 140/208] dwc_otg: Warn if dma_alloc_coherent fails --- drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c | 1 + @@ -144876,10 +144442,10 @@ index 50aaeacdd12fff93d7a9cf1c54612367406c6bee..e799f15f294706ad7ac328dcb9ce68fb /* Check dword alignment */ if (((int)buf & 0x3UL) != 0) { -From 01173b3a476ff625494e0fbd8e98104cb8d76068 Mon Sep 17 00:00:00 2001 +From 556dcc28d787925ac811fede23d170daa24649fd Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Fri, 4 Nov 2016 16:13:07 -0700 -Subject: [PATCH 147/180] bcmrpi3_defconfig: Update config to be compatible +Subject: [PATCH 141/208] bcmrpi3_defconfig: Update config to be compatible with latest Kconfig changes. This new config has been run through make savedefconfig. @@ -145135,10 +144701,10 @@ index d7406f5a4620151044b8f716b4d10bb818648e06..cd1d39b467a947a015eb14568086a6ba CONFIG_LIBCRC32C=y -CONFIG_BCM2708_VCHIQ=n -From 872d3308c9f0b510ca446d1d0654ff236e98e3bd Mon Sep 17 00:00:00 2001 +From 8327ba9ec4f7544d9045f390e72e5305f79f0289 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 148/180] spi-bcm2835: Remove unused code +Subject: [PATCH 142/208] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -145226,10 +144792,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From 97852f5996e1e2379deeaeacc046a92593b3c003 Mon Sep 17 00:00:00 2001 +From a52fcdf0feb26148aa77f39f5ed28d40b45eb201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 17 Sep 2016 15:07:10 +0200 -Subject: [PATCH 149/180] i2c: bcm2835: Fix hang for writing messages larger +Subject: [PATCH 143/208] i2c: bcm2835: Fix hang for writing messages larger than 16 bytes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -145319,10 +144885,10 @@ index d4f3239b56865919e1b781b20a7c5ebcd76b4eb9..f283b714aa79e2e4685ed95b04b6b289 i2c_dev->msg_buf_remaining = msg->len; reinit_completion(&i2c_dev->completion); -From b3da384dcec48d3484b202acb27bbb3845a02dd5 Mon Sep 17 00:00:00 2001 +From 2bfb98d7ef7b2599e323ce5bf7d55da796d1d73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 18:24:38 +0200 -Subject: [PATCH 150/180] i2c: bcm2835: Protect against unexpected TXW/RXR +Subject: [PATCH 144/208] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -145447,10 +145013,10 @@ index f283b714aa79e2e4685ed95b04b6b289f7e9eee7..d2ba1a4de36af512e8e3c97251bd3537 return -ETIMEDOUT; } -From ba5a71247622f7e8c83069a64a4c53cf621cf0d7 Mon Sep 17 00:00:00 2001 +From 95c425e3ae8a01e772381b1d262599a85b6d1871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 19 Sep 2016 17:19:41 +0200 -Subject: [PATCH 151/180] i2c: bcm2835: Use dev_dbg logging on transfer errors +Subject: [PATCH 145/208] i2c: bcm2835: Use dev_dbg logging on transfer errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145482,10 +145048,10 @@ index d2ba1a4de36af512e8e3c97251bd3537ae61591a..54d510abd46a117c9238fc6d7edec840 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From e7fc8951228f156e7b4e4207aa7acb60020d713d Mon Sep 17 00:00:00 2001 +From dd2fb326c9bea407665658538a993d907b681b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 22 Sep 2016 22:05:50 +0200 -Subject: [PATCH 152/180] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK +Subject: [PATCH 146/208] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145529,10 +145095,10 @@ index 54d510abd46a117c9238fc6d7edec84019d1f60d..565ef69ce61423544dc0558c85ef318b if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) -From 3307e9ee46ea8c9eaf82027d8838c9ae5d2c0dad Mon Sep 17 00:00:00 2001 +From e8a3cc458193ad57270e74ceff8f5059ecdfb0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:54:27 +0200 -Subject: [PATCH 153/180] i2c: bcm2835: Add support for Repeated Start +Subject: [PATCH 147/208] i2c: bcm2835: Add support for Repeated Start Condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -145714,10 +145280,10 @@ index 565ef69ce61423544dc0558c85ef318b0ae9c324..241e08ae7c27cec23fad3c1bf3ebad3a static u32 bcm2835_i2c_func(struct i2c_adapter *adap) -From 0cdac873bfb9969fea6079f231f3ddedbd19e1f5 Mon Sep 17 00:00:00 2001 +From 3b97a07025c5bda264cdec1cf56d84d7c5ee90be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:57:17 +0200 -Subject: [PATCH 154/180] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT +Subject: [PATCH 148/208] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145754,10 +145320,10 @@ index 241e08ae7c27cec23fad3c1bf3ebad3a4d2a8e6f..d2085dd3742eabebc537621968088261 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -From 6dd3bca1e0d87bd7e3a7238470deed0f19f74731 Mon Sep 17 00:00:00 2001 +From e67fa8bf66a0efa9d4604cb77c6f7b44a887618b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 27 Sep 2016 01:00:08 +0200 -Subject: [PATCH 155/180] i2c: bcm2835: Add support for dynamic clock +Subject: [PATCH 149/208] i2c: bcm2835: Add support for dynamic clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145873,10 +145439,10 @@ index d2085dd3742eabebc537621968088261f8dc7ea8..c3436f627028477f7e21b47e079fd5ab irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq) { -From 63ab758df54bbc7f40b920ab219186b6f335382d Mon Sep 17 00:00:00 2001 +From 93b4f7766d563b91a30df26ee3305e88d6d56c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 15:15:41 +0100 -Subject: [PATCH 156/180] i2c: bcm2835: Add debug support +Subject: [PATCH 150/208] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146065,10 +145631,10 @@ index c3436f627028477f7e21b47e079fd5ab06ec188a..8642f580ce41803bd22c76a0fa80d083 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From da81c921c72f2426b6c63ddf6eaa2d0bd6682fd8 Mon Sep 17 00:00:00 2001 +From 37134679c255f5b1b4c42e85b454c9dac1308e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 20:03:29 +0100 -Subject: [PATCH 157/180] config: Enable i2c-bcm2835 +Subject: [PATCH 151/208] config: Enable i2c-bcm2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146104,10 +145670,10 @@ index 27c61471a12a38feda62447af8010530bc89c141..98b2e5992a45a6212ef9a8b9826431d9 CONFIG_SPI=y CONFIG_SPI_BCM2835=m -From 8f66a986ad5ceef553f200b27c6538312224710f Mon Sep 17 00:00:00 2001 +From 0abcf1feef4457158239d560a7c5c103eb1b347c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 15:42:55 +0100 -Subject: [PATCH 158/180] BCM270X_DT: Use i2c-bcm2835 as default +Subject: [PATCH 152/208] BCM270X_DT: Use i2c-bcm2835 as default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146150,10 +145716,10 @@ index 7fb1f428332dc48bdd91dd4a0773f3bea7057238..514b481d4f4095dc8b55a216ac733593 /* Add alias */ status = "disabled"; -From a0cad5fbdb9e41c53891ecf409f3a946722fbdc1 Mon Sep 17 00:00:00 2001 +From 279b8a1317b5d18d1d61de902d95fb6fa60b08cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 11 Nov 2016 18:24:26 +0100 -Subject: [PATCH 159/180] BCM270X_DT: Add fallback overlay for i2c-bcm2708 +Subject: [PATCH 153/208] BCM270X_DT: Add fallback overlay for i2c-bcm2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146215,10 +145781,10 @@ index 0000000000000000000000000000000000000000..0afc6b405414c97428278dd3e8836759 + }; +}; -From 741e26e769375407420af946cc8de09537fb95ee Mon Sep 17 00:00:00 2001 +From 4825aaa3b75f9a89acec9cfc3d13eaa0ff1eac4d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Sep 2016 10:07:27 -0700 -Subject: [PATCH 160/180] clk: bcm2835: Clamp the PLL's requested rate to the +Subject: [PATCH 154/208] clk: bcm2835: Clamp the PLL's requested rate to the hardware limits. Fixes setting low-resolution video modes on HDMI. Now the PLLH_PIX @@ -146262,10 +145828,10 @@ index cbbc8d4ddcffc797268c0ecb6477005fa14e228b..89645d63af53a3559c4b2e88f9a592fe use_fb_prediv = true; rate /= 2; -From 6edafb84ee93624ac0057c772ca0e008453f1e98 Mon Sep 17 00:00:00 2001 +From 2d17a0acdfe3de2822caab8c0ad00f7ef2b8f4b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 1 Nov 2016 13:10:05 +0000 -Subject: [PATCH 161/180] config: Add CONFIG_HTU21 module +Subject: [PATCH 155/208] config: Add CONFIG_HTU21 module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -146297,110 +145863,10 @@ index 98b2e5992a45a6212ef9a8b9826431d9fc024169..43fc0a37f8bf2701aac84962203e7219 CONFIG_PWM_PCA9685=m CONFIG_RASPBERRYPI_FIRMWARE=y -From 06b5b05055a5f03904367ca9a11f748cb9904a6a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 31 Oct 2016 17:42:54 +0000 -Subject: [PATCH 162/180] config: Add SECOMP options from #1698 - ---- - arch/arm/configs/bcm2709_defconfig | 8 +++++++- - arch/arm/configs/bcmrpi_defconfig | 7 ++++++- - 2 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index a620bb77fd7934a9977adf3944bb2f3be9d83443..8ab82ca775b336c6786a76dbaacaeb8e4a5da660 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -14,11 +14,15 @@ CONFIG_IKCONFIG=m - CONFIG_IKCONFIG_PROC=y - CONFIG_NMI_LOG_BUF_SHIFT=12 - CONFIG_MEMCG=y -+CONFIG_MEMCG_SWAP=y - CONFIG_BLK_CGROUP=y -+CONFIG_CFS_BANDWIDTH=y -+CONFIG_CGROUP_PIDS=y - CONFIG_CGROUP_FREEZER=y - CONFIG_CPUSETS=y - CONFIG_CGROUP_DEVICE=y - CONFIG_CGROUP_CPUACCT=y -+CONFIG_CGROUP_PERF=y - CONFIG_NAMESPACES=y - CONFIG_USER_NS=y - CONFIG_SCHED_AUTOGROUP=y -@@ -44,7 +48,6 @@ CONFIG_SMP=y - CONFIG_VMSPLIT_2G=y - CONFIG_PREEMPT_VOLUNTARY=y - CONFIG_AEABI=y --CONFIG_OABI_COMPAT=y - # CONFIG_CPU_SW_DOMAIN_PAN is not set - CONFIG_CLEANCACHE=y - CONFIG_FRONTSWAP=y -@@ -342,6 +345,7 @@ CONFIG_NET_ACT_SKBEDIT=m - CONFIG_NET_ACT_CSUM=m - CONFIG_BATMAN_ADV=m - CONFIG_OPENVSWITCH=m -+CONFIG_CGROUP_NET_PRIO=y - CONFIG_NET_PKTGEN=m - CONFIG_HAMRADIO=y - CONFIG_AX25=m -@@ -1278,6 +1282,8 @@ CONFIG_FUNCTION_PROFILER=y - CONFIG_KGDB=y - CONFIG_KGDB_KDB=y - CONFIG_KDB_KEYBOARD=y -+CONFIG_SECURITY=y -+CONFIG_SECURITY_APPARMOR=y - CONFIG_CRYPTO_USER=m - CONFIG_CRYPTO_CBC=y - CONFIG_CRYPTO_CTS=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 43fc0a37f8bf2701aac84962203e7219645d5d7b..3de3a93921cbea9e56ac34d589ec6e83ddb5e7c1 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -13,11 +13,14 @@ CONFIG_IKCONFIG=m - CONFIG_IKCONFIG_PROC=y - CONFIG_NMI_LOG_BUF_SHIFT=12 - CONFIG_MEMCG=y -+CONFIG_MEMCG_SWAP=y - CONFIG_BLK_CGROUP=y -+CONFIG_CGROUP_PIDS=y - CONFIG_CGROUP_FREEZER=y - CONFIG_CPUSETS=y - CONFIG_CGROUP_DEVICE=y - CONFIG_CGROUP_CPUACCT=y -+CONFIG_CGROUP_PERF=y - CONFIG_NAMESPACES=y - CONFIG_USER_NS=y - CONFIG_SCHED_AUTOGROUP=y -@@ -43,7 +46,6 @@ CONFIG_ARCH_BCM2708=y - # CONFIG_CACHE_L2X0 is not set - CONFIG_PREEMPT_VOLUNTARY=y - CONFIG_AEABI=y --CONFIG_OABI_COMPAT=y - # CONFIG_CPU_SW_DOMAIN_PAN is not set - CONFIG_CLEANCACHE=y - CONFIG_FRONTSWAP=y -@@ -338,6 +340,7 @@ CONFIG_NET_ACT_SKBEDIT=m - CONFIG_NET_ACT_CSUM=m - CONFIG_BATMAN_ADV=m - CONFIG_OPENVSWITCH=m -+CONFIG_CGROUP_NET_PRIO=y - CONFIG_NET_PKTGEN=m - CONFIG_HAMRADIO=y - CONFIG_AX25=m -@@ -1289,6 +1292,8 @@ CONFIG_FUNCTION_PROFILER=y - CONFIG_KGDB=y - CONFIG_KGDB_KDB=y - CONFIG_KDB_KEYBOARD=y -+CONFIG_SECURITY=y -+CONFIG_SECURITY_APPARMOR=y - CONFIG_CRYPTO_USER=m - CONFIG_CRYPTO_CRYPTD=m - CONFIG_CRYPTO_CBC=y - -From a0cd5e5a816cb4fd1f1e08f2dc7d78ddbff3e787 Mon Sep 17 00:00:00 2001 +From dc65fdccea2ae766cfa58a888f96072dca195659 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 5 Nov 2016 14:14:43 +0000 -Subject: [PATCH 163/180] bcm2708_fb: Add ioctl for reading gpu memory through +Subject: [PATCH 156/208] bcm2708_fb: Add ioctl for reading gpu memory through dma --- @@ -146570,10 +146036,10 @@ index fa72af0c981710fe80bacf4cf6612f6da19046ee..289e7c03c1e3308d5a02fc783af4a569 __u32 dx; /* screen-relative */ __u32 dy; -From fa70ff86ace5f35b73218c63d873ce49dc47f051 Mon Sep 17 00:00:00 2001 +From 209d010a894c60b2d1d520b156ee388e7a1fcc9d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Nov 2016 19:32:54 +0000 -Subject: [PATCH 164/180] rpi-ft5406: Create coherent buffer and push to +Subject: [PATCH 157/208] rpi-ft5406: Create coherent buffer and push to firmware --- @@ -146820,10 +146286,10 @@ index 227a107214a02deadcca3db202da265eba1fdd21..b0f6e33bd30c35664ceee057f4c3ad32 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From b7d5fc2602c99c28a401bec3756234f88f45ff32 Mon Sep 17 00:00:00 2001 +From e9817038e0442920814b404514373ea9e7838573 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 22:42:39 +0000 -Subject: [PATCH 165/180] brcmvirt_gpio: Create coherent buffer and push to +Subject: [PATCH 158/208] brcmvirt_gpio: Create coherent buffer and push to firmware --- @@ -146997,10 +146463,10 @@ index b0f6e33bd30c35664ceee057f4c3ad32b914291d..e92278968b2b979db2a1f855f70e7aaf RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 071a39be50db52bc7840535d8cf909875e12a468 Mon Sep 17 00:00:00 2001 +From 1dff7d0212f9ac143489397d6da93253d8c79efa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Nov 2016 22:05:30 +0000 -Subject: [PATCH 166/180] fixup: fb: Use basic types for dma addresses as these +Subject: [PATCH 159/208] fixup: fb: Use basic types for dma addresses as these are also included from user code --- @@ -147023,10 +146489,10 @@ index 289e7c03c1e3308d5a02fc783af4a5692e791cfb..703fa8a70574323abe2fb32599254582 }; -From c7cc1da1ed9836d76a68c24f075a1580699daea3 Mon Sep 17 00:00:00 2001 +From 5a82ccf30428b49333f0fcc3ca1729c97cb71592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 12 Nov 2016 20:28:25 +0100 -Subject: [PATCH 167/180] BCM270x_DT: Drop using ARCH_BCM2708 and ARCH_BCM2709 +Subject: [PATCH 160/208] BCM270x_DT: Drop using ARCH_BCM2708 and ARCH_BCM2709 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -147295,10 +146761,10 @@ index 7ef449dcfb206f9ab36d63b04bce9f9694c8c697..c940eb3b685d7b9af4340ff184ca7364 always := $(dtbo-y) clean-files := *.dtbo -From dc4dcbd7087448c09e56fe512051f9686fce2f20 Mon Sep 17 00:00:00 2001 +From 1c930dafefdf565e34d8e8246702c5dbcbcd6f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 12 Nov 2016 20:28:47 +0100 -Subject: [PATCH 168/180] Drop ARCH_BCM2708 and ARCH_BCM2709 +Subject: [PATCH 161/208] Drop ARCH_BCM2708 and ARCH_BCM2709 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -147427,10 +146893,10 @@ index df1a4ce1cd4e570876b7785b357d6c31f66191a4..f6def5d7e5d622cf09e8f87332c7374f soc { ranges = <0x7e000000 0x3f000000 0x01000000>, diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 8ab82ca775b336c6786a76dbaacaeb8e4a5da660..36d0e55739b0feac7faff48bca599a4ba9b15f5f 100644 +index a620bb77fd7934a9977adf3944bb2f3be9d83443..5b7d6177c69eec697a7db2c356263f7770938bd7 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -42,7 +42,7 @@ CONFIG_PARTITION_ADVANCED=y +@@ -38,7 +38,7 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_MAC_PARTITION=y CONFIG_CFQ_GROUP_IOSCHED=y CONFIG_ARCH_BCM=y @@ -147440,10 +146906,10 @@ index 8ab82ca775b336c6786a76dbaacaeb8e4a5da660..36d0e55739b0feac7faff48bca599a4b CONFIG_SMP=y CONFIG_VMSPLIT_2G=y diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 3de3a93921cbea9e56ac34d589ec6e83ddb5e7c1..59dae0cdec5dbd26e4b40dbcdab03191850f20bc 100644 +index 43fc0a37f8bf2701aac84962203e7219645d5d7b..1834f3070bcde9dee21482483e95b9313fad6fc4 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -42,7 +42,7 @@ CONFIG_CFQ_GROUP_IOSCHED=y +@@ -39,7 +39,7 @@ CONFIG_CFQ_GROUP_IOSCHED=y CONFIG_ARCH_MULTI_V6=y # CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_BCM=y @@ -147551,10 +147017,10 @@ index 85d82f31cb49631f03b23631882d2b6c063b33db..13047c08fb71cc6e44c66096720d4654 { smp_mb(); -From f729b2c48bfb085657130023e8cda987be7705e6 Mon Sep 17 00:00:00 2001 +From 947658a7a79e668f6421a94226e0a39dbbe3abe5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Nov 2016 15:58:49 +0000 -Subject: [PATCH 169/180] mkknlimg: Retain downstream-kernel detection +Subject: [PATCH 162/208] mkknlimg: Retain downstream-kernel detection With the death of ARCH_BCM2708 and ARCH_BCM2709, a new way is needed to determine if this is a "downstream" build that wants the firmware to @@ -147577,10 +147043,10 @@ index a21f7e31bc904233e980e66ae3e6337e2eab0f1c..60206de7fa9a49bd027c635306674a29 my $res = try_extract($kernel_file, $tmpfile1); -From 2b95ed52bb754a3f4019ecc2507376312e36dd55 Mon Sep 17 00:00:00 2001 +From a30274434c39f55c32b179a06fbb57e3d3990294 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Nov 2016 21:17:27 +0000 -Subject: [PATCH 170/180] fixup: fb: Use correct bus address for dest of dma +Subject: [PATCH 163/208] fixup: fb: Use correct bus address for dest of dma memcpy --- @@ -147610,10 +147076,10 @@ index a6179186f5a65ebeb99bea34c546f690bb2fd903..0d22e00a0adf2959f94b2f0897888c12 pr_err("[%s]: failed to copy-to-user\n", __func__); -From 10bec642deebc1344743225d450142d153c64ea9 Mon Sep 17 00:00:00 2001 +From b000467a6ec25d6e512ade86b384074608c6289f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Nov 2016 16:49:33 +0000 -Subject: [PATCH 171/180] fixup: fb: Use struct device for dma_alloc_coherent +Subject: [PATCH 164/208] fixup: fb: Use struct device for dma_alloc_coherent --- drivers/video/fbdev/bcm2708_fb.c | 4 ++-- @@ -147642,10 +147108,10 @@ index 0d22e00a0adf2959f94b2f0897888c127062e8d5..53c5a0bdadb4be9251affdabed663058 } -From e3b55ef77c34cf1a745d80a1b4efc60169fe6be4 Mon Sep 17 00:00:00 2001 +From 805037ddae8a2857a35e5afa5635bcb77fb3534c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 18 Nov 2016 10:52:49 +0000 -Subject: [PATCH 172/180] ARM: dts: Visit overlays subdir unconditionally +Subject: [PATCH 165/208] ARM: dts: Visit overlays subdir unconditionally make clean processing occurs without loading the configuration, so the overlays subdir must be added unconditionally. @@ -147680,10 +147146,10 @@ index d59b0f01cdbd7ebe1d660701f47353746faeded6..c8d3d5ac5b49b4bf2b2fb16078f1c5d5 # Enable fixups to support overlays on BCM2708 platforms -From ba40578c597d85214b96b543a4de9ab7cf622d38 Mon Sep 17 00:00:00 2001 +From 858b913571ad2b5a9b9f3f91c074b3255a3d18f0 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Sun, 20 Nov 2016 19:15:24 +1100 -Subject: [PATCH 173/180] [Audioinjector] Fix bit offsets for equal volume and +Subject: [PATCH 166/208] [Audioinjector] Fix bit offsets for equal volume and add 8 kHz operation (#1727) Applying to the audioinjector sound card only. This patch offsets channel @@ -147738,10 +147204,10 @@ index 5ff0985e07efb96b95634a65995f09f7c68d9e99..ef54e0f07ea03f59e9957b5d98f3e7fd } -From f356706ee6ac4a0b8c61e1cff3fdeffeb8629e5d Mon Sep 17 00:00:00 2001 +From 3f01663c3ec2c0ae2a82a46b9484c5726052c295 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 26 Nov 2016 14:01:52 +0000 -Subject: [PATCH 174/180] ARM: dts: Restore dtbs_install functionality +Subject: [PATCH 167/208] ARM: dts: Restore dtbs_install functionality Signed-off-by: Phil Elwell --- @@ -147767,10 +147233,10 @@ index c8d3d5ac5b49b4bf2b2fb16078f1c5d56c75ac65..950714000b98cf92e60a72d8dde4774a + dts-dirs += overlays endif -From 962f1279eb07ed53eb7ae5cbefd3f79ab1a116b8 Mon Sep 17 00:00:00 2001 +From 8569d7041b8778339e0a4cc6bf49aaf3c1dc4887 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Nov 2016 14:19:40 +0000 -Subject: [PATCH 175/180] config: Add ABX80X RTC driver and overlay +Subject: [PATCH 168/208] config: Add ABX80X RTC driver and overlay Signed-off-by: Phil Elwell --- @@ -147848,10 +147314,10 @@ index 8b6f978155c02409eeb7c83353b8194fa3462435..1efcf0b712c9c5c19210545002ac1f09 <&ds3231>,"wakeup-source?", <&mcp7940x>,"wakeup-source?", diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 36d0e55739b0feac7faff48bca599a4ba9b15f5f..1b73eb679619872b2b302f13c02da419d7bde2cb 100644 +index 5b7d6177c69eec697a7db2c356263f7770938bd7..10b32a493f244521e6b3a17d54da192e7006db28 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -1058,6 +1058,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y +@@ -1054,6 +1054,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_RTC_CLASS=y # CONFIG_RTC_HCTOSYS is not set @@ -147860,10 +147326,10 @@ index 36d0e55739b0feac7faff48bca599a4ba9b15f5f..1b73eb679619872b2b302f13c02da419 CONFIG_RTC_DRV_DS1374=m CONFIG_RTC_DRV_DS1672=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 59dae0cdec5dbd26e4b40dbcdab03191850f20bc..cffbd08077c378f91c7a550e5c5ee5e45b29683e 100644 +index 1834f3070bcde9dee21482483e95b9313fad6fc4..2979c31c583cba95096ce449ebc0ccdfa417b838 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1067,6 +1067,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y +@@ -1064,6 +1064,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_RTC_CLASS=y # CONFIG_RTC_HCTOSYS is not set @@ -147872,10 +147338,10 @@ index 59dae0cdec5dbd26e4b40dbcdab03191850f20bc..cffbd08077c378f91c7a550e5c5ee5e4 CONFIG_RTC_DRV_DS1374=m CONFIG_RTC_DRV_DS1672=m -From be2e4ee350c90e35a64a97602b6d577ef1955019 Mon Sep 17 00:00:00 2001 +From 17fa71aa67409771c6e323c905d6f07a49c0265b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 25 Nov 2016 15:01:15 +0000 -Subject: [PATCH 176/180] config: Add AK4554 audio codec driver +Subject: [PATCH 169/208] config: Add AK4554 audio codec driver See: https://github.com/raspberrypi/linux/issues/1730 @@ -147886,10 +147352,10 @@ Signed-off-by: Phil Elwell 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 1b73eb679619872b2b302f13c02da419d7bde2cb..68efa64675e2c1d670667d983e790247ff16bb6e 100644 +index 10b32a493f244521e6b3a17d54da192e7006db28..48ed6bfe263a6a3fab942d0b52b2f409055f23ad 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -880,6 +880,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m +@@ -876,6 +876,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m CONFIG_SND_PISOUND=m CONFIG_SND_SOC_ADAU1701=m @@ -147898,10 +147364,10 @@ index 1b73eb679619872b2b302f13c02da419d7bde2cb..68efa64675e2c1d670667d983e790247 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index cffbd08077c378f91c7a550e5c5ee5e45b29683e..01a25f48af727329f74b5f7ae2ffb6ae1aa26704 100644 +index 2979c31c583cba95096ce449ebc0ccdfa417b838..ff69cafd7fb706fc0069d59c37974c4ce5d50043 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -874,6 +874,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m +@@ -871,6 +871,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m CONFIG_SND_PISOUND=m CONFIG_SND_SOC_ADAU1701=m @@ -147910,10 +147376,10 @@ index cffbd08077c378f91c7a550e5c5ee5e45b29683e..01a25f48af727329f74b5f7ae2ffb6ae CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From bfc4b17de75593dbf12ab2d1ade92a43bf738b03 Mon Sep 17 00:00:00 2001 +From d93ed366eb57a05214b58910e6ee763d7bb16bb9 Mon Sep 17 00:00:00 2001 From: Dave Stevenson <6by9@users.noreply.github.com> Date: Wed, 30 Nov 2016 20:17:14 +0000 -Subject: [PATCH 177/180] BCM2835-v4l2: Fix a conformance test failure +Subject: [PATCH 170/208] BCM2835-v4l2: Fix a conformance test failure Format ioctls: test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK @@ -147938,10 +147404,10 @@ index cb5bab642eaab2f60d641801dd0afdac45b7698f..4f03949aecf3afbf2e04df3828944719 fps_param.num = 0; /* Select variable fps, and then use * FPS_RANGE to select the actual limits. -From d3a75ecb5c65b4cc8347397c846738ed3d7ab34e Mon Sep 17 00:00:00 2001 +From 1b81b02455bce965fbd642bce2eea1370b9461e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 1 Dec 2016 15:32:23 +0000 -Subject: [PATCH 178/180] hifiberry: Make driver names unique in first 15 +Subject: [PATCH 171/208] hifiberry: Make driver names unique in first 15 characters See: LibreELEC PR1001 @@ -148001,10 +147467,10 @@ index 52ab9dea2e724c4238986ca53c59c8492f64e345..19dc953b7227ba86123fc7a2ba654499 .dai_link = snd_rpi_hifiberry_digi_dai, .num_links = ARRAY_SIZE(snd_rpi_hifiberry_digi_dai), -From 8d7a868d798d14bf4f7673dc56aa131f44a8a094 Mon Sep 17 00:00:00 2001 +From c0c3bcda197b84fefc31ea5ef4a3c4c71d61d6cf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 1 Dec 2016 22:58:07 +0000 -Subject: [PATCH 179/180] BCM2835 DT: Add DTC_FLAGS to support overlays +Subject: [PATCH 172/208] BCM2835 DT: Add DTC_FLAGS to support overlays Signed-off-by: Phil Elwell --- @@ -148025,10 +147491,10 @@ index 2152448c8cf5b22c573642d7ce45e85793f5fc9a..d6a4c2fccf68e4c692973e36b749e357 + DTC_FLAGS ?= -@ -H epapr +endif -From 736c64ddb8792fd2212046e7e252788785d53a6b Mon Sep 17 00:00:00 2001 +From b220b620b64b4663af9e6c285a9b8a6edb6b93be Mon Sep 17 00:00:00 2001 From: Gerhard de Clercq Date: Fri, 2 Dec 2016 12:15:26 +0200 -Subject: [PATCH 180/180] Add overlays symlink and dtbo target for ARM64 +Subject: [PATCH 173/208] Add overlays symlink and dtbo target for ARM64 (#1739) Signed-off-by: Gerhard de Clercq @@ -148073,3 +147539,3616 @@ index 0000000000000000000000000000000000000000..413315acbfe83611bb2ae7cbd0da1039 @@ -0,0 +1 @@ +../../../arm/boot/dts/overlays/ \ No newline at end of file + +From 0edb708d26ed355b63c61db6007b89ae8ce5a2ae Mon Sep 17 00:00:00 2001 +From: Alan Yiding Wang +Date: Sat, 3 Dec 2016 23:22:02 -0500 +Subject: [PATCH 174/208] BCM270X_DT: Add overlay for enc28j60 on SPI2 + +Works on SPI2 for compute module +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 10 ++++- + .../boot/dts/overlays/enc28j60-spi2-overlay.dts | 47 ++++++++++++++++++++++ + 3 files changed, 57 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index c940eb3b685d7b9af4340ff184ca736471183e09..20440abbe9a440d1f748b118f9c0ee3a0dbd039f 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -17,6 +17,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + dwc-otg.dtbo \ + dwc2.dtbo \ + enc28j60.dtbo \ ++ enc28j60-spi2.dtbo \ + gpio-ir.dtbo \ + gpio-poweroff.dtbo \ + hifiberry-amp.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 180122b381361469ca9e8c4e14f4aa52c1f351dd..4be81958d0f8a790c6a725b2367cf3f33ceaaec9 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -344,13 +344,21 @@ Params: dr_mode Dual role mode: "host", "peripheral" or "otg" + + + Name: enc28j60 +-Info: Overlay for the Microchip ENC28J60 Ethernet Controller (SPI) ++Info: Overlay for the Microchip ENC28J60 Ethernet Controller on SPI0 + Load: dtoverlay=enc28j60,= + Params: int_pin GPIO used for INT (default 25) + + speed SPI bus speed (default 12000000) + + ++Name: enc28j60-spi2 ++Info: Overlay for the Microchip ENC28J60 Ethernet Controller on SPI2 ++Load: dtoverlay=enc28j60-spi2,= ++Params: int_pin GPIO used for INT (default 39) ++ ++ speed SPI bus speed (default 12000000) ++ ++ + Name: gpio-ir + Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core- + based gpio_ir_recv driver maps received keys directly to a +diff --git a/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts b/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..946c9d2107a83335b11f094e75945a509595ab7c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts +@@ -0,0 +1,47 @@ ++// Overlay for the Microchip ENC28J60 Ethernet Controller - SPI2 Compute Module ++// Interrupt pin: 39 ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&spi2>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ eth1: enc28j60@0{ ++ compatible = "microchip,enc28j60"; ++ reg = <0>; /* CE0 */ ++ pinctrl-names = "default"; ++ pinctrl-0 = <ð1_pins>; ++ interrupt-parent = <&gpio>; ++ interrupts = <39 0x2>; /* falling edge */ ++ spi-max-frequency = <12000000>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ eth1_pins: eth1_pins { ++ brcm,pins = <39>; ++ brcm,function = <0>; /* in */ ++ brcm,pull = <0>; /* none */ ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ int_pin = <ð1>, "interrupts:0", ++ <ð1_pins>, "brcm,pins:0"; ++ speed = <ð1>, "spi-max-frequency:0"; ++ }; ++}; + +From 8d454bd4ff18ff2daeeddca6803edb68401c377c Mon Sep 17 00:00:00 2001 +From: Gerhard de Clercq +Date: Fri, 2 Dec 2016 13:45:06 +0200 +Subject: [PATCH 175/208] RPI-FT5406: Enable aarch64 support through explicit + iomem interface + +Signed-off-by: Gerhard de Clercq +--- + drivers/input/touchscreen/rpi-ft5406.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c +index c5e31978c85a4ffd6839952ce0de50c001c7b875..9d7d05482355d168c5c0c42508cd978979ee5f14 100644 +--- a/drivers/input/touchscreen/rpi-ft5406.c ++++ b/drivers/input/touchscreen/rpi-ft5406.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -47,7 +48,6 @@ struct ft5406 { + struct input_dev * input_dev; + void __iomem * ts_base; + dma_addr_t bus_addr; +- struct ft5406_regs * regs; + struct task_struct * thread; + }; + +@@ -68,8 +68,8 @@ static int ft5406_thread(void *arg) + { + // 60fps polling + msleep_interruptible(17); +- memcpy_fromio(®s, ts->regs, sizeof(*ts->regs)); +- writel(99, &ts->regs->num_points); ++ memcpy_fromio(®s, ts->ts_base, sizeof(struct ft5406_regs)); ++ iowrite8(99, ts->ts_base + offsetof(struct ft5406_regs, num_points)); + // Do not output if theres no new information (num_points is 99) + // or we have no touch points and don't need to release any + if(!(regs.num_points == 99 || (regs.num_points == 0 && known_ids == 0))) +@@ -190,7 +190,7 @@ static int ft5406_probe(struct platform_device *pdev) + + // mmap the physical memory + touchbuf &= ~0xc0000000; +- ts->ts_base = ioremap(touchbuf, sizeof(*ts->regs)); ++ ts->ts_base = ioremap(touchbuf, sizeof(struct ft5406_regs)); + if (ts->ts_base == NULL) + { + dev_err(dev, "Failed to map physical address\n"); +@@ -222,8 +222,6 @@ static int ft5406_probe(struct platform_device *pdev) + err); + goto out; + } +- +- ts->regs = (struct ft5406_regs *) ts->ts_base; + + // create thread to poll the touch events + ts->thread = kthread_run(ft5406_thread, ts, "ft5406"); + +From f014240610c93a7e95d58b5869a6d89209685e7b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 6 Dec 2016 17:27:50 +0000 +Subject: [PATCH 176/208] BCM270X_DT: Add midi-uart0 overlay + +MIDI requires 31.25kbaud, a baudrate unsupported by Linux. The +midi-uart0 overlay configures uart0 (ttyAMA0) to use a fake clock +so that requesting 38.4kbaud actually gets 31.25kbaud. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 7 +++++ + arch/arm/boot/dts/overlays/midi-uart0-overlay.dts | 36 +++++++++++++++++++++++ + 3 files changed, 44 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/midi-uart0-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 20440abbe9a440d1f748b118f9c0ee3a0dbd039f..a3ddb4577ce1f671f4c23ebe32c434c97b00781c 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -45,6 +45,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mcp23s17.dtbo \ + mcp2515-can0.dtbo \ + mcp2515-can1.dtbo \ ++ midi-uart0.dtbo \ + mmc.dtbo \ + mz61581.dtbo \ + pi3-act-led.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 4be81958d0f8a790c6a725b2367cf3f33ceaaec9..496e31db0c7d22934bd381aea5e7227c26a3f034 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -725,6 +725,13 @@ Params: oscillator Clock frequency for the CAN controller (Hz) + interrupt GPIO for interrupt signal + + ++Name: midi-uart0 ++Info: Configures UART0 (ttyAMA0) so that a requested 38.4kbaud actually gets ++ 31.25kbaud, the frequency required for MIDI ++Load: dtoverlay=midi-uart0 ++Params: ++ ++ + Name: mmc + Info: Selects the bcm2835-mmc SD/MMC driver, optionally with overclock + Load: dtoverlay=mmc,= +diff --git a/arch/arm/boot/dts/overlays/midi-uart0-overlay.dts b/arch/arm/boot/dts/overlays/midi-uart0-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..565af7cf79d761877be3bd06191f31aabf9e1e9b +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/midi-uart0-overlay.dts +@@ -0,0 +1,36 @@ ++/dts-v1/; ++/plugin/; ++ ++#include ++ ++/* ++ * Fake a higher clock rate to get a larger divisor, and thereby a lower ++ * baudrate. The real clock is 48MHz, which we scale so that requesting ++ * 38.4kHz results in an actual 31.25kHz. ++ * ++ * 48000000*38400/31250 = 58982400 ++ */ ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target-path = "/clocks"; ++ __overlay__ { ++ midi_clk: midi_clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-output-names = "uart0_pclk"; ++ clock-frequency = <58982400>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart0>; ++ __overlay__ { ++ clocks = <&midi_clk>, ++ <&clocks BCM2835_CLOCK_VPU>; ++ }; ++ }; ++}; + +From 2b4dc8b567a7432b754eb86291add0cb2a153ff4 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 09:18:09 +0100 +Subject: [PATCH 177/208] raspberrypi-firmware: Define the MBOX channel in the + header. + +Signed-off-by: Eric Anholt +--- + include/soc/bcm2835/raspberrypi-firmware.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index e92278968b2b979db2a1f855f70e7aafb224fa98..6f19b27ae24ecfddc880e9b29290238df1f27087 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -12,6 +12,8 @@ + #include + #include + ++#define RPI_FIRMWARE_CHAN_FB 1 ++ + struct rpi_firmware; + + enum rpi_firmware_property_status { + +From 4b1d48bfd89c7a2edfd82be28e7896c9595417f0 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 09:16:19 +0100 +Subject: [PATCH 178/208] raspberrypi-firmware: Export the general transaction + function. + +The vc4-firmware-kms module is going to be doing the MBOX FB call. + +Signed-off-by: Eric Anholt +--- + drivers/firmware/raspberrypi.c | 3 ++- + include/soc/bcm2835/raspberrypi-firmware.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index 3f070bd38a91511c986e3fb114b15bd4ac32634c..f261b64d1657c02290904d841e1f087c34e27ded 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -42,7 +42,7 @@ static void response_callback(struct mbox_client *cl, void *msg) + * Sends a request to the firmware through the BCM2835 mailbox driver, + * and synchronously waits for the reply. + */ +-static int ++int + rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + { + u32 message = MBOX_MSG(chan, data); +@@ -63,6 +63,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + + return ret; + } ++EXPORT_SYMBOL_GPL(rpi_firmware_transaction); + + /** + * rpi_firmware_property_list - Submit firmware property list +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index 6f19b27ae24ecfddc880e9b29290238df1f27087..2859db09e25bb945251e85edb39bc43430857168 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -133,5 +133,6 @@ int rpi_firmware_property(struct rpi_firmware *fw, + int rpi_firmware_property_list(struct rpi_firmware *fw, + void *data, size_t tag_size); + struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); ++int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); + + #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ + +From 0d1d276c7e42e7e7849ae973bf17d259ae958bc7 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Wed, 10 Aug 2016 18:52:34 +0200 +Subject: [PATCH 179/208] drm/fb-helper: Add a dummy + remove_conflicting_framebuffers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Lots of drivers don't properly compile without this when CONFIG_FB=n. +It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when +it's disabled I think it makes sense to add it to drm_fb_helper.h. + +Long term we probably need to rethink all the logic to unload firmware +framebuffer drivers, at least if we want to be able to move away from +CONFIG_FB and fbcon. + +v2: Unfortunately just stubbing out remove_conflicting_framebuffers in +drm_fb_helper.h upset gcc about static vs. non-static declarations, so +a new wrapper it needs to be. Means more churn :( + +Cc: Tobias Jakobi +Cc: Noralf Trønnes +Cc: tomi.valkeinen@ti.com +Cc: dh.herrmann@gmail.com +Reviewed-by: Alex Deucher +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-2-git-send-email-daniel.vetter@ffwll.ch +--- + drivers/gpu/drm/vc4/vc4_drv.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 9ecef93854914579ee74b4d96432d15dfaa1fd6b..eff0530dc713f6ac3cdb5cb3e640abed1cc67492 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -16,6 +16,7 @@ + #include + #include + #include "drm_fb_cma_helper.h" ++#include + + #include "uapi/drm/vc4_drm.h" + #include "vc4_drv.h" +@@ -214,7 +215,7 @@ static void vc4_kick_out_firmware_fb(void) + ap->ranges[0].base = 0; + ap->ranges[0].size = ~0; + +- remove_conflicting_framebuffers(ap, "vc4drmfb", false); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false); + kfree(ap); + } + + +From d970485b895a64a309054dea77693c48332db7fb Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Fri, 19 Aug 2016 11:39:29 +0300 +Subject: [PATCH 180/208] drm: Don't implement empty prepare_fb()/cleanup_fb() + +The plane .prepare_fb() and .cleanup_fb() helpers are optional, there's +no need to implement empty stubs, and no need to explicitly set the +function pointers to NULL either. + +Signed-off-by: Laurent Pinchart +[danvet: Resolved conflicts with Chris' patch.] +Signed-off-by: Daniel Vetter +--- + drivers/gpu/drm/vc4/vc4_plane.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 29e4b400e25e34a63e4710e9edbba62541b9cdc5..881bf489478b01b34e9e4df6013fe608c42215ee 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -735,8 +735,6 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb) + } + + static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = { +- .prepare_fb = NULL, +- .cleanup_fb = NULL, + .atomic_check = vc4_plane_atomic_check, + .atomic_update = vc4_plane_atomic_update, + }; + +From 8046f42af8709ad32d6eaf964bc169f6e8e1136b Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:58:57 +0200 +Subject: [PATCH 181/208] drm/vc4: Disallow interlaced modes on DPI. + +We already don't expose such modes to userspace, but make +sure userspace can't sneak some interlaced mode in. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index 275fedbdbd9eae420939627e7fcdf9236cfce4fa..1e1f6b8184d058c6e55e092653798f4d75b55b7f 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -340,9 +340,20 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + } + } + ++static bool vc4_dpi_encoder_mode_fixup(struct drm_encoder *encoder, ++ const struct drm_display_mode *mode, ++ struct drm_display_mode *adjusted_mode) ++{ ++ if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) ++ return false; ++ ++ return true; ++} ++ + static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { + .disable = vc4_dpi_encoder_disable, + .enable = vc4_dpi_encoder_enable, ++ .mode_fixup = vc4_dpi_encoder_mode_fixup, + }; + + static const struct of_device_id vc4_dpi_dt_match[] = { + +From 43e8caa26763825711b0f901d3a0544690363efd Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:58:58 +0200 +Subject: [PATCH 182/208] drm/vc4: Fix handling of interlaced video modes. + +We must not apply CRTC_INTERLACE_HALVE_V to interlaced modes during +mode enumeration, as drm_helper_probe_single_connector_modes +does, so wrap it and reset the effect of CRTC_INTERLACE_HALVE_V +on affected interlaced modes. + +Also mode_fixup interlaced modes passed in from user space. + +This fixes the vblank timestamping constants and entries in +the mode->crtc_xxx fields needed for precise vblank timestamping. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 18 ++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_hdmi.c | 29 +++++++++++++++++++++++++++-- + 2 files changed, 45 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 8fc2b731b59a613fddce5853981e1ab8fd982837..a479d3d840c59257aaf0f411cc9600f4915bb62c 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -532,6 +532,23 @@ static void vc4_crtc_enable(struct drm_crtc *crtc) + CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN); + } + ++static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, ++ const struct drm_display_mode *mode, ++ struct drm_display_mode *adjusted_mode) ++{ ++ /* ++ * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when ++ * coming from user space. We don't want this, as it screws up ++ * vblank timestamping, so fix it up. ++ */ ++ drm_mode_set_crtcinfo(adjusted_mode, 0); ++ ++ DRM_DEBUG_KMS("[CRTC:%d] adjusted_mode :\n", crtc->base.id); ++ drm_mode_debug_printmodeline(adjusted_mode); ++ ++ return true; ++} ++ + static int vc4_crtc_atomic_check(struct drm_crtc *crtc, + struct drm_crtc_state *state) + { +@@ -819,6 +836,7 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { + .mode_set_nofb = vc4_crtc_mode_set_nofb, + .disable = vc4_crtc_disable, + .enable = vc4_crtc_enable, ++ .mode_fixup = vc4_crtc_mode_fixup, + .atomic_check = vc4_crtc_atomic_check, + .atomic_flush = vc4_crtc_atomic_flush, + }; +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 4452f3631cacea37bbd5dc8a594367631e308adc..68ad10634b29ec7b716f70f0b5fd9f2046da1fe5 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -208,10 +208,35 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + return ret; + } + ++/* ++ * drm_helper_probe_single_connector_modes() applies drm_mode_set_crtcinfo to ++ * all modes with flag CRTC_INTERLACE_HALVE_V. We don't want this, as it ++ * screws up vblank timestamping for interlaced modes, so fix it up. ++ */ ++static int vc4_hdmi_connector_probe_modes(struct drm_connector *connector, ++ uint32_t maxX, uint32_t maxY) ++{ ++ struct drm_display_mode *mode; ++ int count; ++ ++ count = drm_helper_probe_single_connector_modes(connector, maxX, maxY); ++ if (count == 0) ++ return 0; ++ ++ DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed adapted modes :\n", ++ connector->base.id, connector->name); ++ list_for_each_entry(mode, &connector->modes, head) { ++ drm_mode_set_crtcinfo(mode, 0); ++ drm_mode_debug_printmodeline(mode); ++ } ++ ++ return count; ++} ++ + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + .dpms = drm_atomic_helper_connector_dpms, + .detect = vc4_hdmi_connector_detect, +- .fill_modes = drm_helper_probe_single_connector_modes, ++ .fill_modes = vc4_hdmi_connector_probe_modes, + .destroy = vc4_hdmi_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, +@@ -246,7 +271,7 @@ static struct drm_connector *vc4_hdmi_connector_init(struct drm_device *dev, + connector->polled = (DRM_CONNECTOR_POLL_CONNECT | + DRM_CONNECTOR_POLL_DISCONNECT); + +- connector->interlace_allowed = 0; ++ connector->interlace_allowed = 1; + connector->doublescan_allowed = 0; + + drm_mode_connector_attach_encoder(connector, encoder); + +From 991b87fa61335f5241088165fa667ea2ce5c8f90 Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:58:59 +0200 +Subject: [PATCH 183/208] drm/vc4: Reject doublescan modes. + +We can't handle doublescan modes at the moment, so if +userspace tries to set one, reject the mode set. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index a479d3d840c59257aaf0f411cc9600f4915bb62c..2bfa2470e66b3fb5aa3692c66cb803973985f68f 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -536,6 +536,13 @@ static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) + { ++ /* Do not allow doublescan modes from user space */ ++ if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) { ++ DRM_DEBUG_KMS("[CRTC:%d] Doublescan mode rejected.\n", ++ crtc->base.id); ++ return false; ++ } ++ + /* + * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when + * coming from user space. We don't want this, as it screws up + +From 503dc975e3a0fde5266a1528ebef09a384b9b1ff Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:59:00 +0200 +Subject: [PATCH 184/208] drm/vc4: Enable precise vblank timestamping for + interlaced modes. + +On top of the interlaced video mode fix and with some additional +adjustments, this now works well. It has almost the same accuracy +as on regular progressive scan modes. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 2bfa2470e66b3fb5aa3692c66cb803973985f68f..7ffdad543ed2cbb588ad8f2037620bde7bb25e95 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -163,14 +163,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + int vblank_lines; + int ret = 0; + +- /* +- * XXX Doesn't work well in interlaced mode yet, partially due +- * to problems in vc4 kms or drm core interlaced mode handling, +- * so disable for now in interlaced mode. +- */ +- if (mode->flags & DRM_MODE_FLAG_INTERLACE) +- return ret; +- + /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ + + /* Get optional system timestamp before query. */ +@@ -191,10 +183,15 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + + /* Vertical position of hvs composed scanline. */ + *vpos = VC4_GET_FIELD(val, SCALER_DISPSTATX_LINE); ++ *hpos = 0; ++ ++ if (mode->flags & DRM_MODE_FLAG_INTERLACE) { ++ *vpos /= 2; + +- /* No hpos info available. */ +- if (hpos) +- *hpos = 0; ++ /* Use hpos to correct for field offset in interlaced mode. */ ++ if (VC4_GET_FIELD(val, SCALER_DISPSTATX_FRAME_COUNT) % 2) ++ *hpos += mode->crtc_htotal / 2; ++ } + + /* This is the offset we need for translating hvs -> pv scanout pos. */ + fifo_lines = vc4_crtc->cob_size / mode->crtc_hdisplay; +@@ -217,8 +214,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + * position of the PV. + */ + *vpos -= fifo_lines + 1; +- if (mode->flags & DRM_MODE_FLAG_INTERLACE) +- *vpos /= 2; + + ret |= DRM_SCANOUTPOS_ACCURATE; + return ret; + +From ce12fad8b5a7bbe64cba4fea965cd9b9b3d3552b Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:59:01 +0200 +Subject: [PATCH 185/208] drm/vc4: Enable/Disable vblanks properly in crtc + en/disable. + +Add missing drm_crtc_vblank_on/off() calls so vblank irq +handling/updating/timestamping never runs with a crtc shut down +or during its shutdown/startup, as that causes large jumps in +vblank count and trouble for compositors. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 7ffdad543ed2cbb588ad8f2037620bde7bb25e95..2682f07d8f1e6d3dc89ad0858f136c511040b517 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -475,6 +475,9 @@ static void vc4_crtc_disable(struct drm_crtc *crtc) + int ret; + require_hvs_enabled(dev); + ++ /* Disable vblank irq handling before crtc is disabled. */ ++ drm_crtc_vblank_off(crtc); ++ + CRTC_WRITE(PV_V_CONTROL, + CRTC_READ(PV_V_CONTROL) & ~PV_VCONTROL_VIDEN); + ret = wait_for(!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VIDEN), 1); +@@ -525,6 +528,9 @@ static void vc4_crtc_enable(struct drm_crtc *crtc) + /* Turn on the pixel valve, which will emit the vstart signal. */ + CRTC_WRITE(PV_V_CONTROL, + CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN); ++ ++ /* Enable vblank irq handling after crtc is started. */ ++ drm_crtc_vblank_on(crtc); + } + + static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, + +From fec57b3556993256fc654768dba939342ca25dc8 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 2 Aug 2016 17:17:52 -0700 +Subject: [PATCH 186/208] drm/vc4: Don't force new binner overflow allocation + per draw. + +This came from the initial bringup code, which always idled the GPU +and always reset the overflow. That massively increases the size of +the working set when you're doing lots of small draws, though, as is +common on X desktops or piglit. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_gem.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index ae1609e739ef424d99207f830cd2bac41ce71557..47a095f392f8a7b5443227933c78b500a4c7137f 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -419,10 +419,6 @@ again: + + vc4_flush_caches(dev); + +- /* Disable the binner's pre-loaded overflow memory address */ +- V3D_WRITE(V3D_BPOA, 0); +- V3D_WRITE(V3D_BPOS, 0); +- + /* Either put the job in the binner if it uses the binner, or + * immediately move it to the to-be-rendered queue. + */ + +From 3560e2aca2425e2b4ea5f5bdb0fa9589ecc125c3 Mon Sep 17 00:00:00 2001 +From: Liu Ying +Date: Mon, 29 Aug 2016 17:12:03 +0800 +Subject: [PATCH 187/208] drm/atomic-helper: Add NO_DISABLE_AFTER_MODESET flag + support for plane commit + +Drivers may set the NO_DISABLE_AFTER_MODESET flag in the 'flags' parameter +of the helper drm_atomic_helper_commit_planes() if the relevant display +controllers(e.g., IPUv3 for imx-drm) require to disable a CRTC's planes +when the CRTC is disabled. The helper would skip the ->atomic_disable +call for a plane if the CRTC of the old plane state needs a modesetting +operation. Of course, the drivers need to disable the planes in their CRTC +disable callbacks since no one else would do that. + +Suggested-by: Daniel Vetter +Cc: Philipp Zabel +Cc: David Airlie +Cc: Russell King +Cc: Peter Senna Tschudin +Cc: Lucas Stach +Signed-off-by: Liu Ying +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1472461923-14364-1-git-send-email-gnuiyl@gmail.com +--- + drivers/gpu/drm/vc4/vc4_kms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 4ac894d993cd80472777b2a3bacc2fcf0dd52810..c1f65c6c8e601e9331768ca040a5609cad686b2e 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -44,7 +44,7 @@ vc4_atomic_complete_commit(struct vc4_commit *c) + + drm_atomic_helper_commit_modeset_disables(dev, state); + +- drm_atomic_helper_commit_planes(dev, state, false); ++ drm_atomic_helper_commit_planes(dev, state, 0); + + drm_atomic_helper_commit_modeset_enables(dev, state); + + +From 32db4f1829e5531aa6e60ca3020b2c487c945920 Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Wed, 21 Sep 2016 16:59:19 +0200 +Subject: [PATCH 188/208] drm: Don't swallow error codes in drm_dev_alloc() + +There are many reasons other than ENOMEM that drm_dev_init() can +fail. Return ERR_PTR rather than NULL to be able to distinguish +these in the caller. + +Signed-off-by: Tom Gundersen +Signed-off-by: Sean Paul +Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-2-teg@jklm.no +--- + drivers/gpu/drm/vc4/vc4_drv.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index eff0530dc713f6ac3cdb5cb3e640abed1cc67492..8703f56b794774ac4130a7b487472e293ebe7cdf 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -233,8 +233,8 @@ static int vc4_drm_bind(struct device *dev) + return -ENOMEM; + + drm = drm_dev_alloc(&vc4_drm_driver, dev); +- if (!drm) +- return -ENOMEM; ++ if (IS_ERR(drm)) ++ return PTR_ERR(drm); + platform_set_drvdata(pdev, drm); + vc4->dev = drm; + drm->dev_private = vc4; + +From 7f1274b2b1e0fe40b2965bad8853cbe3035a3fbe Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Tue, 13 Sep 2016 03:35:20 +0900 +Subject: [PATCH 189/208] drm/vc4: cleanup with list_first_entry_or_null() + +The combo of list_empty() check and return list_first_entry() +can be replaced with list_first_entry_or_null(). + +Signed-off-by: Masahiro Yamada +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_drv.h | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index f696b752886b153c4654c0b8acca3fe46c9136cb..7c1e4d97486fb57d9ce7002c30a23138519761ae 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -324,18 +324,15 @@ struct vc4_exec_info { + static inline struct vc4_exec_info * + vc4_first_bin_job(struct vc4_dev *vc4) + { +- if (list_empty(&vc4->bin_job_list)) +- return NULL; +- return list_first_entry(&vc4->bin_job_list, struct vc4_exec_info, head); ++ return list_first_entry_or_null(&vc4->bin_job_list, ++ struct vc4_exec_info, head); + } + + static inline struct vc4_exec_info * + vc4_first_render_job(struct vc4_dev *vc4) + { +- if (list_empty(&vc4->render_job_list)) +- return NULL; +- return list_first_entry(&vc4->render_job_list, +- struct vc4_exec_info, head); ++ return list_first_entry_or_null(&vc4->render_job_list, ++ struct vc4_exec_info, head); + } + + static inline struct vc4_exec_info * + +From ec746edb504c5ac7db80f613e52a0c0dbfc866fa Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 16 Sep 2016 10:59:45 +0100 +Subject: [PATCH 190/208] drm/vc4: Enable limited range RGB output on HDMI with + CEA modes. + +Fixes broken grayscale ramps on many HDMI monitors, where large areas +at the ends of the ramp would all appear as black or white. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 31 +++++++++++++++++++++++++++++-- + drivers/gpu/drm/vc4/vc4_regs.h | 9 ++++++++- + 2 files changed, 37 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 68ad10634b29ec7b716f70f0b5fd9f2046da1fe5..29be7b7273df5b2c75d3162d72097efe62ec93df 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -298,6 +298,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + struct drm_display_mode *unadjusted_mode, + struct drm_display_mode *mode) + { ++ struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); + struct drm_device *dev = encoder->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); + bool debug_dump_regs = false; +@@ -313,6 +314,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + u32 vertb = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | + VC4_SET_FIELD(mode->vtotal - mode->vsync_end, + VC4_HDMI_VERTB_VBP)); ++ u32 csc_ctl; + + if (debug_dump_regs) { + DRM_INFO("HDMI regs before:\n"); +@@ -351,9 +353,34 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + (vsync_pos ? 0 : VC4_HD_VID_CTL_VSYNC_LOW) | + (hsync_pos ? 0 : VC4_HD_VID_CTL_HSYNC_LOW)); + ++ csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR, ++ VC4_HD_CSC_CTL_ORDER); ++ ++ if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) > 1) { ++ /* CEA VICs other than #1 requre limited range RGB ++ * output. Apply a colorspace conversion to squash ++ * 0-255 down to 16-235. The matrix here is: ++ * ++ * [ 0 0 0.8594 16] ++ * [ 0 0.8594 0 16] ++ * [ 0.8594 0 0 16] ++ * [ 0 0 0 1] ++ */ ++ csc_ctl |= VC4_HD_CSC_CTL_ENABLE; ++ csc_ctl |= VC4_HD_CSC_CTL_RGB2YCC; ++ csc_ctl |= VC4_SET_FIELD(VC4_HD_CSC_CTL_MODE_CUSTOM, ++ VC4_HD_CSC_CTL_MODE); ++ ++ HD_WRITE(VC4_HD_CSC_12_11, (0x000 << 16) | 0x000); ++ HD_WRITE(VC4_HD_CSC_14_13, (0x100 << 16) | 0x6e0); ++ HD_WRITE(VC4_HD_CSC_22_21, (0x6e0 << 16) | 0x000); ++ HD_WRITE(VC4_HD_CSC_24_23, (0x100 << 16) | 0x000); ++ HD_WRITE(VC4_HD_CSC_32_31, (0x000 << 16) | 0x6e0); ++ HD_WRITE(VC4_HD_CSC_34_33, (0x100 << 16) | 0x000); ++ } ++ + /* The RGB order applies even when CSC is disabled. */ +- HD_WRITE(VC4_HD_CSC_CTL, VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR, +- VC4_HD_CSC_CTL_ORDER)); ++ HD_WRITE(VC4_HD_CSC_CTL, csc_ctl); + + HDMI_WRITE(VC4_HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N); + +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 160942a9180e716e6c6d890214f0fc6e0e081ecd..9ecd6ff3d493ffca5249256ce99dc2de2b21e0ee 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -528,10 +528,17 @@ + # define VC4_HD_CSC_CTL_MODE_SHIFT 2 + # define VC4_HD_CSC_CTL_MODE_RGB_TO_SD_YPRPB 0 + # define VC4_HD_CSC_CTL_MODE_RGB_TO_HD_YPRPB 1 +-# define VC4_HD_CSC_CTL_MODE_CUSTOM 2 ++# define VC4_HD_CSC_CTL_MODE_CUSTOM 3 + # define VC4_HD_CSC_CTL_RGB2YCC BIT(1) + # define VC4_HD_CSC_CTL_ENABLE BIT(0) + ++#define VC4_HD_CSC_12_11 0x044 ++#define VC4_HD_CSC_14_13 0x048 ++#define VC4_HD_CSC_22_21 0x04c ++#define VC4_HD_CSC_24_23 0x050 ++#define VC4_HD_CSC_32_31 0x054 ++#define VC4_HD_CSC_34_33 0x058 ++ + #define VC4_HD_FRAME_COUNT 0x068 + + /* HVS display list information. */ + +From 9bad67df07b8552d61731c2f0e5a5fe0f9d46849 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 19:21:29 +0100 +Subject: [PATCH 191/208] drm/vc4: Fall back to using an EDID probe in the + absence of a GPIO. + +On Pi0/1/2, we use an external GPIO line for hotplug detection, since +the HDMI_HOTPLUG register isn't connected to anything. However, with +the Pi3 the HPD GPIO line has moved off to a GPIO expander that will +be tricky to get to (the firmware is constantly polling the expander +using i2c0, so we'll need to coordinate with it). + +As a stop-gap, if we don't have a GPIO line, use an EDID probe to +detect connection. Fixes HDMI display on the pi3. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 29be7b7273df5b2c75d3162d72097efe62ec93df..1e61931846d3f10cdb7f914e54c260f8b9731cd7 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -174,6 +174,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + return connector_status_disconnected; + } + ++ if (drm_probe_ddc(vc4->hdmi->ddc)) ++ return connector_status_connected; ++ + if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) + return connector_status_connected; + else + +From 45f5d55e2e3214d8e8e0514b1fe7c32ec632357e Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 28 Sep 2016 17:21:05 -0700 +Subject: [PATCH 192/208] drm/vc4: Increase timeout for HDMI_SCHEDULER_CONTROL + changes. + +Fixes occasional debug spew at boot when connected directly through +HDMI, and probably confusing the HDMI state machine when we go trying +to poke registers for the enable sequence too soon. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 1e61931846d3f10cdb7f914e54c260f8b9731cd7..fe1c4e35e68142839756df10ed9b9e56c028d04e 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -424,7 +424,7 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) + VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); + + ret = wait_for(HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) & +- VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1); ++ VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1000); + WARN_ONCE(ret, "Timeout waiting for " + "VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n"); + } else { +@@ -436,7 +436,7 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) + ~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); + + ret = wait_for(!(HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) & +- VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1); ++ VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1000); + WARN_ONCE(ret, "Timeout waiting for " + "!VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n"); + } + +From 0ec96f64a32dc31a9f1bcbcb367d932622fd9cee Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 28 Sep 2016 17:30:25 -0700 +Subject: [PATCH 193/208] drm/vc4: Fix support for interlaced modes on HDMI. + +We really do need to be using the halved V fields. I had been +confused by the code I was using as a reference because it stored +halved vsync fields but not halved vdisplay, so it looked like I only +needed to divide vdisplay by 2. + +This reverts part of Mario's timestamping fixes that prevented +CRTC_HALVE_V from applying, and instead adjusts the timestamping code +to not use the crtc field in that case. + +Fixes locking of 1920x1080x60i on my Dell 2408WFP. There are black +bars on the top and bottom, but I suspect that might be an +under/overscan flags problem as opposed to video timings. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 49 ++++++++++++++++++++++-------------------- + drivers/gpu/drm/vc4/vc4_hdmi.c | 45 +++++++++++--------------------------- + drivers/gpu/drm/vc4/vc4_regs.h | 3 +++ + 3 files changed, 41 insertions(+), 56 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 2682f07d8f1e6d3dc89ad0858f136c511040b517..83cafea03eff720f9f7b80f484dedf22ac7f283f 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -229,7 +229,7 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + * and need to make things up in a approximative but consistent way. + */ + ret |= DRM_SCANOUTPOS_IN_VBLANK; +- vblank_lines = mode->crtc_vtotal - mode->crtc_vdisplay; ++ vblank_lines = mode->vtotal - mode->vdisplay; + + if (flags & DRM_CALLED_FROM_VBLIRQ) { + /* +@@ -378,7 +378,6 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + struct drm_crtc_state *state = crtc->state; + struct drm_display_mode *mode = &state->adjusted_mode; + bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; +- u32 vactive = (mode->vdisplay >> (interlace ? 1 : 0)); + u32 format = PV_CONTROL_FORMAT_24; + bool debug_dump_regs = false; + int clock_select = vc4_get_clock_select(crtc); +@@ -404,32 +403,46 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + VC4_SET_FIELD(mode->hdisplay, PV_HORZB_HACTIVE)); + + CRTC_WRITE(PV_VERTA, +- VC4_SET_FIELD(mode->vtotal - mode->vsync_end, ++ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, + PV_VERTA_VBP) | +- VC4_SET_FIELD(mode->vsync_end - mode->vsync_start, ++ VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, + PV_VERTA_VSYNC)); + CRTC_WRITE(PV_VERTB, +- VC4_SET_FIELD(mode->vsync_start - mode->vdisplay, ++ VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, + PV_VERTB_VFP) | +- VC4_SET_FIELD(vactive, PV_VERTB_VACTIVE)); ++ VC4_SET_FIELD(mode->crtc_vdisplay, PV_VERTB_VACTIVE)); + + if (interlace) { + CRTC_WRITE(PV_VERTA_EVEN, +- VC4_SET_FIELD(mode->vtotal - mode->vsync_end - 1, ++ VC4_SET_FIELD(mode->crtc_vtotal - ++ mode->crtc_vsync_end - 1, + PV_VERTA_VBP) | +- VC4_SET_FIELD(mode->vsync_end - mode->vsync_start, ++ VC4_SET_FIELD(mode->crtc_vsync_end - ++ mode->crtc_vsync_start, + PV_VERTA_VSYNC)); + CRTC_WRITE(PV_VERTB_EVEN, +- VC4_SET_FIELD(mode->vsync_start - mode->vdisplay, ++ VC4_SET_FIELD(mode->crtc_vsync_start - ++ mode->crtc_vdisplay, + PV_VERTB_VFP) | +- VC4_SET_FIELD(vactive, PV_VERTB_VACTIVE)); ++ VC4_SET_FIELD(mode->crtc_vdisplay, PV_VERTB_VACTIVE)); ++ ++ /* We set up first field even mode for HDMI. VEC's ++ * NTSC mode would want first field odd instead, once ++ * we support it (to do so, set ODD_FIRST and put the ++ * delay in VSYNCD_EVEN instead). ++ */ ++ CRTC_WRITE(PV_V_CONTROL, ++ PV_VCONTROL_CONTINUOUS | ++ PV_VCONTROL_INTERLACE | ++ VC4_SET_FIELD(mode->htotal / 2, ++ PV_VCONTROL_ODD_DELAY)); ++ CRTC_WRITE(PV_VSYNCD_EVEN, 0); ++ } else { ++ CRTC_WRITE(PV_V_CONTROL, PV_VCONTROL_CONTINUOUS); + } + + CRTC_WRITE(PV_HACT_ACT, mode->hdisplay); + +- CRTC_WRITE(PV_V_CONTROL, +- PV_VCONTROL_CONTINUOUS | +- (interlace ? PV_VCONTROL_INTERLACE : 0)); + + CRTC_WRITE(PV_CONTROL, + VC4_SET_FIELD(format, PV_CONTROL_FORMAT) | +@@ -544,16 +557,6 @@ static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, + return false; + } + +- /* +- * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when +- * coming from user space. We don't want this, as it screws up +- * vblank timestamping, so fix it up. +- */ +- drm_mode_set_crtcinfo(adjusted_mode, 0); +- +- DRM_DEBUG_KMS("[CRTC:%d] adjusted_mode :\n", crtc->base.id); +- drm_mode_debug_printmodeline(adjusted_mode); +- + return true; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index fe1c4e35e68142839756df10ed9b9e56c028d04e..d94108ca961dac9278d2e38813d089b78acbc8ad 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -211,35 +211,10 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + return ret; + } + +-/* +- * drm_helper_probe_single_connector_modes() applies drm_mode_set_crtcinfo to +- * all modes with flag CRTC_INTERLACE_HALVE_V. We don't want this, as it +- * screws up vblank timestamping for interlaced modes, so fix it up. +- */ +-static int vc4_hdmi_connector_probe_modes(struct drm_connector *connector, +- uint32_t maxX, uint32_t maxY) +-{ +- struct drm_display_mode *mode; +- int count; +- +- count = drm_helper_probe_single_connector_modes(connector, maxX, maxY); +- if (count == 0) +- return 0; +- +- DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed adapted modes :\n", +- connector->base.id, connector->name); +- list_for_each_entry(mode, &connector->modes, head) { +- drm_mode_set_crtcinfo(mode, 0); +- drm_mode_debug_printmodeline(mode); +- } +- +- return count; +-} +- + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + .dpms = drm_atomic_helper_connector_dpms, + .detect = vc4_hdmi_connector_detect, +- .fill_modes = vc4_hdmi_connector_probe_modes, ++ .fill_modes = drm_helper_probe_single_connector_modes, + .destroy = vc4_hdmi_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, +@@ -307,16 +282,20 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + bool debug_dump_regs = false; + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; +- u32 vactive = (mode->vdisplay >> +- ((mode->flags & DRM_MODE_FLAG_INTERLACE) ? 1 : 0)); +- u32 verta = (VC4_SET_FIELD(mode->vsync_end - mode->vsync_start, ++ bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; ++ u32 verta = (VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, + VC4_HDMI_VERTA_VSP) | +- VC4_SET_FIELD(mode->vsync_start - mode->vdisplay, ++ VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, + VC4_HDMI_VERTA_VFP) | +- VC4_SET_FIELD(vactive, VC4_HDMI_VERTA_VAL)); ++ VC4_SET_FIELD(mode->crtc_vdisplay, VC4_HDMI_VERTA_VAL)); + u32 vertb = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | +- VC4_SET_FIELD(mode->vtotal - mode->vsync_end, ++ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, + VC4_HDMI_VERTB_VBP)); ++ u32 vertb_even = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | ++ VC4_SET_FIELD(mode->crtc_vtotal - ++ mode->crtc_vsync_end - ++ interlaced, ++ VC4_HDMI_VERTB_VBP)); + u32 csc_ctl; + + if (debug_dump_regs) { +@@ -349,7 +328,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + HDMI_WRITE(VC4_HDMI_VERTA0, verta); + HDMI_WRITE(VC4_HDMI_VERTA1, verta); + +- HDMI_WRITE(VC4_HDMI_VERTB0, vertb); ++ HDMI_WRITE(VC4_HDMI_VERTB0, vertb_even); + HDMI_WRITE(VC4_HDMI_VERTB1, vertb); + + HD_WRITE(VC4_HD_VID_CTL, +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 9ecd6ff3d493ffca5249256ce99dc2de2b21e0ee..c5a423ead86ffdd1ce2abada24f628b19c1ebc08 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -183,6 +183,9 @@ + # define PV_CONTROL_EN BIT(0) + + #define PV_V_CONTROL 0x04 ++# define PV_VCONTROL_ODD_DELAY_MASK VC4_MASK(22, 6) ++# define PV_VCONTROL_ODD_DELAY_SHIFT 6 ++# define PV_VCONTROL_ODD_FIRST BIT(5) + # define PV_VCONTROL_INTERLACE BIT(4) + # define PV_VCONTROL_CONTINUOUS BIT(1) + # define PV_VCONTROL_VIDEN BIT(0) + +From d1475342b1f4cf8f9a51428a64f04ae50c45c9c8 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 29 Sep 2016 15:34:43 -0700 +Subject: [PATCH 194/208] drm/vc4: Set up the AVI and SPD infoframes. + +Fixes a purple bar on the left side of the screen with my Dell +2408WFP. It will also be required for supporting the double-clocked +video modes. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 136 +++++++++++++++++++++++++++++++++++++++-- + drivers/gpu/drm/vc4/vc4_regs.h | 5 ++ + 2 files changed, 136 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index d94108ca961dac9278d2e38813d089b78acbc8ad..d6b54b905beeec33eee8a763969ffa9568cfa745 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -62,6 +62,8 @@ struct vc4_hdmi { + struct vc4_hdmi_encoder { + struct vc4_encoder base; + bool hdmi_monitor; ++ bool limited_rgb_range; ++ bool rgb_range_selectable; + }; + + static inline struct vc4_hdmi_encoder * +@@ -205,6 +207,12 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + return -ENODEV; + + vc4_encoder->hdmi_monitor = drm_detect_hdmi_monitor(edid); ++ ++ if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) { ++ vc4_encoder->rgb_range_selectable = ++ drm_rgb_quant_range_selectable(edid); ++ } ++ + drm_mode_connector_update_edid_property(connector, edid); + ret = drm_add_edid_modes(connector, edid); + +@@ -272,6 +280,117 @@ static const struct drm_encoder_funcs vc4_hdmi_encoder_funcs = { + .destroy = vc4_hdmi_encoder_destroy, + }; + ++static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, ++ enum hdmi_infoframe_type type) ++{ ++ struct drm_device *dev = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ u32 packet_id = type - 0x80; ++ ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, ++ HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & ~BIT(packet_id)); ++ ++ return wait_for(!(HDMI_READ(VC4_HDMI_RAM_PACKET_STATUS) & ++ BIT(packet_id)), 100); ++} ++ ++static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, ++ union hdmi_infoframe *frame) ++{ ++ struct drm_device *dev = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ u32 packet_id = frame->any.type - 0x80; ++ u32 packet_reg = VC4_HDMI_GCP_0 + VC4_HDMI_PACKET_STRIDE * packet_id; ++ uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; ++ ssize_t len, i; ++ int ret; ++ ++ WARN_ONCE(!(HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & ++ VC4_HDMI_RAM_PACKET_ENABLE), ++ "Packet RAM has to be on to store the packet."); ++ ++ len = hdmi_infoframe_pack(frame, buffer, sizeof(buffer)); ++ if (len < 0) ++ return; ++ ++ ret = vc4_hdmi_stop_packet(encoder, frame->any.type); ++ if (ret) { ++ DRM_ERROR("Failed to wait for infoframe to go idle: %d\n", ret); ++ return; ++ } ++ ++ for (i = 0; i < len; i += 7) { ++ HDMI_WRITE(packet_reg, ++ buffer[i + 0] << 0 | ++ buffer[i + 1] << 8 | ++ buffer[i + 2] << 16); ++ packet_reg += 4; ++ ++ HDMI_WRITE(packet_reg, ++ buffer[i + 3] << 0 | ++ buffer[i + 4] << 8 | ++ buffer[i + 5] << 16 | ++ buffer[i + 6] << 24); ++ packet_reg += 4; ++ } ++ ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, ++ HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) | BIT(packet_id)); ++ ret = wait_for((HDMI_READ(VC4_HDMI_RAM_PACKET_STATUS) & ++ BIT(packet_id)), 100); ++ if (ret) ++ DRM_ERROR("Failed to wait for infoframe to start: %d\n", ret); ++} ++ ++static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) ++{ ++ struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); ++ struct drm_crtc *crtc = encoder->crtc; ++ const struct drm_display_mode *mode = &crtc->state->adjusted_mode; ++ union hdmi_infoframe frame; ++ int ret; ++ ++ ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode); ++ if (ret < 0) { ++ DRM_ERROR("couldn't fill AVI infoframe\n"); ++ return; ++ } ++ ++ if (vc4_encoder->rgb_range_selectable) { ++ if (vc4_encoder->limited_rgb_range) { ++ frame.avi.quantization_range = ++ HDMI_QUANTIZATION_RANGE_LIMITED; ++ } else { ++ frame.avi.quantization_range = ++ HDMI_QUANTIZATION_RANGE_FULL; ++ } ++ } ++ ++ vc4_hdmi_write_infoframe(encoder, &frame); ++} ++ ++static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder) ++{ ++ union hdmi_infoframe frame; ++ int ret; ++ ++ ret = hdmi_spd_infoframe_init(&frame.spd, "Broadcom", "Videocore"); ++ if (ret < 0) { ++ DRM_ERROR("couldn't fill SPD infoframe\n"); ++ return; ++ } ++ ++ frame.spd.sdi = HDMI_SPD_SDI_PC; ++ ++ vc4_hdmi_write_infoframe(encoder, &frame); ++} ++ ++static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) ++{ ++ vc4_hdmi_set_avi_infoframe(encoder); ++ vc4_hdmi_set_spd_infoframe(encoder); ++} ++ + static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + struct drm_display_mode *unadjusted_mode, + struct drm_display_mode *mode) +@@ -340,8 +459,9 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + + if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) > 1) { + /* CEA VICs other than #1 requre limited range RGB +- * output. Apply a colorspace conversion to squash +- * 0-255 down to 16-235. The matrix here is: ++ * output unless overridden by an AVI infoframe. ++ * Apply a colorspace conversion to squash 0-255 down ++ * to 16-235. The matrix here is: + * + * [ 0 0 0.8594 16] + * [ 0 0.8594 0 16] +@@ -359,6 +479,9 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + HD_WRITE(VC4_HD_CSC_24_23, (0x100 << 16) | 0x000); + HD_WRITE(VC4_HD_CSC_32_31, (0x000 << 16) | 0x6e0); + HD_WRITE(VC4_HD_CSC_34_33, (0x100 << 16) | 0x000); ++ vc4_encoder->limited_rgb_range = true; ++ } else { ++ vc4_encoder->limited_rgb_range = false; + } + + /* The RGB order applies even when CSC is disabled. */ +@@ -377,6 +500,8 @@ static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder) + struct drm_device *dev = encoder->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); + ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, 0); ++ + HDMI_WRITE(VC4_HDMI_TX_PHY_RESET_CTL, 0xf << 16); + HD_WRITE(VC4_HD_VID_CTL, + HD_READ(VC4_HD_VID_CTL) & ~VC4_HD_VID_CTL_ENABLE); +@@ -429,9 +554,10 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) + HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) | + VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWAYS_KEEPOUT); + +- /* XXX: Set HDMI_RAM_PACKET_CONFIG (1 << 16) and set +- * up the infoframe. +- */ ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, ++ VC4_HDMI_RAM_PACKET_ENABLE); ++ ++ vc4_hdmi_set_infoframes(encoder); + + drift = HDMI_READ(VC4_HDMI_FIFO_CTL); + drift &= VC4_HDMI_FIFO_VALID_WRITE_MASK; +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index c5a423ead86ffdd1ce2abada24f628b19c1ebc08..0b868aafa8db69b0a08fe9cbf293263a0a7c5bed 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -441,6 +441,8 @@ + #define VC4_HDMI_RAM_PACKET_CONFIG 0x0a0 + # define VC4_HDMI_RAM_PACKET_ENABLE BIT(16) + ++#define VC4_HDMI_RAM_PACKET_STATUS 0x0a4 ++ + #define VC4_HDMI_HORZA 0x0c4 + # define VC4_HDMI_HORZA_VPOS BIT(14) + # define VC4_HDMI_HORZA_HPOS BIT(13) +@@ -502,6 +504,9 @@ + + #define VC4_HDMI_TX_PHY_RESET_CTL 0x2c0 + ++#define VC4_HDMI_GCP_0 0x400 ++#define VC4_HDMI_PACKET_STRIDE 0x24 ++ + #define VC4_HD_M_CTL 0x00c + # define VC4_HD_M_REGISTER_FILE_STANDBY (3 << 6) + # define VC4_HD_M_RAM_STANDBY (3 << 4) + +From d06d8d96a9423f1a5268377bddbd93a3a3fc20af Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 29 Sep 2016 15:34:44 -0700 +Subject: [PATCH 195/208] drm/vc4: Add support for double-clocked modes. + +Now that we have infoframes to report the pixel repeat flag, we can +start using it. Fixes locking the 720x480i and 720x576i modes on my +Dell 2408WFP. Like the 1920x1080i case, they don't fit properly on +the screen, though. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 17 +++++++++++------ + drivers/gpu/drm/vc4/vc4_hdmi.c | 16 +++++++++++----- + drivers/gpu/drm/vc4/vc4_regs.h | 2 ++ + 3 files changed, 24 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 83cafea03eff720f9f7b80f484dedf22ac7f283f..7f08d681a74b4e37529f6c09ae1d2c1a944dcabd 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -378,6 +378,7 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + struct drm_crtc_state *state = crtc->state; + struct drm_display_mode *mode = &state->adjusted_mode; + bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; ++ u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1; + u32 format = PV_CONTROL_FORMAT_24; + bool debug_dump_regs = false; + int clock_select = vc4_get_clock_select(crtc); +@@ -393,14 +394,17 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + CRTC_WRITE(PV_CONTROL, 0); + + CRTC_WRITE(PV_HORZA, +- VC4_SET_FIELD(mode->htotal - mode->hsync_end, ++ VC4_SET_FIELD((mode->htotal - ++ mode->hsync_end) * pixel_rep, + PV_HORZA_HBP) | +- VC4_SET_FIELD(mode->hsync_end - mode->hsync_start, ++ VC4_SET_FIELD((mode->hsync_end - ++ mode->hsync_start) * pixel_rep, + PV_HORZA_HSYNC)); + CRTC_WRITE(PV_HORZB, +- VC4_SET_FIELD(mode->hsync_start - mode->hdisplay, ++ VC4_SET_FIELD((mode->hsync_start - ++ mode->hdisplay) * pixel_rep, + PV_HORZB_HFP) | +- VC4_SET_FIELD(mode->hdisplay, PV_HORZB_HACTIVE)); ++ VC4_SET_FIELD(mode->hdisplay * pixel_rep, PV_HORZB_HACTIVE)); + + CRTC_WRITE(PV_VERTA, + VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, +@@ -434,20 +438,21 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + CRTC_WRITE(PV_V_CONTROL, + PV_VCONTROL_CONTINUOUS | + PV_VCONTROL_INTERLACE | +- VC4_SET_FIELD(mode->htotal / 2, ++ VC4_SET_FIELD(mode->htotal * pixel_rep / 2, + PV_VCONTROL_ODD_DELAY)); + CRTC_WRITE(PV_VSYNCD_EVEN, 0); + } else { + CRTC_WRITE(PV_V_CONTROL, PV_VCONTROL_CONTINUOUS); + } + +- CRTC_WRITE(PV_HACT_ACT, mode->hdisplay); ++ CRTC_WRITE(PV_HACT_ACT, mode->hdisplay * pixel_rep); + + + CRTC_WRITE(PV_CONTROL, + VC4_SET_FIELD(format, PV_CONTROL_FORMAT) | + VC4_SET_FIELD(vc4_get_fifo_full_level(format), + PV_CONTROL_FIFO_LEVEL) | ++ VC4_SET_FIELD(pixel_rep - 1, PV_CONTROL_PIXEL_REP) | + PV_CONTROL_CLR_AT_START | + PV_CONTROL_TRIGGER_UNDERFLOW | + PV_CONTROL_WAIT_HSTART | +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index d6b54b905beeec33eee8a763969ffa9568cfa745..c4cb2e26de32f06db0abf3fd94b3117c3292eed5 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -402,6 +402,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; + bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; ++ u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1; + u32 verta = (VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, + VC4_HDMI_VERTA_VSP) | + VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, +@@ -424,7 +425,8 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + + HD_WRITE(VC4_HD_VID_CTL, 0); + +- clk_set_rate(vc4->hdmi->pixel_clock, mode->clock * 1000); ++ clk_set_rate(vc4->hdmi->pixel_clock, mode->clock * 1000 * ++ ((mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1)); + + HDMI_WRITE(VC4_HDMI_SCHEDULER_CONTROL, + HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) | +@@ -434,14 +436,18 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + HDMI_WRITE(VC4_HDMI_HORZA, + (vsync_pos ? VC4_HDMI_HORZA_VPOS : 0) | + (hsync_pos ? VC4_HDMI_HORZA_HPOS : 0) | +- VC4_SET_FIELD(mode->hdisplay, VC4_HDMI_HORZA_HAP)); ++ VC4_SET_FIELD(mode->hdisplay * pixel_rep, ++ VC4_HDMI_HORZA_HAP)); + + HDMI_WRITE(VC4_HDMI_HORZB, +- VC4_SET_FIELD(mode->htotal - mode->hsync_end, ++ VC4_SET_FIELD((mode->htotal - ++ mode->hsync_end) * pixel_rep, + VC4_HDMI_HORZB_HBP) | +- VC4_SET_FIELD(mode->hsync_end - mode->hsync_start, ++ VC4_SET_FIELD((mode->hsync_end - ++ mode->hsync_start) * pixel_rep, + VC4_HDMI_HORZB_HSP) | +- VC4_SET_FIELD(mode->hsync_start - mode->hdisplay, ++ VC4_SET_FIELD((mode->hsync_start - ++ mode->hdisplay) * pixel_rep, + VC4_HDMI_HORZB_HFP)); + + HDMI_WRITE(VC4_HDMI_VERTA0, verta); +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 0b868aafa8db69b0a08fe9cbf293263a0a7c5bed..1aa44c2db5565ba126d2ceb65495a6c98c555860 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -175,6 +175,8 @@ + # define PV_CONTROL_CLR_AT_START BIT(14) + # define PV_CONTROL_TRIGGER_UNDERFLOW BIT(13) + # define PV_CONTROL_WAIT_HSTART BIT(12) ++# define PV_CONTROL_PIXEL_REP_MASK VC4_MASK(5, 4) ++# define PV_CONTROL_PIXEL_REP_SHIFT 4 + # define PV_CONTROL_CLK_SELECT_DSI_VEC 0 + # define PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI 1 + # define PV_CONTROL_CLK_SELECT_MASK VC4_MASK(3, 2) + +From 68dde0cad20ec7f9c40100cbcfd744d61bdc298a Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 08:39:33 +0100 +Subject: [PATCH 196/208] drm/vc4: Add a mode for using the closed firmware for + display. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/Makefile | 1 + + drivers/gpu/drm/vc4/vc4_crtc.c | 13 + + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_drv.h | 7 + + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 660 +++++++++++++++++++++++++++++++++ + 5 files changed, 682 insertions(+) + create mode 100644 drivers/gpu/drm/vc4/vc4_firmware_kms.c + +diff --git a/drivers/gpu/drm/vc4/Makefile b/drivers/gpu/drm/vc4/Makefile +index fb77db755e0a29d8589860da82186c7a1f394c72..c6dd06cca9830018c39b3b16afe4045e44d1ddf4 100644 +--- a/drivers/gpu/drm/vc4/Makefile ++++ b/drivers/gpu/drm/vc4/Makefile +@@ -8,6 +8,7 @@ vc4-y := \ + vc4_crtc.o \ + vc4_drv.o \ + vc4_dpi.o \ ++ vc4_firmware_kms.o \ + vc4_kms.o \ + vc4_gem.o \ + vc4_hdmi.o \ +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 7f08d681a74b4e37529f6c09ae1d2c1a944dcabd..7366e76c38346f7c700534b28d1eff4eca2ec2fa 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -163,6 +163,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + int vblank_lines; + int ret = 0; + ++ if (vc4->firmware_kms) ++ return 0; ++ + /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ + + /* Get optional system timestamp before query. */ +@@ -656,6 +659,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; + ++ if (vc4->firmware_kms) { ++ /* XXX: Can we mask the SMI interrupt? */ ++ return 0; ++ } ++ + CRTC_WRITE(PV_INTEN, PV_INT_VFP_START); + + return 0; +@@ -666,6 +674,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; + ++ if (vc4->firmware_kms) { ++ /* XXX: Can we mask the SMI interrupt? */ ++ return; ++ } ++ + CRTC_WRITE(PV_INTEN, 0); + } + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 8703f56b794774ac4130a7b487472e293ebe7cdf..6c4a4fbc86d0a30a6977b2081bca4372e693b817 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -292,6 +292,7 @@ static struct platform_driver *const component_drivers[] = { + &vc4_dpi_driver, + &vc4_hvs_driver, + &vc4_crtc_driver, ++ &vc4_firmware_kms_driver, + &vc4_v3d_driver, + }; + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 7c1e4d97486fb57d9ce7002c30a23138519761ae..e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -12,6 +12,9 @@ + struct vc4_dev { + struct drm_device *dev; + ++ bool firmware_kms; ++ struct rpi_firmware *firmware; ++ + struct vc4_hdmi *hdmi; + struct vc4_hvs *hvs; + struct vc4_crtc *crtc[3]; +@@ -460,6 +463,10 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); + extern struct platform_driver vc4_dpi_driver; + int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); + ++/* vc4_firmware_kms.c */ ++extern struct platform_driver vc4_firmware_kms_driver; ++void vc4_fkms_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file); ++ + /* vc4_gem.c */ + void vc4_gem_init(struct drm_device *dev); + void vc4_gem_destroy(struct drm_device *dev); +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +new file mode 100644 +index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57ae97b55c +--- /dev/null ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -0,0 +1,660 @@ ++/* ++ * Copyright (C) 2016 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++/** ++ * DOC: VC4 firmware KMS module. ++ * ++ * As a hack to get us from the current closed source driver world ++ * toward a totally open stack, implement KMS on top of the Raspberry ++ * Pi's firmware display stack. ++ */ ++ ++#include "drm_atomic.h" ++#include "drm_atomic_helper.h" ++#include "drm_plane_helper.h" ++#include "drm_crtc_helper.h" ++#include "linux/clk.h" ++#include "linux/debugfs.h" ++#include "drm_fb_cma_helper.h" ++#include "linux/component.h" ++#include "linux/of_device.h" ++#include "vc4_drv.h" ++#include "vc4_regs.h" ++#include ++ ++/* The firmware delivers a vblank interrupt to us through the SMI ++ * hardware, which has only this one register. ++ */ ++#define SMICS 0x0 ++#define SMICS_INTERRUPTS (BIT(9) | BIT(10) | BIT(11)) ++ ++struct vc4_crtc { ++ struct drm_crtc base; ++ struct drm_encoder *encoder; ++ struct drm_connector *connector; ++ void __iomem *regs; ++ ++ struct drm_pending_vblank_event *event; ++}; ++ ++static inline struct vc4_crtc *to_vc4_crtc(struct drm_crtc *crtc) ++{ ++ return container_of(crtc, struct vc4_crtc, base); ++} ++ ++struct vc4_fkms_encoder { ++ struct drm_encoder base; ++}; ++ ++static inline struct vc4_fkms_encoder * ++to_vc4_fkms_encoder(struct drm_encoder *encoder) ++{ ++ return container_of(encoder, struct vc4_fkms_encoder, base); ++} ++ ++/* VC4 FKMS connector KMS struct */ ++struct vc4_fkms_connector { ++ struct drm_connector base; ++ ++ /* Since the connector is attached to just the one encoder, ++ * this is the reference to it so we can do the best_encoder() ++ * hook. ++ */ ++ struct drm_encoder *encoder; ++}; ++ ++static inline struct vc4_fkms_connector * ++to_vc4_fkms_connector(struct drm_connector *connector) ++{ ++ return container_of(connector, struct vc4_fkms_connector, base); ++} ++ ++/* Firmware's structure for making an FB mbox call. */ ++struct fbinfo_s { ++ u32 xres, yres, xres_virtual, yres_virtual; ++ u32 pitch, bpp; ++ u32 xoffset, yoffset; ++ u32 base; ++ u32 screen_size; ++ u16 cmap[256]; ++}; ++ ++struct vc4_fkms_plane { ++ struct drm_plane base; ++ struct fbinfo_s *fbinfo; ++ dma_addr_t fbinfo_bus_addr; ++ u32 pitch; ++}; ++ ++static inline struct vc4_fkms_plane *to_vc4_fkms_plane(struct drm_plane *plane) ++{ ++ return (struct vc4_fkms_plane *)plane; ++} ++ ++/* Turns the display on/off. */ ++static int vc4_plane_set_primary_blank(struct drm_plane *plane, bool blank) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ ++ u32 packet = blank; ++ return rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_FRAMEBUFFER_BLANK, ++ &packet, sizeof(packet)); ++} ++ ++static void vc4_primary_plane_atomic_update(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ struct vc4_fkms_plane *vc4_plane = to_vc4_fkms_plane(plane); ++ struct drm_plane_state *state = plane->state; ++ struct drm_framebuffer *fb = state->fb; ++ struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); ++ volatile struct fbinfo_s *fbinfo = vc4_plane->fbinfo; ++ u32 bpp = 32; ++ int ret; ++ ++ vc4_plane_set_primary_blank(plane, false); ++ ++ fbinfo->xres = state->crtc_w; ++ fbinfo->yres = state->crtc_h; ++ fbinfo->xres_virtual = state->crtc_w; ++ fbinfo->yres_virtual = state->crtc_h; ++ fbinfo->bpp = bpp; ++ fbinfo->xoffset = state->crtc_x; ++ fbinfo->yoffset = state->crtc_y; ++ fbinfo->base = bo->paddr + fb->offsets[0]; ++ fbinfo->pitch = fb->pitches[0]; ++ /* A bug in the firmware makes it so that if the fb->base is ++ * set to nonzero, the configured pitch gets overwritten with ++ * the previous pitch. So, to get the configured pitch ++ * recomputed, we have to make it allocate itself a new buffer ++ * in VC memory, first. ++ */ ++ if (vc4_plane->pitch != fb->pitches[0]) { ++ u32 saved_base = fbinfo->base; ++ fbinfo->base = 0; ++ ++ ret = rpi_firmware_transaction(vc4->firmware, ++ RPI_FIRMWARE_CHAN_FB, ++ vc4_plane->fbinfo_bus_addr); ++ fbinfo->base = saved_base; ++ ++ vc4_plane->pitch = fbinfo->pitch; ++ WARN_ON_ONCE(vc4_plane->pitch != fb->pitches[0]); ++ } ++ ++ ret = rpi_firmware_transaction(vc4->firmware, ++ RPI_FIRMWARE_CHAN_FB, ++ vc4_plane->fbinfo_bus_addr); ++ WARN_ON_ONCE(fbinfo->pitch != fb->pitches[0]); ++ WARN_ON_ONCE(fbinfo->base != bo->paddr + fb->offsets[0]); ++} ++ ++static void vc4_primary_plane_atomic_disable(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ vc4_plane_set_primary_blank(plane, true); ++} ++ ++static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ struct drm_plane_state *state = plane->state; ++ struct drm_framebuffer *fb = state->fb; ++ struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); ++ int ret; ++ u32 packet_state[] = { true, state->crtc_x, state->crtc_y, 0 }; ++ u32 packet_info[] = { state->crtc_w, state->crtc_h, ++ 0, /* unused */ ++ bo->paddr + fb->offsets[0], ++ 0, 0, /* hotx, hoty */}; ++ WARN_ON_ONCE(fb->pitches[0] != state->crtc_w * 4); ++ WARN_ON_ONCE(fb->bits_per_pixel != 32); ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_SET_CURSOR_STATE, ++ &packet_state, ++ sizeof(packet_state)); ++ if (ret || packet_state[0] != 0) ++ DRM_ERROR("Failed to set cursor state: 0x%08x\n", packet_state[0]); ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_SET_CURSOR_INFO, ++ &packet_info, ++ sizeof(packet_info)); ++ if (ret || packet_info[0] != 0) ++ DRM_ERROR("Failed to set cursor info: 0x%08x\n", packet_info[0]); ++} ++ ++static void vc4_cursor_plane_atomic_disable(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ u32 packet_state[] = { false, 0, 0, 0 }; ++ int ret; ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_SET_CURSOR_STATE, ++ &packet_state, ++ sizeof(packet_state)); ++ if (ret || packet_state[0] != 0) ++ DRM_ERROR("Failed to set cursor state: 0x%08x\n", packet_state[0]); ++} ++ ++static int vc4_plane_atomic_check(struct drm_plane *plane, ++ struct drm_plane_state *state) ++{ ++ return 0; ++} ++ ++static void vc4_plane_destroy(struct drm_plane *plane) ++{ ++ drm_plane_helper_disable(plane); ++ drm_plane_cleanup(plane); ++} ++ ++static const struct drm_plane_funcs vc4_plane_funcs = { ++ .update_plane = drm_atomic_helper_update_plane, ++ .disable_plane = drm_atomic_helper_disable_plane, ++ .destroy = vc4_plane_destroy, ++ .set_property = NULL, ++ .reset = drm_atomic_helper_plane_reset, ++ .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, ++}; ++ ++static const struct drm_plane_helper_funcs vc4_primary_plane_helper_funcs = { ++ .prepare_fb = NULL, ++ .cleanup_fb = NULL, ++ .atomic_check = vc4_plane_atomic_check, ++ .atomic_update = vc4_primary_plane_atomic_update, ++ .atomic_disable = vc4_primary_plane_atomic_disable, ++}; ++ ++static const struct drm_plane_helper_funcs vc4_cursor_plane_helper_funcs = { ++ .prepare_fb = NULL, ++ .cleanup_fb = NULL, ++ .atomic_check = vc4_plane_atomic_check, ++ .atomic_update = vc4_cursor_plane_atomic_update, ++ .atomic_disable = vc4_cursor_plane_atomic_disable, ++}; ++ ++static struct drm_plane *vc4_fkms_plane_init(struct drm_device *dev, ++ enum drm_plane_type type) ++{ ++ struct drm_plane *plane = NULL; ++ struct vc4_fkms_plane *vc4_plane; ++ u32 xrgb8888 = DRM_FORMAT_XRGB8888; ++ u32 argb8888 = DRM_FORMAT_ARGB8888; ++ int ret = 0; ++ bool primary = (type == DRM_PLANE_TYPE_PRIMARY); ++ ++ vc4_plane = devm_kzalloc(dev->dev, sizeof(*vc4_plane), ++ GFP_KERNEL); ++ if (!vc4_plane) { ++ ret = -ENOMEM; ++ goto fail; ++ } ++ ++ plane = &vc4_plane->base; ++ ret = drm_universal_plane_init(dev, plane, 0xff, ++ &vc4_plane_funcs, ++ primary ? &xrgb8888 : &argb8888, 1, ++ type, NULL); ++ ++ if (type == DRM_PLANE_TYPE_PRIMARY) { ++ vc4_plane->fbinfo = ++ dma_alloc_coherent(dev->dev, ++ sizeof(*vc4_plane->fbinfo), ++ &vc4_plane->fbinfo_bus_addr, ++ GFP_KERNEL); ++ memset(vc4_plane->fbinfo, 0, sizeof(*vc4_plane->fbinfo)); ++ ++ drm_plane_helper_add(plane, &vc4_primary_plane_helper_funcs); ++ } else { ++ drm_plane_helper_add(plane, &vc4_cursor_plane_helper_funcs); ++ } ++ ++ return plane; ++fail: ++ if (plane) ++ vc4_plane_destroy(plane); ++ ++ return ERR_PTR(ret); ++} ++ ++static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) ++{ ++ /* Everyting is handled in the planes. */ ++} ++ ++static void vc4_crtc_disable(struct drm_crtc *crtc) ++{ ++} ++ ++static void vc4_crtc_enable(struct drm_crtc *crtc) ++{ ++} ++ ++static int vc4_crtc_atomic_check(struct drm_crtc *crtc, ++ struct drm_crtc_state *state) ++{ ++ return 0; ++} ++ ++static void vc4_crtc_atomic_flush(struct drm_crtc *crtc, ++ struct drm_crtc_state *old_state) ++{ ++} ++ ++static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) ++{ ++ struct drm_crtc *crtc = &vc4_crtc->base; ++ struct drm_device *dev = crtc->dev; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&dev->event_lock, flags); ++ if (vc4_crtc->event) { ++ drm_crtc_send_vblank_event(crtc, vc4_crtc->event); ++ vc4_crtc->event = NULL; ++ drm_crtc_vblank_put(crtc); ++ } ++ spin_unlock_irqrestore(&dev->event_lock, flags); ++} ++ ++static irqreturn_t vc4_crtc_irq_handler(int irq, void *data) ++{ ++ struct vc4_crtc *vc4_crtc = data; ++ u32 stat = readl(vc4_crtc->regs + SMICS); ++ irqreturn_t ret = IRQ_NONE; ++ ++ if (stat & SMICS_INTERRUPTS) { ++ writel(0, vc4_crtc->regs + SMICS); ++ drm_crtc_handle_vblank(&vc4_crtc->base); ++ vc4_crtc_handle_page_flip(vc4_crtc); ++ ret = IRQ_HANDLED; ++ } ++ ++ return ret; ++} ++ ++static int vc4_page_flip(struct drm_crtc *crtc, ++ struct drm_framebuffer *fb, ++ struct drm_pending_vblank_event *event, ++ uint32_t flags) ++{ ++ if (flags & DRM_MODE_PAGE_FLIP_ASYNC) { ++ DRM_ERROR("Async flips aren't allowed\n"); ++ return -EINVAL; ++ } ++ ++ return drm_atomic_helper_page_flip(crtc, fb, event, flags); ++} ++ ++static const struct drm_crtc_funcs vc4_crtc_funcs = { ++ .set_config = drm_atomic_helper_set_config, ++ .destroy = drm_crtc_cleanup, ++ .page_flip = vc4_page_flip, ++ .set_property = NULL, ++ .cursor_set = NULL, /* handled by drm_mode_cursor_universal */ ++ .cursor_move = NULL, /* handled by drm_mode_cursor_universal */ ++ .reset = drm_atomic_helper_crtc_reset, ++ .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, ++}; ++ ++static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { ++ .mode_set_nofb = vc4_crtc_mode_set_nofb, ++ .disable = vc4_crtc_disable, ++ .enable = vc4_crtc_enable, ++ .atomic_check = vc4_crtc_atomic_check, ++ .atomic_flush = vc4_crtc_atomic_flush, ++}; ++ ++/* Frees the page flip event when the DRM device is closed with the ++ * event still outstanding. ++ */ ++void vc4_fkms_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file) ++{ ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ struct drm_device *dev = crtc->dev; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&dev->event_lock, flags); ++ ++ if (vc4_crtc->event && vc4_crtc->event->base.file_priv == file) { ++ kfree(&vc4_crtc->event->base); ++ drm_crtc_vblank_put(crtc); ++ vc4_crtc->event = NULL; ++ } ++ ++ spin_unlock_irqrestore(&dev->event_lock, flags); ++} ++ ++static const struct of_device_id vc4_firmware_kms_dt_match[] = { ++ { .compatible = "raspberrypi,rpi-firmware-kms" }, ++ {} ++}; ++ ++static enum drm_connector_status ++vc4_fkms_connector_detect(struct drm_connector *connector, bool force) ++{ ++ return connector_status_connected; ++} ++ ++static int vc4_fkms_connector_get_modes(struct drm_connector *connector) ++{ ++ struct drm_device *dev = connector->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ u32 wh[2] = {0, 0}; ++ int ret; ++ struct drm_display_mode *mode; ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT, ++ &wh, sizeof(wh)); ++ if (ret) { ++ DRM_ERROR("Failed to get screen size: %d (0x%08x 0x%08x)\n", ++ ret, wh[0], wh[1]); ++ return 0; ++ } ++ ++ mode = drm_cvt_mode(dev, wh[0], wh[1], 60 /* vrefresh */, ++ 0, 0, false); ++ drm_mode_probed_add(connector, mode); ++ ++ return 1; ++} ++ ++static struct drm_encoder * ++vc4_fkms_connector_best_encoder(struct drm_connector *connector) ++{ ++ struct vc4_fkms_connector *fkms_connector = ++ to_vc4_fkms_connector(connector); ++ return fkms_connector->encoder; ++} ++ ++static void vc4_fkms_connector_destroy(struct drm_connector *connector) ++{ ++ drm_connector_unregister(connector); ++ drm_connector_cleanup(connector); ++} ++ ++static const struct drm_connector_funcs vc4_fkms_connector_funcs = { ++ .dpms = drm_atomic_helper_connector_dpms, ++ .detect = vc4_fkms_connector_detect, ++ .fill_modes = drm_helper_probe_single_connector_modes, ++ .destroy = vc4_fkms_connector_destroy, ++ .reset = drm_atomic_helper_connector_reset, ++ .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, ++}; ++ ++static const struct drm_connector_helper_funcs vc4_fkms_connector_helper_funcs = { ++ .get_modes = vc4_fkms_connector_get_modes, ++ .best_encoder = vc4_fkms_connector_best_encoder, ++}; ++ ++static struct drm_connector *vc4_fkms_connector_init(struct drm_device *dev, ++ struct drm_encoder *encoder) ++{ ++ struct drm_connector *connector = NULL; ++ struct vc4_fkms_connector *fkms_connector; ++ int ret = 0; ++ ++ fkms_connector = devm_kzalloc(dev->dev, sizeof(*fkms_connector), ++ GFP_KERNEL); ++ if (!fkms_connector) { ++ ret = -ENOMEM; ++ goto fail; ++ } ++ connector = &fkms_connector->base; ++ ++ fkms_connector->encoder = encoder; ++ ++ drm_connector_init(dev, connector, &vc4_fkms_connector_funcs, ++ DRM_MODE_CONNECTOR_HDMIA); ++ drm_connector_helper_add(connector, &vc4_fkms_connector_helper_funcs); ++ ++ connector->polled = (DRM_CONNECTOR_POLL_CONNECT | ++ DRM_CONNECTOR_POLL_DISCONNECT); ++ ++ connector->interlace_allowed = 0; ++ connector->doublescan_allowed = 0; ++ ++ drm_mode_connector_attach_encoder(connector, encoder); ++ ++ return connector; ++ ++ fail: ++ if (connector) ++ vc4_fkms_connector_destroy(connector); ++ ++ return ERR_PTR(ret); ++} ++ ++static void vc4_fkms_encoder_destroy(struct drm_encoder *encoder) ++{ ++ drm_encoder_cleanup(encoder); ++} ++ ++static const struct drm_encoder_funcs vc4_fkms_encoder_funcs = { ++ .destroy = vc4_fkms_encoder_destroy, ++}; ++ ++static void vc4_fkms_encoder_enable(struct drm_encoder *encoder) ++{ ++} ++ ++static void vc4_fkms_encoder_disable(struct drm_encoder *encoder) ++{ ++} ++ ++static const struct drm_encoder_helper_funcs vc4_fkms_encoder_helper_funcs = { ++ .enable = vc4_fkms_encoder_enable, ++ .disable = vc4_fkms_encoder_disable, ++}; ++ ++static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct drm_device *drm = dev_get_drvdata(master); ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_crtc *vc4_crtc; ++ struct vc4_fkms_encoder *vc4_encoder; ++ struct drm_crtc *crtc; ++ struct drm_plane *primary_plane, *cursor_plane, *destroy_plane, *temp; ++ struct device_node *firmware_node; ++ int ret; ++ ++ vc4->firmware_kms = true; ++ ++ vc4_crtc = devm_kzalloc(dev, sizeof(*vc4_crtc), GFP_KERNEL); ++ if (!vc4_crtc) ++ return -ENOMEM; ++ crtc = &vc4_crtc->base; ++ ++ firmware_node = of_parse_phandle(dev->of_node, "brcm,firmware", 0); ++ vc4->firmware = rpi_firmware_get(firmware_node); ++ if (!vc4->firmware) { ++ DRM_DEBUG("Failed to get Raspberry Pi firmware reference.\n"); ++ return -EPROBE_DEFER; ++ } ++ of_node_put(firmware_node); ++ ++ /* Map the SMI interrupt reg */ ++ vc4_crtc->regs = vc4_ioremap_regs(pdev, 0); ++ if (IS_ERR(vc4_crtc->regs)) ++ return PTR_ERR(vc4_crtc->regs); ++ ++ /* For now, we create just the primary and the legacy cursor ++ * planes. We should be able to stack more planes on easily, ++ * but to do that we would need to compute the bandwidth ++ * requirement of the plane configuration, and reject ones ++ * that will take too much. ++ */ ++ primary_plane = vc4_fkms_plane_init(drm, DRM_PLANE_TYPE_PRIMARY); ++ if (IS_ERR(primary_plane)) { ++ dev_err(dev, "failed to construct primary plane\n"); ++ ret = PTR_ERR(primary_plane); ++ goto err; ++ } ++ ++ cursor_plane = vc4_fkms_plane_init(drm, DRM_PLANE_TYPE_CURSOR); ++ if (IS_ERR(cursor_plane)) { ++ dev_err(dev, "failed to construct cursor plane\n"); ++ ret = PTR_ERR(cursor_plane); ++ goto err; ++ } ++ ++ drm_crtc_init_with_planes(drm, crtc, primary_plane, cursor_plane, ++ &vc4_crtc_funcs, NULL); ++ drm_crtc_helper_add(crtc, &vc4_crtc_helper_funcs); ++ primary_plane->crtc = crtc; ++ cursor_plane->crtc = crtc; ++ vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; ++ ++ vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL); ++ if (!vc4_encoder) ++ return -ENOMEM; ++ vc4_crtc->encoder = &vc4_encoder->base; ++ vc4_encoder->base.possible_crtcs |= drm_crtc_mask(crtc) ; ++ drm_encoder_init(drm, &vc4_encoder->base, &vc4_fkms_encoder_funcs, ++ DRM_MODE_ENCODER_TMDS, NULL); ++ drm_encoder_helper_add(&vc4_encoder->base, ++ &vc4_fkms_encoder_helper_funcs); ++ ++ vc4_crtc->connector = vc4_fkms_connector_init(drm, &vc4_encoder->base); ++ if (IS_ERR(vc4_crtc->connector)) { ++ ret = PTR_ERR(vc4_crtc->connector); ++ goto err_destroy_encoder; ++ } ++ ++ writel(0, vc4_crtc->regs + SMICS); ++ ret = devm_request_irq(dev, platform_get_irq(pdev, 0), ++ vc4_crtc_irq_handler, 0, "vc4 firmware kms", ++ vc4_crtc); ++ if (ret) ++ goto err_destroy_connector; ++ ++ platform_set_drvdata(pdev, vc4_crtc); ++ ++ return 0; ++ ++err_destroy_connector: ++ vc4_fkms_connector_destroy(vc4_crtc->connector); ++err_destroy_encoder: ++ vc4_fkms_encoder_destroy(vc4_crtc->encoder); ++ list_for_each_entry_safe(destroy_plane, temp, ++ &drm->mode_config.plane_list, head) { ++ if (destroy_plane->possible_crtcs == 1 << drm_crtc_index(crtc)) ++ destroy_plane->funcs->destroy(destroy_plane); ++ } ++err: ++ return ret; ++} ++ ++static void vc4_fkms_unbind(struct device *dev, struct device *master, ++ void *data) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct vc4_crtc *vc4_crtc = dev_get_drvdata(dev); ++ ++ vc4_fkms_connector_destroy(vc4_crtc->connector); ++ vc4_fkms_encoder_destroy(vc4_crtc->encoder); ++ drm_crtc_cleanup(&vc4_crtc->base); ++ ++ platform_set_drvdata(pdev, NULL); ++} ++ ++static const struct component_ops vc4_fkms_ops = { ++ .bind = vc4_fkms_bind, ++ .unbind = vc4_fkms_unbind, ++}; ++ ++static int vc4_fkms_probe(struct platform_device *pdev) ++{ ++ return component_add(&pdev->dev, &vc4_fkms_ops); ++} ++ ++static int vc4_fkms_remove(struct platform_device *pdev) ++{ ++ component_del(&pdev->dev, &vc4_fkms_ops); ++ return 0; ++} ++ ++struct platform_driver vc4_firmware_kms_driver = { ++ .probe = vc4_fkms_probe, ++ .remove = vc4_fkms_remove, ++ .driver = { ++ .name = "vc4_firmware_kms", ++ .of_match_table = vc4_firmware_kms_dt_match, ++ }, ++}; + +From 1e7e72efacf0401c04fe4295b8c615350a41d6d0 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Wed, 10 Aug 2016 18:52:34 +0200 +Subject: [PATCH 197/208] drm/fb-helper: Add a dummy + remove_conflicting_framebuffers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Lots of drivers don't properly compile without this when CONFIG_FB=n. +It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when +it's disabled I think it makes sense to add it to drm_fb_helper.h. + +Long term we probably need to rethink all the logic to unload firmware +framebuffer drivers, at least if we want to be able to move away from +CONFIG_FB and fbcon. + +v2: Unfortunately just stubbing out remove_conflicting_framebuffers in +drm_fb_helper.h upset gcc about static vs. non-static declarations, so +a new wrapper it needs to be. Means more churn :( + +Cc: Tobias Jakobi +Cc: Noralf Trønnes +Cc: tomi.valkeinen@ti.com +Cc: dh.herrmann@gmail.com +Reviewed-by: Alex Deucher +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-2-git-send-email-daniel.vetter@ffwll.ch +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- + drivers/gpu/drm/bochs/bochs_drv.c | 3 ++- + drivers/gpu/drm/cirrus/cirrus_drv.c | 2 +- + drivers/gpu/drm/i915/i915_drv.c | 2 +- + drivers/gpu/drm/mgag200/mgag200_drv.c | 2 +- + drivers/gpu/drm/mgag200/mgag200_main.c | 2 +- + drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- + drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- + drivers/gpu/drm/sun4i/sun4i_drv.c | 3 ++- + drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 3 ++- + include/drm/drm_fb_helper.h | 14 ++++++++++++++ + 11 files changed, 28 insertions(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +index 414a1600da54b5a108638d86246429d5796562db..6e37e8b7c0f2fc67ecb7e3b98515217d17808e22 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -341,7 +341,7 @@ static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c +index abace82de6eac2de22b747ff54a5612443f69647..277654abe0f79e768c525380623dc1896749b4cb 100644 +--- a/drivers/gpu/drm/bochs/bochs_drv.c ++++ b/drivers/gpu/drm/bochs/bochs_drv.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "bochs.h" + +@@ -153,7 +154,7 @@ static int bochs_kick_out_firmware_fb(struct pci_dev *pdev) + + ap->ranges[0].base = pci_resource_start(pdev, 0); + ap->ranges[0].size = pci_resource_len(pdev, 0); +- remove_conflicting_framebuffers(ap, "bochsdrmfb", false); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c +index b05f7eae32ce756e39f656adcbadc2ddfb55893c..6c76d125995bef3f20b566292aeeb7ad9122c86d 100644 +--- a/drivers/gpu/drm/cirrus/cirrus_drv.c ++++ b/drivers/gpu/drm/cirrus/cirrus_drv.c +@@ -57,7 +57,7 @@ static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c +index d46fa2206722855856920de5e6d3817fe75679ab..71d8859aa32d424f86d63f4df5e4b5240d6e0906 100644 +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -706,7 +706,7 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv) + primary = + pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + +- ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary); ++ ret = drm_fb_helper_remove_conflicting_framebuffers(ap, "inteldrmfb", primary); + + kfree(ap); + +diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c +index 2b4b125eebc3ef9e5987d3bcc32d429f5b15ff8e..1443b3a34775cbcaca50532482cfa32fd3052671 100644 +--- a/drivers/gpu/drm/mgag200/mgag200_drv.c ++++ b/drivers/gpu/drm/mgag200/mgag200_drv.c +@@ -56,7 +56,7 @@ static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "mgag200drmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary); + kfree(ap); + } + +diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c +index 13798b3e6bebbf0b8a62b39c60b9494659d5264d..e79cbc25ae3c54048b21c6293ea340b91b0750fc 100644 +--- a/drivers/gpu/drm/mgag200/mgag200_main.c ++++ b/drivers/gpu/drm/mgag200/mgag200_main.c +@@ -135,7 +135,7 @@ static int mga_vram_init(struct mga_device *mdev) + aper->ranges[0].base = mdev->mc.vram_base; + aper->ranges[0].size = mdev->mc.vram_window; + +- remove_conflicting_framebuffers(aper, "mgafb", true); ++ drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true); + kfree(aper); + + if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window, +diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c +index 66c1280c0f1f2854aa501f810c50a11e6149eaaa..652ab111dd74d899cc9aac867e05791e0a64229f 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_drm.c ++++ b/drivers/gpu/drm/nouveau/nouveau_drm.c +@@ -351,7 +351,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev, + boot = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif + if (nouveau_modeset != 2) +- remove_conflicting_framebuffers(aper, "nouveaufb", boot); ++ drm_fb_helper_remove_conflicting_framebuffers(aper, "nouveaufb", boot); + kfree(aper); + + ret = nvkm_device_pci_new(pdev, nouveau_config, nouveau_debug, +diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c +index c01a7c6abb491c4227ad02fd6525813a7a9d3d55..90f2ff217b3123e70ed17b6d0ed34c17eadd527e 100644 +--- a/drivers/gpu/drm/radeon/radeon_drv.c ++++ b/drivers/gpu/drm/radeon/radeon_drv.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + + #include "drm_crtc_helper.h" + #include "radeon_kfd.h" +@@ -324,7 +325,7 @@ static int radeon_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "radeondrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c +index 7092daaf6c432b8fa8d2bb93bda63785cf307f01..8913c151b37f475acdbee1f41074188c4430a00d 100644 +--- a/drivers/gpu/drm/sun4i/sun4i_drv.c ++++ b/drivers/gpu/drm/sun4i/sun4i_drv.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include "sun4i_crtc.h" + #include "sun4i_drv.h" +@@ -109,7 +110,7 @@ static void sun4i_remove_framebuffers(void) + ap->ranges[0].base = 0; + ap->ranges[0].size = ~0; + +- remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false); + kfree(ap); + } + +diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c +index 88a39165edd50705d561ca8c5d23df2ac628f9a1..cf142737a1667227240c9c88d0c6864df39003de 100644 +--- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c ++++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c +@@ -24,6 +24,7 @@ + */ + + #include ++#include + + #include "virtgpu_drv.h" + +@@ -52,7 +53,7 @@ static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev) + primary = pci_dev->resource[PCI_ROM_RESOURCE].flags + & IORESOURCE_ROM_SHADOW; + +- remove_conflicting_framebuffers(ap, "virtiodrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary); + + kfree(ap); + } +diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h +index db8d4780eaa27607baf7857111c72b50bbae5fd4..130c324f1aeeddd25c996a766baaf3d8e26ac110 100644 +--- a/include/drm/drm_fb_helper.h ++++ b/include/drm/drm_fb_helper.h +@@ -32,6 +32,7 @@ + + struct drm_fb_helper; + ++#include + #include + + enum mode_set_atomic { +@@ -282,6 +283,12 @@ drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn, + int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector); + int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, + struct drm_connector *connector); ++static inline int ++drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, ++ const char *name, bool primary) ++{ ++ return remove_conflicting_framebuffers(a, name, primary); ++} + #else + static inline int drm_fb_helper_modinit(void) + { +@@ -475,5 +482,12 @@ drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, + { + return 0; + } ++ ++static inline int ++drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, ++ const char *name, bool primary) ++{ ++ return 0; ++} + #endif + #endif + +From c5b9aa24bc98cb757a296d6d26cd27a1728a48cd Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 08:52:26 +0100 +Subject: [PATCH 198/208] BCM270X: Add an overlay for enabling the vc4 driver + in firmware-KMS mode. + +This gets us normal 3D support on top of the existing firmware display +stack. There's no real modesetting support, no async pageflips +(hurting performance), etc., but it means that the desktop can at +least run until we get full native modesetting. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm270x.dtsi | 11 +++ + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 11 +++ + .../arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts | 89 ++++++++++++++++++++++ + 4 files changed, 112 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts + +diff --git a/arch/arm/boot/dts/bcm270x.dtsi b/arch/arm/boot/dts/bcm270x.dtsi +index 514b481d4f4095dc8b55a216ac7335934973e145..a46cb4a8b1419edd95e0e07c18b0f373222dc2bf 100644 +--- a/arch/arm/boot/dts/bcm270x.dtsi ++++ b/arch/arm/boot/dts/bcm270x.dtsi +@@ -1,4 +1,5 @@ + /* Downstream bcm283x.dtsi diff */ ++#include "dt-bindings/power/raspberrypi-power.h" + + / { + chosen { +@@ -88,6 +89,15 @@ + status = "disabled"; + }; + ++ firmwarekms: firmwarekms@7e600000 { ++ compatible = "raspberrypi,rpi-firmware-kms"; ++ /* SMI interrupt reg */ ++ reg = <0x7e600000 0x100>; ++ interrupts = <2 16>; ++ brcm,firmware = <&firmware>; ++ status = "disabled"; ++ }; ++ + smi: smi@7e600000 { + compatible = "brcm,bcm2835-smi"; + reg = <0x7e600000 0x100>; +@@ -119,6 +129,7 @@ + + v3d@7ec00000 { /* vd3 */ + compatible = "brcm,vc4-v3d"; ++ power-domains = <&power RPI_POWER_DOMAIN_V3D>; + status = "disabled"; + }; + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index a3ddb4577ce1f671f4c23ebe32c434c97b00781c..7624812d0cdc74728f3556159871c7a299f9f6b7 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -90,6 +90,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + spi2-3cs.dtbo \ + tinylcd35.dtbo \ + uart1.dtbo \ ++ vc4-fkms-v3d.dtbo \ + vc4-kms-v3d.dtbo \ + vga666.dtbo \ + w1-gpio.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 496e31db0c7d22934bd381aea5e7227c26a3f034..c0290531a61fedfe23e820ca4d9693a0acd3e876 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1276,6 +1276,17 @@ 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) + + ++Name: vc4-fkms-v3d ++Info: Enable Eric Anholt's DRM VC4 V3D driver on top of the dispmanx ++ display stack. ++Load: dtoverlay=vc4-fkms-v3d, ++Params: cma-256 CMA is 256MB, 256MB-aligned (needs 1GB) ++ cma-192 CMA is 192MB, 256MB-aligned (needs 1GB) ++ cma-128 CMA is 128MB, 128MB-aligned ++ cma-96 CMA is 96MB, 128MB-aligned ++ cma-64 CMA is 64MB, 64MB-aligned ++ ++ + Name: vc4-kms-v3d + Info: Enable Eric Anholt's DRM VC4 HDMI/HVS/V3D driver. Running startx or + booting to GUI while this overlay is in use will cause interesting +diff --git a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..95a595a35cb4fbb707bf4b18161f6a46860aa4ae +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +@@ -0,0 +1,89 @@ ++/* ++ * vc4-fkms-v3d-overlay.dts ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target-path = "/chosen"; ++ __overlay__ { ++ bootargs = "cma=256M@256M"; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=192M@256M"; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=128M@128M"; ++ }; ++ }; ++ ++ fragment@3 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=96M@128M"; ++ }; ++ }; ++ ++ fragment@4 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=64M@64M"; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&fb>; ++ __overlay__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&firmwarekms>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@7 { ++ target = <&v3d>; ++ __overlay__ { ++ interrupts = <1 10>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@8 { ++ target = <&gpu>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@9 { ++ target-path = "/soc/dma"; ++ __overlay__ { ++ brcm,dma-channel-mask = <0x7f35>; ++ }; ++ }; ++ ++ __overrides__ { ++ cma-256 = <0>,"+0-1-2-3-4"; ++ cma-192 = <0>,"-0+1-2-3-4"; ++ cma-128 = <0>,"-0-1+2-3-4"; ++ cma-96 = <0>,"-0-1-2+3-4"; ++ cma-64 = <0>,"-0-1-2-3+4"; ++ }; ++}; + +From 23f34d57b322879bdba8291a9b41818fc9001d53 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Thu, 13 Oct 2016 11:54:31 +0300 +Subject: [PATCH 199/208] drm/vc4: Fix a couple error codes in + vc4_cl_lookup_bos() + +If the allocation fails the current code returns success. If +copy_from_user() fails it returns the number of bytes remaining instead +of -EFAULT. + +Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") +Signed-off-by: Dan Carpenter +Reviewed-by: Eric Anholt +(cherry picked from commit b2cdeb19f16ad984eb5bb9193f793d05a8101511) +--- + drivers/gpu/drm/vc4/vc4_gem.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index 47a095f392f8a7b5443227933c78b500a4c7137f..303f23c962206836d8c95786ad835d7625e10ee8 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -544,14 +544,15 @@ vc4_cl_lookup_bos(struct drm_device *dev, + + handles = drm_malloc_ab(exec->bo_count, sizeof(uint32_t)); + if (!handles) { ++ ret = -ENOMEM; + DRM_ERROR("Failed to allocate incoming GEM handles\n"); + goto fail; + } + +- ret = copy_from_user(handles, +- (void __user *)(uintptr_t)args->bo_handles, +- exec->bo_count * sizeof(uint32_t)); +- if (ret) { ++ if (copy_from_user(handles, ++ (void __user *)(uintptr_t)args->bo_handles, ++ exec->bo_count * sizeof(uint32_t))) { ++ ret = -EFAULT; + DRM_ERROR("Failed to copy in GEM handles\n"); + goto fail; + } + +From 46096f860ad1bbc61716e6b83b08c8e469da213b Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 20 Oct 2016 16:48:12 -0700 +Subject: [PATCH 200/208] drm/vc4: Fix termination of the initial scan for + branch targets. + +The loop is scanning until the original max_ip (size of the BO), but +we want to not examine any code after the PROG_END's delay slots. +There was a block trying to do that, except that we had some early +continue statements if the signal wasn't a PROG_END or a BRANCH. + +The failure mode would be that a valid shader is rejected because some +undefined memory after the PROG_END slots is parsed as a branch and +the rest of its setup is illegal. I haven't seen this in the wild, +but valgrind was complaining when about this up in the userland +simulator mode. + +Signed-off-by: Eric Anholt +(cherry picked from commit 457e67a728696c4f8e6423c64e93def50530db9a) +--- + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +index 2543cf5b8b51869d51b72a5db5017dded38761be..917321ce832ffda9d3e8ca20d987437eea9a1765 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -608,9 +608,7 @@ static bool + vc4_validate_branches(struct vc4_shader_validation_state *validation_state) + { + uint32_t max_branch_target = 0; +- bool found_shader_end = false; + int ip; +- int shader_end_ip = 0; + int last_branch = -2; + + for (ip = 0; ip < validation_state->max_ip; ip++) { +@@ -621,8 +619,13 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) + uint32_t branch_target_ip; + + if (sig == QPU_SIG_PROG_END) { +- shader_end_ip = ip; +- found_shader_end = true; ++ /* There are two delay slots after program end is ++ * signaled that are still executed, then we're ++ * finished. validation_state->max_ip is the ++ * instruction after the last valid instruction in the ++ * program. ++ */ ++ validation_state->max_ip = ip + 3; + continue; + } + +@@ -676,15 +679,9 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) + } + set_bit(after_delay_ip, validation_state->branch_targets); + max_branch_target = max(max_branch_target, after_delay_ip); +- +- /* There are two delay slots after program end is signaled +- * that are still executed, then we're finished. +- */ +- if (found_shader_end && ip == shader_end_ip + 2) +- break; + } + +- if (max_branch_target > shader_end_ip) { ++ if (max_branch_target > validation_state->max_ip - 3) { + DRM_ERROR("Branch landed after QPU_SIG_PROG_END"); + return false; + } + +From 1d26463c7b768495482c7883e08685ade635c9c2 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 3 Nov 2016 18:53:10 -0700 +Subject: [PATCH 201/208] drm/vc4: Add support for rendering with ETC1 + textures. + +The validation for it ends up being quite simple, but I hadn't got +around to it before merging the driver. For backwards compatibility, +we also need to add a flag so that the userspace GL driver can easily +tell if the kernel will allow ETC1 textures (on an old kernel, it will +continue to convert to RGBA8) + +Signed-off-by: Eric Anholt +(cherry picked from commit 7154d76fedf549607afbc0d13db9aaf02da5cebf) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_validate.c | 7 +++++++ + include/uapi/drm/vc4_drm.h | 1 + + 3 files changed, 9 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 6c4a4fbc86d0a30a6977b2081bca4372e693b817..157e08ab27771854ffbad101f61ce81e27001e1a 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -78,6 +78,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + pm_runtime_put(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_SUPPORTS_BRANCHES: ++ case DRM_VC4_PARAM_SUPPORTS_ETC1: + args->value = true; + break; + default: +diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c +index 26503e307438a34fe526222c8c15be158eb332a2..e18f88203d32f828b7256a05c653586c14095ef3 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate.c ++++ b/drivers/gpu/drm/vc4/vc4_validate.c +@@ -644,6 +644,13 @@ reloc_tex(struct vc4_exec_info *exec, + cpp = 1; + break; + case VC4_TEXTURE_TYPE_ETC1: ++ /* ETC1 is arranged as 64-bit blocks, where each block is 4x4 ++ * pixels. ++ */ ++ cpp = 8; ++ width = (width + 3) >> 2; ++ height = (height + 3) >> 2; ++ break; + case VC4_TEXTURE_TYPE_BW1: + case VC4_TEXTURE_TYPE_A4: + case VC4_TEXTURE_TYPE_A1: +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index ad7edc3edf7ca1d653a0bc025a5eda6692b74370..69caa21f0cb23c9439238f6239c0041b178d5669 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -286,6 +286,7 @@ struct drm_vc4_get_hang_state { + #define DRM_VC4_PARAM_V3D_IDENT1 1 + #define DRM_VC4_PARAM_V3D_IDENT2 2 + #define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3 ++#define DRM_VC4_PARAM_SUPPORTS_ETC1 4 + + struct drm_vc4_get_param { + __u32 param; + +From 574fbee0c80641a4f2bcc24f30c8c14a54544d1d Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 4 Nov 2016 15:58:38 -0700 +Subject: [PATCH 202/208] drm/vc4: Use runtime autosuspend to avoid thrashing + V3D power state. + +The pm_runtime_put() we were using immediately released power on the +device, which meant that we were generally turning the device off and +on once per frame. In many profiles I've looked at, that added up to +about 1% of CPU time, but this could get worse in the case of frequent +rendering and readback (as may happen in X rendering). By keeping the +device on until we've been idle for a couple of frames, we drop the +overhead of runtime PM down to sub-.1%. + +Signed-off-by: Eric Anholt +(cherry picked from commit 3a62234680d86efa0239665ed8a0e908f1aef147) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 9 ++++++--- + drivers/gpu/drm/vc4/vc4_gem.c | 6 ++++-- + drivers/gpu/drm/vc4/vc4_v3d.c | 2 ++ + 3 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 157e08ab27771854ffbad101f61ce81e27001e1a..8302bd788be470fd61a7382b8c3ef16e26f6861d 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -61,21 +61,24 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + if (ret < 0) + return ret; + args->value = V3D_READ(V3D_IDENT0); +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_V3D_IDENT1: + ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); + if (ret < 0) + return ret; + args->value = V3D_READ(V3D_IDENT1); +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_V3D_IDENT2: + ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); + if (ret < 0) + return ret; + args->value = V3D_READ(V3D_IDENT2); +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_SUPPORTS_BRANCHES: + case DRM_VC4_PARAM_SUPPORTS_ETC1: +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index 303f23c962206836d8c95786ad835d7625e10ee8..db920771bfb5641c9d5d8e53a8f73cf7ee501bb7 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -709,8 +709,10 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + } + + mutex_lock(&vc4->power_lock); +- if (--vc4->power_refcount == 0) +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ if (--vc4->power_refcount == 0) { ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); ++ } + mutex_unlock(&vc4->power_lock); + + kfree(exec); +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index e6d3c6028341e447df293cab525713ac10d8ee5e..7cc346ad9b0baed63701d1fae8f0306aa7713129 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -222,6 +222,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + return ret; + } + ++ pm_runtime_use_autosuspend(dev); ++ pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ + pm_runtime_enable(dev); + + return 0; + +From d90a754daaeb289afe12b1991c3cf08fe9bb423d Mon Sep 17 00:00:00 2001 +From: Jonas Pfeil +Date: Tue, 8 Nov 2016 00:18:39 +0100 +Subject: [PATCH 203/208] drm/vc4: Add fragment shader threading support + +FS threading brings performance improvements of 0-20% in glmark2. + +The validation code checks for thread switch signals and ensures that +the registers of the other thread are not touched, and that our clamps +are not live across thread switches. It also checks that the +threading and branching instructions do not interfere. + +(Original patch by Jonas, changes by anholt for style cleanup, +removing validation the kernel doesn't need to do, and adding the flag +for userspace). + +v2: Minor style fixes from checkpatch. + +Signed-off-by: Jonas Pfeil +Signed-off-by: Eric Anholt +(cherry picked from commit c778cc5df944291dcdb1ca7a6bb781fbc22550c5) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_drv.h | 2 + + drivers/gpu/drm/vc4/vc4_validate.c | 17 +++++--- + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 63 ++++++++++++++++++++++++++++++ + include/uapi/drm/vc4_drm.h | 1 + + 5 files changed, 79 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 8302bd788be470fd61a7382b8c3ef16e26f6861d..3abaa0f85da194016c65f46509d4c64f8e2c8de2 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -82,6 +82,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + break; + case DRM_VC4_PARAM_SUPPORTS_BRANCHES: + case DRM_VC4_PARAM_SUPPORTS_ETC1: ++ case DRM_VC4_PARAM_SUPPORTS_THREADED_FS: + args->value = true; + break; + default: +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5..e15eb37ca6191e0eae3d4947751437d2646c996d 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -384,6 +384,8 @@ struct vc4_validated_shader_info { + + uint32_t num_uniform_addr_offsets; + uint32_t *uniform_addr_offsets; ++ ++ bool is_threaded; + }; + + /** +diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c +index e18f88203d32f828b7256a05c653586c14095ef3..9fd171c361c23b52a4d507919ec7e26fd1e87aac 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate.c ++++ b/drivers/gpu/drm/vc4/vc4_validate.c +@@ -789,11 +789,6 @@ validate_gl_shader_rec(struct drm_device *dev, + exec->shader_rec_v += roundup(packet_size, 16); + exec->shader_rec_size -= packet_size; + +- if (!(*(uint16_t *)pkt_u & VC4_SHADER_FLAG_FS_SINGLE_THREAD)) { +- DRM_ERROR("Multi-threaded fragment shaders not supported.\n"); +- return -EINVAL; +- } +- + for (i = 0; i < shader_reloc_count; i++) { + if (src_handles[i] > exec->bo_count) { + DRM_ERROR("Shader handle %d too big\n", src_handles[i]); +@@ -810,6 +805,18 @@ validate_gl_shader_rec(struct drm_device *dev, + return -EINVAL; + } + ++ if (((*(uint16_t *)pkt_u & VC4_SHADER_FLAG_FS_SINGLE_THREAD) == 0) != ++ to_vc4_bo(&bo[0]->base)->validated_shader->is_threaded) { ++ DRM_ERROR("Thread mode of CL and FS do not match\n"); ++ return -EINVAL; ++ } ++ ++ if (to_vc4_bo(&bo[1]->base)->validated_shader->is_threaded || ++ to_vc4_bo(&bo[2]->base)->validated_shader->is_threaded) { ++ DRM_ERROR("cs and vs cannot be threaded\n"); ++ return -EINVAL; ++ } ++ + for (i = 0; i < shader_reloc_count; i++) { + struct vc4_validated_shader_info *validated_shader; + uint32_t o = shader_reloc_offsets[i]; +diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +index 917321ce832ffda9d3e8ca20d987437eea9a1765..5dba13dd1e9b600b43a769d086d6eb428547ab66 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -83,6 +83,13 @@ struct vc4_shader_validation_state { + * basic blocks. + */ + bool needs_uniform_address_for_loop; ++ ++ /* Set when we find an instruction writing the top half of the ++ * register files. If we allowed writing the unusable regs in ++ * a threaded shader, then the other shader running on our ++ * QPU's clamp validation would be invalid. ++ */ ++ bool all_registers_used; + }; + + static uint32_t +@@ -119,6 +126,13 @@ raddr_add_a_to_live_reg_index(uint64_t inst) + } + + static bool ++live_reg_is_upper_half(uint32_t lri) ++{ ++ return (lri >= 16 && lri < 32) || ++ (lri >= 32 + 16 && lri < 32 + 32); ++} ++ ++static bool + is_tmu_submit(uint32_t waddr) + { + return (waddr == QPU_W_TMU0_S || +@@ -390,6 +404,9 @@ check_reg_write(struct vc4_validated_shader_info *validated_shader, + } else { + validation_state->live_immediates[lri] = ~0; + } ++ ++ if (live_reg_is_upper_half(lri)) ++ validation_state->all_registers_used = true; + } + + switch (waddr) { +@@ -598,6 +615,11 @@ check_instruction_reads(struct vc4_validated_shader_info *validated_shader, + } + } + ++ if ((raddr_a >= 16 && raddr_a < 32) || ++ (raddr_b >= 16 && raddr_b < 32 && sig != QPU_SIG_SMALL_IMM)) { ++ validation_state->all_registers_used = true; ++ } ++ + return true; + } + +@@ -753,6 +775,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + { + bool found_shader_end = false; + int shader_end_ip = 0; ++ uint32_t last_thread_switch_ip = -3; + uint32_t ip; + struct vc4_validated_shader_info *validated_shader = NULL; + struct vc4_shader_validation_state validation_state; +@@ -785,6 +808,17 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + if (!vc4_handle_branch_target(&validation_state)) + goto fail; + ++ if (ip == last_thread_switch_ip + 3) { ++ /* Reset r0-r3 live clamp data */ ++ int i; ++ ++ for (i = 64; i < LIVE_REG_COUNT; i++) { ++ validation_state.live_min_clamp_offsets[i] = ~0; ++ validation_state.live_max_clamp_regs[i] = false; ++ validation_state.live_immediates[i] = ~0; ++ } ++ } ++ + switch (sig) { + case QPU_SIG_NONE: + case QPU_SIG_WAIT_FOR_SCOREBOARD: +@@ -794,6 +828,8 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + case QPU_SIG_LOAD_TMU1: + case QPU_SIG_PROG_END: + case QPU_SIG_SMALL_IMM: ++ case QPU_SIG_THREAD_SWITCH: ++ case QPU_SIG_LAST_THREAD_SWITCH: + if (!check_instruction_writes(validated_shader, + &validation_state)) { + DRM_ERROR("Bad write at ip %d\n", ip); +@@ -809,6 +845,18 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + shader_end_ip = ip; + } + ++ if (sig == QPU_SIG_THREAD_SWITCH || ++ sig == QPU_SIG_LAST_THREAD_SWITCH) { ++ validated_shader->is_threaded = true; ++ ++ if (ip < last_thread_switch_ip + 3) { ++ DRM_ERROR("Thread switch too soon after " ++ "last switch at ip %d\n", ip); ++ goto fail; ++ } ++ last_thread_switch_ip = ip; ++ } ++ + break; + + case QPU_SIG_LOAD_IMM: +@@ -823,6 +871,13 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + if (!check_branch(inst, validated_shader, + &validation_state, ip)) + goto fail; ++ ++ if (ip < last_thread_switch_ip + 3) { ++ DRM_ERROR("Branch in thread switch at ip %d", ++ ip); ++ goto fail; ++ } ++ + break; + default: + DRM_ERROR("Unsupported QPU signal %d at " +@@ -844,6 +899,14 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + goto fail; + } + ++ /* Might corrupt other thread */ ++ if (validated_shader->is_threaded && ++ validation_state.all_registers_used) { ++ DRM_ERROR("Shader uses threading, but uses the upper " ++ "half of the registers, too\n"); ++ goto fail; ++ } ++ + /* If we did a backwards branch and we haven't emitted a uniforms + * reset since then, we still need the uniforms stream to have the + * uniforms address available so that the backwards branch can do its +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index 69caa21f0cb23c9439238f6239c0041b178d5669..f07a090167261131076438960c1dec175d7d376e 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -287,6 +287,7 @@ struct drm_vc4_get_hang_state { + #define DRM_VC4_PARAM_V3D_IDENT2 2 + #define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3 + #define DRM_VC4_PARAM_SUPPORTS_ETC1 4 ++#define DRM_VC4_PARAM_SUPPORTS_THREADED_FS 5 + + struct drm_vc4_get_param { + __u32 param; + +From 963f20f2caa0018ef7fbb756852fcd6226cde43a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 6 Dec 2016 18:54:24 +0000 +Subject: [PATCH 204/208] config: fixup + +--- + arch/arm/configs/bcm2709_defconfig | 3 ++- + arch/arm/configs/bcmrpi_defconfig | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 48ed6bfe263a6a3fab942d0b52b2f409055f23ad..6757f597213cb029ef5a7ded516848685b89fe4c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -44,7 +44,6 @@ CONFIG_SMP=y + CONFIG_VMSPLIT_2G=y + CONFIG_PREEMPT_VOLUNTARY=y + CONFIG_AEABI=y +-CONFIG_OABI_COMPAT=y + # CONFIG_CPU_SW_DOMAIN_PAN is not set + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y +@@ -58,6 +57,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0 + CONFIG_ZBOOT_ROM_BSS=0x0 + CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" + CONFIG_CPU_FREQ=y ++CONFIG_CPU_FREQ_STAT=y + CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y + CONFIG_CPU_FREQ_GOV_PERFORMANCE=y + CONFIG_CPU_FREQ_GOV_USERSPACE=y +@@ -1271,6 +1271,7 @@ CONFIG_BOOT_PRINTK_DELAY=y + CONFIG_DEBUG_MEMORY_INIT=y + CONFIG_DETECT_HUNG_TASK=y + CONFIG_TIMER_STATS=y ++CONFIG_LATENCYTOP=y + CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_STACK_TRACER=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index ff69cafd7fb706fc0069d59c37974c4ce5d50043..e683fe6eb803fefaee137f7e6da6cf346ddd5a14 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -43,7 +43,6 @@ CONFIG_ARCH_BCM2835=y + # CONFIG_CACHE_L2X0 is not set + CONFIG_PREEMPT_VOLUNTARY=y + CONFIG_AEABI=y +-CONFIG_OABI_COMPAT=y + # CONFIG_CPU_SW_DOMAIN_PAN is not set + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y +@@ -57,11 +56,13 @@ CONFIG_ZBOOT_ROM_TEXT=0x0 + CONFIG_ZBOOT_ROM_BSS=0x0 + CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" + CONFIG_CPU_FREQ=y ++CONFIG_CPU_FREQ_STAT=y + CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y + CONFIG_CPU_FREQ_GOV_PERFORMANCE=y + CONFIG_CPU_FREQ_GOV_USERSPACE=y + CONFIG_CPU_FREQ_GOV_ONDEMAND=y + CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y ++CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y + CONFIG_VFP=y + CONFIG_BINFMT_MISC=m + # CONFIG_SUSPEND is not set + +From d6a316e01480a79073f6baf8b89b5cfcb4900f25 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 5 Dec 2016 17:10:44 +0000 +Subject: [PATCH 205/208] BCM270X_DT: Add i2c-sensor overlay + +The i2c-sensor overlay is a container for various pressure and +temperature sensors, currently bmp085 and bmp280. The standalone +bmp085_i2c-sensor overlay is now deprecated. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 12 ++++++-- + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 34 +++++++++++++++++++++++ + 3 files changed, 45 insertions(+), 2 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 7624812d0cdc74728f3556159871c7a299f9f6b7..11dba31712840a9e4b91acd4565c2d6266315273 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -32,6 +32,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + i2c-mux.dtbo \ + i2c-pwm-pca9685a.dtbo \ + i2c-rtc.dtbo \ ++ i2c-sensor.dtbo \ + i2c0-bcm2708.dtbo \ + i2c1-bcm2708.dtbo \ + i2s-gpio28-31.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index c0290531a61fedfe23e820ca4d9693a0acd3e876..4ef35f4ac1622be08066dc74a80d907ae6c164b7 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -283,8 +283,7 @@ Params: swap_lr Reverse the channel allocation, which will also + + + Name: bmp085_i2c-sensor +-Info: Configures the BMP085/BMP180 digital barometric pressure and temperature +- sensors from Bosch Sensortec ++Info: This overlay is now deprecated - see i2c-sensor + Load: dtoverlay=bmp085_i2c-sensor + Params: + +@@ -542,6 +541,15 @@ Params: abx80x Select one of the ABx80x family: + source + + ++Name: i2c-sensor ++Info: Adds support for a number of I2C barometric pressure and temperature ++ sensors on i2c_arm ++Load: dtoverlay=i2c-sensor,= ++Params: bmp085 Select the Bosch sensortronic BMP085 ++ ++ bmp280 Select the Bosch sensortronic BMP280 ++ ++ + Name: i2c0-bcm2708 + Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations + are usable on all platforms. +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..f6d134c095af2398fc55ae7d2b0e86456c30627c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -0,0 +1,34 @@ ++// Definitions for a few digital barometric pressure and temperature sensors ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ bmp085: bmp085@77 { ++ compatible = "bosch,bmp085"; ++ reg = <0x77>; ++ default-oversampling = <3>; ++ status = "disable"; ++ }; ++ ++ bmp280: bmp280@76 { ++ compatible = "bosch,bmp280"; ++ reg = <0x76>; ++ status = "disable"; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ bmp085 = <&bmp085>,"status"; ++ bmp280 = <&bmp280>,"status"; ++ }; ++}; + +From 9265a25166962ef139810f8c1ca51366da98e6d1 Mon Sep 17 00:00:00 2001 +From: Georgii Staroselskii +Date: Wed, 7 Dec 2016 15:10:27 +0300 +Subject: [PATCH 206/208] BCM270X_DT: overlays/*-overlay.dtb -> overlays/*.dtbo + (#1752) + +We now create overlays as .dtbo files. +--- + arch/arm/boot/dts/overlays/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 4ef35f4ac1622be08066dc74a80d907ae6c164b7..81d991803be335e5a1bc3bb0a8c7a2c9f5c392bd 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -61,7 +61,7 @@ this becomes a line in config.txt: + + dtoverlay=lirc-rpi + +-This causes the file /boot/overlays/lirc-rpi-overlay.dtb to be loaded. By ++This causes the file /boot/overlays/lirc-rpi.dtbo to be loaded. By + default it will use GPIOs 17 (out) and 18 (in), but this can be modified using + DT parameters: + + +From 366621f36df68f06589b2813a8fd715cf8f898a7 Mon Sep 17 00:00:00 2001 +From: Ioan-Adrian Ratiu +Date: Tue, 27 Sep 2016 21:41:37 +0300 +Subject: [PATCH 207/208] Revert "HID: dragonrise: fix HID Descriptor for + 0x0006 PID" + +[ Upstream commit 1bcaa05ebee115213e34f1806cc6a4f7a6175a88 ] + +This reverts commit 18339f59c3a6 ("HID: dragonrise: fix HID...") because it +breaks certain dragonrise 0079:0006 gamepads. While it may fix a breakage +caused by commit 79346d620e9d ("HID: input: force generic axis to be mapped +to their user space axis"), it is probable that the manufacturer released +different hardware with the same PID so this fix works for only a subset +and breaks the other gamepads sharing the PID. + +What is needed is another more generic solution which fixes 79346d620e9d +("HID: input: force generic axis ...") breakage for this controller: we +need to add an exception for this driver to make it keep the old behaviour +previous to the initial breakage (this is done in patch 2 of this series). + +Signed-off-by: Ioan-Adrian Ratiu +Reviewed-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +--- + drivers/hid/hid-dr.c | 58 ---------------------------------------------------- + 1 file changed, 58 deletions(-) + +diff --git a/drivers/hid/hid-dr.c b/drivers/hid/hid-dr.c +index 8fd4bf77f264940ec04631252062e06aafe148c8..2523f8a4b7de9fb3152d1268ba7f79c24208c4c9 100644 +--- a/drivers/hid/hid-dr.c ++++ b/drivers/hid/hid-dr.c +@@ -234,58 +234,6 @@ static __u8 pid0011_rdesc_fixed[] = { + 0xC0 /* End Collection */ + }; + +-static __u8 pid0006_rdesc_fixed[] = { +- 0x05, 0x01, /* Usage Page (Generic Desktop) */ +- 0x09, 0x04, /* Usage (Joystick) */ +- 0xA1, 0x01, /* Collection (Application) */ +- 0xA1, 0x02, /* Collection (Logical) */ +- 0x75, 0x08, /* Report Size (8) */ +- 0x95, 0x05, /* Report Count (5) */ +- 0x15, 0x00, /* Logical Minimum (0) */ +- 0x26, 0xFF, 0x00, /* Logical Maximum (255) */ +- 0x35, 0x00, /* Physical Minimum (0) */ +- 0x46, 0xFF, 0x00, /* Physical Maximum (255) */ +- 0x09, 0x30, /* Usage (X) */ +- 0x09, 0x33, /* Usage (Ry) */ +- 0x09, 0x32, /* Usage (Z) */ +- 0x09, 0x31, /* Usage (Y) */ +- 0x09, 0x34, /* Usage (Ry) */ +- 0x81, 0x02, /* Input (Variable) */ +- 0x75, 0x04, /* Report Size (4) */ +- 0x95, 0x01, /* Report Count (1) */ +- 0x25, 0x07, /* Logical Maximum (7) */ +- 0x46, 0x3B, 0x01, /* Physical Maximum (315) */ +- 0x65, 0x14, /* Unit (Centimeter) */ +- 0x09, 0x39, /* Usage (Hat switch) */ +- 0x81, 0x42, /* Input (Variable) */ +- 0x65, 0x00, /* Unit (None) */ +- 0x75, 0x01, /* Report Size (1) */ +- 0x95, 0x0C, /* Report Count (12) */ +- 0x25, 0x01, /* Logical Maximum (1) */ +- 0x45, 0x01, /* Physical Maximum (1) */ +- 0x05, 0x09, /* Usage Page (Button) */ +- 0x19, 0x01, /* Usage Minimum (0x01) */ +- 0x29, 0x0C, /* Usage Maximum (0x0C) */ +- 0x81, 0x02, /* Input (Variable) */ +- 0x06, 0x00, 0xFF, /* Usage Page (Vendor Defined) */ +- 0x75, 0x01, /* Report Size (1) */ +- 0x95, 0x08, /* Report Count (8) */ +- 0x25, 0x01, /* Logical Maximum (1) */ +- 0x45, 0x01, /* Physical Maximum (1) */ +- 0x09, 0x01, /* Usage (0x01) */ +- 0x81, 0x02, /* Input (Variable) */ +- 0xC0, /* End Collection */ +- 0xA1, 0x02, /* Collection (Logical) */ +- 0x75, 0x08, /* Report Size (8) */ +- 0x95, 0x07, /* Report Count (7) */ +- 0x46, 0xFF, 0x00, /* Physical Maximum (255) */ +- 0x26, 0xFF, 0x00, /* Logical Maximum (255) */ +- 0x09, 0x02, /* Usage (0x02) */ +- 0x91, 0x02, /* Output (Variable) */ +- 0xC0, /* End Collection */ +- 0xC0 /* End Collection */ +-}; +- + static __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc, + unsigned int *rsize) + { +@@ -296,12 +244,6 @@ static __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc, + *rsize = sizeof(pid0011_rdesc_fixed); + } + break; +- case 0x0006: +- if (*rsize == sizeof(pid0006_rdesc_fixed)) { +- rdesc = pid0006_rdesc_fixed; +- *rsize = sizeof(pid0006_rdesc_fixed); +- } +- break; + } + return rdesc; + } + +From 822b0eb3dac2230ec04d71eeccea28b2528eb4a2 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 6 Dec 2016 17:05:39 +0000 +Subject: [PATCH 208/208] bcm2835-rng: Avoid initialising if already enabled + +Avoids the 0x40000 cycles of warmup again if firmware has already used it +--- + drivers/char/hw_random/bcm2835-rng.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c +index af2149273fe049b075d0953034cda0aab1525f23..e5b5222314b1677d989f7e7ea7085cacde8ff1b6 100644 +--- a/drivers/char/hw_random/bcm2835-rng.c ++++ b/drivers/char/hw_random/bcm2835-rng.c +@@ -101,9 +101,10 @@ static int bcm2835_rng_probe(struct platform_device *pdev) + rng_setup(rng_base); + + /* set warm-up count & enable */ +- __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); +- __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); +- ++ if (!(__raw_readl(rng_base + RNG_CTRL) & RNG_RBGEN)) { ++ __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); ++ __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); ++ } + /* register driver */ + err = hwrng_register(&bcm2835_rng_ops); + if (err) { diff --git a/projects/RPi2/patches/linux/linux-01-RPi_support.patch b/projects/RPi2/patches/linux/linux-01-RPi_support.patch index e54b6fceec..1c3a98131a 100644 --- a/projects/RPi2/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi2/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ -From ba70c1e58bd4e7d36807c6bd018b79574108e208 Mon Sep 17 00:00:00 2001 +From 7d5fc6dc9e80848e3fb1dc99bf93e3fc6251aed4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 27 Apr 2016 17:43:28 +0100 -Subject: [PATCH 001/180] Revert "SUNRPC: Make NFS swap work with multipath" +Subject: [PATCH 001/208] Revert "SUNRPC: Make NFS swap work with multipath" This reverts commit 15001e5a7e1e207b6bd258cd8f187814cd15b6dc. --- @@ -95,10 +95,10 @@ index 66f23b376fa04a91134eddf6d8ee22a2f5de5808..f55fe2b0137e8fbefcd20c336b28ad48 EXPORT_SYMBOL_GPL(rpc_clnt_swap_deactivate); #endif /* CONFIG_SUNRPC_SWAP */ -From b21e7f16fda448748167898da4ba0d8630640d66 Mon Sep 17 00:00:00 2001 +From a076f856510da92d7b277dd9ad19b624ce02a559 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 002/180] smsx95xx: fix crimes against truesize +Subject: [PATCH 002/208] 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. @@ -145,10 +145,10 @@ index dc989a8b5afbd62b07cd65a2fa5edde67d3cc5fb..116680e3089f16e1e3e9113a3b93e62c usbnet_skb_return(dev, ax_skb); } -From 160c699e74e4c4dc720283669b6ff1a8b12bebe4 Mon Sep 17 00:00:00 2001 +From 1a57f996e9d7b4b9698abf85d2665f32c03a2ded Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 003/180] smsc95xx: Disable turbo mode by default +Subject: [PATCH 003/208] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -168,10 +168,10 @@ index 116680e3089f16e1e3e9113a3b93e62cb78cc1bb..aa4cb43dcd9ba83b042332bc15a4dce6 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 094b0be6e6b0e226d4ac06d672f30a5abf47d628 Mon Sep 17 00:00:00 2001 +From e256c71277d74a1115d9bd9844fcfb5860fec9b2 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 004/180] add smsc95xx packetsize module_param +Subject: [PATCH 004/208] add smsc95xx packetsize module_param Signed-off-by: Sam Nazarko --- @@ -213,10 +213,10 @@ index aa4cb43dcd9ba83b042332bc15a4dce68affce28..889bdabd9dea6cebccc361aa4ac569d7 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From dc922f128eebb4749e16900480c5129e063cf0b9 Mon Sep 17 00:00:00 2001 +From 919b66093359eca7e24223ecbba9e788111c841f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 005/180] Allow mac address to be set in smsc95xx +Subject: [PATCH 005/208] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -312,10 +312,10 @@ index 889bdabd9dea6cebccc361aa4ac569d73681396b..d22a2324085fbf61fbd8920362bfc7b9 eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From 9d04dac9afb497550f040e511777017ec49a2bf1 Mon Sep 17 00:00:00 2001 +From 6885eab792b8feb8c2329f2981453074fae14527 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Aug 2016 22:19:28 +0100 -Subject: [PATCH 006/180] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 006/208] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -346,10 +346,10 @@ index d22a2324085fbf61fbd8920362bfc7b9f72bebe3..c846c55075387398d9bcb0957e31f5c8 MODULE_PARM_DESC(packetsize, "Override the RX URB packet size"); -From 3f3627f10377d5318c47e78ddbaeb9fed4b392c4 Mon Sep 17 00:00:00 2001 +From f0bec5372fdc974676a90c5828dc73ac8df18bb9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 9 Mar 2016 13:28:24 +0000 -Subject: [PATCH 007/180] serial: Take care starting a hung-up tty's port +Subject: [PATCH 007/208] serial: Take care starting a hung-up tty's port tty_port_hangup sets a port's tty field to NULL (holding the port lock), but uart_tx_stopped, called from __uart_start (with the port lock), @@ -377,10 +377,10 @@ index 2f44e20136545162d15ee9a39c2eae38352580d1..6b0518ce13ad210b888b73dd6c02a555 return 0; } -From 8fe93916b4de87d5b99ddfae0a69bcaa496a2dd0 Mon Sep 17 00:00:00 2001 +From 7a4314314fefb3d4288ba4a245f08abd83334c9d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 008/180] Protect __release_resource against resources without +Subject: [PATCH 008/208] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -408,10 +408,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From f19547ae65f0f38e394caf5a0071d43e070a4660 Mon Sep 17 00:00:00 2001 +From b67c49a019770ea73d250e046faabd79df373fa9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 009/180] mm: Remove the PFN busy warning +Subject: [PATCH 009/208] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -436,10 +436,10 @@ index 7401e996009afa14cb6c3834b62ce8780e6e958a..7f48cd9228cd1c7c4fb9451729f7826d goto done; } -From 197ee377bef4f57dd919356c3fbf8ee8da636fca Mon Sep 17 00:00:00 2001 +From 606896cbfc13f4e43c502c30e9d07acaa77f80c3 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 010/180] BCM2835_DT: Fix I2S register map +Subject: [PATCH 010/208] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -477,10 +477,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 4677de54affbd916557d1e60410b9fa9a4bb9aee Mon Sep 17 00:00:00 2001 +From 59ffae373ced5b44abaa948286cb2e1b69fe9cf3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 011/180] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 011/208] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -507,10 +507,10 @@ index d96b2c947e74e3edab3917551c64fbd1ced0f34c..93e3f7660c4230c9f1dd3b195958cb49 #endif } else if (stat) { -From 5dcf50763199caaf5ac89d91464a8eb3fb950f92 Mon Sep 17 00:00:00 2001 +From 64abf4863e38961cfdc3c2b1680e3b7751cd7dee 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 012/180] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 012/208] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -639,10 +639,10 @@ index 44d7c38dde479d771f3552e914bf8c1c1f5019f7..42ff5e6a8e0d532f5b60a1e7af7cc4d9 } -From 43d02aba96aadeb5653469d6e837c8f6b215bfb2 Mon Sep 17 00:00:00 2001 +From 86a5fcd1b51a616ae46047631553503ad2b096c8 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 013/180] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 013/208] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -741,10 +741,10 @@ index 42ff5e6a8e0d532f5b60a1e7af7cc4d941bd5008..eccf6ed025299cb480884f5bcbe77abf for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From 3546c5f2d1bea3d8a1b7852b3088dc92993f8e83 Mon Sep 17 00:00:00 2001 +From dec587cf518f9b967b7ce5faa5fa2944a6e6c0cd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 014/180] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 014/208] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -765,10 +765,10 @@ index 2e05046f866bd01bf87edcdeff0d5b76d4d0aea7..d780491b8013a4e97fa843958964454e }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From f1317397a2b972787d978f899bb062a20f8794fd Mon Sep 17 00:00:00 2001 +From c142337d3ab8a9fbceb6d611e32b3a621d577cb5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 015/180] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 015/208] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -788,10 +788,10 @@ index dcf43f66404f12d2bd290a30adfe494dd056162e..0fba189c676ded310b92a09c4e7e8f76 for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From acf8090ecb31ce0745715dd7335d7ff17dce130c Mon Sep 17 00:00:00 2001 +From 967fd972c6351fed9598396aa68071d3699023d2 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 016/180] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 016/208] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -813,10 +813,10 @@ index fa77165fab2c1348163979da507df17e7168c49b..d11e2e4ea189466e686d762cb6c6fef9 .can_sleep = false, }; -From 13f2368474a2851238f53da44ecf48ddc39b6c94 Mon Sep 17 00:00:00 2001 +From c5d54043c247044a8ecdd7451b7a2fbc5650f114 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 017/180] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 017/208] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -962,10 +962,10 @@ index d11e2e4ea189466e686d762cb6c6fef9111ecf8e..107ad7d58de8f8a7f55e09c9cdcf7d66 }, }; -From 6b1802a03f9c2919cba7520899f9198197491625 Mon Sep 17 00:00:00 2001 +From f12b7d81a1109e470185f3392099dc89552e1545 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 018/180] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 018/208] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -992,10 +992,10 @@ index 107ad7d58de8f8a7f55e09c9cdcf7d66fa7ab66b..644bdecbcfcb79d3b84a33769265fca5 pc->irq_data[i].irqgroup = i; -From 217266cb12b8bf3040de62c2e058bf72cbbb248b Mon Sep 17 00:00:00 2001 +From 28c879d001bb5ab3fd6dbacdf0df76518b41dce1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 May 2016 12:32:47 +0100 -Subject: [PATCH 019/180] pinctrl-bcm2835: Return pins to inputs when freed +Subject: [PATCH 019/208] pinctrl-bcm2835: Return pins to inputs when freed When dynamically unloading overlays, it is important that freed pins are restored to being inputs to prevent functions from being enabled in @@ -1036,10 +1036,10 @@ index 644bdecbcfcb79d3b84a33769265fca5d3d0c9e5..81a66cba2ab0f7e3ae179de7edd10122 .get_function_name = bcm2835_pmx_get_function_name, .get_function_groups = bcm2835_pmx_get_function_groups, -From 5ede89de20a88609a03f448f95888f492ada717a Mon Sep 17 00:00:00 2001 +From 34a7ed67a97641610545f768e1fac116fb09f129 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 020/180] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 020/208] 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 @@ -1120,10 +1120,10 @@ index f35cc10772f6670397ea923ad30158270dd68578..5dfe20ffc2866fa6789825016c585175 /* and set up the "mode" and level */ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", -From f181f13eab079dc69b53f399b3ddcb1f4e326628 Mon Sep 17 00:00:00 2001 +From 164780791396998dfdc84cdd11ac0a57acb88c8d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 021/180] spi-bcm2835: Disable forced software CS +Subject: [PATCH 021/208] spi-bcm2835: Disable forced software CS Select software CS in bcm2708_common.dtsi, and disable the automatic conversion in the driver to allow hardware CS to be re-enabled with an @@ -1157,10 +1157,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From d6da912cfb7bb4baec25dfe8ee701f9f1192bfad Mon Sep 17 00:00:00 2001 +From 8f9c99a7bb5105f249f22244ee7c11c9491909d2 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 022/180] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 022/208] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1213,10 +1213,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From a3063f7c214e7619f608b20a87d25b5b4ba3e553 Mon Sep 17 00:00:00 2001 +From 0dcea622ab242228d2ac5492166f6cc83499596b 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 023/180] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 023/208] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1319,70 +1319,10 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From 04a9e9ea5b3f509d818471291ebb052824ba0c76 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 024/180] bcm2835: Add support for uart1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This is a hack until a proper solution is agreed upon. -Martin Sperl is doing some work in this area. - -Signed-off-by: Noralf Trønnes ---- - arch/arm/mach-bcm/board_bcm2835.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/arch/arm/mach-bcm/board_bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c -index 8f152266ba9b470df2eaaed9ebcf158ed2079834..0ef5cd3d1d6ec420360294acc98d40d698d38d8a 100644 ---- a/arch/arm/mach-bcm/board_bcm2835.c -+++ b/arch/arm/mach-bcm/board_bcm2835.c -@@ -21,6 +21,29 @@ - #include - #include - -+/* Use this hack until a proper solution is agreed upon */ -+static void __init bcm2835_init_uart1(void) -+{ -+ struct device_node *np; -+ -+ np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart"); -+ if (of_device_is_available(np)) { -+ np = of_find_compatible_node(NULL, NULL, -+ "bcrm,bcm2835-aux-enable"); -+ if (np) { -+ void __iomem *base = of_iomap(np, 0); -+ -+ if (!base) { -+ pr_err("bcm2835: Failed enabling Mini UART\n"); -+ return; -+ } -+ -+ writel(1, base); -+ pr_info("bcm2835: Mini UART enabled\n"); -+ } -+ } -+} -+ - static void __init bcm2835_init(void) - { - struct device_node *np = of_find_node_by_path("/system"); -@@ -33,6 +56,8 @@ static void __init bcm2835_init(void) - system_rev = val; - if (!of_property_read_u64(np, "linux,serial", &val64)) - system_serial_low = val64; -+ -+ bcm2835_init_uart1(); - } - - static const char * const bcm2835_compat[] = { - -From 6391b08aa3a23b99c9c22c3f3abf2bb5f892aa12 Mon Sep 17 00:00:00 2001 +From c4d9aa87d6bf7e07bcaa8559af6ad15ab0d2ed95 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 025/180] firmware: Updated mailbox header +Subject: [PATCH 024/208] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 11 +++++++++++ @@ -1445,10 +1385,10 @@ index 3fb357193f09914fe21f8555a4b8613f74f22bc3..227a107214a02deadcca3db202da265e RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From 8aca83a023d6f06615da0accda9ad1787ba7dccf Mon Sep 17 00:00:00 2001 +From 13a01898fca61986f9fbb5fb2e55477248b2037f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Apr 2016 11:44:59 -0700 -Subject: [PATCH 026/180] clk: bcm2835: Mark the VPU clock as critical +Subject: [PATCH 025/208] clk: bcm2835: Mark the VPU clock as critical The VPU clock is also the clock for our AXI bus, so we really can't disable it. This might have happened during boot if, for example, @@ -1494,10 +1434,10 @@ index 0fc71cbaa4404bddc1ca603a28a43425a7e5a341..085e5217d3b9f73c312dc7fd510ef55c /* clocks with per parent mux */ -From 4a1cf49953943b7fee51c32a4d71b826af37f2c2 Mon Sep 17 00:00:00 2001 +From a136d9a40644e151876c7aa36e971aad4b0dc799 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 027/180] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 026/208] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -1552,10 +1492,10 @@ index 085e5217d3b9f73c312dc7fd510ef55cddb4a27c..e527649ee5e32d20cebd762f4badbfca /* HDMI state machine */ [BCM2835_CLOCK_HSM] = REGISTER_PER_CLK( -From daf1e4606d963b98737158d57c08531c62bdecba Mon Sep 17 00:00:00 2001 +From 8c1cbf01341c3f78a107af5dc9b3190932a6c7b2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Jun 2016 12:05:35 -0700 -Subject: [PATCH 028/180] clk: bcm2835: Mark the CM SDRAM clock's parent as +Subject: [PATCH 027/208] clk: bcm2835: Mark the CM SDRAM clock's parent as critical While the SDRAM is being driven by its dedicated PLL most of the time, @@ -1629,10 +1569,10 @@ index e527649ee5e32d20cebd762f4badbfca06657a84..fbf616021704178a9d007219a0ea2a9f &cprman->onecell); } -From eb260956bd419af6593292e54e50b295de482a14 Mon Sep 17 00:00:00 2001 +From 8fabd4b2587c362117ced1337e5ade069e9a2955 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Oct 2016 13:58:40 +0100 -Subject: [PATCH 029/180] Enable upstream BCM2835 auxiliar mini UART support +Subject: [PATCH 028/208] Enable upstream BCM2835 auxiliar mini UART support --- drivers/tty/serial/8250/Kconfig | 2 +- @@ -1652,10 +1592,10 @@ index 7c6f7afca5ddeed7b25fa6272246fc539bf31b04..748098f900d3474b5d535b24da76ad06 help Support for the BCM2835 auxiliar mini UART. -From 5f52133514aac2a020a61e18676fa54bf11c9cdb Mon Sep 17 00:00:00 2001 +From 9f7ddb4f7342c03f3d921e48515f8c89a08efe27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 030/180] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 029/208] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1675,10 +1615,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From ab59cc7148961bdf0b5e326b28e9349b9bbd3e3f Mon Sep 17 00:00:00 2001 +From ca0a284e86c89410ce033ce4abaa0581465665eb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 19 Apr 2016 15:55:02 -0700 -Subject: [PATCH 031/180] ARM: bcm2708: Enable building power domain driver. +Subject: [PATCH 030/208] ARM: bcm2708: Enable building power domain driver. Signed-off-by: Eric Anholt --- @@ -1699,10 +1639,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..7d11a44f36d2e6f8697773cd49a72e53 select PM_GENERIC_DOMAINS if PM help -From c4f1630a6ad6ddadb0f759cde95314ef63457b28 Mon Sep 17 00:00:00 2001 +From d2a8c66431d4a830d84aa61337e7cf75f7263e7a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 032/180] Main bcm2708/bcm2709 linux port +Subject: [PATCH 031/208] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -4227,10 +4167,10 @@ index aa4bfbf129e4585ebb89b25fca4b03c928925022..89f7a3a539b5a1b84ddcf0a1548160c0 mmc_pm_flag_t pm_caps; /* supported pm features */ -From 3ad26f55c09ad41bdd60cf372b3f0716ee0435f5 Mon Sep 17 00:00:00 2001 +From 7a75212664e74d790360674f0e9d589f967149cf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 033/180] reboot: Use power off rather than busy spinning when +Subject: [PATCH 032/208] reboot: Use power off rather than busy spinning when halt is requested --- @@ -4253,10 +4193,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From 7d82d8ab872f570890f26f9f897178f8e6dae056 Mon Sep 17 00:00:00 2001 +From f80a468706132177faffe0708b0cd0976ad6bf80 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 11 Nov 2015 21:01:15 +0000 -Subject: [PATCH 034/180] squash: include ARCH_BCM2708 / ARCH_BCM2709 +Subject: [PATCH 033/208] squash: include ARCH_BCM2708 / ARCH_BCM2709 --- drivers/char/hw_random/Kconfig | 2 +- @@ -4420,10 +4360,10 @@ index d528aaceaad95bc6bae2147ebe66249629d2512e..03a303e52d5fe57bbdd8769d24bca590 select REGMAP_MMIO help -From adc5115bfb8f5418ea6ea9e4ee44b5a0ed1cb7c5 Mon Sep 17 00:00:00 2001 +From 719e241414d5c0c769e3cec0a36701f43665032e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 035/180] Add dwc_otg driver +Subject: [PATCH 034/208] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -65449,10 +65389,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From 716fd0b10200d87a572b3f41d5d3888f5e71888f Mon Sep 17 00:00:00 2001 +From 8e1c17d3d0343deb70fe8cd422d6d3dc19a770fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 036/180] bcm2708 framebuffer driver +Subject: [PATCH 035/208] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68911,10 +68851,10 @@ index 3c14e43b82fefe1d32f591d1b2f61d2cd28d0fa8..7626beb6a5bb8df601ddf0f6e6909d1f +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -From a1d9f548d10bbc06945986ef3328cb3b9d974eed Mon Sep 17 00:00:00 2001 +From 153d404162b1f45c70ea0113ab3057c534cd9532 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 037/180] dmaengine: Add support for BCM2708 +Subject: [PATCH 036/208] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69536,10 +69476,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From 2bcb2ed96c63bc84e0e305cae5bbfa17e1704350 Mon Sep 17 00:00:00 2001 +From 7c69e53eea36e2bc92fb5d1e7e631aa0d4691a68 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 038/180] MMC: added alternative MMC driver +Subject: [PATCH 037/208] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -71286,10 +71226,10 @@ index 0000000000000000000000000000000000000000..ceb37930e167f47c9c848e8de757ad09 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 0d3f8eb8077749cdfdc6d26b34e1032c964882de Mon Sep 17 00:00:00 2001 +From 4acaf78a70bd0f9c2fd25d5c9cc229a397eafe06 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 039/180] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 038/208] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -73681,10 +73621,10 @@ index 0000000000000000000000000000000000000000..23dea422182534e248435aeaee3ecb5d +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From f2ddc6d2d9dd1ff0362f126572682cbc8bea2201 Mon Sep 17 00:00:00 2001 +From a93caaa8ea2e62422122b1a66434e42b56328838 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 040/180] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 039/208] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards Some SD cards have been found that corrupt data when small blocks are erased. Add a quirk to indicate that ERASE should not be used, @@ -73820,10 +73760,10 @@ index d8673ca968ba2d65fb3da39680583ca5152641e4..510c3872929b3267fb6665bb69d26f5a unsigned int erase_shift; /* if erase unit is power 2 */ unsigned int pref_erase; /* in sectors */ -From c061ec0aa23028e330881b9a8fc9325cff67458d Mon Sep 17 00:00:00 2001 +From a27a20db497c1caeba48369323b1821981851d35 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 041/180] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 040/208] 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 @@ -75166,10 +75106,10 @@ index 0000000000000000000000000000000000000000..be2819d5d41f9d5ed65daf8eedb94c9e + +#endif /* VC_CMA_H */ -From 86e142b7270bf953ec9a0b58a0cb83579e5cf113 Mon Sep 17 00:00:00 2001 +From 81396ee5aaaa0cdc1c4c7fadd11dd1d7a3e88fae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 042/180] bcm2708: alsa sound driver +Subject: [PATCH 041/208] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -77905,10 +77845,10 @@ index 0000000000000000000000000000000000000000..af3e6eb690113fc32ce9e06bd2f0f294 + +#endif // _VC_AUDIO_DEFS_H_ -From e99c1ef52da1cf3e11da2815ca5abf8351facb6a Mon Sep 17 00:00:00 2001 +From 5c7989bc7855400db08a481fef1a9caf9e32be2a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 043/180] bcm2708 vchiq driver +Subject: [PATCH 042/208] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -91273,10 +91213,10 @@ index 0000000000000000000000000000000000000000..b6bfa21155e431e93bfb2c149d324371 + return vchiq_build_time; +} -From d334c0056e7bd4448df594565e0892bf60b29922 Mon Sep 17 00:00:00 2001 +From 566c5c2c2ff0ad35cccf0ad61a4ebd9f9dfb2e4b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 044/180] vc_mem: Add vc_mem driver +Subject: [PATCH 043/208] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -92281,10 +92221,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From 20cea7292d4c9a869afcd8002c12b5aa782f1a29 Mon Sep 17 00:00:00 2001 +From 1a374ac5d04091feae0ddeca584c67ca348fcfae Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 045/180] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 044/208] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -96702,10 +96642,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From 1ee05985d1a6cc3b6ee9a4377f8017beff038bc8 Mon Sep 17 00:00:00 2001 +From 9a1ccb17b43b5109f5490c1d6bf5bacbf4e11a1b Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 046/180] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 045/208] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -97016,10 +96956,10 @@ index 0000000000000000000000000000000000000000..911f5b7393ed48ceed8751f06967ae64 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From 46bfbcb1b44f4b4f3da20b43f199fd626ada78da Mon Sep 17 00:00:00 2001 +From f4db6af82e4cb6535fa14fdf29b90769f2ce3f05 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 047/180] Add SMI driver +Subject: [PATCH 046/208] Add SMI driver Signed-off-by: Luke Wren --- @@ -98970,10 +98910,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 1914f05726311cc80498736036445d80bcd5e5e1 Mon Sep 17 00:00:00 2001 +From 5b3d8d4688eb4eeaea69a189323e9c5fc0354e69 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 048/180] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 047/208] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -99143,10 +99083,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 01e3d1f595e1a4ab735616f3f158de91a23601ee Mon Sep 17 00:00:00 2001 +From c6d205f0fe1e94bc2f07fd3c0891c79719fb4acb Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 049/180] Add SMI NAND driver +Subject: [PATCH 048/208] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -99511,10 +99451,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From b0d4b4d1fbe81ba467a57dd51e67a0842a52b99f Mon Sep 17 00:00:00 2001 +From feab27c42b831d89424f2efc1c5eb7a98972712d Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 050/180] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 049/208] 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 @@ -100377,10 +100317,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From f9d71c4cf42957db9b386ae6096785fe80f558f1 Mon Sep 17 00:00:00 2001 +From fff2289d895dbfc79c794d5a1cd1d8d24435c926 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 051/180] Add cpufreq driver +Subject: [PATCH 050/208] Add cpufreq driver Signed-off-by: popcornmix --- @@ -100642,10 +100582,10 @@ index 0000000000000000000000000000000000000000..3eb9e9326231b08e6ee95ad486485245 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 40829724551fc13fa1adc594cdc5a0c37062b47a Mon Sep 17 00:00:00 2001 +From 37aa96d5731f2657672c71c63c1e1a196b62be02 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 052/180] Added hwmon/thermal driver for reporting core +Subject: [PATCH 051/208] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -100811,10 +100751,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From 1bfb3480251e00e86eaf60d79a3d7c8a90fd624b Mon Sep 17 00:00:00 2001 +From e92628a6bd90876e0ccea0ac20eaa0ac2445c14c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 053/180] Add Chris Boot's i2c driver +Subject: [PATCH 052/208] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -101488,10 +101428,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 527e2d3baf7917de6c9ae75d33eb8a941cb4129a Mon Sep 17 00:00:00 2001 +From 10a9053f8e51e5f87b5e3b772c5785ea42971dd7 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 054/180] char: broadcom: Add vcio module +Subject: [PATCH 053/208] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -101717,10 +101657,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 70d6c1f50d485b81f6f8a06c26c45081f75571e4 Mon Sep 17 00:00:00 2001 +From d583497e3d8d54010157aed484835a06a45572e7 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 055/180] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 054/208] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -101826,10 +101766,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..b980d531b35b9981a88356ef1c8a7b86 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 133deb97f2295e037fe5f77a08ae4a02bd7e1acc Mon Sep 17 00:00:00 2001 +From 9296e7af762cee3eaeae26c298130bb2cffe4dae Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 056/180] bcm2835: add v4l2 camera device +Subject: [PATCH 055/208] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -109561,10 +109501,10 @@ index 0000000000000000000000000000000000000000..9d1d11e4a53e510c04a416d92d195a7d + +#endif /* MMAL_VCHIQ_H */ -From bad46e365b6b5c9125ccdbc8b8f9fe15afae3646 Mon Sep 17 00:00:00 2001 +From 11b448942d10a35fb98c8b1f91c78b8ede600c37 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 057/180] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 056/208] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -110076,10 +110016,10 @@ index 0000000000000000000000000000000000000000..78c5845d2f01deb04b477327d83fa606 + return $trailer; +} -From 1c0f7afb336da1adeddabfea801155ac46454629 Mon Sep 17 00:00:00 2001 +From 804f05236652ec5169092c4b102faa5979b92b27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 058/180] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH 057/208] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. @@ -112930,10 +112870,10 @@ index ad9b05ae698b0495ecbda42ffcf4743555313a27..2595dfda020fd9e03f0beff5006f229d -#define DTC_VERSION "DTC 1.4.1-g53bf130b" +#define DTC_VERSION "DTC 1.4.1-g25efc119" -From 99caef2633ab21c6d3ed73b796610c00b612961f Mon Sep 17 00:00:00 2001 +From 87dc2c03954f71140aa60b8e5a2f35ad8236cd08 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 059/180] BCM2708: Add core Device Tree support +Subject: [PATCH 058/208] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -122762,10 +122702,10 @@ index 0000000000000000000000000000000000000000..8498134fdbb3912e9ce18282b53084d8 + +}; -From 3e650bf55c04a42f4d9ce7ba6353a9b016bdb86f Mon Sep 17 00:00:00 2001 +From 65b456a37c0916b6315fec653abcfd712656d6c3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 060/180] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 059/208] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -122785,10 +122725,10 @@ index 179219845dfcdfbeb586d12c5ec1296095d9fbf4..e0743e44f84188667a0c322e8c3d36f1 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From a1808365c951c8c4843118e55cf92a2fe2098016 Mon Sep 17 00:00:00 2001 +From c648634cfedb6adbaf9e793e9fc1ba79dcf4bc9d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 20:00:21 +0000 -Subject: [PATCH 061/180] BCM270X_DT: Add a .dtbo target, use for overlays +Subject: [PATCH 060/208] BCM270X_DT: Add a .dtbo target, use for overlays Change the filenames and extensions to keep the pre-DDT style of overlay (-overlay.dtb) distinct from new ones that use a @@ -122871,10 +122811,10 @@ index 0a07f9014944ed92a8e2e42983ae43be60b3e471..b1513a7c175885137034b9f7225788c0 # Bzip2 -From fce38a0f3ac3541bbd3bdac608577b1d32fc8e2a Mon Sep 17 00:00:00 2001 +From c02bd18e6291de77eb37462f47ce78063975157f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 8 Apr 2016 17:43:27 +0100 -Subject: [PATCH 062/180] BCM270X_DT: Don't generate "linux,phandle" props +Subject: [PATCH 061/208] BCM270X_DT: Don't generate "linux,phandle" props The EPAPR standard says to use "phandle" properties to store phandles, rather than the deprecated "linux,phandle" version. By default, dtc @@ -122900,10 +122840,10 @@ index b1513a7c175885137034b9f7225788c0a7c35027..1d949b7410600dd3b04a3acde8c41cfe -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) -From 1cc64386d132c84a4c9b5d1b08e058fd610335e8 Mon Sep 17 00:00:00 2001 +From 397a180a518dd177c140287c66caf9ae4dcb4a1e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 063/180] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 062/208] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -123079,10 +123019,10 @@ index 8a3b5d29602ffe665cfb26522180f3a696664371..d067976ddc2f34d5476bcd9321856b1c /* Set LED brightness level * Must not sleep. Use brightness_set_blocking for drivers -From 448d8082265fef810f76db4630d04c982d5eb59b Mon Sep 17 00:00:00 2001 +From 43ca3a9b4fe3c10f5ce4a65732444c6df4f081f1 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 064/180] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 063/208] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -123181,10 +123121,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..fa72af0c981710fe80bacf4cf6612f6d #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From a014fcb2498f5585cf7803faf3859ab646cb0e39 Mon Sep 17 00:00:00 2001 +From 26923981303957954bcbc91fff432e1ac2633648 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 065/180] Speed up console framebuffer imageblit function +Subject: [PATCH 064/208] 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 @@ -123393,10 +123333,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From 9e8626decede4c3dcf83c8767a6f6be8878a5477 Mon Sep 17 00:00:00 2001 +From 71619935735369868d063609734855d0bdcc347d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 066/180] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 065/208] 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 @@ -123646,10 +123586,10 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From c5d6e3bf5b80deedebee48608f3a0a83741c3465 Mon Sep 17 00:00:00 2001 +From d3fec7c3a52ebf2123c4c379f48f349fbef17578 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 067/180] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 066/208] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -123699,10 +123639,10 @@ index d6b729beba4930bbb1a1ddc4a6a6b8533bbf94e0..69e8d214f663572319f784fe17032b1e * css_tryget_online_from_dir - get corresponding css from a cgroup dentry * @dentry: directory dentry of interest -From 6edf62767556f639d4f4b962307fc8f7ceeb2e46 Mon Sep 17 00:00:00 2001 +From 4a63703bb5d6cff1731ed710841ff6b3f62b3434 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 068/180] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 067/208] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -123738,10 +123678,10 @@ index ae83af649a607f67239f1a64bf45dd4b5770cc7d..4a7af9d0b910f59d17421ce14138400d ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From d9324c53cafedb02bda99ffd649b274f0ac7c5ad Mon Sep 17 00:00:00 2001 +From a9b48b08d46cfbfd35b45dc3738412a8d9ecf6d0 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 069/180] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 068/208] 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 @@ -124036,10 +123976,10 @@ index 0000000000000000000000000000000000000000..b27dbee8f56773dbd2a5503dc864747d +MODULE_DESCRIPTION("Touchscreen driver for memory based FT5406"); +MODULE_LICENSE("GPL"); -From d801506c2aebe2249bcd4c148a0c701ceae9ce68 Mon Sep 17 00:00:00 2001 +From 79bd07b796e2fc05512634cc0c80bd3d6e641c6b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 070/180] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 069/208] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -125595,10 +125535,10 @@ index 6bd1089b07e0960830ed6bd6a8345202b7efd8b0..cd17dd11ebe7bbe00089e70cd2ccea74 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 17e6fbab1c3e05a227d9517cef1bc34b2d5f940f Mon Sep 17 00:00:00 2001 +From 100203b956cc659d9e65a4086db54f28c304e1e8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 071/180] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 070/208] 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 @@ -125633,10 +125573,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From 0334429c23fcb2f01df2006bfb2cab53e37af273 Mon Sep 17 00:00:00 2001 +From 75e0aa61e26876991add914994a59a0ccf3e6e12 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 072/180] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 071/208] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -126501,10 +126441,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From c2fd6f23e2202934909f2a147ad75409df093a31 Mon Sep 17 00:00:00 2001 +From 396b0f4386372c8b2ca36a812bad656738b82fe2 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 073/180] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 072/208] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -126678,10 +126618,10 @@ index 0000000000000000000000000000000000000000..29ecc08a227cdd4b3c6141935d0c5d21 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From aae86c04c2edf88f8e0de3923c8d61366ec7b0df Mon Sep 17 00:00:00 2001 +From 39db6b2b07cc619b8f31e9698a1a3c6681d5b532 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 074/180] ASoC: Add support for Rpi-DAC +Subject: [PATCH 073/208] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -126965,10 +126905,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 7881eff02052a7a81de51084579d7f49d8fd2617 Mon Sep 17 00:00:00 2001 +From a17eab5f9fbde48aabcbecad1b4d173aecdd2287 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 075/180] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 074/208] 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 @@ -127017,10 +126957,10 @@ index 8d914702cae4a3fe2c0ca0599cd1ec79f7322c83..c846716b4ed1027ade5512e8be90801d .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From fb9ca0a22b86e1f710baed12130bca16bff12d8c Mon Sep 17 00:00:00 2001 +From c4240b894be6cb535c9a3260dc9071eb38ede175 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 076/180] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 075/208] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -127308,10 +127248,10 @@ index 0000000000000000000000000000000000000000..9840e15d3e2be6396bc3ce6e74749408 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 4641e9edaddf434740c51e97dd3e1428cb9cad03 Mon Sep 17 00:00:00 2001 +From d75574658dee579a87b081abf15d7b8f18006156 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 077/180] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 076/208] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -127641,10 +127581,10 @@ index 0000000000000000000000000000000000000000..4e8e6dec14bcf4a1ff286c43742d4097 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From d763fe4f4fa1f79a38d211810f5c704097defb68 Mon Sep 17 00:00:00 2001 +From ab9d6e71cd86d0b32c9100e19dd44a075e3e9645 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jul 2016 17:06:50 +0100 -Subject: [PATCH 078/180] iqaudio-dac: Compile fix - untested +Subject: [PATCH 077/208] iqaudio-dac: Compile fix - untested --- sound/soc/bcm/iqaudio-dac.c | 6 +++++- @@ -127668,10 +127608,10 @@ index 4e8e6dec14bcf4a1ff286c43742d4097249d6777..aa15bc4b49ca95edec905fddd8fd0a6d if (dapm->dev != codec_dai->dev) return 0; -From 4346909acf1c72098f4421acdb32a26a6f1b7856 Mon Sep 17 00:00:00 2001 +From 962edd733d593be9f0542a3aeb9a0591ab5ab5c1 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 079/180] Added support for HiFiBerry DAC+ +Subject: [PATCH 078/208] 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. @@ -128300,10 +128240,10 @@ index 047c48953a20cd4075000ac294a17fe59baedcde..090fe0ee08e8765f9edbb62777413bb6 dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From 81d03570790fd3cc43754ee8bc3f90673f00f545 Mon Sep 17 00:00:00 2001 +From 291d3872c447b25b51ad03f52787442cec78dd1f Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 080/180] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 079/208] 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. @@ -129135,10 +129075,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From 2abc1302d01008127cc8c4c66257abd44650f84f Mon Sep 17 00:00:00 2001 +From 11db210348ec63453d86cb144b3f5c17feedfacf Mon Sep 17 00:00:00 2001 From: "Daniel Matuschek (HiFiBerry)" Date: Tue, 26 Jul 2016 19:16:25 +0200 -Subject: [PATCH 081/180] Added HiFiBerry Digi+ Pro driver +Subject: [PATCH 080/208] Added HiFiBerry Digi+ Pro driver Signed-off-by: Daniel Matuschek --- @@ -129246,10 +129186,10 @@ index 9840e15d3e2be6396bc3ce6e74749408cc28c333..52ab9dea2e724c4238986ca53c59c849 ret = snd_soc_register_card(&snd_rpi_hifiberry_digi); -From 12891c3fed544325f37854d83594658a26cbacb4 Mon Sep 17 00:00:00 2001 +From ca49f7825bbd719ed413c05a07a4c004b598850c Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 082/180] Update ds1307 driver for device-tree support +Subject: [PATCH 081/208] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -129276,10 +129216,10 @@ index 8e1c5cb6ece6f60619e5cafcea4271e056d96778..f9536679b270a39a4d9639fdbd3420fe .driver = { .name = "rtc-ds1307", -From 09d6f0eca58c63b18b4f7b4fb80ab80ecd99f4f1 Mon Sep 17 00:00:00 2001 +From cbc94ab92e62b8628bd4648e2391ee1582c199ba Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 083/180] Add driver for rpi-proto +Subject: [PATCH 082/208] 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 @@ -129495,10 +129435,10 @@ index 0000000000000000000000000000000000000000..9db678e885efd63d84d60a098a84ed67 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 73674939be026499f88c5aee6ab40e1b8fbbe636 Mon Sep 17 00:00:00 2001 +From e31208717f0fc90e3e5d82e10408540c9272a69e Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 084/180] RaspiDAC3 support +Subject: [PATCH 083/208] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -129741,234 +129681,10 @@ index 0000000000000000000000000000000000000000..dd9eeea2af0382307f437e6db09d1546 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From cf64777c8227aa895d3ad133cdc83855378e84ea Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 9 Aug 2016 14:49:23 +0100 -Subject: [PATCH 085/180] tpa6130a2: Add headphone switch control - -Signed-off-by: Jan Grulich ---- - sound/soc/codecs/tpa6130a2.c | 60 ++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 60 insertions(+) - -diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c -index f1ea052a822e1f584eb55cbc876b8e079e813ccd..3bf0163956c5665683d7950798df527fa1b57b59 100644 ---- a/sound/soc/codecs/tpa6130a2.c -+++ b/sound/soc/codecs/tpa6130a2.c -@@ -4,6 +4,7 @@ - * Copyright (C) Nokia Corporation - * - * Author: Peter Ujfalusi -+ * Modified: Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License -@@ -50,6 +51,8 @@ struct tpa6130a2_data { - enum tpa_model id; - }; - -+static void tpa6130a2_channel_enable(u8 channel, int enable); -+ - static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable) - { - int ret; -@@ -109,6 +112,20 @@ static int tpa6130a2_power_event(struct snd_soc_dapm_widget *w, - return 0; - } - -+static int tpa6130a2_put_hp_sw(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ int enable = ucontrol->value.integer.value[0]; -+ unsigned int state; -+ -+ state = (tpa6130a2_read(TPA6130A2_REG_VOL_MUTE) & 0x80) == 0; -+ if (state == enable) -+ return 0; /* No change */ -+ -+ tpa6130a2_channel_enable(TPA6130A2_HP_EN_R | TPA6130A2_HP_EN_L, enable); -+ return 1; /* Changed */ -+} -+ - /* - * TPA6130 volume. From -59.5 to 4 dB with increasing step size when going - * down in gain. -@@ -130,6 +147,9 @@ static const struct snd_kcontrol_new tpa6130a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 0, 0x3f, 0, - tpa6130_tlv), -+ SOC_SINGLE_EXT("TPA6130A2 Headphone Playback Switch", -+ TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -+ tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - - static const DECLARE_TLV_DB_RANGE(tpa6140_tlv, -@@ -142,8 +162,48 @@ static const struct snd_kcontrol_new tpa6140a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 1, 0x1f, 0, - tpa6140_tlv), -+ SOC_SINGLE_EXT("TPA6140A2 Headphone Playback Switch", -+ TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -+ tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - -+/* -+ * Enable or disable channel (left or right) -+ * The bit number for mute and amplifier are the same per channel: -+ * bit 6: Right channel -+ * bit 7: Left channel -+ * in both registers. -+ */ -+static void tpa6130a2_channel_enable(u8 channel, int enable) -+{ -+ u8 val; -+ -+ if (enable) { -+ /* Enable channel */ -+ /* Enable amplifier */ -+ val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -+ val |= channel; -+ val &= ~TPA6130A2_SWS; -+ tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -+ -+ /* Unmute channel */ -+ val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -+ val &= ~channel; -+ tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -+ } else { -+ /* Disable channel */ -+ /* Mute channel */ -+ val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -+ val |= channel; -+ tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -+ -+ /* Disable amplifier */ -+ val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -+ val &= ~channel; -+ tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -+ } -+} -+ - static int tpa6130a2_component_probe(struct snd_soc_component *component) - { - struct tpa6130a2_data *data = snd_soc_component_get_drvdata(component); - -From 0d769e9278c8ebea5cbc3321952bf37e9f379e6b Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 9 Aug 2016 14:49:29 +0100 -Subject: [PATCH 086/180] Revert "tpa6130a2: Add headphone switch control" - -This reverts commit 860574af506a7a28782ca373feb880e7846943f9. ---- - sound/soc/codecs/tpa6130a2.c | 60 -------------------------------------------- - 1 file changed, 60 deletions(-) - -diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c -index 3bf0163956c5665683d7950798df527fa1b57b59..f1ea052a822e1f584eb55cbc876b8e079e813ccd 100644 ---- a/sound/soc/codecs/tpa6130a2.c -+++ b/sound/soc/codecs/tpa6130a2.c -@@ -4,7 +4,6 @@ - * Copyright (C) Nokia Corporation - * - * Author: Peter Ujfalusi -- * Modified: Jan Grulich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License -@@ -51,8 +50,6 @@ struct tpa6130a2_data { - enum tpa_model id; - }; - --static void tpa6130a2_channel_enable(u8 channel, int enable); -- - static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable) - { - int ret; -@@ -112,20 +109,6 @@ static int tpa6130a2_power_event(struct snd_soc_dapm_widget *w, - return 0; - } - --static int tpa6130a2_put_hp_sw(struct snd_kcontrol *kcontrol, -- struct snd_ctl_elem_value *ucontrol) --{ -- int enable = ucontrol->value.integer.value[0]; -- unsigned int state; -- -- state = (tpa6130a2_read(TPA6130A2_REG_VOL_MUTE) & 0x80) == 0; -- if (state == enable) -- return 0; /* No change */ -- -- tpa6130a2_channel_enable(TPA6130A2_HP_EN_R | TPA6130A2_HP_EN_L, enable); -- return 1; /* Changed */ --} -- - /* - * TPA6130 volume. From -59.5 to 4 dB with increasing step size when going - * down in gain. -@@ -147,9 +130,6 @@ static const struct snd_kcontrol_new tpa6130a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 0, 0x3f, 0, - tpa6130_tlv), -- SOC_SINGLE_EXT("TPA6130A2 Headphone Playback Switch", -- TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -- tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - - static const DECLARE_TLV_DB_RANGE(tpa6140_tlv, -@@ -162,48 +142,8 @@ static const struct snd_kcontrol_new tpa6140a2_controls[] = { - SOC_SINGLE_TLV("Headphone Playback Volume", - TPA6130A2_REG_VOL_MUTE, 1, 0x1f, 0, - tpa6140_tlv), -- SOC_SINGLE_EXT("TPA6140A2 Headphone Playback Switch", -- TPA6130A2_REG_VOL_MUTE, 7, 1, 1, -- tpa6130a2_get_volsw, tpa6130a2_put_hp_sw), - }; - --/* -- * Enable or disable channel (left or right) -- * The bit number for mute and amplifier are the same per channel: -- * bit 6: Right channel -- * bit 7: Left channel -- * in both registers. -- */ --static void tpa6130a2_channel_enable(u8 channel, int enable) --{ -- u8 val; -- -- if (enable) { -- /* Enable channel */ -- /* Enable amplifier */ -- val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -- val |= channel; -- val &= ~TPA6130A2_SWS; -- tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -- -- /* Unmute channel */ -- val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -- val &= ~channel; -- tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -- } else { -- /* Disable channel */ -- /* Mute channel */ -- val = tpa6130a2_read(TPA6130A2_REG_VOL_MUTE); -- val |= channel; -- tpa6130a2_i2c_write(TPA6130A2_REG_VOL_MUTE, val); -- -- /* Disable amplifier */ -- val = tpa6130a2_read(TPA6130A2_REG_CONTROL); -- val &= ~channel; -- tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); -- } --} -- - static int tpa6130a2_component_probe(struct snd_soc_component *component) - { - struct tpa6130a2_data *data = snd_soc_component_get_drvdata(component); - -From 1a5a67631ffce954b6ae7b5af635004f1b5d48ee Mon Sep 17 00:00:00 2001 +From 0dbf63d7ac2e0f2ccb758b7641bb24d75fa3e99e Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 087/180] Add Support for JustBoom Audio boards +Subject: [PATCH 084/208] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -130422,10 +130138,10 @@ index 0000000000000000000000000000000000000000..91acb666380faa3c0deb2230f8a0f8bb +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From 5945293ad4ccf3cb79662035aa9b042c9c183122 Mon Sep 17 00:00:00 2001 +From 3c1739ef8bbd37c97af637e792f7dc604eb0dbac Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 088/180] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 085/208] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -130607,10 +130323,10 @@ index 0000000000000000000000000000000000000000..6e2ee027926ee63c89222f75ceb89e3d +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From 0ade8243f1ebbc43c73939a8eb80eeac2ac7ff40 Mon Sep 17 00:00:00 2001 +From d653d98735f512ced56df4968813e513fd93afdb Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 089/180] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 086/208] New AudioInjector.net Pi soundcard with low jitter audio in and out. Contains the sound/soc/bcm ALSA machine driver and necessary alterations to the Kconfig and Makefile. @@ -130859,10 +130575,10 @@ index 0000000000000000000000000000000000000000..5ff0985e07efb96b95634a65995f09f7 +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From 84100a3d2aeb22dc6c5deac1ba6026ab12dafb98 Mon Sep 17 00:00:00 2001 +From 83acbad0b2688cd44fbb7293d219394a8ff4f435 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 090/180] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 087/208] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -131162,10 +130878,10 @@ index 0000000000000000000000000000000000000000..9b6e829bcb5b1762a853775e78163196 +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From dd3c6136e091b24c59e4b81e4fee6d66a3b0811e Mon Sep 17 00:00:00 2001 +From 6004b4aced007bc18f0bf6b2fe006cc23f537e5c Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 091/180] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 088/208] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -131638,10 +131354,10 @@ index 0000000000000000000000000000000000000000..446796e7e4c14a7d95b2f2a01211d9a0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From ed17130f82c5310c9af391791a5022a066554189 Mon Sep 17 00:00:00 2001 +From c9186592a8d8b0de5f1b198d154819283b3ff954 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 092/180] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 089/208] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -131814,10 +131530,10 @@ index 0000000000000000000000000000000000000000..89e65317512bc774453ac8d0d5b0ff98 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 4b53b3a79abec861e98334683df6e101cf3382e6 Mon Sep 17 00:00:00 2001 +From 20d707ddfb3d107dc828e607f181cce0a71d37de Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 093/180] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 090/208] Allo Piano DAC boards: Initial 2 channel (stereo) support (#1645) Add initial 2 channel (stereo) support for Allo Piano DAC (2.0/2.1) boards, @@ -132024,10 +131740,10 @@ index 0000000000000000000000000000000000000000..8e8e62e5a36a279b425ed4655cfbac99 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From f2fed4552bb4f6de09925db38cb32ff334300d2a Mon Sep 17 00:00:00 2001 +From 957b05e2d651db6c7da732440955cb6e3e87155f Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 094/180] rpi_display: add backlight driver and overlay +Subject: [PATCH 091/208] 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 @@ -132196,10 +131912,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From 4716cf35fe6891299cb15c314ae30b906904a6cb Mon Sep 17 00:00:00 2001 +From 20d35ff154f56e330bb4a3781721e271edecc54f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 095/180] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 092/208] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -132425,10 +132141,10 @@ index 0000000000000000000000000000000000000000..f3e0f1620b979e4fa3c7e556eb785ac2 +MODULE_DESCRIPTION("brcmvirt GPIO driver"); +MODULE_ALIAS("platform:brcmvirt-gpio"); -From 0cc872b27395703fa8e7934d9e0c573361d7499e Mon Sep 17 00:00:00 2001 +From ff297e81b17d7bc931554a8246fe3eae8e6f47ef Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 4 Mar 2016 12:49:09 +0000 -Subject: [PATCH 096/180] DRM_VC4: Allow to be built for ARCH_BCM270x +Subject: [PATCH 093/208] DRM_VC4: Allow to be built for ARCH_BCM270x --- drivers/gpu/drm/vc4/Kconfig | 2 +- @@ -132447,10 +132163,10 @@ index e53df59cb139f25f8e6ae916bca93abf0c49e063..f6e938208b73512f20eab46a383ca91b select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER -From 8b0a1be50fd370cf796f569ca140d739e9ff68ec Mon Sep 17 00:00:00 2001 +From 50174cb70458ba4c0c70e88d3cd21defdd156bbb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 097/180] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 094/208] amba_pl011: Don't use DT aliases for numbering The pl011 driver looks for DT aliases of the form "serial", and if found uses as the device ID. This can cause @@ -132479,10 +132195,10 @@ index 8a9e213387a79fcc335caad27520a68edf03f446..4a5a1c5cf9b345e255f4d79714a7ae46 uap->old_cr = 0; uap->port.dev = dev; -From 504d7f96916e8c6e9743f91199f9e471a4570dc8 Mon Sep 17 00:00:00 2001 +From 6a254068480d6ce7cc2ed93742c5412a8e46cda8 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 098/180] OF: DT-Overlay configfs interface +Subject: [PATCH 095/208] OF: DT-Overlay configfs interface This is a port of Pantelis Antoniou's v3 port that makes use of the new upstreamed configfs support for binary attributes. @@ -132914,10 +132630,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From a9b05a16b9f6d7870dc76020253dbe12225b5133 Mon Sep 17 00:00:00 2001 +From 1fddcd40ba81c10c6895d5f7450648d22f4ff015 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 099/180] brcm: adds support for BCM43341 wifi +Subject: [PATCH 096/208] brcm: adds support for BCM43341 wifi --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 ++ @@ -132957,10 +132673,10 @@ index 3cc42bef6245529c37320f0ec6ab5e7b77f1d2f6..2ae9d0c9dbaaab6bc16610ac012039cd #define BRCM_CC_4335_CHIP_ID 0x4335 #define BRCM_CC_4339_CHIP_ID 0x4339 -From ab47a779b65a2cacff54ef93da4ff5c027216e39 Mon Sep 17 00:00:00 2001 +From 4c93f16ed441b2c3ef4a6e4bbaf4da65d3947109 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 9 Mar 2016 17:25:59 +0000 -Subject: [PATCH 100/180] brcmfmac: Disable power management +Subject: [PATCH 097/208] brcmfmac: Disable power management Disable wireless power saving in the brcmfmac WLAN driver. This is a temporary measure until the connectivity loss resulting from power @@ -132985,10 +132701,10 @@ index abaf003a5b396f94e891c6569217ffbb595987e1..f6221c20ff8e2c07a9ddb329204cc59c if (!check_vif_up(ifp->vif)) { -From 4effcd528f7b6e4100e80cfb86828e05186f2159 Mon Sep 17 00:00:00 2001 +From 27a452d3be16848428312107b1281a3a1a3d3752 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 28 Apr 2016 17:13:47 +0100 -Subject: [PATCH 101/180] brcmfmac: Use original country code as a fallback +Subject: [PATCH 098/208] brcmfmac: Use original country code as a fallback Commit 73345fd212980d2e28a5c6d83801c903bd773680: @@ -133047,10 +132763,10 @@ index f6221c20ff8e2c07a9ddb329204cc59ce574117b..12bffe239e9d28ce8f73db48b3f5759f ccreq->country_abbrev[1] = alpha2[1]; ccreq->country_abbrev[2] = 0; -From b2baa23358462b6b595a371d914ee842ff70c9a3 Mon Sep 17 00:00:00 2001 +From fb426eaf2b6cb5e4383d36f1b00c74afbed85c7b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 13 Sep 2016 16:32:37 +0100 -Subject: [PATCH 102/180] brcmfmac: do not use internal roaming engine by +Subject: [PATCH 099/208] brcmfmac: do not use internal roaming engine by default Some evidence of curing disconnects with this disabled, so make it a default. @@ -133074,10 +132790,10 @@ index 3e15d64c64813513bc22202dd9e468588699abb0..4051780f64f44a5ce522babe6c371a1b MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); -From 499241ac9d5915154d97a6ac7a073b3e731bc571 Mon Sep 17 00:00:00 2001 +From 0b42c7b72a05fa0261c707571f0328fba44c8a9e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 31 Aug 2016 17:10:09 +0100 -Subject: [PATCH 103/180] brcmfmac: Change stop_ap sequence +Subject: [PATCH 100/208] brcmfmac: Change stop_ap sequence Patch from Broadcom/Cypress to resolve a customer error @@ -133110,10 +132826,10 @@ index 12bffe239e9d28ce8f73db48b3f5759ffe550162..0c3cecb22763db2db5ccbc1789f50b2b brcmf_fil_iovar_int_set(ifp, "mbss", 0); err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, -From 29dd3f528a391b358757609dd4c5ce00d6a8e3dd Mon Sep 17 00:00:00 2001 +From bae20097877011eea7b2342eee23788a14ceb380 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 104/180] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 101/208] hci_h5: Don't send conf_req when ACTIVE Without this patch, a modem and kernel can continuously bombard each other with conf_req and conf_rsp messages, in a demented game of tag. @@ -133136,73 +132852,10 @@ index 0879d64b1caf58afb6e5d494c07d9ab7e7cdf983..5161ab30fd533d50f516bb93d5b9f402 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From a4c1e4f40aa72fb3bb2b530bb76b2d9e2eb95990 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 22 Jan 2016 13:06:39 -0800 -Subject: [PATCH 105/180] drm/vc4: Add a debugfs node for tracking execution - state. - -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_debugfs.c | 1 + - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_gem.c | 14 ++++++++++++++ - 3 files changed, 16 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c -index 245115d49c46a1244ef3e460a03fde397f763de8..94f2154c3685255e2e67d225f77dea372eae371a 100644 ---- a/drivers/gpu/drm/vc4/vc4_debugfs.c -+++ b/drivers/gpu/drm/vc4/vc4_debugfs.c -@@ -18,6 +18,7 @@ - static const struct drm_info_list vc4_debugfs_list[] = { - {"bo_stats", vc4_bo_stats_debugfs, 0}, - {"dpi_regs", vc4_dpi_debugfs_regs, 0}, -+ {"gem_exec", vc4_gem_exec_debugfs, 0}, - {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, - {"hvs_regs", vc4_hvs_debugfs_regs, 0}, - {"crtc0_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)0}, -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index f696b752886b153c4654c0b8acca3fe46c9136cb..dbe2190f30757d4ec7fa56d03de6e261e7401eb7 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -481,6 +481,7 @@ void vc4_job_handle_completed(struct vc4_dev *vc4); - int vc4_queue_seqno_cb(struct drm_device *dev, - struct vc4_seqno_cb *cb, uint64_t seqno, - void (*func)(struct vc4_seqno_cb *cb)); -+int vc4_gem_exec_debugfs(struct seq_file *m, void *arg); - - /* vc4_hdmi.c */ - extern struct platform_driver vc4_hdmi_driver; -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index ae1609e739ef424d99207f830cd2bac41ce71557..26dc4f5b491e2e7fcd1a28dcc8ef0cbe88461851 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -32,6 +32,20 @@ - #include "vc4_regs.h" - #include "vc4_trace.h" - -+#ifdef CONFIG_DEBUG_FS -+int vc4_gem_exec_debugfs(struct seq_file *m, void *unused) -+{ -+ struct drm_info_node *node = (struct drm_info_node *)m->private; -+ struct drm_device *dev = node->minor->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); -+ -+ seq_printf(m, "Emitted seqno: 0x%016llx\n", vc4->emit_seqno); -+ seq_printf(m, "Finished seqno: 0x%016llx\n", vc4->finished_seqno); -+ -+ return 0; -+} -+#endif /* CONFIG_DEBUG_FS */ -+ - static void - vc4_queue_hangcheck(struct drm_device *dev) - { - -From 61dfed9df00b486a5806d33e80edcaf578932726 Mon Sep 17 00:00:00 2001 +From aa0a8cb875b64118fee48e451ea59561e3b18b1e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2016 13:03:33 -0800 -Subject: [PATCH 106/180] drm/vc4: Include vc4_drm.h in uapi in downstream +Subject: [PATCH 102/208] drm/vc4: Include vc4_drm.h in uapi in downstream build. Signed-off-by: Eric Anholt @@ -133223,36 +132876,10 @@ index 9355dd8eff3ba39401dfe37e7fbf7737f0397f11..68828bf586f05a8d9b0a6ab409ee91a7 header-y += vmwgfx_drm.h header-y += msm_drm.h -From 1b7e8d17a18e6b4757703cef13f4d8a27c79cff9 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 14 Oct 2015 11:32:14 -0700 -Subject: [PATCH 107/180] drm/vc4: Force HDMI to connected. - -For some reason on the downstream tree, the HPD GPIO isn't working. - -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 4452f3631cacea37bbd5dc8a594367631e308adc..3a622f70a077c2ebe214830f5d700cd8fe16e442 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -166,6 +166,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) - struct drm_device *dev = connector->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); - -+ return connector_status_connected; -+ - if (vc4->hdmi->hpd_gpio) { - if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^ - vc4->hdmi->hpd_active_low) - -From fa3339b7d7ca3c067f35c8e46bbde6752032c6d0 Mon Sep 17 00:00:00 2001 +From e6971437077eda153890c78e3428cd883499d7b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 108/180] config: Add default configs +Subject: [PATCH 103/208] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1294 +++++++++++++++++++++++++++++++++++ @@ -135871,10 +135498,10 @@ index 0000000000000000000000000000000000000000..cfe21355f7d95326b292be1b018b988f +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From f4553b93fada5ed2f16ea78d5835bc912926468c Mon Sep 17 00:00:00 2001 +From fba149883c98450421b61cac552394f43efbfda2 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 109/180] Add arm64 configuration and device tree differences. +Subject: [PATCH 104/208] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -137277,10 +136904,10 @@ index 0000000000000000000000000000000000000000..1fcde8c1329bbfd329245a8bb1769199 +CONFIG_LIBCRC32C=y +CONFIG_BCM2708_VCHIQ=n -From 61c595f2eac54afac0e96493e7285ea8625b8d4d Mon Sep 17 00:00:00 2001 +From 54f507bf54343e3d66964683f676cbfef1beed5f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Oct 2016 16:10:59 +0100 -Subject: [PATCH 110/180] bcm2835-cpufreq: Only report a single frequency when +Subject: [PATCH 105/208] bcm2835-cpufreq: Only report a single frequency when max and min frequencies are the same 4.8 kernel gives EINV error when max and min frequencies are the same (e.g. from using force_turbo=1) @@ -137349,10 +136976,10 @@ index 3eb9e9326231b08e6ee95ad486485245c71cf868..414fbdc10dfbfc6e4bb47870a7af3fd5 /* the CPUFreq driver */ -From 82f087bf5b21619701c31ad1e800573b61c4122c Mon Sep 17 00:00:00 2001 +From 4896a5fdcc6c95ae207070fe78e3aad60e597ce3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 7 Oct 2016 12:37:09 +0100 -Subject: [PATCH 111/180] scripts/mkknlimg: Change string for DDT detection +Subject: [PATCH 106/208] scripts/mkknlimg: Change string for DDT detection The old "of_overlay_apply" string does not appear in 4.8 kernel builds. "of_cfs_init" is both present and a more accurate indication of support @@ -137379,10 +137006,10 @@ index 78c5845d2f01deb04b477327d83fa60624f87f98..a21f7e31bc904233e980e66ae3e6337e my $res = try_extract($kernel_file, $tmpfile1); -From 718c0d7437fdb6d45350fec89b9002896010a6d9 Mon Sep 17 00:00:00 2001 +From dc56c6cc7558f783449f7ff3943aa7698d9a2144 Mon Sep 17 00:00:00 2001 From: Herve Jourdain Date: Fri, 20 May 2016 16:02:23 +0800 -Subject: [PATCH 112/180] build: support for .dtbo files for dtb overlays +Subject: [PATCH 107/208] build: support for .dtbo files for dtb overlays Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb. Patch the kernel, which has faulty rules to generate .dtbo the way yocto does @@ -137424,10 +137051,10 @@ index 1d949b7410600dd3b04a3acde8c41cfead15bfa4..1967878a843461c3ff1f473b9a030eb0 -d $(depfile).dtc.tmp $(dtc-tmp) ; \ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) -From 67a2b2c62042429639c5a988a094da1665f58b05 Mon Sep 17 00:00:00 2001 +From e8fc35c718297a56d13a92eb51d984ba28e5916e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 6 Oct 2016 19:42:55 -0700 -Subject: [PATCH 113/180] [media]bcm2835-camera: fix compilation warning/werror +Subject: [PATCH 108/208] [media]bcm2835-camera: fix compilation warning/werror | /a/builder/mnt/build/tmp-glibc/work-shared/raspberrypi3/kernel-source/drivers/media/platform/bcm2835/bcm2835-camera.c:656:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types ] @@ -137457,10 +137084,10 @@ index 70f4db2741037381e638d1dda5a95478809eb161..cb5bab642eaab2f60d641801dd0afdac struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq); unsigned long size; -From 6b552083c6c5f637532da8d50718811fe33896d4 Mon Sep 17 00:00:00 2001 +From 6c91352d35ed41686937484e2777a8af6652d2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 8 Oct 2016 16:26:46 +0200 -Subject: [PATCH 114/180] bcm2709: Drop platform smp and timer init code +Subject: [PATCH 109/208] bcm2709: Drop platform smp and timer init code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -137635,10 +137262,10 @@ index 90773a30b87abbfda1615326c6faf59b9db6d68e..d4c9d57d78a964fbbf799b534471462d .init_early = bcm2709_init_early, .reserve = board_reserve, -From 88f2148f6277381213cc5e4876c0802c9cac8ef9 Mon Sep 17 00:00:00 2001 +From b9634bc3431cbe7aa5157750ab5943024019a99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 3 Oct 2016 17:53:15 +0200 -Subject: [PATCH 115/180] BCM270X_DT: Use bcm283x.dtsi, bcm2835.dtsi and +Subject: [PATCH 110/208] BCM270X_DT: Use bcm283x.dtsi, bcm2835.dtsi and bcm2836.dtsi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -138767,10 +138394,10 @@ index 223bd9627b3dcaac5458909dc59c877eed751ce4..491594c918cf5da94fbb19a606edb0dd +}; +#endif -From 7115222b7fd98472249c78d6a798aea2db3692e7 Mon Sep 17 00:00:00 2001 +From 3011169b346afd96213eb70e42af510451aabfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 16:50:59 +0200 -Subject: [PATCH 116/180] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 111/208] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -138894,10 +138521,10 @@ index 4dddd8298a227d64862f2e92954a465f2e44b3f6..1f545e024422f59280932713e6a1b051 register_restart_handler(&wdt->restart_handler); if (pm_power_off == NULL) -From d20285ee433822c6a0d2ad7bec5a3fe404a5d356 Mon Sep 17 00:00:00 2001 +From 4bea90c43d3fd3e0594f3dc52746f42ca16b8eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 17:07:46 +0200 -Subject: [PATCH 117/180] bcm270x: Use watchdog for reboot/poweroff +Subject: [PATCH 112/208] bcm270x: Use watchdog for reboot/poweroff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139156,10 +138783,10 @@ index d4c9d57d78a964fbbf799b534471462d3c3b88f1..ed5c5414f7a3ad7284cda881e9e55077 module_param(serial, uint, 0644); -module_param(reboot_part, uint, 0644); -From c0b3074c99075a159a88f31869485da976771010 Mon Sep 17 00:00:00 2001 +From f384e2b3b12499f3677facd847263c2669f71d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:35:40 +0200 -Subject: [PATCH 118/180] bcm270x: Remove dead files +Subject: [PATCH 113/208] bcm270x: Remove dead files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139360,10 +138987,10 @@ index 6aa68260dd866c83527dffece8de483913231fb3..00000000000000000000000000000000 - */ -#define VMALLOC_END (0xff000000) -From 49d0e1524570f9a0a64c474d311695fd30ec4e6b Mon Sep 17 00:00:00 2001 +From 0b9d5789d2a90665ed8f46c3dcdff92d3da2e8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:37:43 +0200 -Subject: [PATCH 119/180] bcm270x: Drop bcm2835-aux-uart hack +Subject: [PATCH 114/208] bcm270x: Drop bcm2835-aux-uart hack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139443,71 +139070,10 @@ index ed5c5414f7a3ad7284cda881e9e550777cd29282..9a1ad48d13172856e3ec748db015cb95 system_serial_low = serial; } -From 21884a104351f15b92db7efa464289ff6fcc36fe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= -Date: Mon, 10 Oct 2016 17:39:30 +0200 -Subject: [PATCH 120/180] Revert "bcm2835: Add support for uart1" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit 86eba5c1a1089dc0bad01735f559e37d08525527. - -The gated bcm2835-aux clock is now used to enable uart1 so drop this hack. - -Signed-off-by: Noralf Trønnes ---- - arch/arm/mach-bcm/board_bcm2835.c | 25 ------------------------- - 1 file changed, 25 deletions(-) - -diff --git a/arch/arm/mach-bcm/board_bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c -index 0ef5cd3d1d6ec420360294acc98d40d698d38d8a..8f152266ba9b470df2eaaed9ebcf158ed2079834 100644 ---- a/arch/arm/mach-bcm/board_bcm2835.c -+++ b/arch/arm/mach-bcm/board_bcm2835.c -@@ -21,29 +21,6 @@ - #include - #include - --/* Use this hack until a proper solution is agreed upon */ --static void __init bcm2835_init_uart1(void) --{ -- struct device_node *np; -- -- np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart"); -- if (of_device_is_available(np)) { -- np = of_find_compatible_node(NULL, NULL, -- "bcrm,bcm2835-aux-enable"); -- if (np) { -- void __iomem *base = of_iomap(np, 0); -- -- if (!base) { -- pr_err("bcm2835: Failed enabling Mini UART\n"); -- return; -- } -- -- writel(1, base); -- pr_info("bcm2835: Mini UART enabled\n"); -- } -- } --} -- - static void __init bcm2835_init(void) - { - struct device_node *np = of_find_node_by_path("/system"); -@@ -56,8 +33,6 @@ static void __init bcm2835_init(void) - system_rev = val; - if (!of_property_read_u64(np, "linux,serial", &val64)) - system_serial_low = val64; -- -- bcm2835_init_uart1(); - } - - static const char * const bcm2835_compat[] = { - -From e2d9b9aba7df9ef67560ca521bab65c784522e81 Mon Sep 17 00:00:00 2001 +From 609fc508667ebfb25abaab84e856373ea13ad521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:41:26 +0200 -Subject: [PATCH 121/180] bcm270x: Remove unnecessary of_platform_populate +Subject: [PATCH 115/208] bcm270x: Remove unnecessary of_platform_populate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139582,10 +139148,10 @@ index 9a1ad48d13172856e3ec748db015cb95cd110b76..d2762f558f644ac87c56ba9402a638a3 system_serial_low = serial; } -From ebfd049e7c2432f98308f0390833402a1ffb8731 Mon Sep 17 00:00:00 2001 +From f24c1d7e84b995a5c72dcfeaa4dec996f816438e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 17:46:27 +0200 -Subject: [PATCH 122/180] bcm270x: Remove 4MB dma coherent pool +Subject: [PATCH 116/208] bcm270x: Remove 4MB dma coherent pool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139666,10 +139232,10 @@ index d2762f558f644ac87c56ba9402a638a3c7a26397..d0e43619669e851350c5d9d7bb7e9dd1 .dt_compat = bcm2709_compat, MACHINE_END -From e4e0035459c52a2014e77bdcf723043404b01a6d Mon Sep 17 00:00:00 2001 +From 0fcba7b96ea2778232431b7ae302e1473c1abdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 19:26:42 +0200 -Subject: [PATCH 123/180] bcm270x: Drop map_io device mapping +Subject: [PATCH 117/208] bcm270x: Drop map_io device mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -140618,10 +140184,10 @@ index de7504bfc20ba24be8707861b8389783860adb77..00000000000000000000000000000000 - */ -#define arch_decomp_wdog() -From 9ff2c622c446065b08d0f1ec4e5aef4eccad2591 Mon Sep 17 00:00:00 2001 +From 038f7a212a81706150142e5415ddb060d46c76bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 10 Oct 2016 19:37:06 +0200 -Subject: [PATCH 124/180] bcm270x: Use DT_MACHINE_START +Subject: [PATCH 118/208] bcm270x: Use DT_MACHINE_START MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -140703,10 +140269,10 @@ index b52d949ee91d96eb7672fbbb4969bfa1e7afc376..2ed1b8a922ed02b9e3545991873af77b ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206 wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207 -From c8c5584711a50fdf44258456c27732e07d98c7f5 Mon Sep 17 00:00:00 2001 +From fde57b59c0e15f0416bc962bb82988aba3715acf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 11 Oct 2016 17:48:07 +0100 -Subject: [PATCH 125/180] Use DT rather than modules params for board rev and +Subject: [PATCH 119/208] Use DT rather than modules params for board rev and serial --- @@ -140800,10 +140366,10 @@ index 9cf36118e57b3c362de9adcf089425023d4a601d..9f113736627175bdcb362e0eda469e09 -module_param(boardrev, uint, 0644); -module_param(serial, uint, 0644); -From 3fc7a39e9cec76ca4bf174d7011a90aa95993c94 Mon Sep 17 00:00:00 2001 +From c687c89cf84f71ee3e67c3b965106b5f4d9aa774 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 126/180] Register the clocks early during the boot process, so +Subject: [PATCH 120/208] Register the clocks early during the boot process, so that special/critical clocks can get enabled early on in the boot process avoiding the risk of disabling a clock, pll_divider or pll when a claiming driver fails to install propperly - maybe it needs to defer. @@ -140849,10 +140415,10 @@ index fbf616021704178a9d007219a0ea2a9f1704f0a6..cbbc8d4ddcffc797268c0ecb6477005f MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From 35bc6637100501fc1b473315eff0966a5b1455dc Mon Sep 17 00:00:00 2001 +From fd03919a330c5acea88972ccb762f5786b9b13f2 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Tue, 27 Sep 2016 04:29:00 -0400 -Subject: [PATCH 127/180] Add Adafruit pitft35 touchscreen support (#1657) +Subject: [PATCH 121/208] Add Adafruit pitft35 touchscreen support (#1657) The dts comes from the Adafruit repository @@ -141057,10 +140623,10 @@ index 952104ab6c4cd0e9d8f7bd5f2fba7a72da75424e..26fa6c2b6b6d745178e666465ba226af CONFIG_FB_TFT_ILI9320=m CONFIG_FB_TFT_ILI9325=m -From d3aad2058e7d3eb2b17dc44ac2914e75ded5ae9b Mon Sep 17 00:00:00 2001 +From 0a83e0533ed80a1ae7f8dbbd570a2c245c9432de Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Oct 2016 15:06:20 +0100 -Subject: [PATCH 128/180] BCM270X_DT: Update CM3 to use sdhost interface +Subject: [PATCH 122/208] BCM270X_DT: Update CM3 to use sdhost interface --- arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 9 ++++----- @@ -141096,10 +140662,10 @@ index b5a5ae7747455438f8eabd28e8c11c6aeb0c1ecc..d13e3d4dac4e198c8cac451e3f64ef68 bus-width = <4>; status = "okay"; -From 4716ccd82b5bb98a472282de9d3409760dc56504 Mon Sep 17 00:00:00 2001 +From e729cf9692cd384eb83f1291714965624604b8c0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 12 Oct 2016 15:10:14 +0100 -Subject: [PATCH 129/180] mmc: info (not err) msg on clock probe deferral +Subject: [PATCH 123/208] mmc: info (not err) msg on clock probe deferral --- drivers/mmc/host/bcm2835-mmc.c | 5 ++++- @@ -141141,10 +140707,10 @@ index 23dea422182534e248435aeaee3ecb5da69c0d33..9e55d5ac08b5809c40fe391ae6e685fd } -From 90bef0ddde4c379544d72673b6bbb1e25f58da7f Mon Sep 17 00:00:00 2001 +From 72b5f15453aca3a241e4fdc0751187f51d8d3f8e Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 15 Oct 2016 11:49:52 -0700 -Subject: [PATCH 130/180] ARM64: Modify default config to get raspbian to boot +Subject: [PATCH 124/208] ARM64: Modify default config to get raspbian to boot (#1686) 1. Enable emulation of deprecated instructions. @@ -141209,10 +140775,10 @@ index 1fcde8c1329bbfd329245a8bb17691999882ccfc..d7406f5a4620151044b8f716b4d10bb8 CONFIG_MFD_STMPE=y CONFIG_STMPE_SPI=y -From dd00846e7362d7f8e2dfa3f945c9557636b21193 Mon Sep 17 00:00:00 2001 +From 058069f821d2a205b7e0d8b9741aee5a19e71814 Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 131/180] Support for Blokas Labs pisound board +Subject: [PATCH 125/208] Support for Blokas Labs pisound board --- .../devicetree/bindings/vendor-prefixes.txt | 1 + @@ -142438,10 +142004,10 @@ index 0000000000000000000000000000000000000000..b156e5793e4c482385dedafd85bbf190 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From 7712510f8ad660023926fed17081c763de92ed7d Mon Sep 17 00:00:00 2001 +From 5c4d2949f96142001b815fb44e7a6aedec2d83c2 Mon Sep 17 00:00:00 2001 From: Giedrius Trainavicius Date: Tue, 25 Oct 2016 01:47:20 +0300 -Subject: [PATCH 132/180] FIXUP: pisound: Fix a warning in DEBUG builds +Subject: [PATCH 126/208] FIXUP: pisound: Fix a warning in DEBUG builds Also change a macro that enables debug level printing from DEBUG to PISOUND_DEBUG. @@ -142472,10 +142038,10 @@ index b156e5793e4c482385dedafd85bbf190acc8162b..a3cd089a01447bdb6741ed6bba3b21d4 } -From fd80f9a5a2d0e2bdeeb26e38525c9421519eb159 Mon Sep 17 00:00:00 2001 +From b50c2a9e07bcdf93ca4110cdba3792a9bfb93167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:25:41 +0200 -Subject: [PATCH 133/180] bcm270x: Remove bcm2708_reboot_mode parameter +Subject: [PATCH 127/208] bcm270x: Remove bcm2708_reboot_mode parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142509,10 +142075,10 @@ index 0a0332cb13a7475ee0c4d75a97685b7de6475c95..612eb530f33fcd19bc4539facb26fc30 { unsigned long flags; -From 3a774fd38004c269f0e8860a0d8c49b2ce1a50b5 Mon Sep 17 00:00:00 2001 +From 7c233a345d15064604d3194b35b0aa56ea2f9b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 15:54:41 +0200 -Subject: [PATCH 134/180] bcm270x: Remove NEED_MACH_IO_H +Subject: [PATCH 128/208] bcm270x: Remove NEED_MACH_IO_H MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142629,10 +142195,10 @@ index e6eb84d71006db417dbd0afc4d08d3b19b09a619..00000000000000000000000000000000 - -#endif -From f35d4b56ee7f998f02fb8888d2907d54439ab8b9 Mon Sep 17 00:00:00 2001 +From f30338340fc8707bd44a054991d9bba94297ac80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:01:01 +0200 -Subject: [PATCH 135/180] dwc_otg: Pass struct device to dma_alloc*() +Subject: [PATCH 129/208] dwc_otg: Pass struct device to dma_alloc*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143257,10 +142823,10 @@ index 5624f32c9ea9117599df451af29fca2e3bca36de..50aaeacdd12fff93d7a9cf1c54612367 if (!otg_dev->pcd) { DWC_ERROR("dwc_otg_pcd_init failed\n"); -From 9ed7e85457a3a3f8c5507e7bbb0d2d7f330ddb43 Mon Sep 17 00:00:00 2001 +From 27dc18be13e874cdbe167edb6c2929ab4d2c2e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:05:36 +0200 -Subject: [PATCH 136/180] mmc: bcm2835-sdhost: Pass struct device to +Subject: [PATCH 130/208] mmc: bcm2835-sdhost: Pass struct device to dma_alloc*() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -143310,10 +142876,10 @@ index 9e55d5ac08b5809c40fe391ae6e685fdb4d62df7..a9bc79bfdbb71807819dfe2d8f165144 mmc_of_parse(mmc); else -From 71e6580012e438de59b2676c9b0096acf70c3c85 Mon Sep 17 00:00:00 2001 +From 22d03d1b65d08b5ed7bea59d49f1a455a3636cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 19 Oct 2016 16:16:48 +0200 -Subject: [PATCH 137/180] bcm270x: Drop NEED_MACH_MEMORY_H and use DT +Subject: [PATCH 131/208] bcm270x: Drop NEED_MACH_MEMORY_H and use DT dma-ranges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -143568,10 +143134,10 @@ index 7548a52dcf84affa4d1b0667e5e2f89f591891b8..00000000000000000000000000000000 - -#endif -From 4d259de890f3bf166dd163dceda6eb159d6f45c5 Mon Sep 17 00:00:00 2001 +From 26802db0c398a49668f6d029b50f59876a6f25f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 15:55:09 +0200 -Subject: [PATCH 138/180] dts: Remove bcm2835-rpi-cm.dts +Subject: [PATCH 132/208] dts: Remove bcm2835-rpi-cm.dts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143737,10 +143303,10 @@ index 9c4000fc686a9882b9ddde24fdcf937d52b0f86f..00000000000000000000000000000000 - }; -}; -From 5fad55b8dccf8ba5ba677aa3fc869d1b71e69d56 Mon Sep 17 00:00:00 2001 +From b709b3aa0d39d58479b4a579866ed27cebf3a9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 16:00:07 +0200 -Subject: [PATCH 139/180] bcm2708: Convert to ARCH_MULTIPLATFORM +Subject: [PATCH 133/208] bcm2708: Convert to ARCH_MULTIPLATFORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144061,10 +143627,10 @@ index 75da978fac0e06819d8a9740b95ee3d7035c1059..662790c8fa9c972bbf3ac7f41b9f5eac obj-$(CONFIG_ARCH_BCM2709) += irq-bcm2836.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o -From 6bf013d50367a5a725dda9c77c47532cfd5baa84 Mon Sep 17 00:00:00 2001 +From ef5da26a574bc300c0cffe21b7a1a041c0676465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 16:02:39 +0200 -Subject: [PATCH 140/180] bcm2709: Convert to ARCH_MULTIPLATFORM +Subject: [PATCH 134/208] bcm2709: Convert to ARCH_MULTIPLATFORM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144334,10 +143900,10 @@ index 662790c8fa9c972bbf3ac7f41b9f5eace912b69c..4c203b6b816357dce8d7a768ac81feab obj-$(CONFIG_ARCH_HIP04) += irq-hip04.o obj-$(CONFIG_ARCH_LPC32XX) += irq-lpc32xx.o -From 8dea0d55600d8f63bad168fc112e2f59c7122db5 Mon Sep 17 00:00:00 2001 +From aba21f030087d28e7f8dc7177efe4632ea1a2e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 25 Oct 2016 17:32:02 +0200 -Subject: [PATCH 141/180] kconfig: Just use ARCH_BCM2835 for depends on +Subject: [PATCH 135/208] kconfig: Just use ARCH_BCM2835 for depends on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144668,10 +144234,10 @@ index aed7b47d8736ea3fb1810b0c77916855082f3b2d..d024377e8450fb5402dcb5ea27161f77 select REGMAP_MMIO help -From 338e84cf2384243cb4e8bb13ddc1efcb00695029 Mon Sep 17 00:00:00 2001 +From d770fc68afb2244e1eae7cb99da07425244c500e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 28 Oct 2016 13:55:36 +0100 -Subject: [PATCH 142/180] bcm270x: Use dma-ranges unconditionally on bcm2710 +Subject: [PATCH 136/208] bcm270x: Use dma-ranges unconditionally on bcm2710 See: https://github.com/raspberrypi/linux/pull/1699 @@ -144705,10 +144271,10 @@ index 491594c918cf5da94fbb19a606edb0dd9a28c3a9..df1a4ce1cd4e570876b7785b357d6c31 interrupts = <8>; }; -From 721837dd34086b06a2fa8fbd5f18f48bff592196 Mon Sep 17 00:00:00 2001 +From 3c5d9cfdf541f1da85a407745d790a5cef1d9b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 27 Oct 2016 21:57:56 +0200 -Subject: [PATCH 143/180] BCM270X_DT: Use raspberrypi-power to turn on USB +Subject: [PATCH 137/208] BCM270X_DT: Use raspberrypi-power to turn on USB power MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -144734,10 +144300,10 @@ index d85c05901c8f55f822b89c32d198f15559a2b4b0..46cf8602c3b96e477b05b57dbfe5e349 + power-domains = <&power RPI_POWER_DOMAIN_USB>; +}; -From afeb7f661837302d8c9f51349aaa9b9812795d18 Mon Sep 17 00:00:00 2001 +From 3fc6c0966f06447cfabc8f5b220d32b59e9b7cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 27 Oct 2016 21:58:09 +0200 -Subject: [PATCH 144/180] firmware: bcm2835: Don't turn on USB power +Subject: [PATCH 138/208] firmware: bcm2835: Don't turn on USB power MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -144793,10 +144359,10 @@ index b980d531b35b9981a88356ef1c8a7b868a85f2b5..3f070bd38a91511c986e3fb114b15bd4 } -From bd33aaa2ff70472fb7c9c46feb569d3d5f4a32f4 Mon Sep 17 00:00:00 2001 +From da310619ddd881d063323ee8e3bdc1c8b2b5d9a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 31 Oct 2016 17:35:31 +0000 -Subject: [PATCH 145/180] bcm2835: Increase coherent allocation to 1M for +Subject: [PATCH 139/208] bcm2835: Increase coherent allocation to 1M for dwc_otg bounce buffers --- @@ -144854,10 +144420,10 @@ index 6ce49dea7856b243b38f180231afd25b57dee729..efbd18020479c1cab40ce680446a4259 MACHINE_END #endif -From 188fb58e6b05f0ad6c44096fab31ec9b38d76204 Mon Sep 17 00:00:00 2001 +From 48080e34503d7f5433c56d78586691429a431cdb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 31 Oct 2016 17:35:57 +0000 -Subject: [PATCH 146/180] dwc_otg: Warn if dma_alloc_coherent fails +Subject: [PATCH 140/208] dwc_otg: Warn if dma_alloc_coherent fails --- drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c | 1 + @@ -144876,10 +144442,10 @@ index 50aaeacdd12fff93d7a9cf1c54612367406c6bee..e799f15f294706ad7ac328dcb9ce68fb /* Check dword alignment */ if (((int)buf & 0x3UL) != 0) { -From 01173b3a476ff625494e0fbd8e98104cb8d76068 Mon Sep 17 00:00:00 2001 +From 556dcc28d787925ac811fede23d170daa24649fd Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Fri, 4 Nov 2016 16:13:07 -0700 -Subject: [PATCH 147/180] bcmrpi3_defconfig: Update config to be compatible +Subject: [PATCH 141/208] bcmrpi3_defconfig: Update config to be compatible with latest Kconfig changes. This new config has been run through make savedefconfig. @@ -145135,10 +144701,10 @@ index d7406f5a4620151044b8f716b4d10bb818648e06..cd1d39b467a947a015eb14568086a6ba CONFIG_LIBCRC32C=y -CONFIG_BCM2708_VCHIQ=n -From 872d3308c9f0b510ca446d1d0654ff236e98e3bd Mon Sep 17 00:00:00 2001 +From 8327ba9ec4f7544d9045f390e72e5305f79f0289 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 148/180] spi-bcm2835: Remove unused code +Subject: [PATCH 142/208] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -145226,10 +144792,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From 97852f5996e1e2379deeaeacc046a92593b3c003 Mon Sep 17 00:00:00 2001 +From a52fcdf0feb26148aa77f39f5ed28d40b45eb201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 17 Sep 2016 15:07:10 +0200 -Subject: [PATCH 149/180] i2c: bcm2835: Fix hang for writing messages larger +Subject: [PATCH 143/208] i2c: bcm2835: Fix hang for writing messages larger than 16 bytes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -145319,10 +144885,10 @@ index d4f3239b56865919e1b781b20a7c5ebcd76b4eb9..f283b714aa79e2e4685ed95b04b6b289 i2c_dev->msg_buf_remaining = msg->len; reinit_completion(&i2c_dev->completion); -From b3da384dcec48d3484b202acb27bbb3845a02dd5 Mon Sep 17 00:00:00 2001 +From 2bfb98d7ef7b2599e323ce5bf7d55da796d1d73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 18:24:38 +0200 -Subject: [PATCH 150/180] i2c: bcm2835: Protect against unexpected TXW/RXR +Subject: [PATCH 144/208] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -145447,10 +145013,10 @@ index f283b714aa79e2e4685ed95b04b6b289f7e9eee7..d2ba1a4de36af512e8e3c97251bd3537 return -ETIMEDOUT; } -From ba5a71247622f7e8c83069a64a4c53cf621cf0d7 Mon Sep 17 00:00:00 2001 +From 95c425e3ae8a01e772381b1d262599a85b6d1871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 19 Sep 2016 17:19:41 +0200 -Subject: [PATCH 151/180] i2c: bcm2835: Use dev_dbg logging on transfer errors +Subject: [PATCH 145/208] i2c: bcm2835: Use dev_dbg logging on transfer errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145482,10 +145048,10 @@ index d2ba1a4de36af512e8e3c97251bd3537ae61591a..54d510abd46a117c9238fc6d7edec840 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From e7fc8951228f156e7b4e4207aa7acb60020d713d Mon Sep 17 00:00:00 2001 +From dd2fb326c9bea407665658538a993d907b681b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 22 Sep 2016 22:05:50 +0200 -Subject: [PATCH 152/180] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK +Subject: [PATCH 146/208] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145529,10 +145095,10 @@ index 54d510abd46a117c9238fc6d7edec84019d1f60d..565ef69ce61423544dc0558c85ef318b if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) -From 3307e9ee46ea8c9eaf82027d8838c9ae5d2c0dad Mon Sep 17 00:00:00 2001 +From e8a3cc458193ad57270e74ceff8f5059ecdfb0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:54:27 +0200 -Subject: [PATCH 153/180] i2c: bcm2835: Add support for Repeated Start +Subject: [PATCH 147/208] i2c: bcm2835: Add support for Repeated Start Condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -145714,10 +145280,10 @@ index 565ef69ce61423544dc0558c85ef318b0ae9c324..241e08ae7c27cec23fad3c1bf3ebad3a static u32 bcm2835_i2c_func(struct i2c_adapter *adap) -From 0cdac873bfb9969fea6079f231f3ddedbd19e1f5 Mon Sep 17 00:00:00 2001 +From 3b97a07025c5bda264cdec1cf56d84d7c5ee90be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:57:17 +0200 -Subject: [PATCH 154/180] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT +Subject: [PATCH 148/208] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145754,10 +145320,10 @@ index 241e08ae7c27cec23fad3c1bf3ebad3a4d2a8e6f..d2085dd3742eabebc537621968088261 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -From 6dd3bca1e0d87bd7e3a7238470deed0f19f74731 Mon Sep 17 00:00:00 2001 +From e67fa8bf66a0efa9d4604cb77c6f7b44a887618b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 27 Sep 2016 01:00:08 +0200 -Subject: [PATCH 155/180] i2c: bcm2835: Add support for dynamic clock +Subject: [PATCH 149/208] i2c: bcm2835: Add support for dynamic clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -145873,10 +145439,10 @@ index d2085dd3742eabebc537621968088261f8dc7ea8..c3436f627028477f7e21b47e079fd5ab irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq) { -From 63ab758df54bbc7f40b920ab219186b6f335382d Mon Sep 17 00:00:00 2001 +From 93b4f7766d563b91a30df26ee3305e88d6d56c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 15:15:41 +0100 -Subject: [PATCH 156/180] i2c: bcm2835: Add debug support +Subject: [PATCH 150/208] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146065,10 +145631,10 @@ index c3436f627028477f7e21b47e079fd5ab06ec188a..8642f580ce41803bd22c76a0fa80d083 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From da81c921c72f2426b6c63ddf6eaa2d0bd6682fd8 Mon Sep 17 00:00:00 2001 +From 37134679c255f5b1b4c42e85b454c9dac1308e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 20:03:29 +0100 -Subject: [PATCH 157/180] config: Enable i2c-bcm2835 +Subject: [PATCH 151/208] config: Enable i2c-bcm2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146104,10 +145670,10 @@ index 27c61471a12a38feda62447af8010530bc89c141..98b2e5992a45a6212ef9a8b9826431d9 CONFIG_SPI=y CONFIG_SPI_BCM2835=m -From 8f66a986ad5ceef553f200b27c6538312224710f Mon Sep 17 00:00:00 2001 +From 0abcf1feef4457158239d560a7c5c103eb1b347c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 15:42:55 +0100 -Subject: [PATCH 158/180] BCM270X_DT: Use i2c-bcm2835 as default +Subject: [PATCH 152/208] BCM270X_DT: Use i2c-bcm2835 as default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146150,10 +145716,10 @@ index 7fb1f428332dc48bdd91dd4a0773f3bea7057238..514b481d4f4095dc8b55a216ac733593 /* Add alias */ status = "disabled"; -From a0cad5fbdb9e41c53891ecf409f3a946722fbdc1 Mon Sep 17 00:00:00 2001 +From 279b8a1317b5d18d1d61de902d95fb6fa60b08cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 11 Nov 2016 18:24:26 +0100 -Subject: [PATCH 159/180] BCM270X_DT: Add fallback overlay for i2c-bcm2708 +Subject: [PATCH 153/208] BCM270X_DT: Add fallback overlay for i2c-bcm2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146215,10 +145781,10 @@ index 0000000000000000000000000000000000000000..0afc6b405414c97428278dd3e8836759 + }; +}; -From 741e26e769375407420af946cc8de09537fb95ee Mon Sep 17 00:00:00 2001 +From 4825aaa3b75f9a89acec9cfc3d13eaa0ff1eac4d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Sep 2016 10:07:27 -0700 -Subject: [PATCH 160/180] clk: bcm2835: Clamp the PLL's requested rate to the +Subject: [PATCH 154/208] clk: bcm2835: Clamp the PLL's requested rate to the hardware limits. Fixes setting low-resolution video modes on HDMI. Now the PLLH_PIX @@ -146262,10 +145828,10 @@ index cbbc8d4ddcffc797268c0ecb6477005fa14e228b..89645d63af53a3559c4b2e88f9a592fe use_fb_prediv = true; rate /= 2; -From 6edafb84ee93624ac0057c772ca0e008453f1e98 Mon Sep 17 00:00:00 2001 +From 2d17a0acdfe3de2822caab8c0ad00f7ef2b8f4b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 1 Nov 2016 13:10:05 +0000 -Subject: [PATCH 161/180] config: Add CONFIG_HTU21 module +Subject: [PATCH 155/208] config: Add CONFIG_HTU21 module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -146297,110 +145863,10 @@ index 98b2e5992a45a6212ef9a8b9826431d9fc024169..43fc0a37f8bf2701aac84962203e7219 CONFIG_PWM_PCA9685=m CONFIG_RASPBERRYPI_FIRMWARE=y -From 06b5b05055a5f03904367ca9a11f748cb9904a6a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 31 Oct 2016 17:42:54 +0000 -Subject: [PATCH 162/180] config: Add SECOMP options from #1698 - ---- - arch/arm/configs/bcm2709_defconfig | 8 +++++++- - arch/arm/configs/bcmrpi_defconfig | 7 ++++++- - 2 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index a620bb77fd7934a9977adf3944bb2f3be9d83443..8ab82ca775b336c6786a76dbaacaeb8e4a5da660 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -14,11 +14,15 @@ CONFIG_IKCONFIG=m - CONFIG_IKCONFIG_PROC=y - CONFIG_NMI_LOG_BUF_SHIFT=12 - CONFIG_MEMCG=y -+CONFIG_MEMCG_SWAP=y - CONFIG_BLK_CGROUP=y -+CONFIG_CFS_BANDWIDTH=y -+CONFIG_CGROUP_PIDS=y - CONFIG_CGROUP_FREEZER=y - CONFIG_CPUSETS=y - CONFIG_CGROUP_DEVICE=y - CONFIG_CGROUP_CPUACCT=y -+CONFIG_CGROUP_PERF=y - CONFIG_NAMESPACES=y - CONFIG_USER_NS=y - CONFIG_SCHED_AUTOGROUP=y -@@ -44,7 +48,6 @@ CONFIG_SMP=y - CONFIG_VMSPLIT_2G=y - CONFIG_PREEMPT_VOLUNTARY=y - CONFIG_AEABI=y --CONFIG_OABI_COMPAT=y - # CONFIG_CPU_SW_DOMAIN_PAN is not set - CONFIG_CLEANCACHE=y - CONFIG_FRONTSWAP=y -@@ -342,6 +345,7 @@ CONFIG_NET_ACT_SKBEDIT=m - CONFIG_NET_ACT_CSUM=m - CONFIG_BATMAN_ADV=m - CONFIG_OPENVSWITCH=m -+CONFIG_CGROUP_NET_PRIO=y - CONFIG_NET_PKTGEN=m - CONFIG_HAMRADIO=y - CONFIG_AX25=m -@@ -1278,6 +1282,8 @@ CONFIG_FUNCTION_PROFILER=y - CONFIG_KGDB=y - CONFIG_KGDB_KDB=y - CONFIG_KDB_KEYBOARD=y -+CONFIG_SECURITY=y -+CONFIG_SECURITY_APPARMOR=y - CONFIG_CRYPTO_USER=m - CONFIG_CRYPTO_CBC=y - CONFIG_CRYPTO_CTS=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 43fc0a37f8bf2701aac84962203e7219645d5d7b..3de3a93921cbea9e56ac34d589ec6e83ddb5e7c1 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -13,11 +13,14 @@ CONFIG_IKCONFIG=m - CONFIG_IKCONFIG_PROC=y - CONFIG_NMI_LOG_BUF_SHIFT=12 - CONFIG_MEMCG=y -+CONFIG_MEMCG_SWAP=y - CONFIG_BLK_CGROUP=y -+CONFIG_CGROUP_PIDS=y - CONFIG_CGROUP_FREEZER=y - CONFIG_CPUSETS=y - CONFIG_CGROUP_DEVICE=y - CONFIG_CGROUP_CPUACCT=y -+CONFIG_CGROUP_PERF=y - CONFIG_NAMESPACES=y - CONFIG_USER_NS=y - CONFIG_SCHED_AUTOGROUP=y -@@ -43,7 +46,6 @@ CONFIG_ARCH_BCM2708=y - # CONFIG_CACHE_L2X0 is not set - CONFIG_PREEMPT_VOLUNTARY=y - CONFIG_AEABI=y --CONFIG_OABI_COMPAT=y - # CONFIG_CPU_SW_DOMAIN_PAN is not set - CONFIG_CLEANCACHE=y - CONFIG_FRONTSWAP=y -@@ -338,6 +340,7 @@ CONFIG_NET_ACT_SKBEDIT=m - CONFIG_NET_ACT_CSUM=m - CONFIG_BATMAN_ADV=m - CONFIG_OPENVSWITCH=m -+CONFIG_CGROUP_NET_PRIO=y - CONFIG_NET_PKTGEN=m - CONFIG_HAMRADIO=y - CONFIG_AX25=m -@@ -1289,6 +1292,8 @@ CONFIG_FUNCTION_PROFILER=y - CONFIG_KGDB=y - CONFIG_KGDB_KDB=y - CONFIG_KDB_KEYBOARD=y -+CONFIG_SECURITY=y -+CONFIG_SECURITY_APPARMOR=y - CONFIG_CRYPTO_USER=m - CONFIG_CRYPTO_CRYPTD=m - CONFIG_CRYPTO_CBC=y - -From a0cd5e5a816cb4fd1f1e08f2dc7d78ddbff3e787 Mon Sep 17 00:00:00 2001 +From dc65fdccea2ae766cfa58a888f96072dca195659 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 5 Nov 2016 14:14:43 +0000 -Subject: [PATCH 163/180] bcm2708_fb: Add ioctl for reading gpu memory through +Subject: [PATCH 156/208] bcm2708_fb: Add ioctl for reading gpu memory through dma --- @@ -146570,10 +146036,10 @@ index fa72af0c981710fe80bacf4cf6612f6da19046ee..289e7c03c1e3308d5a02fc783af4a569 __u32 dx; /* screen-relative */ __u32 dy; -From fa70ff86ace5f35b73218c63d873ce49dc47f051 Mon Sep 17 00:00:00 2001 +From 209d010a894c60b2d1d520b156ee388e7a1fcc9d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Nov 2016 19:32:54 +0000 -Subject: [PATCH 164/180] rpi-ft5406: Create coherent buffer and push to +Subject: [PATCH 157/208] rpi-ft5406: Create coherent buffer and push to firmware --- @@ -146820,10 +146286,10 @@ index 227a107214a02deadcca3db202da265eba1fdd21..b0f6e33bd30c35664ceee057f4c3ad32 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From b7d5fc2602c99c28a401bec3756234f88f45ff32 Mon Sep 17 00:00:00 2001 +From e9817038e0442920814b404514373ea9e7838573 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 22:42:39 +0000 -Subject: [PATCH 165/180] brcmvirt_gpio: Create coherent buffer and push to +Subject: [PATCH 158/208] brcmvirt_gpio: Create coherent buffer and push to firmware --- @@ -146997,10 +146463,10 @@ index b0f6e33bd30c35664ceee057f4c3ad32b914291d..e92278968b2b979db2a1f855f70e7aaf RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 071a39be50db52bc7840535d8cf909875e12a468 Mon Sep 17 00:00:00 2001 +From 1dff7d0212f9ac143489397d6da93253d8c79efa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Nov 2016 22:05:30 +0000 -Subject: [PATCH 166/180] fixup: fb: Use basic types for dma addresses as these +Subject: [PATCH 159/208] fixup: fb: Use basic types for dma addresses as these are also included from user code --- @@ -147023,10 +146489,10 @@ index 289e7c03c1e3308d5a02fc783af4a5692e791cfb..703fa8a70574323abe2fb32599254582 }; -From c7cc1da1ed9836d76a68c24f075a1580699daea3 Mon Sep 17 00:00:00 2001 +From 5a82ccf30428b49333f0fcc3ca1729c97cb71592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 12 Nov 2016 20:28:25 +0100 -Subject: [PATCH 167/180] BCM270x_DT: Drop using ARCH_BCM2708 and ARCH_BCM2709 +Subject: [PATCH 160/208] BCM270x_DT: Drop using ARCH_BCM2708 and ARCH_BCM2709 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -147295,10 +146761,10 @@ index 7ef449dcfb206f9ab36d63b04bce9f9694c8c697..c940eb3b685d7b9af4340ff184ca7364 always := $(dtbo-y) clean-files := *.dtbo -From dc4dcbd7087448c09e56fe512051f9686fce2f20 Mon Sep 17 00:00:00 2001 +From 1c930dafefdf565e34d8e8246702c5dbcbcd6f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 12 Nov 2016 20:28:47 +0100 -Subject: [PATCH 168/180] Drop ARCH_BCM2708 and ARCH_BCM2709 +Subject: [PATCH 161/208] Drop ARCH_BCM2708 and ARCH_BCM2709 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -147427,10 +146893,10 @@ index df1a4ce1cd4e570876b7785b357d6c31f66191a4..f6def5d7e5d622cf09e8f87332c7374f soc { ranges = <0x7e000000 0x3f000000 0x01000000>, diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 8ab82ca775b336c6786a76dbaacaeb8e4a5da660..36d0e55739b0feac7faff48bca599a4ba9b15f5f 100644 +index a620bb77fd7934a9977adf3944bb2f3be9d83443..5b7d6177c69eec697a7db2c356263f7770938bd7 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -42,7 +42,7 @@ CONFIG_PARTITION_ADVANCED=y +@@ -38,7 +38,7 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_MAC_PARTITION=y CONFIG_CFQ_GROUP_IOSCHED=y CONFIG_ARCH_BCM=y @@ -147440,10 +146906,10 @@ index 8ab82ca775b336c6786a76dbaacaeb8e4a5da660..36d0e55739b0feac7faff48bca599a4b CONFIG_SMP=y CONFIG_VMSPLIT_2G=y diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 3de3a93921cbea9e56ac34d589ec6e83ddb5e7c1..59dae0cdec5dbd26e4b40dbcdab03191850f20bc 100644 +index 43fc0a37f8bf2701aac84962203e7219645d5d7b..1834f3070bcde9dee21482483e95b9313fad6fc4 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -42,7 +42,7 @@ CONFIG_CFQ_GROUP_IOSCHED=y +@@ -39,7 +39,7 @@ CONFIG_CFQ_GROUP_IOSCHED=y CONFIG_ARCH_MULTI_V6=y # CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_BCM=y @@ -147551,10 +147017,10 @@ index 85d82f31cb49631f03b23631882d2b6c063b33db..13047c08fb71cc6e44c66096720d4654 { smp_mb(); -From f729b2c48bfb085657130023e8cda987be7705e6 Mon Sep 17 00:00:00 2001 +From 947658a7a79e668f6421a94226e0a39dbbe3abe5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 15 Nov 2016 15:58:49 +0000 -Subject: [PATCH 169/180] mkknlimg: Retain downstream-kernel detection +Subject: [PATCH 162/208] mkknlimg: Retain downstream-kernel detection With the death of ARCH_BCM2708 and ARCH_BCM2709, a new way is needed to determine if this is a "downstream" build that wants the firmware to @@ -147577,10 +147043,10 @@ index a21f7e31bc904233e980e66ae3e6337e2eab0f1c..60206de7fa9a49bd027c635306674a29 my $res = try_extract($kernel_file, $tmpfile1); -From 2b95ed52bb754a3f4019ecc2507376312e36dd55 Mon Sep 17 00:00:00 2001 +From a30274434c39f55c32b179a06fbb57e3d3990294 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Nov 2016 21:17:27 +0000 -Subject: [PATCH 170/180] fixup: fb: Use correct bus address for dest of dma +Subject: [PATCH 163/208] fixup: fb: Use correct bus address for dest of dma memcpy --- @@ -147610,10 +147076,10 @@ index a6179186f5a65ebeb99bea34c546f690bb2fd903..0d22e00a0adf2959f94b2f0897888c12 pr_err("[%s]: failed to copy-to-user\n", __func__); -From 10bec642deebc1344743225d450142d153c64ea9 Mon Sep 17 00:00:00 2001 +From b000467a6ec25d6e512ade86b384074608c6289f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Nov 2016 16:49:33 +0000 -Subject: [PATCH 171/180] fixup: fb: Use struct device for dma_alloc_coherent +Subject: [PATCH 164/208] fixup: fb: Use struct device for dma_alloc_coherent --- drivers/video/fbdev/bcm2708_fb.c | 4 ++-- @@ -147642,10 +147108,10 @@ index 0d22e00a0adf2959f94b2f0897888c127062e8d5..53c5a0bdadb4be9251affdabed663058 } -From e3b55ef77c34cf1a745d80a1b4efc60169fe6be4 Mon Sep 17 00:00:00 2001 +From 805037ddae8a2857a35e5afa5635bcb77fb3534c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 18 Nov 2016 10:52:49 +0000 -Subject: [PATCH 172/180] ARM: dts: Visit overlays subdir unconditionally +Subject: [PATCH 165/208] ARM: dts: Visit overlays subdir unconditionally make clean processing occurs without loading the configuration, so the overlays subdir must be added unconditionally. @@ -147680,10 +147146,10 @@ index d59b0f01cdbd7ebe1d660701f47353746faeded6..c8d3d5ac5b49b4bf2b2fb16078f1c5d5 # Enable fixups to support overlays on BCM2708 platforms -From ba40578c597d85214b96b543a4de9ab7cf622d38 Mon Sep 17 00:00:00 2001 +From 858b913571ad2b5a9b9f3f91c074b3255a3d18f0 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Sun, 20 Nov 2016 19:15:24 +1100 -Subject: [PATCH 173/180] [Audioinjector] Fix bit offsets for equal volume and +Subject: [PATCH 166/208] [Audioinjector] Fix bit offsets for equal volume and add 8 kHz operation (#1727) Applying to the audioinjector sound card only. This patch offsets channel @@ -147738,10 +147204,10 @@ index 5ff0985e07efb96b95634a65995f09f7c68d9e99..ef54e0f07ea03f59e9957b5d98f3e7fd } -From f356706ee6ac4a0b8c61e1cff3fdeffeb8629e5d Mon Sep 17 00:00:00 2001 +From 3f01663c3ec2c0ae2a82a46b9484c5726052c295 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 26 Nov 2016 14:01:52 +0000 -Subject: [PATCH 174/180] ARM: dts: Restore dtbs_install functionality +Subject: [PATCH 167/208] ARM: dts: Restore dtbs_install functionality Signed-off-by: Phil Elwell --- @@ -147767,10 +147233,10 @@ index c8d3d5ac5b49b4bf2b2fb16078f1c5d56c75ac65..950714000b98cf92e60a72d8dde4774a + dts-dirs += overlays endif -From 962f1279eb07ed53eb7ae5cbefd3f79ab1a116b8 Mon Sep 17 00:00:00 2001 +From 8569d7041b8778339e0a4cc6bf49aaf3c1dc4887 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Nov 2016 14:19:40 +0000 -Subject: [PATCH 175/180] config: Add ABX80X RTC driver and overlay +Subject: [PATCH 168/208] config: Add ABX80X RTC driver and overlay Signed-off-by: Phil Elwell --- @@ -147848,10 +147314,10 @@ index 8b6f978155c02409eeb7c83353b8194fa3462435..1efcf0b712c9c5c19210545002ac1f09 <&ds3231>,"wakeup-source?", <&mcp7940x>,"wakeup-source?", diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 36d0e55739b0feac7faff48bca599a4ba9b15f5f..1b73eb679619872b2b302f13c02da419d7bde2cb 100644 +index 5b7d6177c69eec697a7db2c356263f7770938bd7..10b32a493f244521e6b3a17d54da192e7006db28 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -1058,6 +1058,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y +@@ -1054,6 +1054,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_RTC_CLASS=y # CONFIG_RTC_HCTOSYS is not set @@ -147860,10 +147326,10 @@ index 36d0e55739b0feac7faff48bca599a4ba9b15f5f..1b73eb679619872b2b302f13c02da419 CONFIG_RTC_DRV_DS1374=m CONFIG_RTC_DRV_DS1672=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 59dae0cdec5dbd26e4b40dbcdab03191850f20bc..cffbd08077c378f91c7a550e5c5ee5e45b29683e 100644 +index 1834f3070bcde9dee21482483e95b9313fad6fc4..2979c31c583cba95096ce449ebc0ccdfa417b838 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1067,6 +1067,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y +@@ -1064,6 +1064,7 @@ CONFIG_LEDS_TRIGGER_INPUT=y CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_RTC_CLASS=y # CONFIG_RTC_HCTOSYS is not set @@ -147872,10 +147338,10 @@ index 59dae0cdec5dbd26e4b40dbcdab03191850f20bc..cffbd08077c378f91c7a550e5c5ee5e4 CONFIG_RTC_DRV_DS1374=m CONFIG_RTC_DRV_DS1672=m -From be2e4ee350c90e35a64a97602b6d577ef1955019 Mon Sep 17 00:00:00 2001 +From 17fa71aa67409771c6e323c905d6f07a49c0265b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 25 Nov 2016 15:01:15 +0000 -Subject: [PATCH 176/180] config: Add AK4554 audio codec driver +Subject: [PATCH 169/208] config: Add AK4554 audio codec driver See: https://github.com/raspberrypi/linux/issues/1730 @@ -147886,10 +147352,10 @@ Signed-off-by: Phil Elwell 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 1b73eb679619872b2b302f13c02da419d7bde2cb..68efa64675e2c1d670667d983e790247ff16bb6e 100644 +index 10b32a493f244521e6b3a17d54da192e7006db28..48ed6bfe263a6a3fab942d0b52b2f409055f23ad 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -880,6 +880,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m +@@ -876,6 +876,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m CONFIG_SND_PISOUND=m CONFIG_SND_SOC_ADAU1701=m @@ -147898,10 +147364,10 @@ index 1b73eb679619872b2b302f13c02da419d7bde2cb..68efa64675e2c1d670667d983e790247 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index cffbd08077c378f91c7a550e5c5ee5e45b29683e..01a25f48af727329f74b5f7ae2ffb6ae1aa26704 100644 +index 2979c31c583cba95096ce449ebc0ccdfa417b838..ff69cafd7fb706fc0069d59c37974c4ce5d50043 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -874,6 +874,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m +@@ -871,6 +871,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m CONFIG_SND_PISOUND=m CONFIG_SND_SOC_ADAU1701=m @@ -147910,10 +147376,10 @@ index cffbd08077c378f91c7a550e5c5ee5e45b29683e..01a25f48af727329f74b5f7ae2ffb6ae CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From bfc4b17de75593dbf12ab2d1ade92a43bf738b03 Mon Sep 17 00:00:00 2001 +From d93ed366eb57a05214b58910e6ee763d7bb16bb9 Mon Sep 17 00:00:00 2001 From: Dave Stevenson <6by9@users.noreply.github.com> Date: Wed, 30 Nov 2016 20:17:14 +0000 -Subject: [PATCH 177/180] BCM2835-v4l2: Fix a conformance test failure +Subject: [PATCH 170/208] BCM2835-v4l2: Fix a conformance test failure Format ioctls: test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK @@ -147938,10 +147404,10 @@ index cb5bab642eaab2f60d641801dd0afdac45b7698f..4f03949aecf3afbf2e04df3828944719 fps_param.num = 0; /* Select variable fps, and then use * FPS_RANGE to select the actual limits. -From d3a75ecb5c65b4cc8347397c846738ed3d7ab34e Mon Sep 17 00:00:00 2001 +From 1b81b02455bce965fbd642bce2eea1370b9461e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 1 Dec 2016 15:32:23 +0000 -Subject: [PATCH 178/180] hifiberry: Make driver names unique in first 15 +Subject: [PATCH 171/208] hifiberry: Make driver names unique in first 15 characters See: LibreELEC PR1001 @@ -148001,10 +147467,10 @@ index 52ab9dea2e724c4238986ca53c59c8492f64e345..19dc953b7227ba86123fc7a2ba654499 .dai_link = snd_rpi_hifiberry_digi_dai, .num_links = ARRAY_SIZE(snd_rpi_hifiberry_digi_dai), -From 8d7a868d798d14bf4f7673dc56aa131f44a8a094 Mon Sep 17 00:00:00 2001 +From c0c3bcda197b84fefc31ea5ef4a3c4c71d61d6cf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 1 Dec 2016 22:58:07 +0000 -Subject: [PATCH 179/180] BCM2835 DT: Add DTC_FLAGS to support overlays +Subject: [PATCH 172/208] BCM2835 DT: Add DTC_FLAGS to support overlays Signed-off-by: Phil Elwell --- @@ -148025,10 +147491,10 @@ index 2152448c8cf5b22c573642d7ce45e85793f5fc9a..d6a4c2fccf68e4c692973e36b749e357 + DTC_FLAGS ?= -@ -H epapr +endif -From 736c64ddb8792fd2212046e7e252788785d53a6b Mon Sep 17 00:00:00 2001 +From b220b620b64b4663af9e6c285a9b8a6edb6b93be Mon Sep 17 00:00:00 2001 From: Gerhard de Clercq Date: Fri, 2 Dec 2016 12:15:26 +0200 -Subject: [PATCH 180/180] Add overlays symlink and dtbo target for ARM64 +Subject: [PATCH 173/208] Add overlays symlink and dtbo target for ARM64 (#1739) Signed-off-by: Gerhard de Clercq @@ -148073,3 +147539,3616 @@ index 0000000000000000000000000000000000000000..413315acbfe83611bb2ae7cbd0da1039 @@ -0,0 +1 @@ +../../../arm/boot/dts/overlays/ \ No newline at end of file + +From 0edb708d26ed355b63c61db6007b89ae8ce5a2ae Mon Sep 17 00:00:00 2001 +From: Alan Yiding Wang +Date: Sat, 3 Dec 2016 23:22:02 -0500 +Subject: [PATCH 174/208] BCM270X_DT: Add overlay for enc28j60 on SPI2 + +Works on SPI2 for compute module +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 10 ++++- + .../boot/dts/overlays/enc28j60-spi2-overlay.dts | 47 ++++++++++++++++++++++ + 3 files changed, 57 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index c940eb3b685d7b9af4340ff184ca736471183e09..20440abbe9a440d1f748b118f9c0ee3a0dbd039f 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -17,6 +17,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + dwc-otg.dtbo \ + dwc2.dtbo \ + enc28j60.dtbo \ ++ enc28j60-spi2.dtbo \ + gpio-ir.dtbo \ + gpio-poweroff.dtbo \ + hifiberry-amp.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 180122b381361469ca9e8c4e14f4aa52c1f351dd..4be81958d0f8a790c6a725b2367cf3f33ceaaec9 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -344,13 +344,21 @@ Params: dr_mode Dual role mode: "host", "peripheral" or "otg" + + + Name: enc28j60 +-Info: Overlay for the Microchip ENC28J60 Ethernet Controller (SPI) ++Info: Overlay for the Microchip ENC28J60 Ethernet Controller on SPI0 + Load: dtoverlay=enc28j60,= + Params: int_pin GPIO used for INT (default 25) + + speed SPI bus speed (default 12000000) + + ++Name: enc28j60-spi2 ++Info: Overlay for the Microchip ENC28J60 Ethernet Controller on SPI2 ++Load: dtoverlay=enc28j60-spi2,= ++Params: int_pin GPIO used for INT (default 39) ++ ++ speed SPI bus speed (default 12000000) ++ ++ + Name: gpio-ir + Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core- + based gpio_ir_recv driver maps received keys directly to a +diff --git a/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts b/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..946c9d2107a83335b11f094e75945a509595ab7c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts +@@ -0,0 +1,47 @@ ++// Overlay for the Microchip ENC28J60 Ethernet Controller - SPI2 Compute Module ++// Interrupt pin: 39 ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&spi2>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ eth1: enc28j60@0{ ++ compatible = "microchip,enc28j60"; ++ reg = <0>; /* CE0 */ ++ pinctrl-names = "default"; ++ pinctrl-0 = <ð1_pins>; ++ interrupt-parent = <&gpio>; ++ interrupts = <39 0x2>; /* falling edge */ ++ spi-max-frequency = <12000000>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ eth1_pins: eth1_pins { ++ brcm,pins = <39>; ++ brcm,function = <0>; /* in */ ++ brcm,pull = <0>; /* none */ ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ int_pin = <ð1>, "interrupts:0", ++ <ð1_pins>, "brcm,pins:0"; ++ speed = <ð1>, "spi-max-frequency:0"; ++ }; ++}; + +From 8d454bd4ff18ff2daeeddca6803edb68401c377c Mon Sep 17 00:00:00 2001 +From: Gerhard de Clercq +Date: Fri, 2 Dec 2016 13:45:06 +0200 +Subject: [PATCH 175/208] RPI-FT5406: Enable aarch64 support through explicit + iomem interface + +Signed-off-by: Gerhard de Clercq +--- + drivers/input/touchscreen/rpi-ft5406.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c +index c5e31978c85a4ffd6839952ce0de50c001c7b875..9d7d05482355d168c5c0c42508cd978979ee5f14 100644 +--- a/drivers/input/touchscreen/rpi-ft5406.c ++++ b/drivers/input/touchscreen/rpi-ft5406.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -47,7 +48,6 @@ struct ft5406 { + struct input_dev * input_dev; + void __iomem * ts_base; + dma_addr_t bus_addr; +- struct ft5406_regs * regs; + struct task_struct * thread; + }; + +@@ -68,8 +68,8 @@ static int ft5406_thread(void *arg) + { + // 60fps polling + msleep_interruptible(17); +- memcpy_fromio(®s, ts->regs, sizeof(*ts->regs)); +- writel(99, &ts->regs->num_points); ++ memcpy_fromio(®s, ts->ts_base, sizeof(struct ft5406_regs)); ++ iowrite8(99, ts->ts_base + offsetof(struct ft5406_regs, num_points)); + // Do not output if theres no new information (num_points is 99) + // or we have no touch points and don't need to release any + if(!(regs.num_points == 99 || (regs.num_points == 0 && known_ids == 0))) +@@ -190,7 +190,7 @@ static int ft5406_probe(struct platform_device *pdev) + + // mmap the physical memory + touchbuf &= ~0xc0000000; +- ts->ts_base = ioremap(touchbuf, sizeof(*ts->regs)); ++ ts->ts_base = ioremap(touchbuf, sizeof(struct ft5406_regs)); + if (ts->ts_base == NULL) + { + dev_err(dev, "Failed to map physical address\n"); +@@ -222,8 +222,6 @@ static int ft5406_probe(struct platform_device *pdev) + err); + goto out; + } +- +- ts->regs = (struct ft5406_regs *) ts->ts_base; + + // create thread to poll the touch events + ts->thread = kthread_run(ft5406_thread, ts, "ft5406"); + +From f014240610c93a7e95d58b5869a6d89209685e7b Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 6 Dec 2016 17:27:50 +0000 +Subject: [PATCH 176/208] BCM270X_DT: Add midi-uart0 overlay + +MIDI requires 31.25kbaud, a baudrate unsupported by Linux. The +midi-uart0 overlay configures uart0 (ttyAMA0) to use a fake clock +so that requesting 38.4kbaud actually gets 31.25kbaud. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 7 +++++ + arch/arm/boot/dts/overlays/midi-uart0-overlay.dts | 36 +++++++++++++++++++++++ + 3 files changed, 44 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/midi-uart0-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 20440abbe9a440d1f748b118f9c0ee3a0dbd039f..a3ddb4577ce1f671f4c23ebe32c434c97b00781c 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -45,6 +45,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mcp23s17.dtbo \ + mcp2515-can0.dtbo \ + mcp2515-can1.dtbo \ ++ midi-uart0.dtbo \ + mmc.dtbo \ + mz61581.dtbo \ + pi3-act-led.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 4be81958d0f8a790c6a725b2367cf3f33ceaaec9..496e31db0c7d22934bd381aea5e7227c26a3f034 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -725,6 +725,13 @@ Params: oscillator Clock frequency for the CAN controller (Hz) + interrupt GPIO for interrupt signal + + ++Name: midi-uart0 ++Info: Configures UART0 (ttyAMA0) so that a requested 38.4kbaud actually gets ++ 31.25kbaud, the frequency required for MIDI ++Load: dtoverlay=midi-uart0 ++Params: ++ ++ + Name: mmc + Info: Selects the bcm2835-mmc SD/MMC driver, optionally with overclock + Load: dtoverlay=mmc,= +diff --git a/arch/arm/boot/dts/overlays/midi-uart0-overlay.dts b/arch/arm/boot/dts/overlays/midi-uart0-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..565af7cf79d761877be3bd06191f31aabf9e1e9b +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/midi-uart0-overlay.dts +@@ -0,0 +1,36 @@ ++/dts-v1/; ++/plugin/; ++ ++#include ++ ++/* ++ * Fake a higher clock rate to get a larger divisor, and thereby a lower ++ * baudrate. The real clock is 48MHz, which we scale so that requesting ++ * 38.4kHz results in an actual 31.25kHz. ++ * ++ * 48000000*38400/31250 = 58982400 ++ */ ++ ++/{ ++ compatible = "brcm,bcm2835"; ++ ++ fragment@0 { ++ target-path = "/clocks"; ++ __overlay__ { ++ midi_clk: midi_clk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-output-names = "uart0_pclk"; ++ clock-frequency = <58982400>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart0>; ++ __overlay__ { ++ clocks = <&midi_clk>, ++ <&clocks BCM2835_CLOCK_VPU>; ++ }; ++ }; ++}; + +From 2b4dc8b567a7432b754eb86291add0cb2a153ff4 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 09:18:09 +0100 +Subject: [PATCH 177/208] raspberrypi-firmware: Define the MBOX channel in the + header. + +Signed-off-by: Eric Anholt +--- + include/soc/bcm2835/raspberrypi-firmware.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index e92278968b2b979db2a1f855f70e7aafb224fa98..6f19b27ae24ecfddc880e9b29290238df1f27087 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -12,6 +12,8 @@ + #include + #include + ++#define RPI_FIRMWARE_CHAN_FB 1 ++ + struct rpi_firmware; + + enum rpi_firmware_property_status { + +From 4b1d48bfd89c7a2edfd82be28e7896c9595417f0 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 09:16:19 +0100 +Subject: [PATCH 178/208] raspberrypi-firmware: Export the general transaction + function. + +The vc4-firmware-kms module is going to be doing the MBOX FB call. + +Signed-off-by: Eric Anholt +--- + drivers/firmware/raspberrypi.c | 3 ++- + include/soc/bcm2835/raspberrypi-firmware.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index 3f070bd38a91511c986e3fb114b15bd4ac32634c..f261b64d1657c02290904d841e1f087c34e27ded 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -42,7 +42,7 @@ static void response_callback(struct mbox_client *cl, void *msg) + * Sends a request to the firmware through the BCM2835 mailbox driver, + * and synchronously waits for the reply. + */ +-static int ++int + rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + { + u32 message = MBOX_MSG(chan, data); +@@ -63,6 +63,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + + return ret; + } ++EXPORT_SYMBOL_GPL(rpi_firmware_transaction); + + /** + * rpi_firmware_property_list - Submit firmware property list +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index 6f19b27ae24ecfddc880e9b29290238df1f27087..2859db09e25bb945251e85edb39bc43430857168 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -133,5 +133,6 @@ int rpi_firmware_property(struct rpi_firmware *fw, + int rpi_firmware_property_list(struct rpi_firmware *fw, + void *data, size_t tag_size); + struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); ++int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); + + #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ + +From 0d1d276c7e42e7e7849ae973bf17d259ae958bc7 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Wed, 10 Aug 2016 18:52:34 +0200 +Subject: [PATCH 179/208] drm/fb-helper: Add a dummy + remove_conflicting_framebuffers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Lots of drivers don't properly compile without this when CONFIG_FB=n. +It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when +it's disabled I think it makes sense to add it to drm_fb_helper.h. + +Long term we probably need to rethink all the logic to unload firmware +framebuffer drivers, at least if we want to be able to move away from +CONFIG_FB and fbcon. + +v2: Unfortunately just stubbing out remove_conflicting_framebuffers in +drm_fb_helper.h upset gcc about static vs. non-static declarations, so +a new wrapper it needs to be. Means more churn :( + +Cc: Tobias Jakobi +Cc: Noralf Trønnes +Cc: tomi.valkeinen@ti.com +Cc: dh.herrmann@gmail.com +Reviewed-by: Alex Deucher +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-2-git-send-email-daniel.vetter@ffwll.ch +--- + drivers/gpu/drm/vc4/vc4_drv.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 9ecef93854914579ee74b4d96432d15dfaa1fd6b..eff0530dc713f6ac3cdb5cb3e640abed1cc67492 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -16,6 +16,7 @@ + #include + #include + #include "drm_fb_cma_helper.h" ++#include + + #include "uapi/drm/vc4_drm.h" + #include "vc4_drv.h" +@@ -214,7 +215,7 @@ static void vc4_kick_out_firmware_fb(void) + ap->ranges[0].base = 0; + ap->ranges[0].size = ~0; + +- remove_conflicting_framebuffers(ap, "vc4drmfb", false); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false); + kfree(ap); + } + + +From d970485b895a64a309054dea77693c48332db7fb Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Fri, 19 Aug 2016 11:39:29 +0300 +Subject: [PATCH 180/208] drm: Don't implement empty prepare_fb()/cleanup_fb() + +The plane .prepare_fb() and .cleanup_fb() helpers are optional, there's +no need to implement empty stubs, and no need to explicitly set the +function pointers to NULL either. + +Signed-off-by: Laurent Pinchart +[danvet: Resolved conflicts with Chris' patch.] +Signed-off-by: Daniel Vetter +--- + drivers/gpu/drm/vc4/vc4_plane.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 29e4b400e25e34a63e4710e9edbba62541b9cdc5..881bf489478b01b34e9e4df6013fe608c42215ee 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -735,8 +735,6 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, struct drm_framebuffer *fb) + } + + static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = { +- .prepare_fb = NULL, +- .cleanup_fb = NULL, + .atomic_check = vc4_plane_atomic_check, + .atomic_update = vc4_plane_atomic_update, + }; + +From 8046f42af8709ad32d6eaf964bc169f6e8e1136b Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:58:57 +0200 +Subject: [PATCH 181/208] drm/vc4: Disallow interlaced modes on DPI. + +We already don't expose such modes to userspace, but make +sure userspace can't sneak some interlaced mode in. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_dpi.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c +index 275fedbdbd9eae420939627e7fcdf9236cfce4fa..1e1f6b8184d058c6e55e092653798f4d75b55b7f 100644 +--- a/drivers/gpu/drm/vc4/vc4_dpi.c ++++ b/drivers/gpu/drm/vc4/vc4_dpi.c +@@ -340,9 +340,20 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + } + } + ++static bool vc4_dpi_encoder_mode_fixup(struct drm_encoder *encoder, ++ const struct drm_display_mode *mode, ++ struct drm_display_mode *adjusted_mode) ++{ ++ if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) ++ return false; ++ ++ return true; ++} ++ + static const struct drm_encoder_helper_funcs vc4_dpi_encoder_helper_funcs = { + .disable = vc4_dpi_encoder_disable, + .enable = vc4_dpi_encoder_enable, ++ .mode_fixup = vc4_dpi_encoder_mode_fixup, + }; + + static const struct of_device_id vc4_dpi_dt_match[] = { + +From 43e8caa26763825711b0f901d3a0544690363efd Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:58:58 +0200 +Subject: [PATCH 182/208] drm/vc4: Fix handling of interlaced video modes. + +We must not apply CRTC_INTERLACE_HALVE_V to interlaced modes during +mode enumeration, as drm_helper_probe_single_connector_modes +does, so wrap it and reset the effect of CRTC_INTERLACE_HALVE_V +on affected interlaced modes. + +Also mode_fixup interlaced modes passed in from user space. + +This fixes the vblank timestamping constants and entries in +the mode->crtc_xxx fields needed for precise vblank timestamping. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 18 ++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_hdmi.c | 29 +++++++++++++++++++++++++++-- + 2 files changed, 45 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 8fc2b731b59a613fddce5853981e1ab8fd982837..a479d3d840c59257aaf0f411cc9600f4915bb62c 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -532,6 +532,23 @@ static void vc4_crtc_enable(struct drm_crtc *crtc) + CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN); + } + ++static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, ++ const struct drm_display_mode *mode, ++ struct drm_display_mode *adjusted_mode) ++{ ++ /* ++ * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when ++ * coming from user space. We don't want this, as it screws up ++ * vblank timestamping, so fix it up. ++ */ ++ drm_mode_set_crtcinfo(adjusted_mode, 0); ++ ++ DRM_DEBUG_KMS("[CRTC:%d] adjusted_mode :\n", crtc->base.id); ++ drm_mode_debug_printmodeline(adjusted_mode); ++ ++ return true; ++} ++ + static int vc4_crtc_atomic_check(struct drm_crtc *crtc, + struct drm_crtc_state *state) + { +@@ -819,6 +836,7 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { + .mode_set_nofb = vc4_crtc_mode_set_nofb, + .disable = vc4_crtc_disable, + .enable = vc4_crtc_enable, ++ .mode_fixup = vc4_crtc_mode_fixup, + .atomic_check = vc4_crtc_atomic_check, + .atomic_flush = vc4_crtc_atomic_flush, + }; +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 4452f3631cacea37bbd5dc8a594367631e308adc..68ad10634b29ec7b716f70f0b5fd9f2046da1fe5 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -208,10 +208,35 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + return ret; + } + ++/* ++ * drm_helper_probe_single_connector_modes() applies drm_mode_set_crtcinfo to ++ * all modes with flag CRTC_INTERLACE_HALVE_V. We don't want this, as it ++ * screws up vblank timestamping for interlaced modes, so fix it up. ++ */ ++static int vc4_hdmi_connector_probe_modes(struct drm_connector *connector, ++ uint32_t maxX, uint32_t maxY) ++{ ++ struct drm_display_mode *mode; ++ int count; ++ ++ count = drm_helper_probe_single_connector_modes(connector, maxX, maxY); ++ if (count == 0) ++ return 0; ++ ++ DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed adapted modes :\n", ++ connector->base.id, connector->name); ++ list_for_each_entry(mode, &connector->modes, head) { ++ drm_mode_set_crtcinfo(mode, 0); ++ drm_mode_debug_printmodeline(mode); ++ } ++ ++ return count; ++} ++ + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + .dpms = drm_atomic_helper_connector_dpms, + .detect = vc4_hdmi_connector_detect, +- .fill_modes = drm_helper_probe_single_connector_modes, ++ .fill_modes = vc4_hdmi_connector_probe_modes, + .destroy = vc4_hdmi_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, +@@ -246,7 +271,7 @@ static struct drm_connector *vc4_hdmi_connector_init(struct drm_device *dev, + connector->polled = (DRM_CONNECTOR_POLL_CONNECT | + DRM_CONNECTOR_POLL_DISCONNECT); + +- connector->interlace_allowed = 0; ++ connector->interlace_allowed = 1; + connector->doublescan_allowed = 0; + + drm_mode_connector_attach_encoder(connector, encoder); + +From 991b87fa61335f5241088165fa667ea2ce5c8f90 Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:58:59 +0200 +Subject: [PATCH 183/208] drm/vc4: Reject doublescan modes. + +We can't handle doublescan modes at the moment, so if +userspace tries to set one, reject the mode set. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index a479d3d840c59257aaf0f411cc9600f4915bb62c..2bfa2470e66b3fb5aa3692c66cb803973985f68f 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -536,6 +536,13 @@ static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) + { ++ /* Do not allow doublescan modes from user space */ ++ if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) { ++ DRM_DEBUG_KMS("[CRTC:%d] Doublescan mode rejected.\n", ++ crtc->base.id); ++ return false; ++ } ++ + /* + * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when + * coming from user space. We don't want this, as it screws up + +From 503dc975e3a0fde5266a1528ebef09a384b9b1ff Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:59:00 +0200 +Subject: [PATCH 184/208] drm/vc4: Enable precise vblank timestamping for + interlaced modes. + +On top of the interlaced video mode fix and with some additional +adjustments, this now works well. It has almost the same accuracy +as on regular progressive scan modes. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 21 ++++++++------------- + 1 file changed, 8 insertions(+), 13 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 2bfa2470e66b3fb5aa3692c66cb803973985f68f..7ffdad543ed2cbb588ad8f2037620bde7bb25e95 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -163,14 +163,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + int vblank_lines; + int ret = 0; + +- /* +- * XXX Doesn't work well in interlaced mode yet, partially due +- * to problems in vc4 kms or drm core interlaced mode handling, +- * so disable for now in interlaced mode. +- */ +- if (mode->flags & DRM_MODE_FLAG_INTERLACE) +- return ret; +- + /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ + + /* Get optional system timestamp before query. */ +@@ -191,10 +183,15 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + + /* Vertical position of hvs composed scanline. */ + *vpos = VC4_GET_FIELD(val, SCALER_DISPSTATX_LINE); ++ *hpos = 0; ++ ++ if (mode->flags & DRM_MODE_FLAG_INTERLACE) { ++ *vpos /= 2; + +- /* No hpos info available. */ +- if (hpos) +- *hpos = 0; ++ /* Use hpos to correct for field offset in interlaced mode. */ ++ if (VC4_GET_FIELD(val, SCALER_DISPSTATX_FRAME_COUNT) % 2) ++ *hpos += mode->crtc_htotal / 2; ++ } + + /* This is the offset we need for translating hvs -> pv scanout pos. */ + fifo_lines = vc4_crtc->cob_size / mode->crtc_hdisplay; +@@ -217,8 +214,6 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + * position of the PV. + */ + *vpos -= fifo_lines + 1; +- if (mode->flags & DRM_MODE_FLAG_INTERLACE) +- *vpos /= 2; + + ret |= DRM_SCANOUTPOS_ACCURATE; + return ret; + +From ce12fad8b5a7bbe64cba4fea965cd9b9b3d3552b Mon Sep 17 00:00:00 2001 +From: Mario Kleiner +Date: Tue, 19 Jul 2016 20:59:01 +0200 +Subject: [PATCH 185/208] drm/vc4: Enable/Disable vblanks properly in crtc + en/disable. + +Add missing drm_crtc_vblank_on/off() calls so vblank irq +handling/updating/timestamping never runs with a crtc shut down +or during its shutdown/startup, as that causes large jumps in +vblank count and trouble for compositors. + +Signed-off-by: Mario Kleiner +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 7ffdad543ed2cbb588ad8f2037620bde7bb25e95..2682f07d8f1e6d3dc89ad0858f136c511040b517 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -475,6 +475,9 @@ static void vc4_crtc_disable(struct drm_crtc *crtc) + int ret; + require_hvs_enabled(dev); + ++ /* Disable vblank irq handling before crtc is disabled. */ ++ drm_crtc_vblank_off(crtc); ++ + CRTC_WRITE(PV_V_CONTROL, + CRTC_READ(PV_V_CONTROL) & ~PV_VCONTROL_VIDEN); + ret = wait_for(!(CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VIDEN), 1); +@@ -525,6 +528,9 @@ static void vc4_crtc_enable(struct drm_crtc *crtc) + /* Turn on the pixel valve, which will emit the vstart signal. */ + CRTC_WRITE(PV_V_CONTROL, + CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN); ++ ++ /* Enable vblank irq handling after crtc is started. */ ++ drm_crtc_vblank_on(crtc); + } + + static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, + +From fec57b3556993256fc654768dba939342ca25dc8 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 2 Aug 2016 17:17:52 -0700 +Subject: [PATCH 186/208] drm/vc4: Don't force new binner overflow allocation + per draw. + +This came from the initial bringup code, which always idled the GPU +and always reset the overflow. That massively increases the size of +the working set when you're doing lots of small draws, though, as is +common on X desktops or piglit. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_gem.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index ae1609e739ef424d99207f830cd2bac41ce71557..47a095f392f8a7b5443227933c78b500a4c7137f 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -419,10 +419,6 @@ again: + + vc4_flush_caches(dev); + +- /* Disable the binner's pre-loaded overflow memory address */ +- V3D_WRITE(V3D_BPOA, 0); +- V3D_WRITE(V3D_BPOS, 0); +- + /* Either put the job in the binner if it uses the binner, or + * immediately move it to the to-be-rendered queue. + */ + +From 3560e2aca2425e2b4ea5f5bdb0fa9589ecc125c3 Mon Sep 17 00:00:00 2001 +From: Liu Ying +Date: Mon, 29 Aug 2016 17:12:03 +0800 +Subject: [PATCH 187/208] drm/atomic-helper: Add NO_DISABLE_AFTER_MODESET flag + support for plane commit + +Drivers may set the NO_DISABLE_AFTER_MODESET flag in the 'flags' parameter +of the helper drm_atomic_helper_commit_planes() if the relevant display +controllers(e.g., IPUv3 for imx-drm) require to disable a CRTC's planes +when the CRTC is disabled. The helper would skip the ->atomic_disable +call for a plane if the CRTC of the old plane state needs a modesetting +operation. Of course, the drivers need to disable the planes in their CRTC +disable callbacks since no one else would do that. + +Suggested-by: Daniel Vetter +Cc: Philipp Zabel +Cc: David Airlie +Cc: Russell King +Cc: Peter Senna Tschudin +Cc: Lucas Stach +Signed-off-by: Liu Ying +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1472461923-14364-1-git-send-email-gnuiyl@gmail.com +--- + drivers/gpu/drm/vc4/vc4_kms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 4ac894d993cd80472777b2a3bacc2fcf0dd52810..c1f65c6c8e601e9331768ca040a5609cad686b2e 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -44,7 +44,7 @@ vc4_atomic_complete_commit(struct vc4_commit *c) + + drm_atomic_helper_commit_modeset_disables(dev, state); + +- drm_atomic_helper_commit_planes(dev, state, false); ++ drm_atomic_helper_commit_planes(dev, state, 0); + + drm_atomic_helper_commit_modeset_enables(dev, state); + + +From 32db4f1829e5531aa6e60ca3020b2c487c945920 Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Wed, 21 Sep 2016 16:59:19 +0200 +Subject: [PATCH 188/208] drm: Don't swallow error codes in drm_dev_alloc() + +There are many reasons other than ENOMEM that drm_dev_init() can +fail. Return ERR_PTR rather than NULL to be able to distinguish +these in the caller. + +Signed-off-by: Tom Gundersen +Signed-off-by: Sean Paul +Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-2-teg@jklm.no +--- + drivers/gpu/drm/vc4/vc4_drv.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index eff0530dc713f6ac3cdb5cb3e640abed1cc67492..8703f56b794774ac4130a7b487472e293ebe7cdf 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -233,8 +233,8 @@ static int vc4_drm_bind(struct device *dev) + return -ENOMEM; + + drm = drm_dev_alloc(&vc4_drm_driver, dev); +- if (!drm) +- return -ENOMEM; ++ if (IS_ERR(drm)) ++ return PTR_ERR(drm); + platform_set_drvdata(pdev, drm); + vc4->dev = drm; + drm->dev_private = vc4; + +From 7f1274b2b1e0fe40b2965bad8853cbe3035a3fbe Mon Sep 17 00:00:00 2001 +From: Masahiro Yamada +Date: Tue, 13 Sep 2016 03:35:20 +0900 +Subject: [PATCH 189/208] drm/vc4: cleanup with list_first_entry_or_null() + +The combo of list_empty() check and return list_first_entry() +can be replaced with list_first_entry_or_null(). + +Signed-off-by: Masahiro Yamada +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_drv.h | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index f696b752886b153c4654c0b8acca3fe46c9136cb..7c1e4d97486fb57d9ce7002c30a23138519761ae 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -324,18 +324,15 @@ struct vc4_exec_info { + static inline struct vc4_exec_info * + vc4_first_bin_job(struct vc4_dev *vc4) + { +- if (list_empty(&vc4->bin_job_list)) +- return NULL; +- return list_first_entry(&vc4->bin_job_list, struct vc4_exec_info, head); ++ return list_first_entry_or_null(&vc4->bin_job_list, ++ struct vc4_exec_info, head); + } + + static inline struct vc4_exec_info * + vc4_first_render_job(struct vc4_dev *vc4) + { +- if (list_empty(&vc4->render_job_list)) +- return NULL; +- return list_first_entry(&vc4->render_job_list, +- struct vc4_exec_info, head); ++ return list_first_entry_or_null(&vc4->render_job_list, ++ struct vc4_exec_info, head); + } + + static inline struct vc4_exec_info * + +From ec746edb504c5ac7db80f613e52a0c0dbfc866fa Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 16 Sep 2016 10:59:45 +0100 +Subject: [PATCH 190/208] drm/vc4: Enable limited range RGB output on HDMI with + CEA modes. + +Fixes broken grayscale ramps on many HDMI monitors, where large areas +at the ends of the ramp would all appear as black or white. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 31 +++++++++++++++++++++++++++++-- + drivers/gpu/drm/vc4/vc4_regs.h | 9 ++++++++- + 2 files changed, 37 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 68ad10634b29ec7b716f70f0b5fd9f2046da1fe5..29be7b7273df5b2c75d3162d72097efe62ec93df 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -298,6 +298,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + struct drm_display_mode *unadjusted_mode, + struct drm_display_mode *mode) + { ++ struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); + struct drm_device *dev = encoder->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); + bool debug_dump_regs = false; +@@ -313,6 +314,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + u32 vertb = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | + VC4_SET_FIELD(mode->vtotal - mode->vsync_end, + VC4_HDMI_VERTB_VBP)); ++ u32 csc_ctl; + + if (debug_dump_regs) { + DRM_INFO("HDMI regs before:\n"); +@@ -351,9 +353,34 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + (vsync_pos ? 0 : VC4_HD_VID_CTL_VSYNC_LOW) | + (hsync_pos ? 0 : VC4_HD_VID_CTL_HSYNC_LOW)); + ++ csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR, ++ VC4_HD_CSC_CTL_ORDER); ++ ++ if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) > 1) { ++ /* CEA VICs other than #1 requre limited range RGB ++ * output. Apply a colorspace conversion to squash ++ * 0-255 down to 16-235. The matrix here is: ++ * ++ * [ 0 0 0.8594 16] ++ * [ 0 0.8594 0 16] ++ * [ 0.8594 0 0 16] ++ * [ 0 0 0 1] ++ */ ++ csc_ctl |= VC4_HD_CSC_CTL_ENABLE; ++ csc_ctl |= VC4_HD_CSC_CTL_RGB2YCC; ++ csc_ctl |= VC4_SET_FIELD(VC4_HD_CSC_CTL_MODE_CUSTOM, ++ VC4_HD_CSC_CTL_MODE); ++ ++ HD_WRITE(VC4_HD_CSC_12_11, (0x000 << 16) | 0x000); ++ HD_WRITE(VC4_HD_CSC_14_13, (0x100 << 16) | 0x6e0); ++ HD_WRITE(VC4_HD_CSC_22_21, (0x6e0 << 16) | 0x000); ++ HD_WRITE(VC4_HD_CSC_24_23, (0x100 << 16) | 0x000); ++ HD_WRITE(VC4_HD_CSC_32_31, (0x000 << 16) | 0x6e0); ++ HD_WRITE(VC4_HD_CSC_34_33, (0x100 << 16) | 0x000); ++ } ++ + /* The RGB order applies even when CSC is disabled. */ +- HD_WRITE(VC4_HD_CSC_CTL, VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR, +- VC4_HD_CSC_CTL_ORDER)); ++ HD_WRITE(VC4_HD_CSC_CTL, csc_ctl); + + HDMI_WRITE(VC4_HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N); + +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 160942a9180e716e6c6d890214f0fc6e0e081ecd..9ecd6ff3d493ffca5249256ce99dc2de2b21e0ee 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -528,10 +528,17 @@ + # define VC4_HD_CSC_CTL_MODE_SHIFT 2 + # define VC4_HD_CSC_CTL_MODE_RGB_TO_SD_YPRPB 0 + # define VC4_HD_CSC_CTL_MODE_RGB_TO_HD_YPRPB 1 +-# define VC4_HD_CSC_CTL_MODE_CUSTOM 2 ++# define VC4_HD_CSC_CTL_MODE_CUSTOM 3 + # define VC4_HD_CSC_CTL_RGB2YCC BIT(1) + # define VC4_HD_CSC_CTL_ENABLE BIT(0) + ++#define VC4_HD_CSC_12_11 0x044 ++#define VC4_HD_CSC_14_13 0x048 ++#define VC4_HD_CSC_22_21 0x04c ++#define VC4_HD_CSC_24_23 0x050 ++#define VC4_HD_CSC_32_31 0x054 ++#define VC4_HD_CSC_34_33 0x058 ++ + #define VC4_HD_FRAME_COUNT 0x068 + + /* HVS display list information. */ + +From 9bad67df07b8552d61731c2f0e5a5fe0f9d46849 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 19:21:29 +0100 +Subject: [PATCH 191/208] drm/vc4: Fall back to using an EDID probe in the + absence of a GPIO. + +On Pi0/1/2, we use an external GPIO line for hotplug detection, since +the HDMI_HOTPLUG register isn't connected to anything. However, with +the Pi3 the HPD GPIO line has moved off to a GPIO expander that will +be tricky to get to (the firmware is constantly polling the expander +using i2c0, so we'll need to coordinate with it). + +As a stop-gap, if we don't have a GPIO line, use an EDID probe to +detect connection. Fixes HDMI display on the pi3. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 29be7b7273df5b2c75d3162d72097efe62ec93df..1e61931846d3f10cdb7f914e54c260f8b9731cd7 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -174,6 +174,9 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force) + return connector_status_disconnected; + } + ++ if (drm_probe_ddc(vc4->hdmi->ddc)) ++ return connector_status_connected; ++ + if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED) + return connector_status_connected; + else + +From 45f5d55e2e3214d8e8e0514b1fe7c32ec632357e Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 28 Sep 2016 17:21:05 -0700 +Subject: [PATCH 192/208] drm/vc4: Increase timeout for HDMI_SCHEDULER_CONTROL + changes. + +Fixes occasional debug spew at boot when connected directly through +HDMI, and probably confusing the HDMI state machine when we go trying +to poke registers for the enable sequence too soon. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index 1e61931846d3f10cdb7f914e54c260f8b9731cd7..fe1c4e35e68142839756df10ed9b9e56c028d04e 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -424,7 +424,7 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) + VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); + + ret = wait_for(HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) & +- VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1); ++ VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1000); + WARN_ONCE(ret, "Timeout waiting for " + "VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n"); + } else { +@@ -436,7 +436,7 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) + ~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); + + ret = wait_for(!(HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) & +- VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1); ++ VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1000); + WARN_ONCE(ret, "Timeout waiting for " + "!VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n"); + } + +From 0ec96f64a32dc31a9f1bcbcb367d932622fd9cee Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 28 Sep 2016 17:30:25 -0700 +Subject: [PATCH 193/208] drm/vc4: Fix support for interlaced modes on HDMI. + +We really do need to be using the halved V fields. I had been +confused by the code I was using as a reference because it stored +halved vsync fields but not halved vdisplay, so it looked like I only +needed to divide vdisplay by 2. + +This reverts part of Mario's timestamping fixes that prevented +CRTC_HALVE_V from applying, and instead adjusts the timestamping code +to not use the crtc field in that case. + +Fixes locking of 1920x1080x60i on my Dell 2408WFP. There are black +bars on the top and bottom, but I suspect that might be an +under/overscan flags problem as opposed to video timings. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 49 ++++++++++++++++++++++-------------------- + drivers/gpu/drm/vc4/vc4_hdmi.c | 45 +++++++++++--------------------------- + drivers/gpu/drm/vc4/vc4_regs.h | 3 +++ + 3 files changed, 41 insertions(+), 56 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 2682f07d8f1e6d3dc89ad0858f136c511040b517..83cafea03eff720f9f7b80f484dedf22ac7f283f 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -229,7 +229,7 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + * and need to make things up in a approximative but consistent way. + */ + ret |= DRM_SCANOUTPOS_IN_VBLANK; +- vblank_lines = mode->crtc_vtotal - mode->crtc_vdisplay; ++ vblank_lines = mode->vtotal - mode->vdisplay; + + if (flags & DRM_CALLED_FROM_VBLIRQ) { + /* +@@ -378,7 +378,6 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + struct drm_crtc_state *state = crtc->state; + struct drm_display_mode *mode = &state->adjusted_mode; + bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; +- u32 vactive = (mode->vdisplay >> (interlace ? 1 : 0)); + u32 format = PV_CONTROL_FORMAT_24; + bool debug_dump_regs = false; + int clock_select = vc4_get_clock_select(crtc); +@@ -404,32 +403,46 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + VC4_SET_FIELD(mode->hdisplay, PV_HORZB_HACTIVE)); + + CRTC_WRITE(PV_VERTA, +- VC4_SET_FIELD(mode->vtotal - mode->vsync_end, ++ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, + PV_VERTA_VBP) | +- VC4_SET_FIELD(mode->vsync_end - mode->vsync_start, ++ VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, + PV_VERTA_VSYNC)); + CRTC_WRITE(PV_VERTB, +- VC4_SET_FIELD(mode->vsync_start - mode->vdisplay, ++ VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, + PV_VERTB_VFP) | +- VC4_SET_FIELD(vactive, PV_VERTB_VACTIVE)); ++ VC4_SET_FIELD(mode->crtc_vdisplay, PV_VERTB_VACTIVE)); + + if (interlace) { + CRTC_WRITE(PV_VERTA_EVEN, +- VC4_SET_FIELD(mode->vtotal - mode->vsync_end - 1, ++ VC4_SET_FIELD(mode->crtc_vtotal - ++ mode->crtc_vsync_end - 1, + PV_VERTA_VBP) | +- VC4_SET_FIELD(mode->vsync_end - mode->vsync_start, ++ VC4_SET_FIELD(mode->crtc_vsync_end - ++ mode->crtc_vsync_start, + PV_VERTA_VSYNC)); + CRTC_WRITE(PV_VERTB_EVEN, +- VC4_SET_FIELD(mode->vsync_start - mode->vdisplay, ++ VC4_SET_FIELD(mode->crtc_vsync_start - ++ mode->crtc_vdisplay, + PV_VERTB_VFP) | +- VC4_SET_FIELD(vactive, PV_VERTB_VACTIVE)); ++ VC4_SET_FIELD(mode->crtc_vdisplay, PV_VERTB_VACTIVE)); ++ ++ /* We set up first field even mode for HDMI. VEC's ++ * NTSC mode would want first field odd instead, once ++ * we support it (to do so, set ODD_FIRST and put the ++ * delay in VSYNCD_EVEN instead). ++ */ ++ CRTC_WRITE(PV_V_CONTROL, ++ PV_VCONTROL_CONTINUOUS | ++ PV_VCONTROL_INTERLACE | ++ VC4_SET_FIELD(mode->htotal / 2, ++ PV_VCONTROL_ODD_DELAY)); ++ CRTC_WRITE(PV_VSYNCD_EVEN, 0); ++ } else { ++ CRTC_WRITE(PV_V_CONTROL, PV_VCONTROL_CONTINUOUS); + } + + CRTC_WRITE(PV_HACT_ACT, mode->hdisplay); + +- CRTC_WRITE(PV_V_CONTROL, +- PV_VCONTROL_CONTINUOUS | +- (interlace ? PV_VCONTROL_INTERLACE : 0)); + + CRTC_WRITE(PV_CONTROL, + VC4_SET_FIELD(format, PV_CONTROL_FORMAT) | +@@ -544,16 +557,6 @@ static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, + return false; + } + +- /* +- * Interlaced video modes got CRTC_INTERLACE_HALVE_V applied when +- * coming from user space. We don't want this, as it screws up +- * vblank timestamping, so fix it up. +- */ +- drm_mode_set_crtcinfo(adjusted_mode, 0); +- +- DRM_DEBUG_KMS("[CRTC:%d] adjusted_mode :\n", crtc->base.id); +- drm_mode_debug_printmodeline(adjusted_mode); +- + return true; + } + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index fe1c4e35e68142839756df10ed9b9e56c028d04e..d94108ca961dac9278d2e38813d089b78acbc8ad 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -211,35 +211,10 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + return ret; + } + +-/* +- * drm_helper_probe_single_connector_modes() applies drm_mode_set_crtcinfo to +- * all modes with flag CRTC_INTERLACE_HALVE_V. We don't want this, as it +- * screws up vblank timestamping for interlaced modes, so fix it up. +- */ +-static int vc4_hdmi_connector_probe_modes(struct drm_connector *connector, +- uint32_t maxX, uint32_t maxY) +-{ +- struct drm_display_mode *mode; +- int count; +- +- count = drm_helper_probe_single_connector_modes(connector, maxX, maxY); +- if (count == 0) +- return 0; +- +- DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed adapted modes :\n", +- connector->base.id, connector->name); +- list_for_each_entry(mode, &connector->modes, head) { +- drm_mode_set_crtcinfo(mode, 0); +- drm_mode_debug_printmodeline(mode); +- } +- +- return count; +-} +- + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + .dpms = drm_atomic_helper_connector_dpms, + .detect = vc4_hdmi_connector_detect, +- .fill_modes = vc4_hdmi_connector_probe_modes, ++ .fill_modes = drm_helper_probe_single_connector_modes, + .destroy = vc4_hdmi_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, +@@ -307,16 +282,20 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + bool debug_dump_regs = false; + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; +- u32 vactive = (mode->vdisplay >> +- ((mode->flags & DRM_MODE_FLAG_INTERLACE) ? 1 : 0)); +- u32 verta = (VC4_SET_FIELD(mode->vsync_end - mode->vsync_start, ++ bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; ++ u32 verta = (VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, + VC4_HDMI_VERTA_VSP) | +- VC4_SET_FIELD(mode->vsync_start - mode->vdisplay, ++ VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, + VC4_HDMI_VERTA_VFP) | +- VC4_SET_FIELD(vactive, VC4_HDMI_VERTA_VAL)); ++ VC4_SET_FIELD(mode->crtc_vdisplay, VC4_HDMI_VERTA_VAL)); + u32 vertb = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | +- VC4_SET_FIELD(mode->vtotal - mode->vsync_end, ++ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, + VC4_HDMI_VERTB_VBP)); ++ u32 vertb_even = (VC4_SET_FIELD(0, VC4_HDMI_VERTB_VSPO) | ++ VC4_SET_FIELD(mode->crtc_vtotal - ++ mode->crtc_vsync_end - ++ interlaced, ++ VC4_HDMI_VERTB_VBP)); + u32 csc_ctl; + + if (debug_dump_regs) { +@@ -349,7 +328,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + HDMI_WRITE(VC4_HDMI_VERTA0, verta); + HDMI_WRITE(VC4_HDMI_VERTA1, verta); + +- HDMI_WRITE(VC4_HDMI_VERTB0, vertb); ++ HDMI_WRITE(VC4_HDMI_VERTB0, vertb_even); + HDMI_WRITE(VC4_HDMI_VERTB1, vertb); + + HD_WRITE(VC4_HD_VID_CTL, +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 9ecd6ff3d493ffca5249256ce99dc2de2b21e0ee..c5a423ead86ffdd1ce2abada24f628b19c1ebc08 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -183,6 +183,9 @@ + # define PV_CONTROL_EN BIT(0) + + #define PV_V_CONTROL 0x04 ++# define PV_VCONTROL_ODD_DELAY_MASK VC4_MASK(22, 6) ++# define PV_VCONTROL_ODD_DELAY_SHIFT 6 ++# define PV_VCONTROL_ODD_FIRST BIT(5) + # define PV_VCONTROL_INTERLACE BIT(4) + # define PV_VCONTROL_CONTINUOUS BIT(1) + # define PV_VCONTROL_VIDEN BIT(0) + +From d1475342b1f4cf8f9a51428a64f04ae50c45c9c8 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 29 Sep 2016 15:34:43 -0700 +Subject: [PATCH 194/208] drm/vc4: Set up the AVI and SPD infoframes. + +Fixes a purple bar on the left side of the screen with my Dell +2408WFP. It will also be required for supporting the double-clocked +video modes. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_hdmi.c | 136 +++++++++++++++++++++++++++++++++++++++-- + drivers/gpu/drm/vc4/vc4_regs.h | 5 ++ + 2 files changed, 136 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index d94108ca961dac9278d2e38813d089b78acbc8ad..d6b54b905beeec33eee8a763969ffa9568cfa745 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -62,6 +62,8 @@ struct vc4_hdmi { + struct vc4_hdmi_encoder { + struct vc4_encoder base; + bool hdmi_monitor; ++ bool limited_rgb_range; ++ bool rgb_range_selectable; + }; + + static inline struct vc4_hdmi_encoder * +@@ -205,6 +207,12 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + return -ENODEV; + + vc4_encoder->hdmi_monitor = drm_detect_hdmi_monitor(edid); ++ ++ if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) { ++ vc4_encoder->rgb_range_selectable = ++ drm_rgb_quant_range_selectable(edid); ++ } ++ + drm_mode_connector_update_edid_property(connector, edid); + ret = drm_add_edid_modes(connector, edid); + +@@ -272,6 +280,117 @@ static const struct drm_encoder_funcs vc4_hdmi_encoder_funcs = { + .destroy = vc4_hdmi_encoder_destroy, + }; + ++static int vc4_hdmi_stop_packet(struct drm_encoder *encoder, ++ enum hdmi_infoframe_type type) ++{ ++ struct drm_device *dev = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ u32 packet_id = type - 0x80; ++ ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, ++ HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & ~BIT(packet_id)); ++ ++ return wait_for(!(HDMI_READ(VC4_HDMI_RAM_PACKET_STATUS) & ++ BIT(packet_id)), 100); ++} ++ ++static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, ++ union hdmi_infoframe *frame) ++{ ++ struct drm_device *dev = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ u32 packet_id = frame->any.type - 0x80; ++ u32 packet_reg = VC4_HDMI_GCP_0 + VC4_HDMI_PACKET_STRIDE * packet_id; ++ uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; ++ ssize_t len, i; ++ int ret; ++ ++ WARN_ONCE(!(HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & ++ VC4_HDMI_RAM_PACKET_ENABLE), ++ "Packet RAM has to be on to store the packet."); ++ ++ len = hdmi_infoframe_pack(frame, buffer, sizeof(buffer)); ++ if (len < 0) ++ return; ++ ++ ret = vc4_hdmi_stop_packet(encoder, frame->any.type); ++ if (ret) { ++ DRM_ERROR("Failed to wait for infoframe to go idle: %d\n", ret); ++ return; ++ } ++ ++ for (i = 0; i < len; i += 7) { ++ HDMI_WRITE(packet_reg, ++ buffer[i + 0] << 0 | ++ buffer[i + 1] << 8 | ++ buffer[i + 2] << 16); ++ packet_reg += 4; ++ ++ HDMI_WRITE(packet_reg, ++ buffer[i + 3] << 0 | ++ buffer[i + 4] << 8 | ++ buffer[i + 5] << 16 | ++ buffer[i + 6] << 24); ++ packet_reg += 4; ++ } ++ ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, ++ HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) | BIT(packet_id)); ++ ret = wait_for((HDMI_READ(VC4_HDMI_RAM_PACKET_STATUS) & ++ BIT(packet_id)), 100); ++ if (ret) ++ DRM_ERROR("Failed to wait for infoframe to start: %d\n", ret); ++} ++ ++static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) ++{ ++ struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); ++ struct drm_crtc *crtc = encoder->crtc; ++ const struct drm_display_mode *mode = &crtc->state->adjusted_mode; ++ union hdmi_infoframe frame; ++ int ret; ++ ++ ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, mode); ++ if (ret < 0) { ++ DRM_ERROR("couldn't fill AVI infoframe\n"); ++ return; ++ } ++ ++ if (vc4_encoder->rgb_range_selectable) { ++ if (vc4_encoder->limited_rgb_range) { ++ frame.avi.quantization_range = ++ HDMI_QUANTIZATION_RANGE_LIMITED; ++ } else { ++ frame.avi.quantization_range = ++ HDMI_QUANTIZATION_RANGE_FULL; ++ } ++ } ++ ++ vc4_hdmi_write_infoframe(encoder, &frame); ++} ++ ++static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder) ++{ ++ union hdmi_infoframe frame; ++ int ret; ++ ++ ret = hdmi_spd_infoframe_init(&frame.spd, "Broadcom", "Videocore"); ++ if (ret < 0) { ++ DRM_ERROR("couldn't fill SPD infoframe\n"); ++ return; ++ } ++ ++ frame.spd.sdi = HDMI_SPD_SDI_PC; ++ ++ vc4_hdmi_write_infoframe(encoder, &frame); ++} ++ ++static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) ++{ ++ vc4_hdmi_set_avi_infoframe(encoder); ++ vc4_hdmi_set_spd_infoframe(encoder); ++} ++ + static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + struct drm_display_mode *unadjusted_mode, + struct drm_display_mode *mode) +@@ -340,8 +459,9 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + + if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) > 1) { + /* CEA VICs other than #1 requre limited range RGB +- * output. Apply a colorspace conversion to squash +- * 0-255 down to 16-235. The matrix here is: ++ * output unless overridden by an AVI infoframe. ++ * Apply a colorspace conversion to squash 0-255 down ++ * to 16-235. The matrix here is: + * + * [ 0 0 0.8594 16] + * [ 0 0.8594 0 16] +@@ -359,6 +479,9 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + HD_WRITE(VC4_HD_CSC_24_23, (0x100 << 16) | 0x000); + HD_WRITE(VC4_HD_CSC_32_31, (0x000 << 16) | 0x6e0); + HD_WRITE(VC4_HD_CSC_34_33, (0x100 << 16) | 0x000); ++ vc4_encoder->limited_rgb_range = true; ++ } else { ++ vc4_encoder->limited_rgb_range = false; + } + + /* The RGB order applies even when CSC is disabled. */ +@@ -377,6 +500,8 @@ static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder) + struct drm_device *dev = encoder->dev; + struct vc4_dev *vc4 = to_vc4_dev(dev); + ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, 0); ++ + HDMI_WRITE(VC4_HDMI_TX_PHY_RESET_CTL, 0xf << 16); + HD_WRITE(VC4_HD_VID_CTL, + HD_READ(VC4_HD_VID_CTL) & ~VC4_HD_VID_CTL_ENABLE); +@@ -429,9 +554,10 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder) + HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) | + VC4_HDMI_SCHEDULER_CONTROL_VERT_ALWAYS_KEEPOUT); + +- /* XXX: Set HDMI_RAM_PACKET_CONFIG (1 << 16) and set +- * up the infoframe. +- */ ++ HDMI_WRITE(VC4_HDMI_RAM_PACKET_CONFIG, ++ VC4_HDMI_RAM_PACKET_ENABLE); ++ ++ vc4_hdmi_set_infoframes(encoder); + + drift = HDMI_READ(VC4_HDMI_FIFO_CTL); + drift &= VC4_HDMI_FIFO_VALID_WRITE_MASK; +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index c5a423ead86ffdd1ce2abada24f628b19c1ebc08..0b868aafa8db69b0a08fe9cbf293263a0a7c5bed 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -441,6 +441,8 @@ + #define VC4_HDMI_RAM_PACKET_CONFIG 0x0a0 + # define VC4_HDMI_RAM_PACKET_ENABLE BIT(16) + ++#define VC4_HDMI_RAM_PACKET_STATUS 0x0a4 ++ + #define VC4_HDMI_HORZA 0x0c4 + # define VC4_HDMI_HORZA_VPOS BIT(14) + # define VC4_HDMI_HORZA_HPOS BIT(13) +@@ -502,6 +504,9 @@ + + #define VC4_HDMI_TX_PHY_RESET_CTL 0x2c0 + ++#define VC4_HDMI_GCP_0 0x400 ++#define VC4_HDMI_PACKET_STRIDE 0x24 ++ + #define VC4_HD_M_CTL 0x00c + # define VC4_HD_M_REGISTER_FILE_STANDBY (3 << 6) + # define VC4_HD_M_RAM_STANDBY (3 << 4) + +From d06d8d96a9423f1a5268377bddbd93a3a3fc20af Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 29 Sep 2016 15:34:44 -0700 +Subject: [PATCH 195/208] drm/vc4: Add support for double-clocked modes. + +Now that we have infoframes to report the pixel repeat flag, we can +start using it. Fixes locking the 720x480i and 720x576i modes on my +Dell 2408WFP. Like the 1920x1080i case, they don't fit properly on +the screen, though. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_crtc.c | 17 +++++++++++------ + drivers/gpu/drm/vc4/vc4_hdmi.c | 16 +++++++++++----- + drivers/gpu/drm/vc4/vc4_regs.h | 2 ++ + 3 files changed, 24 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 83cafea03eff720f9f7b80f484dedf22ac7f283f..7f08d681a74b4e37529f6c09ae1d2c1a944dcabd 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -378,6 +378,7 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + struct drm_crtc_state *state = crtc->state; + struct drm_display_mode *mode = &state->adjusted_mode; + bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE; ++ u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1; + u32 format = PV_CONTROL_FORMAT_24; + bool debug_dump_regs = false; + int clock_select = vc4_get_clock_select(crtc); +@@ -393,14 +394,17 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + CRTC_WRITE(PV_CONTROL, 0); + + CRTC_WRITE(PV_HORZA, +- VC4_SET_FIELD(mode->htotal - mode->hsync_end, ++ VC4_SET_FIELD((mode->htotal - ++ mode->hsync_end) * pixel_rep, + PV_HORZA_HBP) | +- VC4_SET_FIELD(mode->hsync_end - mode->hsync_start, ++ VC4_SET_FIELD((mode->hsync_end - ++ mode->hsync_start) * pixel_rep, + PV_HORZA_HSYNC)); + CRTC_WRITE(PV_HORZB, +- VC4_SET_FIELD(mode->hsync_start - mode->hdisplay, ++ VC4_SET_FIELD((mode->hsync_start - ++ mode->hdisplay) * pixel_rep, + PV_HORZB_HFP) | +- VC4_SET_FIELD(mode->hdisplay, PV_HORZB_HACTIVE)); ++ VC4_SET_FIELD(mode->hdisplay * pixel_rep, PV_HORZB_HACTIVE)); + + CRTC_WRITE(PV_VERTA, + VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, +@@ -434,20 +438,21 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + CRTC_WRITE(PV_V_CONTROL, + PV_VCONTROL_CONTINUOUS | + PV_VCONTROL_INTERLACE | +- VC4_SET_FIELD(mode->htotal / 2, ++ VC4_SET_FIELD(mode->htotal * pixel_rep / 2, + PV_VCONTROL_ODD_DELAY)); + CRTC_WRITE(PV_VSYNCD_EVEN, 0); + } else { + CRTC_WRITE(PV_V_CONTROL, PV_VCONTROL_CONTINUOUS); + } + +- CRTC_WRITE(PV_HACT_ACT, mode->hdisplay); ++ CRTC_WRITE(PV_HACT_ACT, mode->hdisplay * pixel_rep); + + + CRTC_WRITE(PV_CONTROL, + VC4_SET_FIELD(format, PV_CONTROL_FORMAT) | + VC4_SET_FIELD(vc4_get_fifo_full_level(format), + PV_CONTROL_FIFO_LEVEL) | ++ VC4_SET_FIELD(pixel_rep - 1, PV_CONTROL_PIXEL_REP) | + PV_CONTROL_CLR_AT_START | + PV_CONTROL_TRIGGER_UNDERFLOW | + PV_CONTROL_WAIT_HSTART | +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index d6b54b905beeec33eee8a763969ffa9568cfa745..c4cb2e26de32f06db0abf3fd94b3117c3292eed5 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -402,6 +402,7 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; + bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; ++ u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1; + u32 verta = (VC4_SET_FIELD(mode->crtc_vsync_end - mode->crtc_vsync_start, + VC4_HDMI_VERTA_VSP) | + VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, +@@ -424,7 +425,8 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + + HD_WRITE(VC4_HD_VID_CTL, 0); + +- clk_set_rate(vc4->hdmi->pixel_clock, mode->clock * 1000); ++ clk_set_rate(vc4->hdmi->pixel_clock, mode->clock * 1000 * ++ ((mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1)); + + HDMI_WRITE(VC4_HDMI_SCHEDULER_CONTROL, + HDMI_READ(VC4_HDMI_SCHEDULER_CONTROL) | +@@ -434,14 +436,18 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, + HDMI_WRITE(VC4_HDMI_HORZA, + (vsync_pos ? VC4_HDMI_HORZA_VPOS : 0) | + (hsync_pos ? VC4_HDMI_HORZA_HPOS : 0) | +- VC4_SET_FIELD(mode->hdisplay, VC4_HDMI_HORZA_HAP)); ++ VC4_SET_FIELD(mode->hdisplay * pixel_rep, ++ VC4_HDMI_HORZA_HAP)); + + HDMI_WRITE(VC4_HDMI_HORZB, +- VC4_SET_FIELD(mode->htotal - mode->hsync_end, ++ VC4_SET_FIELD((mode->htotal - ++ mode->hsync_end) * pixel_rep, + VC4_HDMI_HORZB_HBP) | +- VC4_SET_FIELD(mode->hsync_end - mode->hsync_start, ++ VC4_SET_FIELD((mode->hsync_end - ++ mode->hsync_start) * pixel_rep, + VC4_HDMI_HORZB_HSP) | +- VC4_SET_FIELD(mode->hsync_start - mode->hdisplay, ++ VC4_SET_FIELD((mode->hsync_start - ++ mode->hdisplay) * pixel_rep, + VC4_HDMI_HORZB_HFP)); + + HDMI_WRITE(VC4_HDMI_VERTA0, verta); +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 0b868aafa8db69b0a08fe9cbf293263a0a7c5bed..1aa44c2db5565ba126d2ceb65495a6c98c555860 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -175,6 +175,8 @@ + # define PV_CONTROL_CLR_AT_START BIT(14) + # define PV_CONTROL_TRIGGER_UNDERFLOW BIT(13) + # define PV_CONTROL_WAIT_HSTART BIT(12) ++# define PV_CONTROL_PIXEL_REP_MASK VC4_MASK(5, 4) ++# define PV_CONTROL_PIXEL_REP_SHIFT 4 + # define PV_CONTROL_CLK_SELECT_DSI_VEC 0 + # define PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI 1 + # define PV_CONTROL_CLK_SELECT_MASK VC4_MASK(3, 2) + +From 68dde0cad20ec7f9c40100cbcfd744d61bdc298a Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 08:39:33 +0100 +Subject: [PATCH 196/208] drm/vc4: Add a mode for using the closed firmware for + display. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/Makefile | 1 + + drivers/gpu/drm/vc4/vc4_crtc.c | 13 + + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_drv.h | 7 + + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 660 +++++++++++++++++++++++++++++++++ + 5 files changed, 682 insertions(+) + create mode 100644 drivers/gpu/drm/vc4/vc4_firmware_kms.c + +diff --git a/drivers/gpu/drm/vc4/Makefile b/drivers/gpu/drm/vc4/Makefile +index fb77db755e0a29d8589860da82186c7a1f394c72..c6dd06cca9830018c39b3b16afe4045e44d1ddf4 100644 +--- a/drivers/gpu/drm/vc4/Makefile ++++ b/drivers/gpu/drm/vc4/Makefile +@@ -8,6 +8,7 @@ vc4-y := \ + vc4_crtc.o \ + vc4_drv.o \ + vc4_dpi.o \ ++ vc4_firmware_kms.o \ + vc4_kms.o \ + vc4_gem.o \ + vc4_hdmi.o \ +diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c +index 7f08d681a74b4e37529f6c09ae1d2c1a944dcabd..7366e76c38346f7c700534b28d1eff4eca2ec2fa 100644 +--- a/drivers/gpu/drm/vc4/vc4_crtc.c ++++ b/drivers/gpu/drm/vc4/vc4_crtc.c +@@ -163,6 +163,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, + int vblank_lines; + int ret = 0; + ++ if (vc4->firmware_kms) ++ return 0; ++ + /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ + + /* Get optional system timestamp before query. */ +@@ -656,6 +659,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; + ++ if (vc4->firmware_kms) { ++ /* XXX: Can we mask the SMI interrupt? */ ++ return 0; ++ } ++ + CRTC_WRITE(PV_INTEN, PV_INT_VFP_START); + + return 0; +@@ -666,6 +674,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) + struct vc4_dev *vc4 = to_vc4_dev(dev); + struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; + ++ if (vc4->firmware_kms) { ++ /* XXX: Can we mask the SMI interrupt? */ ++ return; ++ } ++ + CRTC_WRITE(PV_INTEN, 0); + } + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 8703f56b794774ac4130a7b487472e293ebe7cdf..6c4a4fbc86d0a30a6977b2081bca4372e693b817 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -292,6 +292,7 @@ static struct platform_driver *const component_drivers[] = { + &vc4_dpi_driver, + &vc4_hvs_driver, + &vc4_crtc_driver, ++ &vc4_firmware_kms_driver, + &vc4_v3d_driver, + }; + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 7c1e4d97486fb57d9ce7002c30a23138519761ae..e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -12,6 +12,9 @@ + struct vc4_dev { + struct drm_device *dev; + ++ bool firmware_kms; ++ struct rpi_firmware *firmware; ++ + struct vc4_hdmi *hdmi; + struct vc4_hvs *hvs; + struct vc4_crtc *crtc[3]; +@@ -460,6 +463,10 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); + extern struct platform_driver vc4_dpi_driver; + int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); + ++/* vc4_firmware_kms.c */ ++extern struct platform_driver vc4_firmware_kms_driver; ++void vc4_fkms_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file); ++ + /* vc4_gem.c */ + void vc4_gem_init(struct drm_device *dev); + void vc4_gem_destroy(struct drm_device *dev); +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +new file mode 100644 +index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57ae97b55c +--- /dev/null ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -0,0 +1,660 @@ ++/* ++ * Copyright (C) 2016 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++/** ++ * DOC: VC4 firmware KMS module. ++ * ++ * As a hack to get us from the current closed source driver world ++ * toward a totally open stack, implement KMS on top of the Raspberry ++ * Pi's firmware display stack. ++ */ ++ ++#include "drm_atomic.h" ++#include "drm_atomic_helper.h" ++#include "drm_plane_helper.h" ++#include "drm_crtc_helper.h" ++#include "linux/clk.h" ++#include "linux/debugfs.h" ++#include "drm_fb_cma_helper.h" ++#include "linux/component.h" ++#include "linux/of_device.h" ++#include "vc4_drv.h" ++#include "vc4_regs.h" ++#include ++ ++/* The firmware delivers a vblank interrupt to us through the SMI ++ * hardware, which has only this one register. ++ */ ++#define SMICS 0x0 ++#define SMICS_INTERRUPTS (BIT(9) | BIT(10) | BIT(11)) ++ ++struct vc4_crtc { ++ struct drm_crtc base; ++ struct drm_encoder *encoder; ++ struct drm_connector *connector; ++ void __iomem *regs; ++ ++ struct drm_pending_vblank_event *event; ++}; ++ ++static inline struct vc4_crtc *to_vc4_crtc(struct drm_crtc *crtc) ++{ ++ return container_of(crtc, struct vc4_crtc, base); ++} ++ ++struct vc4_fkms_encoder { ++ struct drm_encoder base; ++}; ++ ++static inline struct vc4_fkms_encoder * ++to_vc4_fkms_encoder(struct drm_encoder *encoder) ++{ ++ return container_of(encoder, struct vc4_fkms_encoder, base); ++} ++ ++/* VC4 FKMS connector KMS struct */ ++struct vc4_fkms_connector { ++ struct drm_connector base; ++ ++ /* Since the connector is attached to just the one encoder, ++ * this is the reference to it so we can do the best_encoder() ++ * hook. ++ */ ++ struct drm_encoder *encoder; ++}; ++ ++static inline struct vc4_fkms_connector * ++to_vc4_fkms_connector(struct drm_connector *connector) ++{ ++ return container_of(connector, struct vc4_fkms_connector, base); ++} ++ ++/* Firmware's structure for making an FB mbox call. */ ++struct fbinfo_s { ++ u32 xres, yres, xres_virtual, yres_virtual; ++ u32 pitch, bpp; ++ u32 xoffset, yoffset; ++ u32 base; ++ u32 screen_size; ++ u16 cmap[256]; ++}; ++ ++struct vc4_fkms_plane { ++ struct drm_plane base; ++ struct fbinfo_s *fbinfo; ++ dma_addr_t fbinfo_bus_addr; ++ u32 pitch; ++}; ++ ++static inline struct vc4_fkms_plane *to_vc4_fkms_plane(struct drm_plane *plane) ++{ ++ return (struct vc4_fkms_plane *)plane; ++} ++ ++/* Turns the display on/off. */ ++static int vc4_plane_set_primary_blank(struct drm_plane *plane, bool blank) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ ++ u32 packet = blank; ++ return rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_FRAMEBUFFER_BLANK, ++ &packet, sizeof(packet)); ++} ++ ++static void vc4_primary_plane_atomic_update(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ struct vc4_fkms_plane *vc4_plane = to_vc4_fkms_plane(plane); ++ struct drm_plane_state *state = plane->state; ++ struct drm_framebuffer *fb = state->fb; ++ struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); ++ volatile struct fbinfo_s *fbinfo = vc4_plane->fbinfo; ++ u32 bpp = 32; ++ int ret; ++ ++ vc4_plane_set_primary_blank(plane, false); ++ ++ fbinfo->xres = state->crtc_w; ++ fbinfo->yres = state->crtc_h; ++ fbinfo->xres_virtual = state->crtc_w; ++ fbinfo->yres_virtual = state->crtc_h; ++ fbinfo->bpp = bpp; ++ fbinfo->xoffset = state->crtc_x; ++ fbinfo->yoffset = state->crtc_y; ++ fbinfo->base = bo->paddr + fb->offsets[0]; ++ fbinfo->pitch = fb->pitches[0]; ++ /* A bug in the firmware makes it so that if the fb->base is ++ * set to nonzero, the configured pitch gets overwritten with ++ * the previous pitch. So, to get the configured pitch ++ * recomputed, we have to make it allocate itself a new buffer ++ * in VC memory, first. ++ */ ++ if (vc4_plane->pitch != fb->pitches[0]) { ++ u32 saved_base = fbinfo->base; ++ fbinfo->base = 0; ++ ++ ret = rpi_firmware_transaction(vc4->firmware, ++ RPI_FIRMWARE_CHAN_FB, ++ vc4_plane->fbinfo_bus_addr); ++ fbinfo->base = saved_base; ++ ++ vc4_plane->pitch = fbinfo->pitch; ++ WARN_ON_ONCE(vc4_plane->pitch != fb->pitches[0]); ++ } ++ ++ ret = rpi_firmware_transaction(vc4->firmware, ++ RPI_FIRMWARE_CHAN_FB, ++ vc4_plane->fbinfo_bus_addr); ++ WARN_ON_ONCE(fbinfo->pitch != fb->pitches[0]); ++ WARN_ON_ONCE(fbinfo->base != bo->paddr + fb->offsets[0]); ++} ++ ++static void vc4_primary_plane_atomic_disable(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ vc4_plane_set_primary_blank(plane, true); ++} ++ ++static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ struct drm_plane_state *state = plane->state; ++ struct drm_framebuffer *fb = state->fb; ++ struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); ++ int ret; ++ u32 packet_state[] = { true, state->crtc_x, state->crtc_y, 0 }; ++ u32 packet_info[] = { state->crtc_w, state->crtc_h, ++ 0, /* unused */ ++ bo->paddr + fb->offsets[0], ++ 0, 0, /* hotx, hoty */}; ++ WARN_ON_ONCE(fb->pitches[0] != state->crtc_w * 4); ++ WARN_ON_ONCE(fb->bits_per_pixel != 32); ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_SET_CURSOR_STATE, ++ &packet_state, ++ sizeof(packet_state)); ++ if (ret || packet_state[0] != 0) ++ DRM_ERROR("Failed to set cursor state: 0x%08x\n", packet_state[0]); ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_SET_CURSOR_INFO, ++ &packet_info, ++ sizeof(packet_info)); ++ if (ret || packet_info[0] != 0) ++ DRM_ERROR("Failed to set cursor info: 0x%08x\n", packet_info[0]); ++} ++ ++static void vc4_cursor_plane_atomic_disable(struct drm_plane *plane, ++ struct drm_plane_state *old_state) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(plane->dev); ++ u32 packet_state[] = { false, 0, 0, 0 }; ++ int ret; ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_SET_CURSOR_STATE, ++ &packet_state, ++ sizeof(packet_state)); ++ if (ret || packet_state[0] != 0) ++ DRM_ERROR("Failed to set cursor state: 0x%08x\n", packet_state[0]); ++} ++ ++static int vc4_plane_atomic_check(struct drm_plane *plane, ++ struct drm_plane_state *state) ++{ ++ return 0; ++} ++ ++static void vc4_plane_destroy(struct drm_plane *plane) ++{ ++ drm_plane_helper_disable(plane); ++ drm_plane_cleanup(plane); ++} ++ ++static const struct drm_plane_funcs vc4_plane_funcs = { ++ .update_plane = drm_atomic_helper_update_plane, ++ .disable_plane = drm_atomic_helper_disable_plane, ++ .destroy = vc4_plane_destroy, ++ .set_property = NULL, ++ .reset = drm_atomic_helper_plane_reset, ++ .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, ++}; ++ ++static const struct drm_plane_helper_funcs vc4_primary_plane_helper_funcs = { ++ .prepare_fb = NULL, ++ .cleanup_fb = NULL, ++ .atomic_check = vc4_plane_atomic_check, ++ .atomic_update = vc4_primary_plane_atomic_update, ++ .atomic_disable = vc4_primary_plane_atomic_disable, ++}; ++ ++static const struct drm_plane_helper_funcs vc4_cursor_plane_helper_funcs = { ++ .prepare_fb = NULL, ++ .cleanup_fb = NULL, ++ .atomic_check = vc4_plane_atomic_check, ++ .atomic_update = vc4_cursor_plane_atomic_update, ++ .atomic_disable = vc4_cursor_plane_atomic_disable, ++}; ++ ++static struct drm_plane *vc4_fkms_plane_init(struct drm_device *dev, ++ enum drm_plane_type type) ++{ ++ struct drm_plane *plane = NULL; ++ struct vc4_fkms_plane *vc4_plane; ++ u32 xrgb8888 = DRM_FORMAT_XRGB8888; ++ u32 argb8888 = DRM_FORMAT_ARGB8888; ++ int ret = 0; ++ bool primary = (type == DRM_PLANE_TYPE_PRIMARY); ++ ++ vc4_plane = devm_kzalloc(dev->dev, sizeof(*vc4_plane), ++ GFP_KERNEL); ++ if (!vc4_plane) { ++ ret = -ENOMEM; ++ goto fail; ++ } ++ ++ plane = &vc4_plane->base; ++ ret = drm_universal_plane_init(dev, plane, 0xff, ++ &vc4_plane_funcs, ++ primary ? &xrgb8888 : &argb8888, 1, ++ type, NULL); ++ ++ if (type == DRM_PLANE_TYPE_PRIMARY) { ++ vc4_plane->fbinfo = ++ dma_alloc_coherent(dev->dev, ++ sizeof(*vc4_plane->fbinfo), ++ &vc4_plane->fbinfo_bus_addr, ++ GFP_KERNEL); ++ memset(vc4_plane->fbinfo, 0, sizeof(*vc4_plane->fbinfo)); ++ ++ drm_plane_helper_add(plane, &vc4_primary_plane_helper_funcs); ++ } else { ++ drm_plane_helper_add(plane, &vc4_cursor_plane_helper_funcs); ++ } ++ ++ return plane; ++fail: ++ if (plane) ++ vc4_plane_destroy(plane); ++ ++ return ERR_PTR(ret); ++} ++ ++static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) ++{ ++ /* Everyting is handled in the planes. */ ++} ++ ++static void vc4_crtc_disable(struct drm_crtc *crtc) ++{ ++} ++ ++static void vc4_crtc_enable(struct drm_crtc *crtc) ++{ ++} ++ ++static int vc4_crtc_atomic_check(struct drm_crtc *crtc, ++ struct drm_crtc_state *state) ++{ ++ return 0; ++} ++ ++static void vc4_crtc_atomic_flush(struct drm_crtc *crtc, ++ struct drm_crtc_state *old_state) ++{ ++} ++ ++static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) ++{ ++ struct drm_crtc *crtc = &vc4_crtc->base; ++ struct drm_device *dev = crtc->dev; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&dev->event_lock, flags); ++ if (vc4_crtc->event) { ++ drm_crtc_send_vblank_event(crtc, vc4_crtc->event); ++ vc4_crtc->event = NULL; ++ drm_crtc_vblank_put(crtc); ++ } ++ spin_unlock_irqrestore(&dev->event_lock, flags); ++} ++ ++static irqreturn_t vc4_crtc_irq_handler(int irq, void *data) ++{ ++ struct vc4_crtc *vc4_crtc = data; ++ u32 stat = readl(vc4_crtc->regs + SMICS); ++ irqreturn_t ret = IRQ_NONE; ++ ++ if (stat & SMICS_INTERRUPTS) { ++ writel(0, vc4_crtc->regs + SMICS); ++ drm_crtc_handle_vblank(&vc4_crtc->base); ++ vc4_crtc_handle_page_flip(vc4_crtc); ++ ret = IRQ_HANDLED; ++ } ++ ++ return ret; ++} ++ ++static int vc4_page_flip(struct drm_crtc *crtc, ++ struct drm_framebuffer *fb, ++ struct drm_pending_vblank_event *event, ++ uint32_t flags) ++{ ++ if (flags & DRM_MODE_PAGE_FLIP_ASYNC) { ++ DRM_ERROR("Async flips aren't allowed\n"); ++ return -EINVAL; ++ } ++ ++ return drm_atomic_helper_page_flip(crtc, fb, event, flags); ++} ++ ++static const struct drm_crtc_funcs vc4_crtc_funcs = { ++ .set_config = drm_atomic_helper_set_config, ++ .destroy = drm_crtc_cleanup, ++ .page_flip = vc4_page_flip, ++ .set_property = NULL, ++ .cursor_set = NULL, /* handled by drm_mode_cursor_universal */ ++ .cursor_move = NULL, /* handled by drm_mode_cursor_universal */ ++ .reset = drm_atomic_helper_crtc_reset, ++ .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, ++}; ++ ++static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { ++ .mode_set_nofb = vc4_crtc_mode_set_nofb, ++ .disable = vc4_crtc_disable, ++ .enable = vc4_crtc_enable, ++ .atomic_check = vc4_crtc_atomic_check, ++ .atomic_flush = vc4_crtc_atomic_flush, ++}; ++ ++/* Frees the page flip event when the DRM device is closed with the ++ * event still outstanding. ++ */ ++void vc4_fkms_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file) ++{ ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ struct drm_device *dev = crtc->dev; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&dev->event_lock, flags); ++ ++ if (vc4_crtc->event && vc4_crtc->event->base.file_priv == file) { ++ kfree(&vc4_crtc->event->base); ++ drm_crtc_vblank_put(crtc); ++ vc4_crtc->event = NULL; ++ } ++ ++ spin_unlock_irqrestore(&dev->event_lock, flags); ++} ++ ++static const struct of_device_id vc4_firmware_kms_dt_match[] = { ++ { .compatible = "raspberrypi,rpi-firmware-kms" }, ++ {} ++}; ++ ++static enum drm_connector_status ++vc4_fkms_connector_detect(struct drm_connector *connector, bool force) ++{ ++ return connector_status_connected; ++} ++ ++static int vc4_fkms_connector_get_modes(struct drm_connector *connector) ++{ ++ struct drm_device *dev = connector->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); ++ u32 wh[2] = {0, 0}; ++ int ret; ++ struct drm_display_mode *mode; ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT, ++ &wh, sizeof(wh)); ++ if (ret) { ++ DRM_ERROR("Failed to get screen size: %d (0x%08x 0x%08x)\n", ++ ret, wh[0], wh[1]); ++ return 0; ++ } ++ ++ mode = drm_cvt_mode(dev, wh[0], wh[1], 60 /* vrefresh */, ++ 0, 0, false); ++ drm_mode_probed_add(connector, mode); ++ ++ return 1; ++} ++ ++static struct drm_encoder * ++vc4_fkms_connector_best_encoder(struct drm_connector *connector) ++{ ++ struct vc4_fkms_connector *fkms_connector = ++ to_vc4_fkms_connector(connector); ++ return fkms_connector->encoder; ++} ++ ++static void vc4_fkms_connector_destroy(struct drm_connector *connector) ++{ ++ drm_connector_unregister(connector); ++ drm_connector_cleanup(connector); ++} ++ ++static const struct drm_connector_funcs vc4_fkms_connector_funcs = { ++ .dpms = drm_atomic_helper_connector_dpms, ++ .detect = vc4_fkms_connector_detect, ++ .fill_modes = drm_helper_probe_single_connector_modes, ++ .destroy = vc4_fkms_connector_destroy, ++ .reset = drm_atomic_helper_connector_reset, ++ .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, ++ .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, ++}; ++ ++static const struct drm_connector_helper_funcs vc4_fkms_connector_helper_funcs = { ++ .get_modes = vc4_fkms_connector_get_modes, ++ .best_encoder = vc4_fkms_connector_best_encoder, ++}; ++ ++static struct drm_connector *vc4_fkms_connector_init(struct drm_device *dev, ++ struct drm_encoder *encoder) ++{ ++ struct drm_connector *connector = NULL; ++ struct vc4_fkms_connector *fkms_connector; ++ int ret = 0; ++ ++ fkms_connector = devm_kzalloc(dev->dev, sizeof(*fkms_connector), ++ GFP_KERNEL); ++ if (!fkms_connector) { ++ ret = -ENOMEM; ++ goto fail; ++ } ++ connector = &fkms_connector->base; ++ ++ fkms_connector->encoder = encoder; ++ ++ drm_connector_init(dev, connector, &vc4_fkms_connector_funcs, ++ DRM_MODE_CONNECTOR_HDMIA); ++ drm_connector_helper_add(connector, &vc4_fkms_connector_helper_funcs); ++ ++ connector->polled = (DRM_CONNECTOR_POLL_CONNECT | ++ DRM_CONNECTOR_POLL_DISCONNECT); ++ ++ connector->interlace_allowed = 0; ++ connector->doublescan_allowed = 0; ++ ++ drm_mode_connector_attach_encoder(connector, encoder); ++ ++ return connector; ++ ++ fail: ++ if (connector) ++ vc4_fkms_connector_destroy(connector); ++ ++ return ERR_PTR(ret); ++} ++ ++static void vc4_fkms_encoder_destroy(struct drm_encoder *encoder) ++{ ++ drm_encoder_cleanup(encoder); ++} ++ ++static const struct drm_encoder_funcs vc4_fkms_encoder_funcs = { ++ .destroy = vc4_fkms_encoder_destroy, ++}; ++ ++static void vc4_fkms_encoder_enable(struct drm_encoder *encoder) ++{ ++} ++ ++static void vc4_fkms_encoder_disable(struct drm_encoder *encoder) ++{ ++} ++ ++static const struct drm_encoder_helper_funcs vc4_fkms_encoder_helper_funcs = { ++ .enable = vc4_fkms_encoder_enable, ++ .disable = vc4_fkms_encoder_disable, ++}; ++ ++static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct drm_device *drm = dev_get_drvdata(master); ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_crtc *vc4_crtc; ++ struct vc4_fkms_encoder *vc4_encoder; ++ struct drm_crtc *crtc; ++ struct drm_plane *primary_plane, *cursor_plane, *destroy_plane, *temp; ++ struct device_node *firmware_node; ++ int ret; ++ ++ vc4->firmware_kms = true; ++ ++ vc4_crtc = devm_kzalloc(dev, sizeof(*vc4_crtc), GFP_KERNEL); ++ if (!vc4_crtc) ++ return -ENOMEM; ++ crtc = &vc4_crtc->base; ++ ++ firmware_node = of_parse_phandle(dev->of_node, "brcm,firmware", 0); ++ vc4->firmware = rpi_firmware_get(firmware_node); ++ if (!vc4->firmware) { ++ DRM_DEBUG("Failed to get Raspberry Pi firmware reference.\n"); ++ return -EPROBE_DEFER; ++ } ++ of_node_put(firmware_node); ++ ++ /* Map the SMI interrupt reg */ ++ vc4_crtc->regs = vc4_ioremap_regs(pdev, 0); ++ if (IS_ERR(vc4_crtc->regs)) ++ return PTR_ERR(vc4_crtc->regs); ++ ++ /* For now, we create just the primary and the legacy cursor ++ * planes. We should be able to stack more planes on easily, ++ * but to do that we would need to compute the bandwidth ++ * requirement of the plane configuration, and reject ones ++ * that will take too much. ++ */ ++ primary_plane = vc4_fkms_plane_init(drm, DRM_PLANE_TYPE_PRIMARY); ++ if (IS_ERR(primary_plane)) { ++ dev_err(dev, "failed to construct primary plane\n"); ++ ret = PTR_ERR(primary_plane); ++ goto err; ++ } ++ ++ cursor_plane = vc4_fkms_plane_init(drm, DRM_PLANE_TYPE_CURSOR); ++ if (IS_ERR(cursor_plane)) { ++ dev_err(dev, "failed to construct cursor plane\n"); ++ ret = PTR_ERR(cursor_plane); ++ goto err; ++ } ++ ++ drm_crtc_init_with_planes(drm, crtc, primary_plane, cursor_plane, ++ &vc4_crtc_funcs, NULL); ++ drm_crtc_helper_add(crtc, &vc4_crtc_helper_funcs); ++ primary_plane->crtc = crtc; ++ cursor_plane->crtc = crtc; ++ vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; ++ ++ vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL); ++ if (!vc4_encoder) ++ return -ENOMEM; ++ vc4_crtc->encoder = &vc4_encoder->base; ++ vc4_encoder->base.possible_crtcs |= drm_crtc_mask(crtc) ; ++ drm_encoder_init(drm, &vc4_encoder->base, &vc4_fkms_encoder_funcs, ++ DRM_MODE_ENCODER_TMDS, NULL); ++ drm_encoder_helper_add(&vc4_encoder->base, ++ &vc4_fkms_encoder_helper_funcs); ++ ++ vc4_crtc->connector = vc4_fkms_connector_init(drm, &vc4_encoder->base); ++ if (IS_ERR(vc4_crtc->connector)) { ++ ret = PTR_ERR(vc4_crtc->connector); ++ goto err_destroy_encoder; ++ } ++ ++ writel(0, vc4_crtc->regs + SMICS); ++ ret = devm_request_irq(dev, platform_get_irq(pdev, 0), ++ vc4_crtc_irq_handler, 0, "vc4 firmware kms", ++ vc4_crtc); ++ if (ret) ++ goto err_destroy_connector; ++ ++ platform_set_drvdata(pdev, vc4_crtc); ++ ++ return 0; ++ ++err_destroy_connector: ++ vc4_fkms_connector_destroy(vc4_crtc->connector); ++err_destroy_encoder: ++ vc4_fkms_encoder_destroy(vc4_crtc->encoder); ++ list_for_each_entry_safe(destroy_plane, temp, ++ &drm->mode_config.plane_list, head) { ++ if (destroy_plane->possible_crtcs == 1 << drm_crtc_index(crtc)) ++ destroy_plane->funcs->destroy(destroy_plane); ++ } ++err: ++ return ret; ++} ++ ++static void vc4_fkms_unbind(struct device *dev, struct device *master, ++ void *data) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct vc4_crtc *vc4_crtc = dev_get_drvdata(dev); ++ ++ vc4_fkms_connector_destroy(vc4_crtc->connector); ++ vc4_fkms_encoder_destroy(vc4_crtc->encoder); ++ drm_crtc_cleanup(&vc4_crtc->base); ++ ++ platform_set_drvdata(pdev, NULL); ++} ++ ++static const struct component_ops vc4_fkms_ops = { ++ .bind = vc4_fkms_bind, ++ .unbind = vc4_fkms_unbind, ++}; ++ ++static int vc4_fkms_probe(struct platform_device *pdev) ++{ ++ return component_add(&pdev->dev, &vc4_fkms_ops); ++} ++ ++static int vc4_fkms_remove(struct platform_device *pdev) ++{ ++ component_del(&pdev->dev, &vc4_fkms_ops); ++ return 0; ++} ++ ++struct platform_driver vc4_firmware_kms_driver = { ++ .probe = vc4_fkms_probe, ++ .remove = vc4_fkms_remove, ++ .driver = { ++ .name = "vc4_firmware_kms", ++ .of_match_table = vc4_firmware_kms_dt_match, ++ }, ++}; + +From 1e7e72efacf0401c04fe4295b8c615350a41d6d0 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Wed, 10 Aug 2016 18:52:34 +0200 +Subject: [PATCH 197/208] drm/fb-helper: Add a dummy + remove_conflicting_framebuffers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Lots of drivers don't properly compile without this when CONFIG_FB=n. +It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when +it's disabled I think it makes sense to add it to drm_fb_helper.h. + +Long term we probably need to rethink all the logic to unload firmware +framebuffer drivers, at least if we want to be able to move away from +CONFIG_FB and fbcon. + +v2: Unfortunately just stubbing out remove_conflicting_framebuffers in +drm_fb_helper.h upset gcc about static vs. non-static declarations, so +a new wrapper it needs to be. Means more churn :( + +Cc: Tobias Jakobi +Cc: Noralf Trønnes +Cc: tomi.valkeinen@ti.com +Cc: dh.herrmann@gmail.com +Reviewed-by: Alex Deucher +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-2-git-send-email-daniel.vetter@ffwll.ch +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- + drivers/gpu/drm/bochs/bochs_drv.c | 3 ++- + drivers/gpu/drm/cirrus/cirrus_drv.c | 2 +- + drivers/gpu/drm/i915/i915_drv.c | 2 +- + drivers/gpu/drm/mgag200/mgag200_drv.c | 2 +- + drivers/gpu/drm/mgag200/mgag200_main.c | 2 +- + drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- + drivers/gpu/drm/radeon/radeon_drv.c | 3 ++- + drivers/gpu/drm/sun4i/sun4i_drv.c | 3 ++- + drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 3 ++- + include/drm/drm_fb_helper.h | 14 ++++++++++++++ + 11 files changed, 28 insertions(+), 10 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +index 414a1600da54b5a108638d86246429d5796562db..6e37e8b7c0f2fc67ecb7e3b98515217d17808e22 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +@@ -341,7 +341,7 @@ static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c +index abace82de6eac2de22b747ff54a5612443f69647..277654abe0f79e768c525380623dc1896749b4cb 100644 +--- a/drivers/gpu/drm/bochs/bochs_drv.c ++++ b/drivers/gpu/drm/bochs/bochs_drv.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "bochs.h" + +@@ -153,7 +154,7 @@ static int bochs_kick_out_firmware_fb(struct pci_dev *pdev) + + ap->ranges[0].base = pci_resource_start(pdev, 0); + ap->ranges[0].size = pci_resource_len(pdev, 0); +- remove_conflicting_framebuffers(ap, "bochsdrmfb", false); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c +index b05f7eae32ce756e39f656adcbadc2ddfb55893c..6c76d125995bef3f20b566292aeeb7ad9122c86d 100644 +--- a/drivers/gpu/drm/cirrus/cirrus_drv.c ++++ b/drivers/gpu/drm/cirrus/cirrus_drv.c +@@ -57,7 +57,7 @@ static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c +index d46fa2206722855856920de5e6d3817fe75679ab..71d8859aa32d424f86d63f4df5e4b5240d6e0906 100644 +--- a/drivers/gpu/drm/i915/i915_drv.c ++++ b/drivers/gpu/drm/i915/i915_drv.c +@@ -706,7 +706,7 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv) + primary = + pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + +- ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary); ++ ret = drm_fb_helper_remove_conflicting_framebuffers(ap, "inteldrmfb", primary); + + kfree(ap); + +diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c +index 2b4b125eebc3ef9e5987d3bcc32d429f5b15ff8e..1443b3a34775cbcaca50532482cfa32fd3052671 100644 +--- a/drivers/gpu/drm/mgag200/mgag200_drv.c ++++ b/drivers/gpu/drm/mgag200/mgag200_drv.c +@@ -56,7 +56,7 @@ static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "mgag200drmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary); + kfree(ap); + } + +diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c +index 13798b3e6bebbf0b8a62b39c60b9494659d5264d..e79cbc25ae3c54048b21c6293ea340b91b0750fc 100644 +--- a/drivers/gpu/drm/mgag200/mgag200_main.c ++++ b/drivers/gpu/drm/mgag200/mgag200_main.c +@@ -135,7 +135,7 @@ static int mga_vram_init(struct mga_device *mdev) + aper->ranges[0].base = mdev->mc.vram_base; + aper->ranges[0].size = mdev->mc.vram_window; + +- remove_conflicting_framebuffers(aper, "mgafb", true); ++ drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true); + kfree(aper); + + if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window, +diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c +index 66c1280c0f1f2854aa501f810c50a11e6149eaaa..652ab111dd74d899cc9aac867e05791e0a64229f 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_drm.c ++++ b/drivers/gpu/drm/nouveau/nouveau_drm.c +@@ -351,7 +351,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev, + boot = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif + if (nouveau_modeset != 2) +- remove_conflicting_framebuffers(aper, "nouveaufb", boot); ++ drm_fb_helper_remove_conflicting_framebuffers(aper, "nouveaufb", boot); + kfree(aper); + + ret = nvkm_device_pci_new(pdev, nouveau_config, nouveau_debug, +diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c +index c01a7c6abb491c4227ad02fd6525813a7a9d3d55..90f2ff217b3123e70ed17b6d0ed34c17eadd527e 100644 +--- a/drivers/gpu/drm/radeon/radeon_drv.c ++++ b/drivers/gpu/drm/radeon/radeon_drv.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + + #include "drm_crtc_helper.h" + #include "radeon_kfd.h" +@@ -324,7 +325,7 @@ static int radeon_kick_out_firmware_fb(struct pci_dev *pdev) + #ifdef CONFIG_X86 + primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; + #endif +- remove_conflicting_framebuffers(ap, "radeondrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary); + kfree(ap); + + return 0; +diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c +index 7092daaf6c432b8fa8d2bb93bda63785cf307f01..8913c151b37f475acdbee1f41074188c4430a00d 100644 +--- a/drivers/gpu/drm/sun4i/sun4i_drv.c ++++ b/drivers/gpu/drm/sun4i/sun4i_drv.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include "sun4i_crtc.h" + #include "sun4i_drv.h" +@@ -109,7 +110,7 @@ static void sun4i_remove_framebuffers(void) + ap->ranges[0].base = 0; + ap->ranges[0].size = ~0; + +- remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false); + kfree(ap); + } + +diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c +index 88a39165edd50705d561ca8c5d23df2ac628f9a1..cf142737a1667227240c9c88d0c6864df39003de 100644 +--- a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c ++++ b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c +@@ -24,6 +24,7 @@ + */ + + #include ++#include + + #include "virtgpu_drv.h" + +@@ -52,7 +53,7 @@ static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev) + primary = pci_dev->resource[PCI_ROM_RESOURCE].flags + & IORESOURCE_ROM_SHADOW; + +- remove_conflicting_framebuffers(ap, "virtiodrmfb", primary); ++ drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary); + + kfree(ap); + } +diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h +index db8d4780eaa27607baf7857111c72b50bbae5fd4..130c324f1aeeddd25c996a766baaf3d8e26ac110 100644 +--- a/include/drm/drm_fb_helper.h ++++ b/include/drm/drm_fb_helper.h +@@ -32,6 +32,7 @@ + + struct drm_fb_helper; + ++#include + #include + + enum mode_set_atomic { +@@ -282,6 +283,12 @@ drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn, + int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector); + int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, + struct drm_connector *connector); ++static inline int ++drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, ++ const char *name, bool primary) ++{ ++ return remove_conflicting_framebuffers(a, name, primary); ++} + #else + static inline int drm_fb_helper_modinit(void) + { +@@ -475,5 +482,12 @@ drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, + { + return 0; + } ++ ++static inline int ++drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, ++ const char *name, bool primary) ++{ ++ return 0; ++} + #endif + #endif + +From c5b9aa24bc98cb757a296d6d26cd27a1728a48cd Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 08:52:26 +0100 +Subject: [PATCH 198/208] BCM270X: Add an overlay for enabling the vc4 driver + in firmware-KMS mode. + +This gets us normal 3D support on top of the existing firmware display +stack. There's no real modesetting support, no async pageflips +(hurting performance), etc., but it means that the desktop can at +least run until we get full native modesetting. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/bcm270x.dtsi | 11 +++ + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 11 +++ + .../arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts | 89 ++++++++++++++++++++++ + 4 files changed, 112 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts + +diff --git a/arch/arm/boot/dts/bcm270x.dtsi b/arch/arm/boot/dts/bcm270x.dtsi +index 514b481d4f4095dc8b55a216ac7335934973e145..a46cb4a8b1419edd95e0e07c18b0f373222dc2bf 100644 +--- a/arch/arm/boot/dts/bcm270x.dtsi ++++ b/arch/arm/boot/dts/bcm270x.dtsi +@@ -1,4 +1,5 @@ + /* Downstream bcm283x.dtsi diff */ ++#include "dt-bindings/power/raspberrypi-power.h" + + / { + chosen { +@@ -88,6 +89,15 @@ + status = "disabled"; + }; + ++ firmwarekms: firmwarekms@7e600000 { ++ compatible = "raspberrypi,rpi-firmware-kms"; ++ /* SMI interrupt reg */ ++ reg = <0x7e600000 0x100>; ++ interrupts = <2 16>; ++ brcm,firmware = <&firmware>; ++ status = "disabled"; ++ }; ++ + smi: smi@7e600000 { + compatible = "brcm,bcm2835-smi"; + reg = <0x7e600000 0x100>; +@@ -119,6 +129,7 @@ + + v3d@7ec00000 { /* vd3 */ + compatible = "brcm,vc4-v3d"; ++ power-domains = <&power RPI_POWER_DOMAIN_V3D>; + status = "disabled"; + }; + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index a3ddb4577ce1f671f4c23ebe32c434c97b00781c..7624812d0cdc74728f3556159871c7a299f9f6b7 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -90,6 +90,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + spi2-3cs.dtbo \ + tinylcd35.dtbo \ + uart1.dtbo \ ++ vc4-fkms-v3d.dtbo \ + vc4-kms-v3d.dtbo \ + vga666.dtbo \ + w1-gpio.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 496e31db0c7d22934bd381aea5e7227c26a3f034..c0290531a61fedfe23e820ca4d9693a0acd3e876 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1276,6 +1276,17 @@ 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) + + ++Name: vc4-fkms-v3d ++Info: Enable Eric Anholt's DRM VC4 V3D driver on top of the dispmanx ++ display stack. ++Load: dtoverlay=vc4-fkms-v3d, ++Params: cma-256 CMA is 256MB, 256MB-aligned (needs 1GB) ++ cma-192 CMA is 192MB, 256MB-aligned (needs 1GB) ++ cma-128 CMA is 128MB, 128MB-aligned ++ cma-96 CMA is 96MB, 128MB-aligned ++ cma-64 CMA is 64MB, 64MB-aligned ++ ++ + Name: vc4-kms-v3d + Info: Enable Eric Anholt's DRM VC4 HDMI/HVS/V3D driver. Running startx or + booting to GUI while this overlay is in use will cause interesting +diff --git a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..95a595a35cb4fbb707bf4b18161f6a46860aa4ae +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +@@ -0,0 +1,89 @@ ++/* ++ * vc4-fkms-v3d-overlay.dts ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target-path = "/chosen"; ++ __overlay__ { ++ bootargs = "cma=256M@256M"; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=192M@256M"; ++ }; ++ }; ++ ++ fragment@2 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=128M@128M"; ++ }; ++ }; ++ ++ fragment@3 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=96M@128M"; ++ }; ++ }; ++ ++ fragment@4 { ++ target-path = "/chosen"; ++ __dormant__ { ++ bootargs = "cma=64M@64M"; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&fb>; ++ __overlay__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&firmwarekms>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@7 { ++ target = <&v3d>; ++ __overlay__ { ++ interrupts = <1 10>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@8 { ++ target = <&gpu>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@9 { ++ target-path = "/soc/dma"; ++ __overlay__ { ++ brcm,dma-channel-mask = <0x7f35>; ++ }; ++ }; ++ ++ __overrides__ { ++ cma-256 = <0>,"+0-1-2-3-4"; ++ cma-192 = <0>,"-0+1-2-3-4"; ++ cma-128 = <0>,"-0-1+2-3-4"; ++ cma-96 = <0>,"-0-1-2+3-4"; ++ cma-64 = <0>,"-0-1-2-3+4"; ++ }; ++}; + +From 23f34d57b322879bdba8291a9b41818fc9001d53 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Thu, 13 Oct 2016 11:54:31 +0300 +Subject: [PATCH 199/208] drm/vc4: Fix a couple error codes in + vc4_cl_lookup_bos() + +If the allocation fails the current code returns success. If +copy_from_user() fails it returns the number of bytes remaining instead +of -EFAULT. + +Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") +Signed-off-by: Dan Carpenter +Reviewed-by: Eric Anholt +(cherry picked from commit b2cdeb19f16ad984eb5bb9193f793d05a8101511) +--- + drivers/gpu/drm/vc4/vc4_gem.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index 47a095f392f8a7b5443227933c78b500a4c7137f..303f23c962206836d8c95786ad835d7625e10ee8 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -544,14 +544,15 @@ vc4_cl_lookup_bos(struct drm_device *dev, + + handles = drm_malloc_ab(exec->bo_count, sizeof(uint32_t)); + if (!handles) { ++ ret = -ENOMEM; + DRM_ERROR("Failed to allocate incoming GEM handles\n"); + goto fail; + } + +- ret = copy_from_user(handles, +- (void __user *)(uintptr_t)args->bo_handles, +- exec->bo_count * sizeof(uint32_t)); +- if (ret) { ++ if (copy_from_user(handles, ++ (void __user *)(uintptr_t)args->bo_handles, ++ exec->bo_count * sizeof(uint32_t))) { ++ ret = -EFAULT; + DRM_ERROR("Failed to copy in GEM handles\n"); + goto fail; + } + +From 46096f860ad1bbc61716e6b83b08c8e469da213b Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 20 Oct 2016 16:48:12 -0700 +Subject: [PATCH 200/208] drm/vc4: Fix termination of the initial scan for + branch targets. + +The loop is scanning until the original max_ip (size of the BO), but +we want to not examine any code after the PROG_END's delay slots. +There was a block trying to do that, except that we had some early +continue statements if the signal wasn't a PROG_END or a BRANCH. + +The failure mode would be that a valid shader is rejected because some +undefined memory after the PROG_END slots is parsed as a branch and +the rest of its setup is illegal. I haven't seen this in the wild, +but valgrind was complaining when about this up in the userland +simulator mode. + +Signed-off-by: Eric Anholt +(cherry picked from commit 457e67a728696c4f8e6423c64e93def50530db9a) +--- + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +index 2543cf5b8b51869d51b72a5db5017dded38761be..917321ce832ffda9d3e8ca20d987437eea9a1765 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -608,9 +608,7 @@ static bool + vc4_validate_branches(struct vc4_shader_validation_state *validation_state) + { + uint32_t max_branch_target = 0; +- bool found_shader_end = false; + int ip; +- int shader_end_ip = 0; + int last_branch = -2; + + for (ip = 0; ip < validation_state->max_ip; ip++) { +@@ -621,8 +619,13 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) + uint32_t branch_target_ip; + + if (sig == QPU_SIG_PROG_END) { +- shader_end_ip = ip; +- found_shader_end = true; ++ /* There are two delay slots after program end is ++ * signaled that are still executed, then we're ++ * finished. validation_state->max_ip is the ++ * instruction after the last valid instruction in the ++ * program. ++ */ ++ validation_state->max_ip = ip + 3; + continue; + } + +@@ -676,15 +679,9 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) + } + set_bit(after_delay_ip, validation_state->branch_targets); + max_branch_target = max(max_branch_target, after_delay_ip); +- +- /* There are two delay slots after program end is signaled +- * that are still executed, then we're finished. +- */ +- if (found_shader_end && ip == shader_end_ip + 2) +- break; + } + +- if (max_branch_target > shader_end_ip) { ++ if (max_branch_target > validation_state->max_ip - 3) { + DRM_ERROR("Branch landed after QPU_SIG_PROG_END"); + return false; + } + +From 1d26463c7b768495482c7883e08685ade635c9c2 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 3 Nov 2016 18:53:10 -0700 +Subject: [PATCH 201/208] drm/vc4: Add support for rendering with ETC1 + textures. + +The validation for it ends up being quite simple, but I hadn't got +around to it before merging the driver. For backwards compatibility, +we also need to add a flag so that the userspace GL driver can easily +tell if the kernel will allow ETC1 textures (on an old kernel, it will +continue to convert to RGBA8) + +Signed-off-by: Eric Anholt +(cherry picked from commit 7154d76fedf549607afbc0d13db9aaf02da5cebf) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_validate.c | 7 +++++++ + include/uapi/drm/vc4_drm.h | 1 + + 3 files changed, 9 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 6c4a4fbc86d0a30a6977b2081bca4372e693b817..157e08ab27771854ffbad101f61ce81e27001e1a 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -78,6 +78,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + pm_runtime_put(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_SUPPORTS_BRANCHES: ++ case DRM_VC4_PARAM_SUPPORTS_ETC1: + args->value = true; + break; + default: +diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c +index 26503e307438a34fe526222c8c15be158eb332a2..e18f88203d32f828b7256a05c653586c14095ef3 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate.c ++++ b/drivers/gpu/drm/vc4/vc4_validate.c +@@ -644,6 +644,13 @@ reloc_tex(struct vc4_exec_info *exec, + cpp = 1; + break; + case VC4_TEXTURE_TYPE_ETC1: ++ /* ETC1 is arranged as 64-bit blocks, where each block is 4x4 ++ * pixels. ++ */ ++ cpp = 8; ++ width = (width + 3) >> 2; ++ height = (height + 3) >> 2; ++ break; + case VC4_TEXTURE_TYPE_BW1: + case VC4_TEXTURE_TYPE_A4: + case VC4_TEXTURE_TYPE_A1: +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index ad7edc3edf7ca1d653a0bc025a5eda6692b74370..69caa21f0cb23c9439238f6239c0041b178d5669 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -286,6 +286,7 @@ struct drm_vc4_get_hang_state { + #define DRM_VC4_PARAM_V3D_IDENT1 1 + #define DRM_VC4_PARAM_V3D_IDENT2 2 + #define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3 ++#define DRM_VC4_PARAM_SUPPORTS_ETC1 4 + + struct drm_vc4_get_param { + __u32 param; + +From 574fbee0c80641a4f2bcc24f30c8c14a54544d1d Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 4 Nov 2016 15:58:38 -0700 +Subject: [PATCH 202/208] drm/vc4: Use runtime autosuspend to avoid thrashing + V3D power state. + +The pm_runtime_put() we were using immediately released power on the +device, which meant that we were generally turning the device off and +on once per frame. In many profiles I've looked at, that added up to +about 1% of CPU time, but this could get worse in the case of frequent +rendering and readback (as may happen in X rendering). By keeping the +device on until we've been idle for a couple of frames, we drop the +overhead of runtime PM down to sub-.1%. + +Signed-off-by: Eric Anholt +(cherry picked from commit 3a62234680d86efa0239665ed8a0e908f1aef147) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 9 ++++++--- + drivers/gpu/drm/vc4/vc4_gem.c | 6 ++++-- + drivers/gpu/drm/vc4/vc4_v3d.c | 2 ++ + 3 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 157e08ab27771854ffbad101f61ce81e27001e1a..8302bd788be470fd61a7382b8c3ef16e26f6861d 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -61,21 +61,24 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + if (ret < 0) + return ret; + args->value = V3D_READ(V3D_IDENT0); +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_V3D_IDENT1: + ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); + if (ret < 0) + return ret; + args->value = V3D_READ(V3D_IDENT1); +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_V3D_IDENT2: + ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); + if (ret < 0) + return ret; + args->value = V3D_READ(V3D_IDENT2); +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); + break; + case DRM_VC4_PARAM_SUPPORTS_BRANCHES: + case DRM_VC4_PARAM_SUPPORTS_ETC1: +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index 303f23c962206836d8c95786ad835d7625e10ee8..db920771bfb5641c9d5d8e53a8f73cf7ee501bb7 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -709,8 +709,10 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + } + + mutex_lock(&vc4->power_lock); +- if (--vc4->power_refcount == 0) +- pm_runtime_put(&vc4->v3d->pdev->dev); ++ if (--vc4->power_refcount == 0) { ++ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); ++ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); ++ } + mutex_unlock(&vc4->power_lock); + + kfree(exec); +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index e6d3c6028341e447df293cab525713ac10d8ee5e..7cc346ad9b0baed63701d1fae8f0306aa7713129 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -222,6 +222,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + return ret; + } + ++ pm_runtime_use_autosuspend(dev); ++ pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ + pm_runtime_enable(dev); + + return 0; + +From d90a754daaeb289afe12b1991c3cf08fe9bb423d Mon Sep 17 00:00:00 2001 +From: Jonas Pfeil +Date: Tue, 8 Nov 2016 00:18:39 +0100 +Subject: [PATCH 203/208] drm/vc4: Add fragment shader threading support + +FS threading brings performance improvements of 0-20% in glmark2. + +The validation code checks for thread switch signals and ensures that +the registers of the other thread are not touched, and that our clamps +are not live across thread switches. It also checks that the +threading and branching instructions do not interfere. + +(Original patch by Jonas, changes by anholt for style cleanup, +removing validation the kernel doesn't need to do, and adding the flag +for userspace). + +v2: Minor style fixes from checkpatch. + +Signed-off-by: Jonas Pfeil +Signed-off-by: Eric Anholt +(cherry picked from commit c778cc5df944291dcdb1ca7a6bb781fbc22550c5) +--- + drivers/gpu/drm/vc4/vc4_drv.c | 1 + + drivers/gpu/drm/vc4/vc4_drv.h | 2 + + drivers/gpu/drm/vc4/vc4_validate.c | 17 +++++--- + drivers/gpu/drm/vc4/vc4_validate_shaders.c | 63 ++++++++++++++++++++++++++++++ + include/uapi/drm/vc4_drm.h | 1 + + 5 files changed, 79 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 8302bd788be470fd61a7382b8c3ef16e26f6861d..3abaa0f85da194016c65f46509d4c64f8e2c8de2 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -82,6 +82,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + break; + case DRM_VC4_PARAM_SUPPORTS_BRANCHES: + case DRM_VC4_PARAM_SUPPORTS_ETC1: ++ case DRM_VC4_PARAM_SUPPORTS_THREADED_FS: + args->value = true; + break; + default: +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5..e15eb37ca6191e0eae3d4947751437d2646c996d 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -384,6 +384,8 @@ struct vc4_validated_shader_info { + + uint32_t num_uniform_addr_offsets; + uint32_t *uniform_addr_offsets; ++ ++ bool is_threaded; + }; + + /** +diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c +index e18f88203d32f828b7256a05c653586c14095ef3..9fd171c361c23b52a4d507919ec7e26fd1e87aac 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate.c ++++ b/drivers/gpu/drm/vc4/vc4_validate.c +@@ -789,11 +789,6 @@ validate_gl_shader_rec(struct drm_device *dev, + exec->shader_rec_v += roundup(packet_size, 16); + exec->shader_rec_size -= packet_size; + +- if (!(*(uint16_t *)pkt_u & VC4_SHADER_FLAG_FS_SINGLE_THREAD)) { +- DRM_ERROR("Multi-threaded fragment shaders not supported.\n"); +- return -EINVAL; +- } +- + for (i = 0; i < shader_reloc_count; i++) { + if (src_handles[i] > exec->bo_count) { + DRM_ERROR("Shader handle %d too big\n", src_handles[i]); +@@ -810,6 +805,18 @@ validate_gl_shader_rec(struct drm_device *dev, + return -EINVAL; + } + ++ if (((*(uint16_t *)pkt_u & VC4_SHADER_FLAG_FS_SINGLE_THREAD) == 0) != ++ to_vc4_bo(&bo[0]->base)->validated_shader->is_threaded) { ++ DRM_ERROR("Thread mode of CL and FS do not match\n"); ++ return -EINVAL; ++ } ++ ++ if (to_vc4_bo(&bo[1]->base)->validated_shader->is_threaded || ++ to_vc4_bo(&bo[2]->base)->validated_shader->is_threaded) { ++ DRM_ERROR("cs and vs cannot be threaded\n"); ++ return -EINVAL; ++ } ++ + for (i = 0; i < shader_reloc_count; i++) { + struct vc4_validated_shader_info *validated_shader; + uint32_t o = shader_reloc_offsets[i]; +diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +index 917321ce832ffda9d3e8ca20d987437eea9a1765..5dba13dd1e9b600b43a769d086d6eb428547ab66 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c ++++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c +@@ -83,6 +83,13 @@ struct vc4_shader_validation_state { + * basic blocks. + */ + bool needs_uniform_address_for_loop; ++ ++ /* Set when we find an instruction writing the top half of the ++ * register files. If we allowed writing the unusable regs in ++ * a threaded shader, then the other shader running on our ++ * QPU's clamp validation would be invalid. ++ */ ++ bool all_registers_used; + }; + + static uint32_t +@@ -119,6 +126,13 @@ raddr_add_a_to_live_reg_index(uint64_t inst) + } + + static bool ++live_reg_is_upper_half(uint32_t lri) ++{ ++ return (lri >= 16 && lri < 32) || ++ (lri >= 32 + 16 && lri < 32 + 32); ++} ++ ++static bool + is_tmu_submit(uint32_t waddr) + { + return (waddr == QPU_W_TMU0_S || +@@ -390,6 +404,9 @@ check_reg_write(struct vc4_validated_shader_info *validated_shader, + } else { + validation_state->live_immediates[lri] = ~0; + } ++ ++ if (live_reg_is_upper_half(lri)) ++ validation_state->all_registers_used = true; + } + + switch (waddr) { +@@ -598,6 +615,11 @@ check_instruction_reads(struct vc4_validated_shader_info *validated_shader, + } + } + ++ if ((raddr_a >= 16 && raddr_a < 32) || ++ (raddr_b >= 16 && raddr_b < 32 && sig != QPU_SIG_SMALL_IMM)) { ++ validation_state->all_registers_used = true; ++ } ++ + return true; + } + +@@ -753,6 +775,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + { + bool found_shader_end = false; + int shader_end_ip = 0; ++ uint32_t last_thread_switch_ip = -3; + uint32_t ip; + struct vc4_validated_shader_info *validated_shader = NULL; + struct vc4_shader_validation_state validation_state; +@@ -785,6 +808,17 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + if (!vc4_handle_branch_target(&validation_state)) + goto fail; + ++ if (ip == last_thread_switch_ip + 3) { ++ /* Reset r0-r3 live clamp data */ ++ int i; ++ ++ for (i = 64; i < LIVE_REG_COUNT; i++) { ++ validation_state.live_min_clamp_offsets[i] = ~0; ++ validation_state.live_max_clamp_regs[i] = false; ++ validation_state.live_immediates[i] = ~0; ++ } ++ } ++ + switch (sig) { + case QPU_SIG_NONE: + case QPU_SIG_WAIT_FOR_SCOREBOARD: +@@ -794,6 +828,8 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + case QPU_SIG_LOAD_TMU1: + case QPU_SIG_PROG_END: + case QPU_SIG_SMALL_IMM: ++ case QPU_SIG_THREAD_SWITCH: ++ case QPU_SIG_LAST_THREAD_SWITCH: + if (!check_instruction_writes(validated_shader, + &validation_state)) { + DRM_ERROR("Bad write at ip %d\n", ip); +@@ -809,6 +845,18 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + shader_end_ip = ip; + } + ++ if (sig == QPU_SIG_THREAD_SWITCH || ++ sig == QPU_SIG_LAST_THREAD_SWITCH) { ++ validated_shader->is_threaded = true; ++ ++ if (ip < last_thread_switch_ip + 3) { ++ DRM_ERROR("Thread switch too soon after " ++ "last switch at ip %d\n", ip); ++ goto fail; ++ } ++ last_thread_switch_ip = ip; ++ } ++ + break; + + case QPU_SIG_LOAD_IMM: +@@ -823,6 +871,13 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + if (!check_branch(inst, validated_shader, + &validation_state, ip)) + goto fail; ++ ++ if (ip < last_thread_switch_ip + 3) { ++ DRM_ERROR("Branch in thread switch at ip %d", ++ ip); ++ goto fail; ++ } ++ + break; + default: + DRM_ERROR("Unsupported QPU signal %d at " +@@ -844,6 +899,14 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) + goto fail; + } + ++ /* Might corrupt other thread */ ++ if (validated_shader->is_threaded && ++ validation_state.all_registers_used) { ++ DRM_ERROR("Shader uses threading, but uses the upper " ++ "half of the registers, too\n"); ++ goto fail; ++ } ++ + /* If we did a backwards branch and we haven't emitted a uniforms + * reset since then, we still need the uniforms stream to have the + * uniforms address available so that the backwards branch can do its +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index 69caa21f0cb23c9439238f6239c0041b178d5669..f07a090167261131076438960c1dec175d7d376e 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -287,6 +287,7 @@ struct drm_vc4_get_hang_state { + #define DRM_VC4_PARAM_V3D_IDENT2 2 + #define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3 + #define DRM_VC4_PARAM_SUPPORTS_ETC1 4 ++#define DRM_VC4_PARAM_SUPPORTS_THREADED_FS 5 + + struct drm_vc4_get_param { + __u32 param; + +From 963f20f2caa0018ef7fbb756852fcd6226cde43a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 6 Dec 2016 18:54:24 +0000 +Subject: [PATCH 204/208] config: fixup + +--- + arch/arm/configs/bcm2709_defconfig | 3 ++- + arch/arm/configs/bcmrpi_defconfig | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 48ed6bfe263a6a3fab942d0b52b2f409055f23ad..6757f597213cb029ef5a7ded516848685b89fe4c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -44,7 +44,6 @@ CONFIG_SMP=y + CONFIG_VMSPLIT_2G=y + CONFIG_PREEMPT_VOLUNTARY=y + CONFIG_AEABI=y +-CONFIG_OABI_COMPAT=y + # CONFIG_CPU_SW_DOMAIN_PAN is not set + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y +@@ -58,6 +57,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0 + CONFIG_ZBOOT_ROM_BSS=0x0 + CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" + CONFIG_CPU_FREQ=y ++CONFIG_CPU_FREQ_STAT=y + CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y + CONFIG_CPU_FREQ_GOV_PERFORMANCE=y + CONFIG_CPU_FREQ_GOV_USERSPACE=y +@@ -1271,6 +1271,7 @@ CONFIG_BOOT_PRINTK_DELAY=y + CONFIG_DEBUG_MEMORY_INIT=y + CONFIG_DETECT_HUNG_TASK=y + CONFIG_TIMER_STATS=y ++CONFIG_LATENCYTOP=y + CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_STACK_TRACER=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index ff69cafd7fb706fc0069d59c37974c4ce5d50043..e683fe6eb803fefaee137f7e6da6cf346ddd5a14 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -43,7 +43,6 @@ CONFIG_ARCH_BCM2835=y + # CONFIG_CACHE_L2X0 is not set + CONFIG_PREEMPT_VOLUNTARY=y + CONFIG_AEABI=y +-CONFIG_OABI_COMPAT=y + # CONFIG_CPU_SW_DOMAIN_PAN is not set + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y +@@ -57,11 +56,13 @@ CONFIG_ZBOOT_ROM_TEXT=0x0 + CONFIG_ZBOOT_ROM_BSS=0x0 + CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" + CONFIG_CPU_FREQ=y ++CONFIG_CPU_FREQ_STAT=y + CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y + CONFIG_CPU_FREQ_GOV_PERFORMANCE=y + CONFIG_CPU_FREQ_GOV_USERSPACE=y + CONFIG_CPU_FREQ_GOV_ONDEMAND=y + CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y ++CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y + CONFIG_VFP=y + CONFIG_BINFMT_MISC=m + # CONFIG_SUSPEND is not set + +From d6a316e01480a79073f6baf8b89b5cfcb4900f25 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 5 Dec 2016 17:10:44 +0000 +Subject: [PATCH 205/208] BCM270X_DT: Add i2c-sensor overlay + +The i2c-sensor overlay is a container for various pressure and +temperature sensors, currently bmp085 and bmp280. The standalone +bmp085_i2c-sensor overlay is now deprecated. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 12 ++++++-- + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 34 +++++++++++++++++++++++ + 3 files changed, 45 insertions(+), 2 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 7624812d0cdc74728f3556159871c7a299f9f6b7..11dba31712840a9e4b91acd4565c2d6266315273 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -32,6 +32,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + i2c-mux.dtbo \ + i2c-pwm-pca9685a.dtbo \ + i2c-rtc.dtbo \ ++ i2c-sensor.dtbo \ + i2c0-bcm2708.dtbo \ + i2c1-bcm2708.dtbo \ + i2s-gpio28-31.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index c0290531a61fedfe23e820ca4d9693a0acd3e876..4ef35f4ac1622be08066dc74a80d907ae6c164b7 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -283,8 +283,7 @@ Params: swap_lr Reverse the channel allocation, which will also + + + Name: bmp085_i2c-sensor +-Info: Configures the BMP085/BMP180 digital barometric pressure and temperature +- sensors from Bosch Sensortec ++Info: This overlay is now deprecated - see i2c-sensor + Load: dtoverlay=bmp085_i2c-sensor + Params: + +@@ -542,6 +541,15 @@ Params: abx80x Select one of the ABx80x family: + source + + ++Name: i2c-sensor ++Info: Adds support for a number of I2C barometric pressure and temperature ++ sensors on i2c_arm ++Load: dtoverlay=i2c-sensor,= ++Params: bmp085 Select the Bosch sensortronic BMP085 ++ ++ bmp280 Select the Bosch sensortronic BMP280 ++ ++ + Name: i2c0-bcm2708 + Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations + are usable on all platforms. +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..f6d134c095af2398fc55ae7d2b0e86456c30627c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -0,0 +1,34 @@ ++// Definitions for a few digital barometric pressure and temperature sensors ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ bmp085: bmp085@77 { ++ compatible = "bosch,bmp085"; ++ reg = <0x77>; ++ default-oversampling = <3>; ++ status = "disable"; ++ }; ++ ++ bmp280: bmp280@76 { ++ compatible = "bosch,bmp280"; ++ reg = <0x76>; ++ status = "disable"; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ bmp085 = <&bmp085>,"status"; ++ bmp280 = <&bmp280>,"status"; ++ }; ++}; + +From 9265a25166962ef139810f8c1ca51366da98e6d1 Mon Sep 17 00:00:00 2001 +From: Georgii Staroselskii +Date: Wed, 7 Dec 2016 15:10:27 +0300 +Subject: [PATCH 206/208] BCM270X_DT: overlays/*-overlay.dtb -> overlays/*.dtbo + (#1752) + +We now create overlays as .dtbo files. +--- + arch/arm/boot/dts/overlays/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 4ef35f4ac1622be08066dc74a80d907ae6c164b7..81d991803be335e5a1bc3bb0a8c7a2c9f5c392bd 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -61,7 +61,7 @@ this becomes a line in config.txt: + + dtoverlay=lirc-rpi + +-This causes the file /boot/overlays/lirc-rpi-overlay.dtb to be loaded. By ++This causes the file /boot/overlays/lirc-rpi.dtbo to be loaded. By + default it will use GPIOs 17 (out) and 18 (in), but this can be modified using + DT parameters: + + +From 366621f36df68f06589b2813a8fd715cf8f898a7 Mon Sep 17 00:00:00 2001 +From: Ioan-Adrian Ratiu +Date: Tue, 27 Sep 2016 21:41:37 +0300 +Subject: [PATCH 207/208] Revert "HID: dragonrise: fix HID Descriptor for + 0x0006 PID" + +[ Upstream commit 1bcaa05ebee115213e34f1806cc6a4f7a6175a88 ] + +This reverts commit 18339f59c3a6 ("HID: dragonrise: fix HID...") because it +breaks certain dragonrise 0079:0006 gamepads. While it may fix a breakage +caused by commit 79346d620e9d ("HID: input: force generic axis to be mapped +to their user space axis"), it is probable that the manufacturer released +different hardware with the same PID so this fix works for only a subset +and breaks the other gamepads sharing the PID. + +What is needed is another more generic solution which fixes 79346d620e9d +("HID: input: force generic axis ...") breakage for this controller: we +need to add an exception for this driver to make it keep the old behaviour +previous to the initial breakage (this is done in patch 2 of this series). + +Signed-off-by: Ioan-Adrian Ratiu +Reviewed-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +--- + drivers/hid/hid-dr.c | 58 ---------------------------------------------------- + 1 file changed, 58 deletions(-) + +diff --git a/drivers/hid/hid-dr.c b/drivers/hid/hid-dr.c +index 8fd4bf77f264940ec04631252062e06aafe148c8..2523f8a4b7de9fb3152d1268ba7f79c24208c4c9 100644 +--- a/drivers/hid/hid-dr.c ++++ b/drivers/hid/hid-dr.c +@@ -234,58 +234,6 @@ static __u8 pid0011_rdesc_fixed[] = { + 0xC0 /* End Collection */ + }; + +-static __u8 pid0006_rdesc_fixed[] = { +- 0x05, 0x01, /* Usage Page (Generic Desktop) */ +- 0x09, 0x04, /* Usage (Joystick) */ +- 0xA1, 0x01, /* Collection (Application) */ +- 0xA1, 0x02, /* Collection (Logical) */ +- 0x75, 0x08, /* Report Size (8) */ +- 0x95, 0x05, /* Report Count (5) */ +- 0x15, 0x00, /* Logical Minimum (0) */ +- 0x26, 0xFF, 0x00, /* Logical Maximum (255) */ +- 0x35, 0x00, /* Physical Minimum (0) */ +- 0x46, 0xFF, 0x00, /* Physical Maximum (255) */ +- 0x09, 0x30, /* Usage (X) */ +- 0x09, 0x33, /* Usage (Ry) */ +- 0x09, 0x32, /* Usage (Z) */ +- 0x09, 0x31, /* Usage (Y) */ +- 0x09, 0x34, /* Usage (Ry) */ +- 0x81, 0x02, /* Input (Variable) */ +- 0x75, 0x04, /* Report Size (4) */ +- 0x95, 0x01, /* Report Count (1) */ +- 0x25, 0x07, /* Logical Maximum (7) */ +- 0x46, 0x3B, 0x01, /* Physical Maximum (315) */ +- 0x65, 0x14, /* Unit (Centimeter) */ +- 0x09, 0x39, /* Usage (Hat switch) */ +- 0x81, 0x42, /* Input (Variable) */ +- 0x65, 0x00, /* Unit (None) */ +- 0x75, 0x01, /* Report Size (1) */ +- 0x95, 0x0C, /* Report Count (12) */ +- 0x25, 0x01, /* Logical Maximum (1) */ +- 0x45, 0x01, /* Physical Maximum (1) */ +- 0x05, 0x09, /* Usage Page (Button) */ +- 0x19, 0x01, /* Usage Minimum (0x01) */ +- 0x29, 0x0C, /* Usage Maximum (0x0C) */ +- 0x81, 0x02, /* Input (Variable) */ +- 0x06, 0x00, 0xFF, /* Usage Page (Vendor Defined) */ +- 0x75, 0x01, /* Report Size (1) */ +- 0x95, 0x08, /* Report Count (8) */ +- 0x25, 0x01, /* Logical Maximum (1) */ +- 0x45, 0x01, /* Physical Maximum (1) */ +- 0x09, 0x01, /* Usage (0x01) */ +- 0x81, 0x02, /* Input (Variable) */ +- 0xC0, /* End Collection */ +- 0xA1, 0x02, /* Collection (Logical) */ +- 0x75, 0x08, /* Report Size (8) */ +- 0x95, 0x07, /* Report Count (7) */ +- 0x46, 0xFF, 0x00, /* Physical Maximum (255) */ +- 0x26, 0xFF, 0x00, /* Logical Maximum (255) */ +- 0x09, 0x02, /* Usage (0x02) */ +- 0x91, 0x02, /* Output (Variable) */ +- 0xC0, /* End Collection */ +- 0xC0 /* End Collection */ +-}; +- + static __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc, + unsigned int *rsize) + { +@@ -296,12 +244,6 @@ static __u8 *dr_report_fixup(struct hid_device *hdev, __u8 *rdesc, + *rsize = sizeof(pid0011_rdesc_fixed); + } + break; +- case 0x0006: +- if (*rsize == sizeof(pid0006_rdesc_fixed)) { +- rdesc = pid0006_rdesc_fixed; +- *rsize = sizeof(pid0006_rdesc_fixed); +- } +- break; + } + return rdesc; + } + +From 822b0eb3dac2230ec04d71eeccea28b2528eb4a2 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 6 Dec 2016 17:05:39 +0000 +Subject: [PATCH 208/208] bcm2835-rng: Avoid initialising if already enabled + +Avoids the 0x40000 cycles of warmup again if firmware has already used it +--- + drivers/char/hw_random/bcm2835-rng.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c +index af2149273fe049b075d0953034cda0aab1525f23..e5b5222314b1677d989f7e7ea7085cacde8ff1b6 100644 +--- a/drivers/char/hw_random/bcm2835-rng.c ++++ b/drivers/char/hw_random/bcm2835-rng.c +@@ -101,9 +101,10 @@ static int bcm2835_rng_probe(struct platform_device *pdev) + rng_setup(rng_base); + + /* set warm-up count & enable */ +- __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); +- __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); +- ++ if (!(__raw_readl(rng_base + RNG_CTRL) & RNG_RBGEN)) { ++ __raw_writel(RNG_WARMUP_COUNT, rng_base + RNG_STATUS); ++ __raw_writel(RNG_RBGEN, rng_base + RNG_CTRL); ++ } + /* register driver */ + err = hwrng_register(&bcm2835_rng_ops); + if (err) {