From d5a18c8575d78a70a60274d0d013ce5aedd5d358 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Thu, 13 Jul 2017 18:53:26 +0100 Subject: [PATCH] RPi/RPi2: update linux support patches for linux 4.9.36 --- .../patches/linux/linux-01-RPi_support.patch | 10393 ++++++++++++---- .../patches/linux/linux-01-RPi_support.patch | 10393 ++++++++++++---- 2 files changed, 15378 insertions(+), 5408 deletions(-) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index fe35e11120..3aeabbe929 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 79015824ce4b54ba9699bed89dc186b3c50b762e Mon Sep 17 00:00:00 2001 +From 3e3e899278bea795e955bec7c8436d58e29a12bd Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/269] smsx95xx: fix crimes against truesize +Subject: [PATCH 001/305] 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. @@ -48,10 +48,10 @@ index 831aa33d078ae7d2dd57fdded5de71d1eb915f99..b77935bded8c0ff7808b00f170ff10e5 usbnet_skb_return(dev, ax_skb); } -From 732a0b24284eb08d1265a280c39f08e5fa57bd9a Mon Sep 17 00:00:00 2001 +From 761f30fd312357c5e8397565a70931536118a8ae Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 002/269] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 002/305] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -94,10 +94,10 @@ index b77935bded8c0ff7808b00f170ff10e594300ad0..693f163684de921404738e33244881e0 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From 43376d16055cd5782e3b3ced15da7c6cd0f5bf60 Mon Sep 17 00:00:00 2001 +From 3aa7ecebbe0720eaa1a5fd216f5244af7cbfb1a0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 003/269] Allow mac address to be set in smsc95xx +Subject: [PATCH 003/305] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -193,10 +193,10 @@ index 693f163684de921404738e33244881e0aab92ec9..df60c989fc229bf0aab3c27e95ccd453 eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From caec1794edbfc3ab80abdcb3d65a47f885c8fe87 Mon Sep 17 00:00:00 2001 +From 42ea42facfb41779b87d74a36f8ca050dcb3f5c5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 004/269] Protect __release_resource against resources without +Subject: [PATCH 004/305] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -224,10 +224,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From b486dc6bb81c88815f8ed3fcb9662e1d931341aa Mon Sep 17 00:00:00 2001 +From cc04a45be26f4f522ba621a49cdb0c82369c00e4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 005/269] mm: Remove the PFN busy warning +Subject: [PATCH 005/305] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -239,10 +239,10 @@ Signed-off-by: Eric Anholt 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 5b06fb385dd714847143bc15a07fd086ff343992..83ae950cff28bc79c46b7acf35e0af8a3c7715bc 100644 +index 56df8c24689db1433a7e0df6ad8903b4b3f8a294..f85430ac34de36ff1d087cf2159cd341fbebfe38 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7324,8 +7324,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, +@@ -7335,8 +7335,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, /* Make sure the range is really isolated. */ if (test_pages_isolated(outer_start, end, false)) { @@ -252,10 +252,10 @@ index 5b06fb385dd714847143bc15a07fd086ff343992..83ae950cff28bc79c46b7acf35e0af8a goto done; } -From d19c9df4f4c53747d9077428647b8020460f88ec Mon Sep 17 00:00:00 2001 +From 5529625939f2c81efac0e28b10ae94a95a215dd7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 006/269] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 006/305] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -282,10 +282,10 @@ index d96b2c947e74e3edab3917551c64fbd1ced0f34c..93e3f7660c4230c9f1dd3b195958cb49 #endif } else if (stat) { -From 2acf37b5d17ebfbb754f21fb4bfb30cc3cbf91f4 Mon Sep 17 00:00:00 2001 +From b5d5f6d0afc1ad128422bd7b4db4b4031fc82389 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 007/269] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 007/305] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -414,10 +414,10 @@ index 44d7c38dde479d771f3552e914bf8c1c1f5019f7..42ff5e6a8e0d532f5b60a1e7af7cc4d9 } -From b4d77f69db5e28050db4de7b62217f2aa298ab47 Mon Sep 17 00:00:00 2001 +From 7090f3d2365c4d5fa4044308e4a35a28ac6bc890 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 008/269] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 008/305] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -516,10 +516,10 @@ index 42ff5e6a8e0d532f5b60a1e7af7cc4d941bd5008..eccf6ed025299cb480884f5bcbe77abf for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From a89119580285bc108c1507723ec5b0ab511be9ff Mon Sep 17 00:00:00 2001 +From 033f11d95c4c94959312bf3496775e744d0437e8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 009/269] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 009/305] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -540,10 +540,10 @@ index 2e05046f866bd01bf87edcdeff0d5b76d4d0aea7..d780491b8013a4e97fa843958964454e }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From f48bb049bc5cd3efe385c0202f268b65a1e824f8 Mon Sep 17 00:00:00 2001 +From 4b59d984cba365c9778f6f4cde0cc4df274e26af Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 010/269] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 010/305] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -563,10 +563,10 @@ index e8819aa20415603c80547e382838a8fa3ce54792..cf9c7d2e3f95e1a19410247a89c2e49c for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From 52fceb45cd09ed8a6169a6ef43089e3dcf4b0fff Mon Sep 17 00:00:00 2001 +From 98fedd06e2d9c221bfec769304d6a582362a890e Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 011/269] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 011/305] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -588,10 +588,10 @@ index fa77165fab2c1348163979da507df17e7168c49b..d11e2e4ea189466e686d762cb6c6fef9 .can_sleep = false, }; -From abef3b2d3950764fc95d2677a60725826a8d8697 Mon Sep 17 00:00:00 2001 +From 3edbafe419f3b148f9e975461cb384df8fed0f5e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 012/269] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 012/305] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -737,10 +737,10 @@ index d11e2e4ea189466e686d762cb6c6fef9111ecf8e..107ad7d58de8f8a7f55e09c9cdcf7d66 }, }; -From ea406cc2d3889cbdaa8049cd190d030d6340d085 Mon Sep 17 00:00:00 2001 +From db0f201b31994fdda1cca0bb3f416c5bc7a79c16 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 013/269] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 013/305] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -767,10 +767,10 @@ index 107ad7d58de8f8a7f55e09c9cdcf7d66fa7ab66b..644bdecbcfcb79d3b84a33769265fca5 pc->irq_data[i].irqgroup = i; -From 7d03ef81a2071d491f72c3361b6638efd4e8f490 Mon Sep 17 00:00:00 2001 +From 5159d742f6efcf74f8e99f867064b88595eeb2ad Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 May 2016 12:32:47 +0100 -Subject: [PATCH 014/269] pinctrl-bcm2835: Return pins to inputs when freed +Subject: [PATCH 014/305] 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 @@ -811,10 +811,10 @@ index 644bdecbcfcb79d3b84a33769265fca5d3d0c9e5..81a66cba2ab0f7e3ae179de7edd10122 .get_function_name = bcm2835_pmx_get_function_name, .get_function_groups = bcm2835_pmx_get_function_groups, -From d85d172287e58dbb99e40666d9822d6db01e1f5c Mon Sep 17 00:00:00 2001 +From 43c8c89b397aba792c0b5298adeb7b82d83355df Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 015/269] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 015/305] 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 @@ -895,10 +895,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 2586dbdfee1bc39270dd390e5e8bef0e0e506ffc Mon Sep 17 00:00:00 2001 +From acae2ee6b74f5333d0845f1956810c58911f3777 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 016/269] spi-bcm2835: Disable forced software CS +Subject: [PATCH 016/305] 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 @@ -932,10 +932,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From 2648dc560f4a9c92eed36c537880640ae2de0173 Mon Sep 17 00:00:00 2001 +From a344d6589055f9fa8a1cb1c978bc7fed6a819ac3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 017/269] spi-bcm2835: Remove unused code +Subject: [PATCH 017/305] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -1023,10 +1023,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From 8fe2ebf8cbfb79647aa63d7cc8d76ffecc585628 Mon Sep 17 00:00:00 2001 +From ca1cda118deb5778e4c9d50c400ffffb2a725e61 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 018/269] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 018/305] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1079,10 +1079,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From 14fd76962dee82784349d1a39a7f419e046acf88 Mon Sep 17 00:00:00 2001 +From 997cbdd8dcb0ab73ed3ee664f8a29ca68e82cfd3 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 019/269] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 019/305] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1113,7 +1113,7 @@ index 141aefbe37ec93d1f4f38d1be5e2cf8d93266725..9c931d36c6a499a02f4f215f8cd77d3f select DMA_VIRTUAL_CHANNELS diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c -index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538bac3892a4d 100644 +index 6204cc32d09c5096df8aec304c3c37b3bcb6be44..599c218dc8a73172dd4bd4a058fc8f95a73f982f 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -37,6 +37,7 @@ @@ -1132,7 +1132,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba struct bcm2835_dmadev { struct dma_device ddev; -@@ -922,6 +924,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) +@@ -925,6 +927,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(base)) return PTR_ERR(base); @@ -1142,7 +1142,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba od->base = base; -@@ -959,6 +964,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) +@@ -962,6 +967,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) goto err_no_dma; } @@ -1152,7 +1152,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba /* get irqs for each channel that we support */ for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) { /* skip masked out channels */ -@@ -1033,6 +1041,7 @@ static int bcm2835_dma_remove(struct platform_device *pdev) +@@ -1036,6 +1044,7 @@ static int bcm2835_dma_remove(struct platform_device *pdev) { struct bcm2835_dmadev *od = platform_get_drvdata(pdev); @@ -1160,7 +1160,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba dma_async_device_unregister(&od->ddev); bcm2835_dma_free(od); -@@ -1048,7 +1057,22 @@ static struct platform_driver bcm2835_dma_driver = { +@@ -1051,7 +1060,22 @@ static struct platform_driver bcm2835_dma_driver = { }, }; @@ -1185,10 +1185,10 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From d696a17375d536f12298e92daceb600dc76204d4 Mon Sep 17 00:00:00 2001 +From af5c6e9c706e0ae8431707ac49c592d8e9fc32dd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 020/269] firmware: Updated mailbox header +Subject: [PATCH 020/305] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 11 +++++++++++ @@ -1251,10 +1251,10 @@ index 3fb357193f09914fe21f8555a4b8613f74f22bc3..227a107214a02deadcca3db202da265e RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From af5f7cea1b68d9493451c236bfd885b874e5abb4 Mon Sep 17 00:00:00 2001 +From 4802def18f9314236d353b81300807540c3d6ce7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 021/269] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 021/305] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -1292,10 +1292,10 @@ index 2acaa77ad482a99f28ea64ea43c891501125304c..d13cbbf5bbe06314bfdf103ff85d5cd7 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From bc8a0df1f9fa1ab79f34d941d6849d7468d79469 Mon Sep 17 00:00:00 2001 +From b043b445cf8cca09c5e86f5f6ccf081d4d32b9c0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 022/269] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 022/305] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1315,10 +1315,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From f4109d9f80f848317c141ea72bf2a3d4d0a411a3 Mon Sep 17 00:00:00 2001 +From b2c093aaaae250966a741fa5729b8777cd19739b 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 023/269] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 023/305] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1442,10 +1442,10 @@ index 4dddd8298a227d64862f2e92954a465f2e44b3f6..1f545e024422f59280932713e6a1b051 register_restart_handler(&wdt->restart_handler); if (pm_power_off == NULL) -From 92fd7c705b975f380ed3b4882e24f7f9d32e2f58 Mon Sep 17 00:00:00 2001 +From ac2a2b6c3e08bb1d4336e235090b6f1ad03d6420 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 024/269] reboot: Use power off rather than busy spinning when +Subject: [PATCH 024/305] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1468,10 +1468,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From ba07abff2715476c89b49f06063c3a16bd688ea6 Mon Sep 17 00:00:00 2001 +From 3f9fa51201312e1972e06045610ed3756b033fb2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 025/269] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 025/305] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1490,10 +1490,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..e037a6dd79d1881a09e3ca9115782709 help This enables support for the RPi power domains which can be enabled -From 7f075a5e8d20e793329859e52b28f83a8aa5fe79 Mon Sep 17 00:00:00 2001 +From 7f4f8dcf7dfaac04cd711321d329e8bf820a859a Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 026/269] Register the clocks early during the boot process, so +Subject: [PATCH 026/305] 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. @@ -1538,10 +1538,10 @@ index d13cbbf5bbe06314bfdf103ff85d5cd73cbf7f7a..a99ccf9f056d3a3e7c482339e08483f3 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From ea22a6e92e62ecf4466cf0d9eae0ee772e8183dc Mon Sep 17 00:00:00 2001 +From fc20b0621026f5be366f1d23f1f227ab980250ee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 027/269] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 027/305] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1567,10 +1567,10 @@ index 574211a495491d9d6021dcaefe4274a63ed02055..e66c0fca8c6090e32f72796c0877a1cf err = hwrng_register(&bcm2835_rng_ops); if (err) { -From a6c91433ce9d179a872ebbd3b6b8712ec0dfd2a1 Mon Sep 17 00:00:00 2001 +From 7f4f5acd4e06e1c46f47d776e4f0ad6c241f7530 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 028/269] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 028/305] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -1590,10 +1590,10 @@ index 179219845dfcdfbeb586d12c5ec1296095d9fbf4..e0743e44f84188667a0c322e8c3d36f1 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From 0d7da923aa7bb70d36b7dcb55d2285cc18bbeb00 Mon Sep 17 00:00:00 2001 +From 047a10c8f73616aca8769393b4833ef0adb911e1 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 029/269] BCM2835_DT: Fix I2S register map +Subject: [PATCH 029/305] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -1631,10 +1631,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 4f4d87ae96216a2c749f5c60e5f8b208b9b60e6c Mon Sep 17 00:00:00 2001 +From 539882daae6a62c09c129b1753e1aed59554ee03 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 030/269] Main bcm2708/bcm2709 linux port +Subject: [PATCH 030/305] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1841,10 +1841,10 @@ index cfb4b4496dd9f61362dea012176c146120fada07..d9c6c217c4d6a2408abe2665bf7f2700 MODULE_AUTHOR("Lubomir Rintel "); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); -From 7bff94f3aa10014a64ff85746934309d4834409d Mon Sep 17 00:00:00 2001 +From 4c1833856221253fa3a8f517abc5119c6b061bd6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 031/269] Add dwc_otg driver +Subject: [PATCH 031/305] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2546,10 +2546,10 @@ index 358ca8dd784fe43700ae070764fa783500a792fe..abaac7c7142d8887c1516957fc52162c return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index 579900640faabb84b68f344951193f860fab598d..1704f1d8c2f5d174e4b059dd7fda6b75e6c3ec0d 100644 +index f953d6d647f245be5452f6db70ea503552dff525..e17e9e094e5a85798579b25b34bd2b6f7f18c898 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5025,7 +5025,7 @@ static void port_event(struct usb_hub *hub, int port1) +@@ -5040,7 +5040,7 @@ static void port_event(struct usb_hub *hub, int port1) if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; @@ -62901,10 +62901,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From 50fa5fe5e07da8f2d41c99486f4bb8c3b7d6cc7f Mon Sep 17 00:00:00 2001 +From ab92478ebf40178f9b6a22b59847fa44b8c24cd8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 032/269] bcm2708 framebuffer driver +Subject: [PATCH 032/305] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66363,10 +66363,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 b5792c84a6067b64d0e594bde8b3b8e699f166d7 Mon Sep 17 00:00:00 2001 +From 8e9b3795a2eb00a19e28a42810bd07d4a3956307 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 033/269] dmaengine: Add support for BCM2708 +Subject: [PATCH 033/305] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66997,10 +66997,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From 31ef18993d95147073260061725da8b7408a5729 Mon Sep 17 00:00:00 2001 +From 6675aab5cec3935e15007c26b05fc2418e0c822d Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 034/269] MMC: added alternative MMC driver +Subject: [PATCH 034/305] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68750,10 +68750,10 @@ index 0000000000000000000000000000000000000000..4fe8d1fe44578fbefcd48f8c327ba3d0 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 099cfb48eaa9d6c2aa9009188d25dfe6c9b3e9c3 Mon Sep 17 00:00:00 2001 +From 4532400c2a5a071cc67a169b5dd4f597bbc65d01 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 035/269] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 035/305] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -71158,10 +71158,10 @@ index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f165144 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 4610911ae7d2ab9c6e51ecb5e5fb5545e1acf083 Mon Sep 17 00:00:00 2001 +From 3ac0cd57a1d960d456be7296f7d4eb3c441839aa Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 036/269] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 036/305] 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, @@ -71297,10 +71297,10 @@ index 73fad83acbcb6a157587180516f9ffe7c61eb7d7..e7c9d3098ac06e3c6554fa3373a311f9 unsigned int erase_shift; /* if erase unit is power 2 */ unsigned int pref_erase; /* in sectors */ -From ff78d0a7689b0a5c4aab838a8acabbad47e0128d Mon Sep 17 00:00:00 2001 +From 57cfa41bb9ca5061d8286f5f2d269aef622aeddc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 037/269] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 037/305] 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 @@ -72636,10 +72636,10 @@ index 0000000000000000000000000000000000000000..be2819d5d41f9d5ed65daf8eedb94c9e + +#endif /* VC_CMA_H */ -From 476d9005edbd948a8650cd9c191438a51d17ea1a Mon Sep 17 00:00:00 2001 +From 5f1ce6ad61187a4e40aedcadb5334a2a024141a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 038/269] bcm2708: alsa sound driver +Subject: [PATCH 038/305] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75374,10 +75374,10 @@ index 0000000000000000000000000000000000000000..af3e6eb690113fc32ce9e06bd2f0f294 + +#endif // _VC_AUDIO_DEFS_H_ -From 97ed9e26481ecb89c62fe2f205308843690fe2d3 Mon Sep 17 00:00:00 2001 +From 6dfa16b231ec746345b5faaf97d2592bc5913843 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 039/269] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 039/305] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -75901,10 +75901,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From ab0ea172ef575913b63f7893a0c41da050b8ad75 Mon Sep 17 00:00:00 2001 +From a06191e7ef0728ca1d031a9a0f5edff0e5207cb1 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 040/269] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 040/305] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -80311,10 +80311,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From e52946361a8e8e795a8001c27a8a5381f045c274 Mon Sep 17 00:00:00 2001 +From 7a02754167032fc87db6eda7d0588967aaed241c Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 041/269] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 041/305] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -80625,10 +80625,10 @@ index 0000000000000000000000000000000000000000..911f5b7393ed48ceed8751f06967ae64 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From 08d0749e9c634b24e4aa793b8f4aa4fcb25470be Mon Sep 17 00:00:00 2001 +From e4a52e521605066b0bb8e49ce44ca5166e009280 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 042/269] Add SMI driver +Subject: [PATCH 042/305] Add SMI driver Signed-off-by: Luke Wren --- @@ -82579,10 +82579,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 11400a6db1c81cbce1bb6dce8d225231f82b6859 Mon Sep 17 00:00:00 2001 +From daee6ffd810b931cfa4dd2b6f60fb8778fbbd012 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 043/269] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 043/305] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -82752,10 +82752,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 74a992992502f182c76e414c4adc46b48b23dc6c Mon Sep 17 00:00:00 2001 +From a29ce213a14be31ca1acfc987de1a4adbd6c23da Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 044/269] Add SMI NAND driver +Subject: [PATCH 044/305] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -83120,10 +83120,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From 911feabd59b70016a059eed6aa5d5103a8777eee Mon Sep 17 00:00:00 2001 +From 944b5bf55e2a73df1cd10e53bd8b93c56cbf7bc9 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 045/269] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 045/305] 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 @@ -83986,10 +83986,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From 2178915a09cce0414ad54d991a3a648eb7d74f19 Mon Sep 17 00:00:00 2001 +From 661d3b6e4a9cab6c1bb641680cfa6c32cb0bb168 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 046/269] Add cpufreq driver +Subject: [PATCH 046/305] Add cpufreq driver Signed-off-by: popcornmix --- @@ -84256,10 +84256,10 @@ index 0000000000000000000000000000000000000000..414fbdc10dfbfc6e4bb47870a7af3fd5 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 321d95c9c599c0c4a3d320c7f22dfa61c19606cf Mon Sep 17 00:00:00 2001 +From 9df33b551c35cfb5a747840252b3758108f71c08 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 047/269] Added hwmon/thermal driver for reporting core +Subject: [PATCH 047/305] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -84425,10 +84425,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From ec44ec502547d427fb6b1bf148dbde31c3000261 Mon Sep 17 00:00:00 2001 +From 91e1d6740ab2f1398f5efb84ac3fb1e3da1c7f4b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 048/269] Add Chris Boot's i2c driver +Subject: [PATCH 048/305] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85093,10 +85093,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From ceb9c52e8528b600055dd8125b9247702a3dd0a6 Mon Sep 17 00:00:00 2001 +From 33ef2dd8967ff3e499a9debb3d5b23f37cedda5f 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 049/269] char: broadcom: Add vcio module +Subject: [PATCH 049/305] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85322,10 +85322,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 89388ba84f0c79ae29ce5c3ca7fd4cbbc7116648 Mon Sep 17 00:00:00 2001 +From d9c0dd6378bb15f7c3215bc46f67451ac28558c8 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 050/269] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 050/305] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85408,10 +85408,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..3f070bd38a91511c986e3fb114b15bd4 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 0cf6d0049c108b7613c4a902694aad08ba74d4c5 Mon Sep 17 00:00:00 2001 +From b56905e0b6a48769d95c5e4a68f03c2633e27580 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 051/269] bcm2835: add v4l2 camera device +Subject: [PATCH 051/305] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -93153,10 +93153,10 @@ index 0000000000000000000000000000000000000000..9d1d11e4a53e510c04a416d92d195a7d + +#endif /* MMAL_VCHIQ_H */ -From 94396fb17f4db40a5ad4a3373005013a9a789cb3 Mon Sep 17 00:00:00 2001 +From 83b77047a0e8f20d11f159e0a92ffc915c814c1f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 052/269] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 052/305] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -93676,10 +93676,10 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + return $trailer; +} -From 9cebc064fccb57147ed38a40fbc85450e817912b Mon Sep 17 00:00:00 2001 +From e15aa78af8c0ac8cc26cebe8f811825495b3cdd2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 053/269] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH 053/305] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. @@ -96530,10 +96530,10 @@ index ad9b05ae698b0495ecbda42ffcf4743555313a27..2595dfda020fd9e03f0beff5006f229d -#define DTC_VERSION "DTC 1.4.1-g53bf130b" +#define DTC_VERSION "DTC 1.4.1-g25efc119" -From 24eaf4ba165808168d4780fc09554965044399e0 Mon Sep 17 00:00:00 2001 +From 41333985a0bbb860dff9ae6359e363f16378ed1f Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 054/269] BCM2708: Add core Device Tree support +Subject: [PATCH 054/305] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -106661,10 +106661,10 @@ index 0a07f9014944ed92a8e2e42983ae43be60b3e471..1967878a843461c3ff1f473b9a030eb0 # Bzip2 -From 9343c744be717bfeb6ff750eedada9ce1962730e Mon Sep 17 00:00:00 2001 +From c1cc5914d43c8861e15e1ebade7beb026968dd3a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 055/269] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 055/305] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -106840,10 +106840,10 @@ index ddfcb2df3656cf0ab6aebd1fa3d624a6ec2e94e9..271563eb835f9018712e2076a88f341d /* Set LED brightness level * Must not sleep. Use brightness_set_blocking for drivers -From adfcfa34ccbb5819fced283fcf792d5daf6df55d Mon Sep 17 00:00:00 2001 +From c8246ac66a521480f4e10dfa69eacbb07bd7ff73 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 056/269] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 056/305] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -107095,10 +107095,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..703fa8a70574323abe2fb32599254582 __u32 dx; /* screen-relative */ __u32 dy; -From 0033178bba78f6f6d2a19a5c6a7b6c201a8e28cf Mon Sep 17 00:00:00 2001 +From 8d87aae72904eb8bcfc2f99cc902f6cc6f749234 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 057/269] Speed up console framebuffer imageblit function +Subject: [PATCH 057/305] 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 @@ -107307,10 +107307,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From ad863573d9b4897c225463b30772858427afc96b Mon Sep 17 00:00:00 2001 +From 4371ec3cf395dbcf5a2cf024be1e2272c98ac997 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 058/269] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 058/305] 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 @@ -107560,10 +107560,10 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 57d3f0cf1f645fd8bd8101fa008525c7591f5bf1 Mon Sep 17 00:00:00 2001 +From e53ec94adef7c06684b9371eb8e0bd725b281178 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 059/269] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 059/305] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -107571,10 +107571,10 @@ Subject: [PATCH 059/269] config: Enable CONFIG_MEMCG, but leave it disabled 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c -index a3d2aad2443f3314396d25086d891eca22317cf8..45db7dee21858fc80e571f463717e51afce4262c 100644 +index 1fde8eec95297ec442a90dfcf59a873d357aa5bf..e22af4287b4ba084a7cfe7b6fcbf28956796b113 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c -@@ -5627,7 +5627,7 @@ int __init cgroup_init_early(void) +@@ -5632,7 +5632,7 @@ int __init cgroup_init_early(void) return 0; } @@ -107583,7 +107583,7 @@ index a3d2aad2443f3314396d25086d891eca22317cf8..45db7dee21858fc80e571f463717e51a /** * cgroup_init - cgroup initialization -@@ -6164,6 +6164,28 @@ static int __init cgroup_no_v1(char *str) +@@ -6169,6 +6169,28 @@ static int __init cgroup_no_v1(char *str) } __setup("cgroup_no_v1=", cgroup_no_v1); @@ -107613,10 +107613,10 @@ index a3d2aad2443f3314396d25086d891eca22317cf8..45db7dee21858fc80e571f463717e51a * css_tryget_online_from_dir - get corresponding css from a cgroup dentry * @dentry: directory dentry of interest -From 800020ec64d0125524ad6900ad9e5e48081520b2 Mon Sep 17 00:00:00 2001 +From 46445638df685e893b7dc180a0a5e2117f67c7e8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 060/269] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 060/305] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -107652,10 +107652,10 @@ index ae83af649a607f67239f1a64bf45dd4b5770cc7d..4a7af9d0b910f59d17421ce14138400d ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From d8a72ba362b98060fdb0ac3da3f195f914c40d27 Mon Sep 17 00:00:00 2001 +From aaef3225c0d839d0bc3a989f2b4d10d9ed31c02b Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 061/269] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 061/305] 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 @@ -108013,10 +108013,10 @@ index 227a107214a02deadcca3db202da265eba1fdd21..b0f6e33bd30c35664ceee057f4c3ad32 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 9b5ec1177407b8ab94ec2e7379f2b3c76443483d Mon Sep 17 00:00:00 2001 +From 5b59da22bd0f92250b3149bd7adc30291db182b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 062/269] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 062/305] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -109591,10 +109591,10 @@ index 333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20..46b787a6474ffa857da9b663948863ec bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 -From 52ee4b138ebb31b1cdc49fac30425d7b6565ee26 Mon Sep 17 00:00:00 2001 +From d0c34721e9d17a8d98e7b23016481e10fa455d0a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 063/269] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 063/305] 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 @@ -109629,10 +109629,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From 7af6a352ddc4a4aebd73719d86b091aa957e42e3 Mon Sep 17 00:00:00 2001 +From 6b76776fb66b3b5cde6d047e0eec336b4389dab9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 064/269] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 064/305] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -110497,10 +110497,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From 6383fcdd234ae04b11f5c6d39bf67be87443744b Mon Sep 17 00:00:00 2001 +From cb63feaccfd98341199e793f3f65cc441bbf886e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 065/269] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 065/305] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -110675,10 +110675,10 @@ index 0000000000000000000000000000000000000000..45f2b770ad9e67728ca599a7445d6ae9 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 26b6f466e82f8cdf82a037c3b4b7a8bdac1f2bca Mon Sep 17 00:00:00 2001 +From 6b6cf37841abc54199e3fb1b173f547592aaa6eb Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 066/269] ASoC: Add support for Rpi-DAC +Subject: [PATCH 066/305] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -110962,10 +110962,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 54bce83bc79f84b40e93f42266daa1c116819246 Mon Sep 17 00:00:00 2001 +From e18a0dd9a5ebab50b34bb532a26fafd53b7a7839 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 067/269] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 067/305] 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 @@ -111014,10 +111014,10 @@ index af95d648265b3e92e345101542b332aee35191d4..513f56ba132929662802d15cdc653af3 .component_driver = { .dapm_widgets = wm8804_dapm_widgets, -From fa059db83ae953d6f104c56b0f118a3c1b95d123 Mon Sep 17 00:00:00 2001 +From d4386447e2b2e4f99c2bb9436d6ed573835cd6a2 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 068/269] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 068/305] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -111361,10 +111361,10 @@ index 0000000000000000000000000000000000000000..19dc953b7227ba86123fc7a2ba654499 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 976d11db746a5621b01a13ac1fc1d6829a3033fa Mon Sep 17 00:00:00 2001 +From 02f571d1d2a6e825318ac67aafd339788d42aae8 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 069/269] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 069/305] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -111694,10 +111694,10 @@ index 0000000000000000000000000000000000000000..4e8e6dec14bcf4a1ff286c43742d4097 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From cdb9c4a0d174c8e35d6ff6c0a61cd7bf5a27052b Mon Sep 17 00:00:00 2001 +From bcadd273625cce0cfe8cd7e970f10f68e65a19a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jul 2016 17:06:50 +0100 -Subject: [PATCH 070/269] iqaudio-dac: Compile fix - untested +Subject: [PATCH 070/305] iqaudio-dac: Compile fix - untested --- sound/soc/bcm/iqaudio-dac.c | 6 +++++- @@ -111721,10 +111721,10 @@ index 4e8e6dec14bcf4a1ff286c43742d4097249d6777..aa15bc4b49ca95edec905fddd8fd0a6d if (dapm->dev != codec_dai->dev) return 0; -From 32645a1dac87204737663854c325811cd41a413e Mon Sep 17 00:00:00 2001 +From c71d125bd3281458f54a7ecec9ce67db0af1d68d Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 071/269] Added support for HiFiBerry DAC+ +Subject: [PATCH 071/305] 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. @@ -112354,10 +112354,10 @@ index 72b19e62f6267698aea45d2410d616d91c1825cb..c6839ef6e16754ed9de2698507b8986a dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From 5fa4f242e074f3f7ca33ef31c099c93a6d1cb25b Mon Sep 17 00:00:00 2001 +From 10c9bf4d92fbe2094009bc00a9969183a6e4afaa Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 072/269] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 072/305] 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. @@ -113197,10 +113197,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From b620a6dc0b07848c1ececeb779b8ad87b75886f1 Mon Sep 17 00:00:00 2001 +From 0b5f4e14db59fad8fce397f3020abf3f47a66521 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 073/269] Update ds1307 driver for device-tree support +Subject: [PATCH 073/305] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -113227,10 +113227,10 @@ index 4e31036ee2596dec93accd26f627c5b95591ae9f..b92044cf03e750afa521a93519500e9d .driver = { .name = "rtc-ds1307", -From 4bd384e4f3039ac2b10763e5fce5452d9a85b8a1 Mon Sep 17 00:00:00 2001 +From 8a110c28585805d903c1089c63c3c53ad46593f1 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 074/269] Add driver for rpi-proto +Subject: [PATCH 074/305] 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 @@ -113446,10 +113446,10 @@ index 0000000000000000000000000000000000000000..9db678e885efd63d84d60a098a84ed67 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 426ea22201429e2d4ea2e32817eb2517d5798f5f Mon Sep 17 00:00:00 2001 +From c6d0651bb58713a27105d5d2884c2a3433d2c368 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 075/269] RaspiDAC3 support +Subject: [PATCH 075/305] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -113692,10 +113692,10 @@ index 0000000000000000000000000000000000000000..dd9eeea2af0382307f437e6db09d1546 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From d3ffc86453d9c6faaad26f4a1b5c679d140597cd Mon Sep 17 00:00:00 2001 +From a424d10c2f501afda3a85a8788dd62e434e6cf8b Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 076/269] Add Support for JustBoom Audio boards +Subject: [PATCH 076/305] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -114149,10 +114149,10 @@ index 0000000000000000000000000000000000000000..91acb666380faa3c0deb2230f8a0f8bb +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From 5ac19586717d639a422648b5e8ab74ee3ab21432 Mon Sep 17 00:00:00 2001 +From 2b3b4f246c8ab3be270564b0b051f75c5ce22c65 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 077/269] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 077/305] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -114334,10 +114334,10 @@ index 0000000000000000000000000000000000000000..6e2ee027926ee63c89222f75ceb89e3d +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From e3a8db083e0d33b1ca2bd8359beb495681192333 Mon Sep 17 00:00:00 2001 +From 5494f36deb3bc2e0a5cd0e72ee577592a265d928 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 078/269] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 078/305] 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. @@ -114588,10 +114588,10 @@ index 0000000000000000000000000000000000000000..ef54e0f07ea03f59e9957b5d98f3e7fd +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From 2ffdbfa91860d7c0fd6e7bb34a65726e35fd41eb Mon Sep 17 00:00:00 2001 +From 1412b1ddb330ecace845e633ae884ae145bdd062 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 079/269] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 079/305] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -114891,10 +114891,10 @@ index 0000000000000000000000000000000000000000..9b6e829bcb5b1762a853775e78163196 +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From 1cdbc4130e598ad8cd32503e38339ed3a9e99a58 Mon Sep 17 00:00:00 2001 +From 4b728e675f4f88678dc92d8daaec2d5ea2cd15ca Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 080/269] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 080/305] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -115367,10 +115367,10 @@ index 0000000000000000000000000000000000000000..446796e7e4c14a7d95b2f2a01211d9a0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From 8a2204cd8e782bc5d3aaef71b0c1e67d914d0b56 Mon Sep 17 00:00:00 2001 +From 7a38bc81a17b39e61764018a65d6ffc172e0b407 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 081/269] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 081/305] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -115543,10 +115543,10 @@ index 0000000000000000000000000000000000000000..89e65317512bc774453ac8d0d5b0ff98 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 48b62591ffd63a84b65d6a31efc9c993db75176f Mon Sep 17 00:00:00 2001 +From a5cf02d9e6e60ca249c48da7c61beace717dd97d Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 082/269] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 082/305] 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, @@ -115753,10 +115753,10 @@ index 0000000000000000000000000000000000000000..8e8e62e5a36a279b425ed4655cfbac99 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From 8d0c8d76aca2bea8df8fca2fc7bf6b6cd4166782 Mon Sep 17 00:00:00 2001 +From 39c4147b35866243f166186b54d5df30cb02b51c Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 083/269] Support for Blokas Labs pisound board +Subject: [PATCH 083/305] Support for Blokas Labs pisound board Pisound dynamic overlay (#1760) @@ -116933,10 +116933,10 @@ index 0000000000000000000000000000000000000000..4b8545487d06e4ea70073a5d063fb231 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From 4c67995f8c22187e16ef3ff79e8b07108b8bb007 Mon Sep 17 00:00:00 2001 +From 54d0ef5494c9feab2e25c81f1a747af2df5bfe07 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 084/269] rpi_display: add backlight driver and overlay +Subject: [PATCH 084/305] 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 @@ -117105,10 +117105,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From 61fb1bd55d8a32aba77c179589a9111cd6b7946f Mon Sep 17 00:00:00 2001 +From fa7303c635e18453a2a53be5cf2eb6f90e40eaba Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 085/269] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 085/305] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -117382,10 +117382,10 @@ index b0f6e33bd30c35664ceee057f4c3ad32b914291d..e92278968b2b979db2a1f855f70e7aaf RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 3cf12d62433ad0b06197a895e7a5524bc139a661 Mon Sep 17 00:00:00 2001 +From 72dcc1ef21da085e822a165cde58db574b3cbada Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 086/269] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 086/305] 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 @@ -117414,10 +117414,10 @@ index e2c33b9528d82ed7a2c27d083d7b1d222da68178..5a11ff833e1fd112ba04df3a427cd94b uap->old_cr = 0; uap->port.dev = dev; -From 770a744fce53d99aadfa995ea826112730df9584 Mon Sep 17 00:00:00 2001 +From 013d6b8242981329098c330cfc5b564093c7b6da Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 087/269] OF: DT-Overlay configfs interface +Subject: [PATCH 087/305] 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. @@ -117849,10 +117849,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From 7e65bb1597e90ed605c43e65e289064922ea1eec Mon Sep 17 00:00:00 2001 +From 6fbb2ff08ab9a34bffae14fc7471aed8a955b782 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 088/269] brcm: adds support for BCM43341 wifi +Subject: [PATCH 088/305] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -117899,7 +117899,7 @@ Signed-off-by: Phil Elwell 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -index 78d9966a3957b2b934fe6b21de5cade494ec2839..3fcb1887b2d312e050c02e9fe66ea20f48f0abcb 100644 +index 0f5dde1f224831ab68ece84a94fba6aca97b9bc0..121a697455caba5a9e15145c96c7fb7055dd5ad7 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2756,6 +2756,8 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, @@ -117930,7 +117930,7 @@ index 78d9966a3957b2b934fe6b21de5cade494ec2839..3fcb1887b2d312e050c02e9fe66ea20f if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) brcmf_fil_iovar_int_set(ifp, "mbss", 0); brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, -@@ -6737,12 +6742,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +@@ -6739,12 +6744,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], struct brcmfmac_pd_cc *country_codes; struct brcmfmac_pd_cc_entry *cc; s32 found_index; @@ -117951,7 +117951,7 @@ index 78d9966a3957b2b934fe6b21de5cade494ec2839..3fcb1887b2d312e050c02e9fe66ea20f } if ((alpha2[0] == ccreq->country_abbrev[0]) && -@@ -6766,10 +6777,14 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +@@ -6768,10 +6779,14 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], brcmf_dbg(TRACE, "No country code match found\n"); return -EINVAL; } @@ -117983,7 +117983,7 @@ index 3e15d64c64813513bc22202dd9e468588699abb0..4051780f64f44a5ce522babe6c371a1b MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -index 2458e6e05276c3ff7cb067bdfa1edf34a1eec09b..d13826095c09f5b4037625371fe648900c9d670a 100644 +index 8744b9beda336f468250577243514c942b9fc3ed..3a993a57b69a52ebb40f7ce7d8358e05ad0f5f90 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -604,6 +604,7 @@ BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt"); @@ -118015,10 +118015,10 @@ index d0407d9ad7827cd756b6311410ffe2d9a7cacc78..f1fb8a3c7a3211e8429585861f2f42e0 #define BRCM_CC_4335_CHIP_ID 0x4335 #define BRCM_CC_4339_CHIP_ID 0x4339 -From 7b41569a2a8b2c8073c9877fd4bcee35672f946f Mon Sep 17 00:00:00 2001 +From c4899a1421c447a0d4cb45e3cd362367731c9429 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 089/269] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 089/305] 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. @@ -118041,10 +118041,10 @@ index 0879d64b1caf58afb6e5d494c07d9ab7e7cdf983..5161ab30fd533d50f516bb93d5b9f402 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From b7ef0b7ecd67f609c172d13d969f63ea90aa1618 Mon Sep 17 00:00:00 2001 +From 19541411f5b83653d8660e43913300fda74ac3d9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 090/269] config: Add default configs +Subject: [PATCH 090/305] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1297 +++++++++++++++++++++++++++++++++++ @@ -120671,10 +120671,10 @@ index 0000000000000000000000000000000000000000..8acee9f31202ec14f2933d92dd70831c +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 444787979857bef59d2c9e7c3c10db80591bfb62 Mon Sep 17 00:00:00 2001 +From 06331145cccde21851eb1296eb1fe473ede28423 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 091/269] Add arm64 configuration and device tree differences. +Subject: [PATCH 091/305] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -122089,10 +122089,10 @@ index 0000000000000000000000000000000000000000..d7406f5a4620151044b8f716b4d10bb8 +CONFIG_LIBCRC32C=y +CONFIG_BCM2708_VCHIQ=n -From 46933ecb02977c39375083ebae2edb806ea9ba38 Mon Sep 17 00:00:00 2001 +From d073a5d3feb542d3c6411faff568c977af44df4c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 15:05:11 +0000 -Subject: [PATCH 092/269] vchiq_arm: Tweak the logging output +Subject: [PATCH 092/305] vchiq_arm: Tweak the logging output Signed-off-by: Phil Elwell --- @@ -122167,10 +122167,10 @@ index 2c98da4307dff994a00dc246574ef0aaee05d5da..160db24aeea33a8296923501009c1f02 switch (type) { -From bc9e796c9a5a6d54ab745ad2c60375a30fea36fa Mon Sep 17 00:00:00 2001 +From ef35d1e5ed0639a8d421189af5519d00d062620b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 14:16:25 +0000 -Subject: [PATCH 093/269] vchiq_arm: Access the dequeue_pending flag locked +Subject: [PATCH 093/305] vchiq_arm: Access the dequeue_pending flag locked Reading through this code looking for another problem (now found in userland) the use of dequeue_pending outside a lock didn't seem safe. @@ -122228,10 +122228,10 @@ index 7b6cd4d80621e38ff6d47fcd87b45fbe9cd4259b..d8669fa7f39b077877eca1829ba9538b return add_completion(instance, reason, header, user_service, -From 51412de6b7ff20c5c2c9ba2bb91e605217f759fd Mon Sep 17 00:00:00 2001 +From 03536abed6a3de02b8eec7deb319c920979fe961 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 20:53:47 +0000 -Subject: [PATCH 094/269] vchiq_arm: Service callbacks must not fail +Subject: [PATCH 094/305] vchiq_arm: Service callbacks must not fail Service callbacks are not allowed to return an error. The internal callback that delivers events and messages to user tasks does not enqueue them if @@ -122257,10 +122257,10 @@ index d8669fa7f39b077877eca1829ba9538bf2e21a82..54552c6ce54f413c9781ba279b936f98 DEBUG_TRACE(SERVICE_CALLBACK_LINE); } -From 214a4a348965b0dfc215a4eb793fbe8376943073 Mon Sep 17 00:00:00 2001 +From fff4b063b230fad7bac57817da9a16993bf3e9ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 13:49:32 +0100 -Subject: [PATCH 095/269] vchiq_arm: Add completion records under the mutex +Subject: [PATCH 095/305] vchiq_arm: Add completion records under the mutex An issue was observed when flushing openmax components which generate a large number of messages returning @@ -122323,10 +122323,10 @@ index 54552c6ce54f413c9781ba279b936f98be4f47b0..bde8955b7d8505d73579b77b5b392154 return VCHIQ_SUCCESS; -From 0178bac3eaccf0df78011c49309d0d7bfec7c610 Mon Sep 17 00:00:00 2001 +From 143c06724d173b818b005f707a77a1c96e8c8049 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jun 2016 13:51:44 +0100 -Subject: [PATCH 096/269] vchiq_arm: Avoid use of mutex in add_completion +Subject: [PATCH 096/305] vchiq_arm: Avoid use of mutex in add_completion Claiming the completion_mutex within add_completion did prevent some messages appearing twice, but provokes a deadlock caused by vcsm using @@ -122520,10 +122520,10 @@ index 160db24aeea33a8296923501009c1f02bc41e599..71a3bedc55314f3b22dbff40c05dedf0 up(&state->slot_available_event); } -From 5e9ea98df8770d36acc27e6e57f3fdd17220cad1 Mon Sep 17 00:00:00 2001 +From a305f5385dd8ac01dc644578e6ea5e6487aed125 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:14:10 -0700 -Subject: [PATCH 097/269] staging/vchi: Convert to current get_user_pages() +Subject: [PATCH 097/305] staging/vchi: Convert to current get_user_pages() arguments. Signed-off-by: Eric Anholt @@ -122560,10 +122560,10 @@ index e5cdda12c7e5c35c69eb96991cfdb8326def167f..085d37588c59198b4e5f00b9249bb842 num_pages, /* len */ 0, /* gup_flags */ -From 4918a6e968d302e1572a148205d0899de121deda Mon Sep 17 00:00:00 2001 +From a099d8b2a6794b5572a188fa64225a47344e3b50 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:16:03 -0700 -Subject: [PATCH 098/269] staging/vchi: Update for rename of +Subject: [PATCH 098/305] staging/vchi: Update for rename of page_cache_release() to put_page(). Signed-off-by: Eric Anholt @@ -122608,10 +122608,10 @@ index 085d37588c59198b4e5f00b9249bb8421695854f..5a2b8fb459ebe086ec229f37b6381bdb kfree(pages); } -From 98f7ab2f25b47f304b724dab8c432c67b1582369 Mon Sep 17 00:00:00 2001 +From cda9154ea37aa44fbdfc23dfffbd06ac5826f060 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:21:17 -0700 -Subject: [PATCH 099/269] drivers/vchi: Remove dependency on CONFIG_BROKEN. +Subject: [PATCH 099/305] drivers/vchi: Remove dependency on CONFIG_BROKEN. The driver builds now. @@ -122633,10 +122633,10 @@ index 9676fb29075a457109e4d4235f086987aec74868..db8e1beb89f9f8c48ea5964016c8285e help Kernel to VideoCore communication interface for the -From 056024e6d4a399172716ea53bae6b6726bf4f741 Mon Sep 17 00:00:00 2001 +From c914108e446efd2c072e65d05483603de46643ce Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 100/269] raspberrypi-firmware: Export the general transaction +Subject: [PATCH 100/305] raspberrypi-firmware: Export the general transaction function. The vc4-firmware-kms module is going to be doing the MBOX FB call. @@ -122680,10 +122680,10 @@ index e92278968b2b979db2a1f855f70e7aafb224fa98..09e3d871d110eb0762ebdb5ea3293537 #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From 8b94268c00fd97fe98a5149b4a0c5f81ba2b72e6 Mon Sep 17 00:00:00 2001 +From 2abbd865bdb3a6188f3aa1369194819da9b452f5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:18:09 +0100 -Subject: [PATCH 101/269] raspberrypi-firmware: Define the MBOX channel in the +Subject: [PATCH 101/305] raspberrypi-firmware: Define the MBOX channel in the header. Signed-off-by: Eric Anholt @@ -122705,10 +122705,10 @@ index 09e3d871d110eb0762ebdb5ea329353738d58661..2859db09e25bb945251e85edb39bc434 enum rpi_firmware_property_status { -From 2454c6f20b2c892d6807aa67c3840605ffcf64ad Mon Sep 17 00:00:00 2001 +From ecbaf3c47d97ca7611f76806ad03068197b015cf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 08:39:33 +0100 -Subject: [PATCH 102/269] drm/vc4: Add a mode for using the closed firmware for +Subject: [PATCH 102/305] drm/vc4: Add a mode for using the closed firmware for display. Signed-off-by: Eric Anholt @@ -123475,10 +123475,10 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + }, +}; -From d590e0a75b1bdf54ec40fa5cba6fe1456fa1c35b Mon Sep 17 00:00:00 2001 +From 89236de15f88a9a24ef97a70bc5eff025d09f443 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 103/269] i2c: bcm2835: Protect against unexpected TXW/RXR +Subject: [PATCH 103/305] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123603,10 +123603,10 @@ index f283b714aa79e2e4685ed95b04b6b289f7e9eee7..d2ba1a4de36af512e8e3c97251bd3537 return -ETIMEDOUT; } -From d6ce79564eb31ba3fe92772b6e19eb1d7fff372d Mon Sep 17 00:00:00 2001 +From 8b44abd412cb0be1485ad29dfb66158863c139d8 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 104/269] i2c: bcm2835: Use dev_dbg logging on transfer errors +Subject: [PATCH 104/305] i2c: bcm2835: Use dev_dbg logging on transfer errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123638,10 +123638,10 @@ index d2ba1a4de36af512e8e3c97251bd3537ae61591a..54d510abd46a117c9238fc6d7edec840 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From d0042963f07b66371d97dd146f8c0c67f1925de8 Mon Sep 17 00:00:00 2001 +From e68f89a3f00f0b0c1b1012fdfcf522276891cc7a 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 105/269] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK +Subject: [PATCH 105/305] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123685,10 +123685,10 @@ index 54d510abd46a117c9238fc6d7edec84019d1f60d..565ef69ce61423544dc0558c85ef318b if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) -From a57cd62b8f6e515caf6ac5f86a22dc0472e1ec1b Mon Sep 17 00:00:00 2001 +From e77f93c32b40bc783991491f41e5fe7d844b9a0c 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 106/269] i2c: bcm2835: Add support for Repeated Start +Subject: [PATCH 106/305] i2c: bcm2835: Add support for Repeated Start Condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123870,10 +123870,10 @@ index 565ef69ce61423544dc0558c85ef318b0ae9c324..241e08ae7c27cec23fad3c1bf3ebad3a static u32 bcm2835_i2c_func(struct i2c_adapter *adap) -From a31352ef30492721335e4ca695e4b74d380db80e Mon Sep 17 00:00:00 2001 +From a8fa929731451ea6d7f618dc542b0fea3b3d91c6 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 107/269] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT +Subject: [PATCH 107/305] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123910,10 +123910,10 @@ index 241e08ae7c27cec23fad3c1bf3ebad3a4d2a8e6f..d2085dd3742eabebc537621968088261 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -From 1e22c3a0caef822de0c25ca6f93562e52a84d992 Mon Sep 17 00:00:00 2001 +From 510a4fc68acdecde66a2727ff6a62ee7fcaa0f55 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 108/269] i2c: bcm2835: Add support for dynamic clock +Subject: [PATCH 108/305] i2c: bcm2835: Add support for dynamic clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124029,10 +124029,10 @@ index d2085dd3742eabebc537621968088261f8dc7ea8..c3436f627028477f7e21b47e079fd5ab irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq) { -From f3df2e3003af536614907cb0db26d42aa339396d Mon Sep 17 00:00:00 2001 +From 8c45feb7add7280d137dd3420256068284b0f604 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 109/269] i2c: bcm2835: Add debug support +Subject: [PATCH 109/305] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124221,10 +124221,10 @@ index c3436f627028477f7e21b47e079fd5ab06ec188a..8642f580ce41803bd22c76a0fa80d083 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 772a2bc20c10aa7675c8a8eb395e3de8dcd278e8 Mon Sep 17 00:00:00 2001 +From 611d00b287e6043f595a863fcd66d698e11ccbea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 31 Dec 2016 14:15:50 +0000 -Subject: [PATCH 110/269] arm64: Add CONFIG_ARCH_BCM2835 +Subject: [PATCH 110/305] arm64: Add CONFIG_ARCH_BCM2835 --- arch/arm64/configs/bcmrpi3_defconfig | 1 + @@ -124240,10 +124240,10 @@ index d7406f5a4620151044b8f716b4d10bb818648e06..53da5c7a33e5898a66e549fb0c39fe3d CONFIG_BCM2708_VCHIQ=n +CONFIG_ARCH_BCM2835=y -From 89f35cb59dd5281e7ad66e7c6afb12229a86de8b Mon Sep 17 00:00:00 2001 +From 7166357bd62767614e1bcf5221e2878a56eeeceb Mon Sep 17 00:00:00 2001 From: Alex Tucker Date: Tue, 13 Dec 2016 19:50:18 +0000 -Subject: [PATCH 111/269] Add support for Silicon Labs Si7013/20/21 +Subject: [PATCH 111/305] Add support for Silicon Labs Si7013/20/21 humidity/temperature sensor. --- @@ -124318,10 +124318,10 @@ index f6d134c095af2398fc55ae7d2b0e86456c30627c..31bda8da4cb6a56bfe493a81b9189009 }; }; -From 8f567a8fd736cb2637761ba100d7d759e45401c5 Mon Sep 17 00:00:00 2001 +From c8e0addfc4e02de515e1ea5acf1fe1c84c793ab4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Jan 2017 21:27:46 +0000 -Subject: [PATCH 112/269] Document the si7020 option +Subject: [PATCH 112/305] Document the si7020 option --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -124342,10 +124342,10 @@ index 81d991803be335e5a1bc3bb0a8c7a2c9f5c392bd..e8fa4ccb44c34a20485c4e6155467af9 Name: i2c0-bcm2708 Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations -From b395d0b06ace0b43219f73da425ca2839998ac4e Mon Sep 17 00:00:00 2001 +From bb2d2aeaa53e6f35ce98e434453831f54b8832e1 Mon Sep 17 00:00:00 2001 From: Giedrius Trainavicius Date: Thu, 5 Jan 2017 02:38:16 +0200 -Subject: [PATCH 113/269] pisound improvements: +Subject: [PATCH 113/305] pisound improvements: * Added a writable sysfs object to enable scripts / user space software to blink MIDI activity LEDs for variable duration. @@ -124639,10 +124639,10 @@ index 4b8545487d06e4ea70073a5d063fb2310b3b94d0..ba70734b89e61a11201657406223f0b3 }; -From 6c4ae519e04992c1dd6816e1227234075f21f245 Mon Sep 17 00:00:00 2001 +From 8c38985ce16eebf11a860adbef745891ee8e205d Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:05:41 +0000 -Subject: [PATCH 114/269] Add driver_name property +Subject: [PATCH 114/305] Add driver_name property Add driver name property for use with 5.1 passthrough audio in LibreElec and other Kodi based OSs --- @@ -124662,10 +124662,10 @@ index 8fd50dbe681508a2cfe8fdde1c9fedbe9a507fa7..05a224ec712d06b8b7587ab6b8bb562d .dai_link = snd_rpi_justboom_dac_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_dac_dai), -From a027a9645d93afa0ae99c46ead3d29851faee82e Mon Sep 17 00:00:00 2001 +From c331b967a82dbe3de83a64c5de0e5dee0eaf11fd Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:11:04 +0000 -Subject: [PATCH 115/269] Add driver_name paramater +Subject: [PATCH 115/305] Add driver_name paramater Add driver_name parameter for use with 5.1 passthrough audio in LibreElec and other Kodi OSs --- @@ -124685,10 +124685,10 @@ index 91acb666380faa3c0deb2230f8a0f8bbec59417b..abfdc5c4dd5811e6847bddda4921abe3 .dai_link = snd_rpi_justboom_digi_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_digi_dai), -From 565dc6bbc215b231ff756b3ba8d67360b52af333 Mon Sep 17 00:00:00 2001 +From b9d6176c4a6673ab633e406b1344730a1914e473 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Jan 2017 13:01:21 +0000 -Subject: [PATCH 116/269] BCM270X_DT: Add pi3-disable-wifi overlay +Subject: [PATCH 116/305] BCM270X_DT: Add pi3-disable-wifi overlay pi3-disable-wifi is a minimal overlay to disable the onboard WiFi. @@ -124749,10 +124749,10 @@ index 0000000000000000000000000000000000000000..017199554bf2f4e381efcc7bb71e750c + }; +}; -From 862bda77c8696cf9505e47203c6451d908c17cdd Mon Sep 17 00:00:00 2001 +From 0278e297c27e51fe99cbe1a799fe28b84fe93e07 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Thu, 12 Jan 2017 07:07:08 -0800 -Subject: [PATCH 117/269] ARM64: Make it work again on 4.9 (#1790) +Subject: [PATCH 117/305] ARM64: Make it work again on 4.9 (#1790) * Invoke the dtc compiler with the same options used in arm mode. * ARM64 now uses the bcm2835 platform just like ARM32. @@ -125157,10 +125157,10 @@ index 53da5c7a33e5898a66e549fb0c39fe3da555ca87..c7e891d72969a388d9b135a36dbfc9c9 -CONFIG_BCM2708_VCHIQ=n -CONFIG_ARCH_BCM2835=y -From 5d408444f1beb55ecb96301fea7d204379840fca Mon Sep 17 00:00:00 2001 +From 66c0b59cd07c274c28a4d60b0c9fd85f7f2c0712 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 14 Jan 2017 02:54:26 -0800 -Subject: [PATCH 118/269] ARM64: Enable Kernel Address Space Randomization +Subject: [PATCH 118/305] ARM64: Enable Kernel Address Space Randomization (#1792) Randomization allows the mapping between virtual addresses and physical @@ -125192,10 +125192,10 @@ index c7e891d72969a388d9b135a36dbfc9c9cb609bf8..974d8889c0cf695eb88b57bbef11bc5a CONFIG_BINFMT_MISC=y CONFIG_COMPAT=y -From 083def6f1a370b3511679cf710a3df60ef0507f9 Mon Sep 17 00:00:00 2001 +From b3f3cb9413496e558cdea23164cd3bb9ef11cbea Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sun, 15 Jan 2017 07:31:59 -0800 -Subject: [PATCH 119/269] ARM64: Enable RTL8187/RTL8192CU wifi in build config +Subject: [PATCH 119/305] ARM64: Enable RTL8187/RTL8192CU wifi in build config These drivers build now, so they can be enabled back in the build configuration just like they are for @@ -125220,10 +125220,10 @@ index 974d8889c0cf695eb88b57bbef11bc5aa556b635..4670a490dfb1e582ec24a3b39a3cb9b2 CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From 4cbe4cc4fd52a6f81e6e84a6d3cbe41d6feffccf Mon Sep 17 00:00:00 2001 +From 82df269fda8a5a4e22c673e0fe1852a71ed7f69e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Jan 2017 14:53:12 +0000 -Subject: [PATCH 120/269] BCM270X_DT: Add spi0-cs overlay +Subject: [PATCH 120/305] BCM270X_DT: Add spi0-cs overlay The spi0-cs overlay allows the software chip selectts to be modified using the cs0_pin and cs1_pin parameters. @@ -125311,10 +125311,10 @@ index 0000000000000000000000000000000000000000..7f79029d043c04d7496c7c3480450c69 + }; +}; -From cb1dd524a34034616c63f3506c7c8e28a7258f0f Mon Sep 17 00:00:00 2001 +From 0d48e23c56d7e9dd4cc374e0c50592790c3cbedb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 121/269] spi-bcm2835: Disable forced software CS +Subject: [PATCH 121/305] 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 @@ -125340,10 +125340,10 @@ index 74dd21b7373c7564ede01d84a4f63b93a6d52fa7..51cdefbf5eb265f49bd05e0aa91dfbee i2c0: i2c@7e205000 { -From e2d9c3dae2dec8478317936cfbc451477bb5c4ad Mon Sep 17 00:00:00 2001 +From b72225aba1f4511e239644003fafd7edabc8dba9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jan 2017 16:33:54 +0000 -Subject: [PATCH 122/269] config: Add CONFIG_TCP_CONG_BBR See: +Subject: [PATCH 122/305] config: Add CONFIG_TCP_CONG_BBR See: https://github.com/raspberrypi/linux/issues/1784 --- @@ -125378,10 +125378,10 @@ index 8acee9f31202ec14f2933d92dd70831cda8d7b51..219f67051a2542329449b0099165ae28 CONFIG_IPV6_ROUTER_PREF=y CONFIG_INET6_AH=m -From 85276a1c75389311370999f568fcb9c853edf52b Mon Sep 17 00:00:00 2001 +From eb19c4d78c36bb7af31d8cbd0b600ab0b0a45abd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 11:34:58 +0000 -Subject: [PATCH 123/269] BCM270X_DT: Enable UART0 on CM3 +Subject: [PATCH 123/305] BCM270X_DT: Enable UART0 on CM3 Signed-off-by: Phil Elwell --- @@ -125404,10 +125404,10 @@ index 41874c25a84226c0e4af92ec4059e0a571fe6123..3ba6e621856c288ae4694f758604619f sdhost_pins: sdhost_pins { brcm,pins = <48 49 50 51 52 53>; -From 0641d754211b34c6dea150fed3ab4500edf6e100 Mon Sep 17 00:00:00 2001 +From 170ac907c4cf80719e252353ddd735430f0b2ad8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 14:39:39 +0000 -Subject: [PATCH 124/269] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR +Subject: [PATCH 124/305] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR See: https://github.com/raspberrypi/linux/issues/1781 @@ -125446,10 +125446,10 @@ index 219f67051a2542329449b0099165ae2885022bec..c4898d63d74718097ec3a1d1fe60b230 CONFIG_OF_CONFIGFS=y CONFIG_ZRAM=m -From 01042ae26b288e092169323d79fa70b385337e92 Mon Sep 17 00:00:00 2001 +From 64fff99f57cde8fecc5273e3a389ed19b952b546 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:33:51 -0800 -Subject: [PATCH 125/269] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 +Subject: [PATCH 125/305] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 In ARM64, the FIQ mechanism used by this driver is not current implemented. As a workaround, reqular IRQ is used instead @@ -125792,10 +125792,10 @@ index 6b2c7d0c93f36a63863ff4b0ecc1f3eab77e058b..d7b700ff17821ad1944e36721fe6b2db /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE -From 406bbc0a91e1f18603b396e3901ffc534666a5d7 Mon Sep 17 00:00:00 2001 +From 6cf7feb6a67d85455219ca62a69b9b26d10f9278 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 126/269] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 126/305] ARM64: Round-Robin dispatch IRQs between CPUs. IRQ-CPU mapping is round robined on ARM64 to increase concurrency and allow multiple interrupts to be serviced @@ -125869,10 +125869,10 @@ index 93e3f7660c4230c9f1dd3b195958cb498949b0ca..486bcbfb32305ee417f6b3be7e91a3ff .name = "bcm2836-gpu", .irq_mask = bcm2836_arm_irqchip_mask_gpu_irq, -From d122d3c1bf7ba8c87b7f732cafdc253a0a8fac6d Mon Sep 17 00:00:00 2001 +From 851b375e9baa8c25dfdb661b9123d7dbb355ba1c Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:45:03 -0800 -Subject: [PATCH 127/269] ARM64: Enable DWC_OTG Driver In ARM64 Build +Subject: [PATCH 127/305] ARM64: Enable DWC_OTG Driver In ARM64 Build Config(bcmrpi3_defconfig) Signed-off-by: Michael Zoran @@ -125893,10 +125893,10 @@ index 4670a490dfb1e582ec24a3b39a3cb9b2488b1864..8c4392344eb4495689c220d5d176ee8c CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From 9b05f4da446413be9549298b19056d978a7a8df6 Mon Sep 17 00:00:00 2001 +From 2fc4fb119736ca3562188302e9963834a18c13bc Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:46:04 -0800 -Subject: [PATCH 128/269] ARM64: Use dwc_otg driver by default for USB. +Subject: [PATCH 128/305] ARM64: Use dwc_otg driver by default for USB. If it breaks on anybody, they can use the standard device tree overlays to switch back to the dwc2 driver. @@ -125922,10 +125922,10 @@ index f6def5d7e5d622cf09e8f87332c7374fe28da08b..3e134a1208610b90e2d0fc22f03c6e9f -}; -#endif -From 0db182d163fca2e9092e3f59a2f368cc92b8f0bd Mon Sep 17 00:00:00 2001 +From 7a2062cf663d281ace259cec78a343009cf59049 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Jan 2017 17:36:50 +0000 -Subject: [PATCH 129/269] BCM270X_DT: Add reference to audio_pins to CM dtb +Subject: [PATCH 129/305] BCM270X_DT: Add reference to audio_pins to CM dtb The CM1 dtb contains an empty audio_pins node, but no reference to it. Adding the usual pinctrl reference from the audio node enables the @@ -125953,10 +125953,10 @@ index eb8662f0d222b4c0a9a2bcb8bccb13e86a0006b3..10be69972bd1440f574e35d515f3d6a0 hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; }; -From fd85f1b1fb028559bece5c168e2f295373c2920e Mon Sep 17 00:00:00 2001 +From 3000b5fd15918d438ed9a645aafce893605e0e09 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 25 Jan 2017 11:30:38 +0000 -Subject: [PATCH 130/269] config: Add additional network scheduling modules +Subject: [PATCH 130/305] config: Add additional network scheduling modules --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -126008,10 +126008,10 @@ index c4898d63d74718097ec3a1d1fe60b2307a6a3140..b448eaa866c200f48351819072c7fefc CONFIG_NET_SCH_PLUG=m CONFIG_NET_CLS_BASIC=m -From a00a45f2d0e3558ce7d1b7231cdcac1dd4f50160 Mon Sep 17 00:00:00 2001 +From a086c72446121c3313ae780d8400d3202e2f4167 Mon Sep 17 00:00:00 2001 From: chris johnson Date: Sun, 22 Jan 2017 03:27:31 +0000 -Subject: [PATCH 131/269] ASoC: A simple-card overlay for ADAU7002 +Subject: [PATCH 131/305] ASoC: A simple-card overlay for ADAU7002 Usage: `dtoverlay=adau7002-simple` --- @@ -126109,10 +126109,10 @@ index 0000000000000000000000000000000000000000..e67e6625d7967abc92cf00cb604d4c12 + }; +}; -From 407ac69a801b923ea3b802dd46780c95f959afa4 Mon Sep 17 00:00:00 2001 +From 73b3ac3f70a7fafa5a4f0aa8e65b8a9760e29c10 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Jan 2017 21:17:23 +0000 -Subject: [PATCH 132/269] config: Add SND_SOC_ADAU7002 codec module +Subject: [PATCH 132/305] config: Add SND_SOC_ADAU7002 codec module As there is now an overlay requiring it, build the codec module. @@ -126147,10 +126147,10 @@ index b448eaa866c200f48351819072c7fefcd8ad8132..5105a592c9bcfee1cc6a8b50fd1c6c32 CONFIG_SND_SOC_WM8804_I2C=m CONFIG_SND_SIMPLE_CARD=m -From 4a36c6f1d7752712eb2c99d5de16d48eac14f8ef Mon Sep 17 00:00:00 2001 +From 9fc3d21b9e00a5f2dfa69b05a79344ed04a3558d Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Fri, 27 Jan 2017 06:42:42 -0500 -Subject: [PATCH 133/269] Add overlay for mcp3008 adc (#1818) +Subject: [PATCH 133/305] Add overlay for mcp3008 adc (#1818) Some example usage: @@ -126436,10 +126436,10 @@ index 0000000000000000000000000000000000000000..06bf4264959c380d8a9f90f74e780397 + }; +}; -From f357cec2b0951db19978e5ab96be4990a890386b Mon Sep 17 00:00:00 2001 +From a4b658a6ef29e6e94aa8ff003baec75730540362 Mon Sep 17 00:00:00 2001 From: ED6E0F17 Date: Fri, 3 Feb 2017 14:52:42 +0000 -Subject: [PATCH 134/269] usb: dwc2: Avoid suspending if we're in gadget mode +Subject: [PATCH 134/305] usb: dwc2: Avoid suspending if we're in gadget mode (#1825) I've found when booting HiKey with the usb gadget cable attached @@ -126491,10 +126491,10 @@ index df5a065780054f21841ca9f08b8ab118922c530b..619ccfe1eafc4643b16970f8a1129ff9 goto skip_power_saving; -From 7e11c3845d325b6853f8341523bf6e1d9fafd06c Mon Sep 17 00:00:00 2001 +From ea6ecd3bed504822ea97b57304212198f3df79e8 Mon Sep 17 00:00:00 2001 From: JamesH65 Date: Mon, 6 Feb 2017 15:24:47 +0000 -Subject: [PATCH 135/269] gpio_mem: Remove unnecessary dev_info output (#1830) +Subject: [PATCH 135/305] gpio_mem: Remove unnecessary dev_info output (#1830) The open function was spamming syslog every time called, so have removed call completely. @@ -126516,10 +126516,10 @@ index 911f5b7393ed48ceed8751f06967ae6463453f9c..f5e7f1ba8fb6f18dee77fad06a17480c dev_err(inst->dev, "Unknown minor device: %d", dev); ret = -ENXIO; -From c679dac6774aa47321b448e5fe9c5df0a524f0b7 Mon Sep 17 00:00:00 2001 +From 34eafc1e4bc0b806c0c78921ec142434828c11b6 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 136/269] config: Enable regulator support +Subject: [PATCH 136/305] config: Enable regulator support Signed-off-by: Matthias Reichl --- @@ -126554,10 +126554,10 @@ index 5105a592c9bcfee1cc6a8b50fd1c6c32f1381158..74bc0d81bcb4d7f6676368926cdcc10e CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -From 90036eb53e5f3912aa06960282a18b60a9b58ce5 Mon Sep 17 00:00:00 2001 +From c331c813cb26ad20bfc6fc5391d4e8cd4bd42615 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 137/269] BCM270x DT: expose 3.3V and 5V system rails +Subject: [PATCH 137/305] BCM270x DT: expose 3.3V and 5V system rails Signed-off-by: Matthias Reichl --- @@ -126590,10 +126590,10 @@ index a46cb4a8b1419edd95e0e07c18b0f373222dc2bf..36d853715f2379e1952ce3d3be58dd67 + }; }; -From b1cf376677e437a354c47e103784001d1f82721f Mon Sep 17 00:00:00 2001 +From 1e9ad55be7048c6d6e39f64a628e817b734c2469 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 138/269] BCM270x DT: Consolidate audio card overlays +Subject: [PATCH 138/305] BCM270x DT: Consolidate audio card overlays Reference 3.3V / 5V system rails instead of instantiating local regulators. @@ -126888,10 +126888,10 @@ index 16b1247bfa618ff85936ddf78c3aea58075eaa67..f8d48233e28c7c18509b4a95692f6aff __overlay__ { compatible = "rra,digidac1-soundcard"; -From 7d144e423572838549369774143f2f396e78391d Mon Sep 17 00:00:00 2001 +From 122493e12881ef1c74aad4743d24b2b71e976bd6 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 139/269] ASoC: Add driver for Cirrus Logic Audio Card +Subject: [PATCH 139/305] ASoC: Add driver for Cirrus Logic Audio Card Note: due to problems with deferred probing of regulators the following softdep should be added to a modprobe.d file @@ -128141,10 +128141,10 @@ index 0000000000000000000000000000000000000000..ac8651ddff7bd3701dffe22c7fb88352 +MODULE_DESCRIPTION("ASoC driver for Cirrus Logic Audio Card"); +MODULE_LICENSE("GPL"); -From 819acde6b44a9aaa6693b58e37cefafcbf18dc23 Mon Sep 17 00:00:00 2001 +From 33310d492a98aeb754008683d52cef7f8b12b4f5 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 140/269] config: enable Cirrus Logic Audio Card +Subject: [PATCH 140/305] config: enable Cirrus Logic Audio Card Signed-off-by: Matthias Reichl --- @@ -128193,10 +128193,10 @@ index 74bc0d81bcb4d7f6676368926cdcc10e581fbcae..f0b87d15e959d88eb26e5a11244365da CONFIG_SND_BCM2708_SOC_RPI_PROTO=m CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m -From cd8e08e2a75007fd2f9d1bf1ed9ca6d99d47b74a Mon Sep 17 00:00:00 2001 +From 797be587fdf6b0dcd1f1f27a493a228674ebb463 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 141/269] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 141/305] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -128220,10 +128220,10 @@ index 486bcbfb32305ee417f6b3be7e91a3ff069a586c..e10597c1a1e51e5e27aa574b6a26d871 static void -From 983954c6c0113f7b0466e3dfe5002b4e9de74046 Mon Sep 17 00:00:00 2001 +From b92f2b349ee93cd0cedbde5e62f51a38fb15791e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 142/269] sound: Demote deferral errors to INFO level +Subject: [PATCH 142/305] sound: Demote deferral errors to INFO level At present there is no mechanism to specify driver load order, which can lead to deferrals and repeated retries until successful. @@ -128236,7 +128236,7 @@ Signed-off-by: Phil Elwell 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c -index c0bbcd9032613a78aef551ce697cabc792880bad..a2504d8c83d74d7227e65be142a26cc9d0a88158 100644 +index 4e3de566809c6b4776415482490ff80df2003351..d83f645de9ef60a05c6b8bb44bb2ae850fb22477 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1013,7 +1013,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, @@ -128258,10 +128258,10 @@ index c0bbcd9032613a78aef551ce697cabc792880bad..a2504d8c83d74d7227e65be142a26cc9 goto _err_defer; } -From df52afbfd051ab9768238de5c9f1a965d03ee4d6 Mon Sep 17 00:00:00 2001 +From 8f2c541e395f3a7b951e931a361507a16a04de26 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:40:33 +0000 -Subject: [PATCH 143/269] sound: Suppress error message about deferrals +Subject: [PATCH 143/305] sound: Suppress error message about deferrals Since driver load deferrals are expected and will already have resulted in a kernel message, suppress an essentially @@ -128508,10 +128508,10 @@ index 9db678e885efd63d84d60a098a84ed6772b19a2d..fadbfade100228aaafabb0d3bdf35c01 return ret; } -From ecbaee0e39dcf28b4c6f5dc60375b218e581395b Mon Sep 17 00:00:00 2001 +From 4c6b8b975633f2482c399265d077beb07b517666 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 144/269] Update vfpmodule.c +Subject: [PATCH 144/305] Update vfpmodule.c Christopher Alexander Tobias Schulze - May 2, 2015, 11:57 a.m. This patch fixes a problem with VFP state save and restore related @@ -128648,10 +128648,10 @@ index da0b33deba6d3c2906eef271f253ab7a30a92680..c6f1d6da808cda78a58f184e19e83522 /* * Save the userland NEON/VFP state. Under UP, -From 664d3815fe18c5215242e27c104efd12aa101fdf Mon Sep 17 00:00:00 2001 +From f7b55cbdda0651cdc3b13ed7e961756f04a62dab Mon Sep 17 00:00:00 2001 From: Martin Cerveny Date: Mon, 13 Feb 2017 17:23:47 +0100 -Subject: [PATCH 145/269] dwc_otg: fix summarize urb->actual_length for +Subject: [PATCH 145/305] dwc_otg: fix summarize urb->actual_length for isochronous transfers Kernel does not copy input data of ISO transfers to userspace @@ -128679,10 +128679,10 @@ index 162a656501988e56c9d780b7793d365fde09f801..992269d61ecf48126379a38e528f7190 dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_urb, i); } -From c3123867d09256cc952f574d5252258d9adbb902 Mon Sep 17 00:00:00 2001 +From 034ce986f970d1e41d5b651b4c77d23633997c4d Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:19 +0100 -Subject: [PATCH 146/269] clk: bcm: Support rate change propagation on bcm2835 +Subject: [PATCH 146/305] clk: bcm: Support rate change propagation on bcm2835 clocks Some peripheral clocks, like the VEC (Video EnCoder) clock need to be set @@ -128807,10 +128807,10 @@ index a99ccf9f056d3a3e7c482339e08483f3701ebc04..dafaa6b22724ab41dac1327cfa81de09 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From 9a4e2e6a6391621567638620f13baaf983842c16 Mon Sep 17 00:00:00 2001 +From 065c526daa5ba3bfa0fef6dac2446f3b8e10b2d8 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:20 +0100 -Subject: [PATCH 147/269] clk: bcm: Allow rate change propagation to PLLH_AUX +Subject: [PATCH 147/305] clk: bcm: Allow rate change propagation to PLLH_AUX on VEC clock The VEC clock requires needs to be set at exactly 108MHz. Allow rate @@ -128845,10 +128845,10 @@ index dafaa6b22724ab41dac1327cfa81de09908a4dfd..0453d7c6a63923370e4191db2c4d083b /* dsi clocks */ [BCM2835_CLOCK_DSI0E] = REGISTER_PER_CLK( -From 775c2c3bc8c33fe331211f26cd0b9b63971fbfd9 Mon Sep 17 00:00:00 2001 +From 6244a8edb76c50d30c2a9e6790549640c441a5bd Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 12 Dec 2016 09:00:53 +0100 -Subject: [PATCH 148/269] clk: bcm: Fix 'maybe-uninitialized' warning in +Subject: [PATCH 148/305] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() best_rate is reported as potentially uninitialized by gcc. @@ -128877,10 +128877,10 @@ index 0453d7c6a63923370e4191db2c4d083b893b3b47..9d895726ebb24bc78a2014870dbdd7c7 struct clk_hw *parent; -From 622fc529526eea0833138036509ed311d40bdf8b Mon Sep 17 00:00:00 2001 +From 54d6cf47e389e827e418d64c0750134b25441d92 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:55 +1100 -Subject: [PATCH 149/269] clk: bcm2835: Don't rate change PLLs on behalf of DSI +Subject: [PATCH 149/305] clk: bcm2835: Don't rate change PLLs on behalf of DSI PLL dividers. Our core PLLs are intended to be configured once and left alone. With @@ -129052,10 +129052,10 @@ index 9d895726ebb24bc78a2014870dbdd7c779cd1cdf..b58cff2756581ba7e0be8a818cdbdf72 /* the clocks */ -From 30801d8b04094f6b70029e1f44e68c3fc7fc4787 Mon Sep 17 00:00:00 2001 +From a3035568cd6d7302f8faf78d63691898af336b98 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:56 +1100 -Subject: [PATCH 150/269] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. +Subject: [PATCH 150/305] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. The DSI pixel clocks are muxed from clocks generated in the analog phy by the DSI driver. In order to set them as parents, we need to do the @@ -129297,10 +129297,10 @@ index 360e00cefd35679b49890234b5c369fb52b89e20..a0c812b0fa391d149b4f546db39bdc4b +#define BCM2835_CLOCK_DSI0P 49 +#define BCM2835_CLOCK_DSI1P 50 -From becfa52776c0b6841c5da28f76ee381271480872 Mon Sep 17 00:00:00 2001 +From a36f6f067a52d4621dad21f83b58641a542ebab7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:57 +1100 -Subject: [PATCH 151/269] clk: bcm2835: Add leaf clock measurement support, +Subject: [PATCH 151/305] clk: bcm2835: Add leaf clock measurement support, disabled by default This proved incredibly useful during debugging of the DSI driver, to @@ -129646,10 +129646,10 @@ index b2c277b378ee799a4f8e05ad076d1253e85cb392..136e5d28f9eaeaa10d45382a0f31da9f /* the gates */ -From 9b69201bb11e75d042085cf0ad87434d1a02f32a Mon Sep 17 00:00:00 2001 +From 2d81389a35919ea1729afe4f6275b68b32306455 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Apr 2016 13:46:13 -0700 -Subject: [PATCH 152/269] drm/panel: Add support for the Raspberry Pi 7" +Subject: [PATCH 152/305] drm/panel: Add support for the Raspberry Pi 7" Touchscreen. This driver communicates with the Atmel microcontroller for sequencing @@ -130230,10 +130230,10 @@ index 0000000000000000000000000000000000000000..1a536fe4d040f5fafe324baee110a622 +MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver"); +MODULE_LICENSE("GPL v2"); -From 1b5605926a00a2f41fa422a3b3b188770cac6696 Mon Sep 17 00:00:00 2001 +From e90c52604dabe80e1df907b565b118a8ce85ca90 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 12:29:45 -0700 -Subject: [PATCH 153/269] BCM270X: Add the DSI panel to the defconfig. +Subject: [PATCH 153/305] BCM270X: Add the DSI panel to the defconfig. Signed-off-by: Eric Anholt --- @@ -130282,10 +130282,10 @@ index 8c4392344eb4495689c220d5d176ee8c189079fd..301611d2283f5f8800339271cea59aed CONFIG_DRM_VC4=m CONFIG_FB=y -From 235128aeb90a0fcce31f7437245211c808239311 Mon Sep 17 00:00:00 2001 +From 3f00797a3a94d732cbab92f20902b735e08dd8d3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Dec 2016 15:15:10 -0800 -Subject: [PATCH 154/269] ARM: bcm2835: dt: Add the DSI module nodes and +Subject: [PATCH 154/305] ARM: bcm2835: dt: Add the DSI module nodes and clocks. The modules stay disabled by default, and if you want to enable DSI @@ -130389,10 +130389,10 @@ index 51cdefbf5eb265f49bd05e0aa91dfbeee3fbfdcc..41776b97b4b6b1c053d07fd357fac4ba compatible = "brcm,bcm2835-i2c"; reg = <0x7e804000 0x1000>; -From 70321de284e9cac0b2222c68c01de38f9de3ca0e Mon Sep 17 00:00:00 2001 +From cc8a3b78b10f85462123dca5403e243e58abf3c6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 15:09:35 -0700 -Subject: [PATCH 155/269] BCM270X: Enable the DSI panel node in the VC4 +Subject: [PATCH 155/305] BCM270X: Enable the DSI panel node in the VC4 overlay. Signed-off-by: Eric Anholt @@ -130543,10 +130543,10 @@ index 4f1cc20f90dc6780f74e08ebee00e5a1a6062c85..f25cd9a3936861920b0d518ff2d773ee cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From 61da2e14ac9447cc4f1a9e81ed4a485724293728 Mon Sep 17 00:00:00 2001 +From e7887522a69a916c4635d440ec8c832a46db7809 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Nov 2016 18:53:10 -0700 -Subject: [PATCH 156/269] drm/vc4: Add support for rendering with ETC1 +Subject: [PATCH 156/305] drm/vc4: Add support for rendering with ETC1 textures. The validation for it ends up being quite simple, but I hadn't got @@ -130606,10 +130606,10 @@ index ad7edc3edf7ca1d653a0bc025a5eda6692b74370..69caa21f0cb23c9439238f6239c0041b struct drm_vc4_get_param { __u32 param; -From 4baae56b542704259ba0853709bb2a2b67ce97c7 Mon Sep 17 00:00:00 2001 +From e8c384af07b41fca487a78957ab0cf593e472505 Mon Sep 17 00:00:00 2001 From: Jonas Pfeil Date: Tue, 8 Nov 2016 00:18:39 +0100 -Subject: [PATCH 157/269] drm/vc4: Add fragment shader threading support +Subject: [PATCH 157/305] drm/vc4: Add fragment shader threading support FS threading brings performance improvements of 0-20% in glmark2. @@ -130845,10 +130845,10 @@ index 69caa21f0cb23c9439238f6239c0041b178d5669..f07a090167261131076438960c1dec17 struct drm_vc4_get_param { __u32 param; -From d192b83ab1c6af390d4cc2692ca833621b697058 Mon Sep 17 00:00:00 2001 +From e970c76555e9b5f71f3505b8bcddafde522a1ef3 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:09 +0100 -Subject: [PATCH 158/269] drm: Add TV connector states to drm_connector_state +Subject: [PATCH 158/305] drm: Add TV connector states to drm_connector_state Some generic TV connector properties are exposed in drm_mode_config, but they are currently handled independently in each DRM encoder driver. @@ -130944,7 +130944,7 @@ index 4e19bde4bbffac08e700460b69db882f42d5463b..846da4f6416435221cb8d08a8c124f05 return connector->funcs->atomic_get_property(connector, state, property, val); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h -index ac9d7d8e0e43a807e9fc9a0b66de5f26b49d3348..2645e803857253ff98eb94aa1bacc8257f37ae76 100644 +index d8bb8d151825fe818a0fc8cf0b1d685feae6b686..c9fbc52e88879c9b91c63b4d1f7abf0fd789ebdd 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -194,10 +194,40 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info, @@ -130998,10 +130998,10 @@ index ac9d7d8e0e43a807e9fc9a0b66de5f26b49d3348..2645e803857253ff98eb94aa1bacc825 /** -From f87fb38e402437d64c20ff9064be77d0fcbb53ca Mon Sep 17 00:00:00 2001 +From 4cb96f5521e5725efe0e42e6811ac691529d4f3f Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:08 +0100 -Subject: [PATCH 159/269] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into +Subject: [PATCH 159/305] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum List of values like the DRM_MODE_SUBCONNECTOR_xx ones are better @@ -131048,10 +131048,10 @@ index df0e3504c349a950bf41540fbcd6cd944cf11d2f..970bfc0d7107451e5bc4e29c524a764c #define DRM_MODE_CONNECTOR_Unknown 0 #define DRM_MODE_CONNECTOR_VGA 1 -From 3cc14c6165143f9086528f14318e496f31ae1370 Mon Sep 17 00:00:00 2001 +From 962e6bdb8b1be8a4315921cf9332956bf12d64b0 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:10 +0100 -Subject: [PATCH 160/269] drm/vc4: Add support for the VEC (Video Encoder) IP +Subject: [PATCH 160/305] drm/vc4: Add support for the VEC (Video Encoder) IP The VEC IP is a TV DAC, providing support for PAL and NTSC standards. @@ -131790,10 +131790,10 @@ index 0000000000000000000000000000000000000000..32bb8ef985fbc6f39f9e5f459846bb77 + }, +}; -From e5719838142ba3ac3e07a6b51bc28706bf66661d Mon Sep 17 00:00:00 2001 +From eb74deaeb4521f2b1d7fc613d3e0d070105a7b62 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 15 Sep 2016 15:25:23 +0100 -Subject: [PATCH 161/269] drm/vc4: Set up SCALER_DISPCTRL at boot. +Subject: [PATCH 161/305] drm/vc4: Set up SCALER_DISPCTRL at boot. We want the HVS on, obviously, and we also want DSP3 (PV1's source) to be muxed from HVS channel 2 like we expect in vc4_crtc.c. The @@ -131853,10 +131853,10 @@ index 39f6886b24100c43b590e47e0c7bc44846721d65..b3b297fba7097bc495fa8916292c5479 * SCALER_DISPSTAT_IRQDISP0. Note that short frame contributions are * always enabled. -From 96cae40ca7cf676d5225c1d2279b3364cd13eb44 Mon Sep 17 00:00:00 2001 +From fcf66b59def66b4581cb4250cdef7aba72fc95c9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 16:17:29 -0800 -Subject: [PATCH 162/269] drm/vc4: Add support for feeding DSI encoders from +Subject: [PATCH 162/305] drm/vc4: Add support for feeding DSI encoders from the pixel valve. We have to set a different pixel format, which tells the hardware to @@ -131971,10 +131971,10 @@ index b3b297fba7097bc495fa8916292c547925720199..385405a2df05eb3dd86d4f687aa82053 # define PV_VCONTROL_VIDEN BIT(0) -From 75985f22a474066700ecc466f480c5fe9d2b1f19 Mon Sep 17 00:00:00 2001 +From be61d1081cf504427a95f53d83e53265820dbf62 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 11:42:32 -0800 -Subject: [PATCH 163/269] drm/vc4: Add DSI driver +Subject: [PATCH 163/305] drm/vc4: Add DSI driver The DSI0 and DSI1 blocks on the 2835 are related hardware blocks. Some registers move around, and the featureset is slightly different, @@ -133802,10 +133802,10 @@ index 0000000000000000000000000000000000000000..17fcac381dbb37cd9a5ff210ad8578f4 + }, +}; -From 762f3576707e21a2ed1bb77a8571468016fb8451 Mon Sep 17 00:00:00 2001 +From 13804e779fbc1d06203fc39ad6dabb432a066991 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:12 +0100 -Subject: [PATCH 164/269] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi +Subject: [PATCH 164/305] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi Add the VEC (Video EnCoder) node definition in bcm283x.dtsi. @@ -133836,10 +133836,10 @@ index 41776b97b4b6b1c053d07fd357fac4ba4787ac53..d3cc586661f903e67a840189c0446aa8 compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>; -From 9cef0c51873c19bb846dd1eeb909bbb6d6706130 Mon Sep 17 00:00:00 2001 +From cb26f4bda3766107ab4005d2f825b584f2151c59 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:13 +0100 -Subject: [PATCH 165/269] ARM: dts: bcm283x: Enable the VEC IP on all +Subject: [PATCH 165/305] ARM: dts: bcm283x: Enable the VEC IP on all RaspberryPi boards Enable the VEC IP on all RaspberryPi boards. @@ -133865,10 +133865,10 @@ index 365648898f3acc4f82dc6cb58e4bbebbe249be94..d4577a51e678cb600b475d3d3395ca4e + status = "okay"; +}; -From 5c15341b00c9ca553477984365cedb69971ec5d2 Mon Sep 17 00:00:00 2001 +From 856ff0b9d52c835e3353edb635518736215844ad Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 23 Jan 2017 11:41:54 -0800 -Subject: [PATCH 166/269] BCM270X: Disable VEC unless vc4-kms-v3d is present. +Subject: [PATCH 166/305] BCM270X: Disable VEC unless vc4-kms-v3d is present. Signed-off-by: Eric Anholt --- @@ -133907,10 +133907,10 @@ index f25cd9a3936861920b0d518ff2d773ee467e2f49..a8ef8c9051668a7477dea30aa262568c cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From daa86e71b7c1e317e960bcce7bea1f251593e4f4 Mon Sep 17 00:00:00 2001 +From 28c80efcf33d7d4e3d4fa5f6a04d55e4407b0b7f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:09:18 -0800 -Subject: [PATCH 167/269] drm/vc4: Name the primary and cursor planes in fkms. +Subject: [PATCH 167/305] drm/vc4: Name the primary and cursor planes in fkms. This makes debugging nicer, compared to trying to remember what the IDs are. @@ -133934,10 +133934,10 @@ index d18a1dae51a2275846c9826b5bf1ba57ae97b55c..e49ce68b607a7ffc2329e3235362f3bc if (type == DRM_PLANE_TYPE_PRIMARY) { vc4_plane->fbinfo = -From db0a0b4de860ec95379ed850ff075fd0bf0eff9c Mon Sep 17 00:00:00 2001 +From 200f3e4c32e944e6a230aa10e70353b0d45c7f46 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:10:09 -0800 -Subject: [PATCH 168/269] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of +Subject: [PATCH 168/305] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of fkms. Trying to debug weston on fkms involved figuring out what calls I was @@ -134007,10 +134007,10 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -From ef91655787d87e1bd96bb59a032e9f5576b5e4ab Mon Sep 17 00:00:00 2001 +From d8855017f57d293c647a1ad869a5e9062154d2f8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Feb 2017 09:42:18 -0800 -Subject: [PATCH 169/269] drm/vc4: Fix sending of page flip completion events +Subject: [PATCH 169/305] drm/vc4: Fix sending of page flip completion events in FKMS mode. In the rewrite of vc4_crtc.c for fkms, I dropped the part of the @@ -134052,10 +134052,10 @@ index dbf065677202fbebf8e3a0cffbe880aa42daef3f..da818a207bfa639b8cea48d94bcf4566 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) -From ef5e5782a94171e684b0507967336e80070c0b96 Mon Sep 17 00:00:00 2001 +From 84a08534bd8014fc24f1cab10010d93c94fc99e2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 8 Feb 2017 15:00:54 -0800 -Subject: [PATCH 170/269] drm/vc4: Fulfill user BO creation requests from the +Subject: [PATCH 170/305] drm/vc4: Fulfill user BO creation requests from the kernel BO cache. The from_cache flag was actually "the BO is invisible to userspace", @@ -134075,7 +134075,7 @@ Signed-off-by: Eric Anholt 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c -index 3f6704cf6608d7be47637c6aa585de087b7f74ee..5ec14f25625dde6fd61e10415092fa25527cc151 100644 +index ec9023bd935b6755b3c2b6a7e171cb269562234c..fd83a28076564b9ea5cf0f2ba29b884ee3c5af43 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -208,21 +208,22 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) @@ -134108,47 +134108,10 @@ index 3f6704cf6608d7be47637c6aa585de087b7f74ee..5ec14f25625dde6fd61e10415092fa25 cma_obj = drm_gem_cma_create(dev, size); -From de9cd3e6a506fbbb3c5e4d29ade8c257cd9e7e5b Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 9 Feb 2017 09:23:34 -0800 -Subject: [PATCH 171/269] drm/vc4: Fix OOPSes from trying to cache a partially - constructed BO. - -If a CMA allocation failed, the partially constructed BO would be -unreferenced through the normal path, and we might choose to put it in -the BO cache. If we then reused it before it expired from the cache, -the kernel would OOPS. - -Signed-off-by: Eric Anholt -Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.") ---- - drivers/gpu/drm/vc4/vc4_bo.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c -index 5ec14f25625dde6fd61e10415092fa25527cc151..fd83a28076564b9ea5cf0f2ba29b884ee3c5af43 100644 ---- a/drivers/gpu/drm/vc4/vc4_bo.c -+++ b/drivers/gpu/drm/vc4/vc4_bo.c -@@ -314,6 +314,14 @@ void vc4_free_object(struct drm_gem_object *gem_bo) - goto out; - } - -+ /* If this object was partially constructed but CMA allocation -+ * had failed, just free it. -+ */ -+ if (!bo->base.vaddr) { -+ vc4_bo_destroy(bo); -+ goto out; -+ } -+ - cache_list = vc4_get_cache_list_for_size(dev, gem_bo->size); - if (!cache_list) { - vc4_bo_destroy(bo); - -From b6685b56027450e43707136f7098150951bada75 Mon Sep 17 00:00:00 2001 +From 981e80f562020ff55d1e5f7a061781883f14c8d6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Oct 2015 08:58:08 -0700 -Subject: [PATCH 172/269] drm/vc4: Verify at boot that CMA doesn't cross a +Subject: [PATCH 171/305] drm/vc4: Verify at boot that CMA doesn't cross a 256MB boundary. I've seen lots of users cranking CMA up higher, so throw an error if @@ -134231,10 +134194,10 @@ index c960459eda7e640ea55be1d4ed80c6a9125a8877..b50245282a18bc790da0f901944c2e67 static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, int align_order) -From 80374437351a33f7d64c01fef4e4bfb1c4c042a3 Mon Sep 17 00:00:00 2001 +From 2faa8f450c99a5a50bb632434ef7eb97e69d882a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 09:47:11 +0000 -Subject: [PATCH 173/269] BCM270X_DT: Add SMSC ethernet controller to DT +Subject: [PATCH 172/305] BCM270X_DT: Add SMSC ethernet controller to DT With an ethernet node in the DT, a suitable firmware can populate the local-mac-address property, removing the need for a downstream patch @@ -134297,10 +134260,10 @@ index d29ba72de727fe26b5a586e0bd0a41181c68ae04..78101849441679baf3624cf67a0ff7a2 / { model = "Raspberry Pi 3 Model B"; -From b0cb31fe043a29bab491cf2dffd206ccf0e0ad9b Mon Sep 17 00:00:00 2001 +From cb30027317dc433201d0e8253e2d43e81ca20fc4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 15:26:13 +0000 -Subject: [PATCH 174/269] brcmfmac: Mute expected startup 'errors' +Subject: [PATCH 173/305] brcmfmac: Mute expected startup 'errors' The brcmfmac WiFi driver always complains about the '00' country code and the firmware version is reported as an error. Modify the driver to @@ -134313,10 +134276,10 @@ Signed-off-by: Phil Elwell 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -index 3fcb1887b2d312e050c02e9fe66ea20f48f0abcb..e2a459f7a2003cb316f29b6dace3ca975f4d7a95 100644 +index 121a697455caba5a9e15145c96c7fb7055dd5ad7..9d63be7b1c9a929880183c453c0444c0213d191a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6804,6 +6804,8 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, +@@ -6806,6 +6806,8 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, /* ignore non-ISO3166 country codes */ for (i = 0; i < sizeof(req->alpha2); i++) if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { @@ -134339,10 +134302,10 @@ index 4051780f64f44a5ce522babe6c371a1beb79a824..b081673abcb4aa72d70d8e0834b608f6 /* locate firmware version number for ethtool */ ptr = strrchr(buf, ' ') + 1; -From 513c64a4d56f1264613dfede5291d4ef3d85c9fe Mon Sep 17 00:00:00 2001 +From 3df6cf5b38fbfe7ba38ea8fc9cd98449c1bbf93f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 175/269] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 174/305] clk-bcm2835: Mark used PLLs and dividers CRITICAL The VPU configures and relies on several PLLs and dividers. Mark all enabled dividers and their PLLs as CRITICAL to prevent the kernel from @@ -134370,10 +134333,10 @@ index 136e5d28f9eaeaa10d45382a0f31da9f4adb91ef..4192863778c8009aacfc9a49ee38ad1c divider->data = data; -From c0f136cc0137125ac2d61bdb82b25fa14cfb414a Mon Sep 17 00:00:00 2001 +From 83b359afff27e394c1026fd97165b005ea946495 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 176/269] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 175/305] clk-bcm2835: Add claim-clocks property The claim-clocks property can be used to prevent PLLs and dividers from being marked as critical. It contains a vector of clock IDs, @@ -134508,52 +134471,10 @@ index 4192863778c8009aacfc9a49ee38ad1ca62a01e4..6b245357e4e93c19a839eee92a82f95a sizeof(cprman_parent_names)); of_clk_parent_fill(dev->of_node, cprman->real_parent_names, -From 2ec24e41fc219ca78b2f308966339b2a6d1f0d68 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Mon, 20 Feb 2017 20:01:16 +0100 -Subject: [PATCH 177/269] dmaengine: bcm2835: Fix cyclic DMA period splitting - -The code responsible for splitting periods into chunks that -can be handled by the DMA controller missed to update total_len, -the number of bytes processed in the current period, when there -are more chunks to follow. - -Therefore total_len was stuck at 0 and the code didn't work at all. -This resulted in a wrong control block layout and audio issues because -the cyclic DMA callback wasn't executing on period boundaries. - -Fix this by adding the missing total_len update. - -Signed-off-by: Matthias Reichl -Signed-off-by: Martin Sperl -Tested-by: Clive Messer -Reviewed-by: Eric Anholt ---- - drivers/dma/bcm2835-dma.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c -index 80d35f760b4a4a51e60c355a84d538bac3892a4d..599c218dc8a73172dd4bd4a058fc8f95a73f982f 100644 ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -253,8 +253,11 @@ static void bcm2835_dma_create_cb_set_length( - */ - - /* have we filled in period_length yet? */ -- if (*total_len + control_block->length < period_len) -+ if (*total_len + control_block->length < period_len) { -+ /* update number of bytes in this period so far */ -+ *total_len += control_block->length; - return; -+ } - - /* calculate the length that remains to reach period_length */ - control_block->length = period_len - *total_len; - -From 28467850c080bc39eb4c2b312000d7d837615b3b Mon Sep 17 00:00:00 2001 +From 643b14e60af0678eddc6897e4b54ef7a34edd837 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Thu, 23 Feb 2017 11:56:20 -0500 -Subject: [PATCH 178/269] Add ads1015 driver to config +Subject: [PATCH 176/305] Add ads1015 driver to config --- arch/arm/configs/bcm2709_defconfig | 3 ++- @@ -134607,10 +134528,10 @@ index 9a9cd1cdcb2f76d4408568681ec80885293bae48..554fed3a4fbfd1940422b808046c6d2b CONFIG_FB=y CONFIG_FB_BCM2708=y -From 6c66d4fba197c6d4fb21b07b08e151a34a0a5981 Mon Sep 17 00:00:00 2001 +From c821b53a38c43cbb2f073a65d2f7c73cebbb53a6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jan 2017 18:49:30 +0000 -Subject: [PATCH 179/269] config: add slcan kernel module +Subject: [PATCH 177/305] config: add slcan kernel module See: https://github.com/raspberrypi/linux/issues/1819 --- @@ -134643,10 +134564,10 @@ index 554fed3a4fbfd1940422b808046c6d2b1f508394..99888182259b280790a7506b248a8130 CONFIG_IRDA=m CONFIG_IRLAN=m -From 47708a39cde7788759726c36b8f70405725577dd Mon Sep 17 00:00:00 2001 +From 2dcddefd1a9f4e0ea3950a321ad6dea3ed10e55a Mon Sep 17 00:00:00 2001 From: Miquel Date: Fri, 24 Feb 2017 20:51:06 +0100 -Subject: [PATCH 180/269] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT +Subject: [PATCH 178/305] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT Signed-off-by: Miquel Blauw --- @@ -134910,10 +134831,10 @@ index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b035 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO-V2"); +MODULE_LICENSE("GPL v2"); -From 569f6ff5c211030fc48f0333ecedf72b4451ff43 Mon Sep 17 00:00:00 2001 +From 584217082ef31c58659ec34278d701d13a9ba863 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 26 Feb 2017 01:13:02 +0000 -Subject: [PATCH 181/269] SQUASH: Add LOCO-V2 overlay from last commit +Subject: [PATCH 179/305] SQUASH: Add LOCO-V2 overlay from last commit --- .../dts/overlays/dionaudio-loco-v2-overlay.dts | 49 ++++++++++++++++++++++ @@ -134976,10 +134897,10 @@ index 0000000000000000000000000000000000000000..a1af93de30119734e8d14cbd454589d3 + }; +}; -From a761535375a9a35f93e747d37faf323ae6801aa9 Mon Sep 17 00:00:00 2001 +From 6805c3cf171d54f9f8b4eca7c3db663f18bb965b Mon Sep 17 00:00:00 2001 From: Fe-Pi Date: Wed, 1 Mar 2017 04:42:43 -0700 -Subject: [PATCH 182/269] Add support for Fe-Pi audio sound card. (#1867) +Subject: [PATCH 180/305] Add support for Fe-Pi audio sound card. (#1867) Fe-Pi Audio Sound Card is based on NXP SGTL5000 codec. Mechanical specification of the board is the same the Raspberry Pi Zero. @@ -135328,10 +135249,10 @@ index 0000000000000000000000000000000000000000..015b56fd73cc36be5b5eecd17548fd03 +MODULE_DESCRIPTION("ASoC Driver for Fe-Pi Audio"); +MODULE_LICENSE("GPL v2"); -From 27f214e9a240c68ebc591e9301aa21a41f63d84f Mon Sep 17 00:00:00 2001 +From aef7d8a7fc676e73d83459fc1ff1c7fc76402655 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Wed, 1 Mar 2017 07:22:24 -0500 -Subject: [PATCH 183/269] Add overlay for ads1115 ADCs (#1864) +Subject: [PATCH 181/305] Add overlay for ads1115 ADCs (#1864) --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -135495,10 +135416,10 @@ index 0000000000000000000000000000000000000000..7c16a1af3172d14e1a976b1776b9f167 + }; +}; -From 04733c82affa7a309018d1eaac371d3c38326f5d Mon Sep 17 00:00:00 2001 +From df072585f8473d9b0742e144b127bf6a1e85e6e0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:06:53 +0000 -Subject: [PATCH 184/269] clk-bcm2835: Correct the prediv logic +Subject: [PATCH 182/305] clk-bcm2835: Correct the prediv logic If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency. @@ -135525,10 +135446,10 @@ index 6b245357e4e93c19a839eee92a82f95aec996e4e..8ea29fbc8dc451b9cff502bc1a918ae6 return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv); } -From 9dd418e3b4eb50ce763bcbcf4953cb8b75c2d14e Mon Sep 17 00:00:00 2001 +From cb0e4cd040fe00a770d3e4cbadf306ec8d3fac8a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 185/269] amba_pl011: Round input clock up +Subject: [PATCH 183/305] amba_pl011: Round input clock up The UART clock is initialised to be as close to the requested frequency as possible without exceeding it. Now that there is a @@ -135614,10 +135535,10 @@ index 5a11ff833e1fd112ba04df3a427cd94bf6793ec5..003a5b0c30295dbbcb94a28d0c64d124 /* unregisters the driver also if no more ports are left */ static void pl011_unregister_port(struct uart_amba_port *uap) -From a4391cb7bb1e9b9ab427ab0d3683a970eee19280 Mon Sep 17 00:00:00 2001 +From f217a9ea1e963946a7775f04225df66c77159a92 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 11:10:50 +0000 -Subject: [PATCH 186/269] BCM2835-V4L2: Ensure H264 header bytes get a sensible +Subject: [PATCH 184/305] BCM2835-V4L2: Ensure H264 header bytes get a sensible timestamp H264 header come off VC with 0 timestamps, which means they get a @@ -135706,10 +135627,10 @@ index e6aeb7e7e381de65d6c6586205069a4c5cd33274..7f8a68916a67001bc9241bce2928519a struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ -From 5334a85c956c34c35462d0dd20704b2e57283342 Mon Sep 17 00:00:00 2001 +From 416b34df498f1234ee53ef9e0d406b1a488bd7ba Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 13:11:41 +0000 -Subject: [PATCH 187/269] BCM2835-V4L2: Correctly denote key frames in encoded +Subject: [PATCH 185/305] BCM2835-V4L2: Correctly denote key frames in encoded data Forward MMAL key frame flags to the V4L2 buffers. @@ -135734,10 +135655,10 @@ index e69731320f4e59249933bc21843913deab4a1209..6bdec0806126044cf7146d53326e4da5 "Buffer has ts %llu", dev->capture.last_timestamp); -From 8f780a7c3e2b50d36405cb523b14cc9433f5dc67 Mon Sep 17 00:00:00 2001 +From e2c61551e762b889a2fa7b7f6bbb00f4b7010774 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Feb 2017 17:01:21 +0000 -Subject: [PATCH 188/269] bcm2835-gpio-exp: Driver for GPIO expander via +Subject: [PATCH 186/305] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Pi3 and Compute Module 3 have a GPIO expander that the @@ -136155,10 +136076,10 @@ index 2859db09e25bb945251e85edb39bc43430857168..56b3f0fe1ea3d22fcf207e6df90b640e /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From 97c97764b0c9f476503170f31d13d710e770b809 Mon Sep 17 00:00:00 2001 +From 5cb2c96847c04bd91b5f00fc181a01bb113a69b3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 May 2016 16:30:05 +0100 -Subject: [PATCH 189/269] BCM270X_DT: Add bcm2708-rpi-0-w.dts +Subject: [PATCH 187/305] BCM270X_DT: Add bcm2708-rpi-0-w.dts Add DT support for the Pi Zero W. N.B. It will not be loaded automatically without a corresponding change to the firmware. @@ -136386,10 +136307,10 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + }; +}; -From 4a49a02337cf20f4e58e331dd280cc11ffca3137 Mon Sep 17 00:00:00 2001 +From 7fe980e2d58314379f52eed2a94b26798a56c069 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Mar 2017 09:06:18 +0000 -Subject: [PATCH 190/269] clk-bcm2835: Read max core clock from firmware +Subject: [PATCH 188/305] clk-bcm2835: Read max core clock from firmware The VPU is responsible for managing the core clock, usually under direction from the bcm2835-cpufreq driver but not via the clk-bcm2835 @@ -136517,10 +136438,10 @@ index 8ea29fbc8dc451b9cff502bc1a918ae65fb1b306..fe3298b54cdfb96bd90fb4f39e13921d for (i = 0; !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks", -From 9212faa329aed60c9bfc0130923a808934400b41 Mon Sep 17 00:00:00 2001 +From e05ae88148273a0877056f1044370b76beb6bbf0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 7 Mar 2017 19:48:23 +0000 -Subject: [PATCH 191/269] config: Add CONFIG_CRYPTO_LZ4 +Subject: [PATCH 189/305] config: Add CONFIG_CRYPTO_LZ4 Enabling this options allows LZ4 memory compression. @@ -136557,10 +136478,10 @@ index 2c124bbfa343bf2c160250d055e1509678a80850..1748fcb84bdc3853ffccba93a41cd2dc # CONFIG_CRYPTO_HW is not set CONFIG_ARM_CRYPTO=y -From 3463f2cc120c004b83ff1aa772cf0c45b21c0afe Mon Sep 17 00:00:00 2001 +From 7616b54824ad6218c1877f31170265b413d49e18 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 23 Feb 2017 17:54:31 -0800 -Subject: [PATCH 192/269] drm/vc4: Don't wait for vblank when updating the +Subject: [PATCH 190/305] drm/vc4: Don't wait for vblank when updating the cursor Commonly used desktop environments such as xfce4 and gnome @@ -136617,10 +136538,10 @@ index 881bf489478b01b34e9e4df6013fe608c42215ee..14d69bb4967dedcd3bbc475639a8c27e * expected change from the drm_mode_cursor_universal() * helper. -From 5afef1347eea10e84cced76f1d0a2b26c6266502 Mon Sep 17 00:00:00 2001 +From 68d1a69d9153d6eb40b799d727846e985f1befab Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 6 Mar 2017 12:17:16 -0800 -Subject: [PATCH 193/269] panel-raspberrypi-touchscreen: Round up clk rate to +Subject: [PATCH 191/305] panel-raspberrypi-touchscreen: Round up clk rate to fix DSI panel. Commit 488f9bc8e3def93e0baef53cee2026c2cb0d8956 slightly increased the @@ -136655,10 +136576,10 @@ index 1a536fe4d040f5fafe324baee110a6225dd0be08..7f315f04b109621ca7f3861fdd8acf95 .hsync_start = HACT + HFP, .hsync_end = HACT + HFP + HSW, -From 573328094f77dd6c6b79ad91e1723ec360b5b673 Mon Sep 17 00:00:00 2001 +From af113d1f3fdd77d4c9a566c3c7cb0309ae84d55b Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 20:04:13 +1100 -Subject: [PATCH 194/269] Add support for the AudioInjector.net Octo sound card +Subject: [PATCH 192/305] Add support for the AudioInjector.net Octo sound card --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -137129,10 +137050,10 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:audioinjector-octo-soundcard"); -From 624cbd152a9dfb1705adf73d59f0a0eada4e9888 Mon Sep 17 00:00:00 2001 +From e73df72f27268ea31feb651e29658918bec48d6e Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 21:13:24 +1100 -Subject: [PATCH 195/269] ASoC: bcm2835_i2s.c: relax the ch2 register setting +Subject: [PATCH 193/305] ASoC: bcm2835_i2s.c: relax the ch2 register setting for 8 channels This patch allows ch2 registers to be set for 8 channels of audio. @@ -137161,10 +137082,10 @@ index 6ba20498202ed36906b52096893a88867a79269f..c8dd065aea8414b47aa2ea4fc04168b5 format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); -From 5f8dbf43641bbdbf6b98838e50035f912ddc6066 Mon Sep 17 00:00:00 2001 +From 3d7b9862a0801953a7415bf5e9e0d5f8c4c93e34 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 10 Mar 2017 14:43:15 +0000 -Subject: [PATCH 196/269] bcm2835-v4l2: Fix buffer overflow problem +Subject: [PATCH 194/305] bcm2835-v4l2: Fix buffer overflow problem https://github.com/raspberrypi/linux/issues/1447 port_parameter_get() failed to account for the header @@ -137200,10 +137121,10 @@ index 781322542d5a8295f3d7d5a3eaaf0cac29930c30..e4b243b33f58913f3d2952c97d2a2e3f * but report true size of parameter */ -From fa4d8eb488f238a4176a01283151c657254ae0af Mon Sep 17 00:00:00 2001 +From 426c15ce256ad778da9f3a36d2be290a9a0a5695 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 10 Feb 2017 17:57:08 -0800 -Subject: [PATCH 197/269] build/arm64: Add rules for .dtbo files for dts +Subject: [PATCH 195/305] build/arm64: Add rules for .dtbo files for dts overlays We now create overlays as .dtbo files. @@ -137228,10 +137149,10 @@ index 3635b8662724569d3338ebb620d603c644fe38b7..822fefeb1cd0aa2dc8398f885cf28e9b dtbs: prepare scripts -From 898f4c920f2b1051fce8884a886bc44e49ced7e3 Mon Sep 17 00:00:00 2001 +From 4a4c86b50de77f7b28f18e6444909f96d088665b Mon Sep 17 00:00:00 2001 From: John Greb Date: Wed, 8 Mar 2017 15:12:29 +0000 -Subject: [PATCH 198/269] Match dwc2 device-tree fifo sizes to the hardware +Subject: [PATCH 196/305] Match dwc2 device-tree fifo sizes to the hardware values. Since commit aa381a7259c3f53727bcaa8c5f9359e940a0e3fd was reverted with 3fa9538539ac737096c81f3315a14670b1609092 the g-tx-fifo-size array in the device-tree needs to match the preset values in the bcm2835. @@ -137262,10 +137183,10 @@ index 527abc9f0ddf71f4dc7d58336d87684c931cc2f3..265a16bab008453edba198cf2366c423 }; }; -From a431769232a1185b995d57027f9d2a6b5731690e Mon Sep 17 00:00:00 2001 +From ba5c638de5b564e20839d4b7123f1c3f2540c514 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 5 Mar 2017 11:46:41 +0000 -Subject: [PATCH 199/269] config: Add RTL8XXXU wifi module +Subject: [PATCH 197/305] config: Add RTL8XXXU wifi module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -137297,10 +137218,45 @@ index bf52db66afb2aa18d6f6f9fb9b64dcbd97e24521..4bc0f8b52b7f39f99d650cb9c4cdfdba CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From 1129ad96ef886cbbb908887f4e08fe68926c3b64 Mon Sep 17 00:00:00 2001 +From 0d2c22a40c0f1aad1e9e4e9b0ac2d6bd38cdddde Mon Sep 17 00:00:00 2001 +From: "K. Y. Srinivasan" +Date: Thu, 22 Dec 2016 16:54:00 -0800 +Subject: [PATCH 198/305] Drivers: hv: vmbus: Fix a rescind handling bug + +commit ccb61f8a99e6c29df4fb96a65dad4fad740d5be9 upstream. + +The host can rescind a channel that has been offered to the +guest and once the channel is rescinded, the host does not +respond to any requests on that channel. Deal with the case where +the guest may be blocked waiting for a response from the host. + +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hv/channel.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c +index 1606e7f08f4b36750be747feb5d0e9f36b3e6dd0..9aff4f6f5423a3b03fa834d4f69d4bb5cbc07a07 100644 +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -506,6 +506,11 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) + + wait_for_completion(&info->waitevent); + ++ if (channel->rescind) { ++ ret = -ENODEV; ++ goto post_msg_err; ++ } ++ + post_msg_err: + /* + * If the channel has been rescinded; + +From 737b88e528fe661f4dfe3d00601b43f2dfd6529c Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Mar 2017 12:18:20 +0000 -Subject: [PATCH 200/269] BCM270X_DT: Invert Pi3 power LED to match fw change +Subject: [PATCH 199/305] BCM270X_DT: Invert Pi3 power LED to match fw change Firmware expgpio driver reworked due to complaint over hotplug detect. @@ -137326,10 +137282,10 @@ index 173103aaca503833b5e29530ed94e14c7cab0444..b21d2866d204adc533b46d581028f290 }; -From 327873c238d5f0f023e56597026339ba1ac32c18 Mon Sep 17 00:00:00 2001 +From 0abf8fa2a75023c07aabcbcfbbd4344c713f72ad Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Mar 2017 09:10:05 +0000 -Subject: [PATCH 201/269] BCM270X_DT: Add lm75 to i2c-sensor overlay +Subject: [PATCH 200/305] BCM270X_DT: Add lm75 to i2c-sensor overlay See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=177236 @@ -137392,10 +137348,10 @@ index 31bda8da4cb6a56bfe493a81b918900995fb0589..606b2d5012abf2e85712be631c42ea40 }; }; -From 8f06ec5e33e3464eabfca97c08dcaa838ae0d6de Mon Sep 17 00:00:00 2001 +From cb52d99f26a108454d8a27e1676ab136903bbc96 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Mar 2017 14:23:06 +0000 -Subject: [PATCH 202/269] bcm2835-gpio-exp: Copy/paste error adding base twice +Subject: [PATCH 201/305] bcm2835-gpio-exp: Copy/paste error adding base twice brcmexp_gpio_set was adding gpio->gc.base to the offset twice, so passing an invalid number to the mailbox service. @@ -137421,10 +137377,10 @@ index 681a91492d4c33bdfd42416e069218e8611cc4d9..d68adafaee4ad406f45f4ff0d6b7c1ad set.state = val; /* Output state */ -From fc57975bd64ad13252abdaa2741dba5387f67cb9 Mon Sep 17 00:00:00 2001 +From 5ef66bea064dda3dd226d0f193adbf64b9aadb06 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Mar 2017 11:12:40 +0000 -Subject: [PATCH 203/269] bcm2835-camera: Correct port_parameter_get return +Subject: [PATCH 202/305] bcm2835-camera: Correct port_parameter_get return value The API for port_parameter_get() requires that the @@ -137482,10 +137438,10 @@ index e4b243b33f58913f3d2952c97d2a2e3fbbbd0ae8..ec2853ba9d4b1b0cd6e07a495a424e15 pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, ret, port->component->handle, port->handle, parameter_id); -From 4bed6cdea45f3ae764c67ad7660e7ca54675c45d Mon Sep 17 00:00:00 2001 +From 5139a8a841f16e731bc22509d3d791dda532c919 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Mar 2017 12:24:41 +0000 -Subject: [PATCH 204/269] config: Make spidev a loadable module +Subject: [PATCH 203/305] config: Make spidev a loadable module spidev isn't required early in the boot process, and not all users need it (spi_bcm2835 is a module), so make it a loadable module. @@ -137541,10 +137497,10 @@ index 4bc0f8b52b7f39f99d650cb9c4cdfdba6fac59dd..8d64ce4465f6f276b2d58ed1e2e45fb0 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From 29ab3cd7b0f4c536cdee960a22fa7eacde342412 Mon Sep 17 00:00:00 2001 +From 03494fc360604e1f3f5ca7476352130e41aa9544 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 10:06:56 +0000 -Subject: [PATCH 205/269] ASoC: Add prompt for ICS43432 codec +Subject: [PATCH 204/305] ASoC: Add prompt for ICS43432 codec Without a prompt string, a config setting can't be included in a defconfig. Give CONFIG_SND_SOC_ICS43432 a prompt so that Pi soundcards @@ -137569,10 +137525,10 @@ index 9824cdd04b0c11c45b8cedd0187a0eba8f1dc2d4..c0b88d43df0de283c58ed6158680bc7e config SND_SOC_INNO_RK3036 tristate "Inno codec driver for RK3036 SoC" -From e453f0cd398e6efe9d34b885ec58ce1ca413af3a Mon Sep 17 00:00:00 2001 +From e1a615810770a4302c1d6822513e105d1990e3a4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 16:34:46 +0000 -Subject: [PATCH 206/269] bcm2835-aux: Add aux interrupt controller +Subject: [PATCH 205/305] bcm2835-aux: Add aux interrupt controller The AUX block has a shared interrupt line with a register indicating which devices have active IRQs. Expose this as a nested interrupt @@ -137736,10 +137692,10 @@ index bd750cf2238d61489811e7d7bd3b5f9950ed53c8..41e0702fae4692221980b0d02aed1ba6 BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); if (!onecell) -From 4b0a5af47900cc059c0685a4269e3f17d35a6d17 Mon Sep 17 00:00:00 2001 +From 35bf986c59fa5a714229b3e10b21fd3df0af3fce Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 17:08:44 +0000 -Subject: [PATCH 207/269] BCM270X_DT: Enable AUX interrupt controller in DT +Subject: [PATCH 206/305] BCM270X_DT: Enable AUX interrupt controller in DT See: https://github.com/raspberrypi/linux/issues/1484 https://github.com/raspberrypi/linux/issues/1573 @@ -137792,10 +137748,10 @@ index d3cc586661f903e67a840189c0446aa80e16a44e..348c71bbc913644c04bab43fcb95abe9 #address-cells = <1>; #size-cells = <0>; -From 5f68e7371778455f08e928b4d56971ca7f13f1b9 Mon Sep 17 00:00:00 2001 +From 1be561d6ed7d683395d1a7b8562412ccecc607d6 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 27 Mar 2017 22:26:49 +1100 -Subject: [PATCH 208/269] Audioinjector addons dts : add reset and regulators +Subject: [PATCH 207/305] Audioinjector addons dts : add reset and regulators for the Octo product. This patch adds a reset GPIO for the AudioInjector.net octo sound card. @@ -137862,10 +137818,10 @@ index dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c..a36fa85a61f7eaab35ca481ed1dac621 codec = <&cs42448>; status = "okay"; -From d81f6a1d789f57d1c36b91258c08a69f4eeb0815 Mon Sep 17 00:00:00 2001 +From eb5841fb52cdcecf0279a77286b87cb085248950 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 27 Mar 2017 22:27:26 +1100 -Subject: [PATCH 209/269] AudioInjector Octo : Consolidate sample rates and add +Subject: [PATCH 208/305] AudioInjector Octo : Consolidate sample rates and add a codec reset. This patch consolidates the sample rates which the audioinjector.net octo @@ -138005,10 +137961,10 @@ index 9effea725798640887755dfa688da45338718afc..1198c36c4563b8673e5d386d1dfa92d4 dai->cpu_dai_name = NULL; dai->cpu_of_node = i2s_node; -From b447153a8938ff4f13c114075abbbcc788ecb5bd Mon Sep 17 00:00:00 2001 +From f43535f3ff57ef1215a83b4fd2a229eeb78a7ef7 Mon Sep 17 00:00:00 2001 From: Peter Malkin Date: Mon, 27 Mar 2017 16:38:21 -0700 -Subject: [PATCH 210/269] Driver support for Google voiceHAT soundcard. +Subject: [PATCH 209/305] Driver support for Google voiceHAT soundcard. --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -138513,10 +138469,10 @@ index 0000000000000000000000000000000000000000..225854b8e5298b3c3018f59a49404354 +MODULE_DESCRIPTION("ASoC Driver for Google voiceHAT SoundCard"); +MODULE_LICENSE("GPL v2"); -From 4c8836c546f27ecdc18e88a8d833dc371041d1ed Mon Sep 17 00:00:00 2001 +From 6a70ae83c1f7155eafa39a6a43ccdeba395cb279 Mon Sep 17 00:00:00 2001 From: Raashid Muhammed Date: Mon, 27 Mar 2017 12:35:00 +0530 -Subject: [PATCH 211/269] Add support for Allo Piano DAC 2.1 plus add-on board +Subject: [PATCH 210/305] Add support for Allo Piano DAC 2.1 plus add-on board for Raspberry Pi. The Piano DAC 2.1 has support for 4 channels with subwoofer. @@ -139144,10 +139100,10 @@ index 0000000000000000000000000000000000000000..f66f42abadbd5f9d3fe000676e8297ed +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC Plus"); +MODULE_LICENSE("GPL v2"); -From d16f9d078175353c6da66595257a53021eb29969 Mon Sep 17 00:00:00 2001 +From 6ae7ba918062a63b4bff76642ce92bb0a61ed05f Mon Sep 17 00:00:00 2001 From: BabuSubashChandar Date: Tue, 28 Mar 2017 20:04:42 +0530 -Subject: [PATCH 212/269] Add support for Allo Boss DAC add-on board for +Subject: [PATCH 211/305] Add support for Allo Boss DAC add-on board for Raspberry Pi. (#1924) Signed-off-by: Baswaraj K @@ -139877,10 +139833,10 @@ index 0000000000000000000000000000000000000000..c080e31065d99ab309ab3bdf41a44adf +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Boss DAC"); +MODULE_LICENSE("GPL v2"); -From 5ef08bf183f85e2dbcaa7ca98f5ce752fd0c89fe Mon Sep 17 00:00:00 2001 +From 6f2d186685ef919d85c96cf60dc7113c6775dfaf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 28 Mar 2017 14:22:20 +0100 -Subject: [PATCH 213/269] BCM270X_DT: Allow multiple instances of w1-gpio +Subject: [PATCH 212/305] BCM270X_DT: Allow multiple instances of w1-gpio overlays Upcoming firmware will modify the address portion of node names when @@ -139945,10 +139901,10 @@ index 66a98f6c9601f51483f27803995bec772bb3350e..ef8bfbcabdb31231075d5c281df3b38b <&w1_pins>,"brcm,pins:4"; pullup = <&w1>,"rpi,parasitic-power:0"; -From 6cdb836ec8164ce463556fe15cad56d7b34f348f Mon Sep 17 00:00:00 2001 +From fc53af74e1b532b18015f7bf9c433087071deef3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 28 Mar 2017 17:41:30 +0100 -Subject: [PATCH 214/269] leds-gpio: Remove stray assignment to brightness_set +Subject: [PATCH 213/305] leds-gpio: Remove stray assignment to brightness_set The brightness_set method is intended for use cases that must not block, and can only be used if the GPIO provider can never sleep. @@ -139974,10 +139930,10 @@ index 6a27a693034825de2897bb7b338b60cc10c9e59f..a6b352cb003ff5e6c87cf6d37d6502b6 if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP) { state = gpiod_get_value_cansleep(led_dat->gpiod); -From 60158a9060ede8284904061f1954eee844d18792 Mon Sep 17 00:00:00 2001 +From 0645d60391fabe63a2576f257c39bdbd0e53201b Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Thu, 30 Mar 2017 11:43:57 +1100 -Subject: [PATCH 215/269] Audioinjector Octo : add extra sample rates, fix rst +Subject: [PATCH 214/305] Audioinjector Octo : add extra sample rates, fix rst and use bcm270x regs This patch adds new sample rates to the Audioinjector Octo sound card. The @@ -140139,10 +140095,10 @@ index 1198c36c4563b8673e5d386d1dfa92d43689e297..dcf403ab37639ba79e38278d7e4b1ade if (i2s_node && codec_node) { dai->cpu_dai_name = NULL; -From cd3fd500ae9e4e4a84d8a7228c7b13e1fb8eb0dc Mon Sep 17 00:00:00 2001 +From 7b2d01b2bd1a33617451cf291ef5b44fbfdf41b8 Mon Sep 17 00:00:00 2001 From: BabuSubashChandar C Date: Thu, 30 Mar 2017 20:17:27 +0530 -Subject: [PATCH 216/269] Add support for new clock rate and mute gpios. +Subject: [PATCH 215/305] Add support for new clock rate and mute gpios. Signed-off-by: Baswaraj K Reviewed-by: Deepak @@ -140795,10 +140751,10 @@ index c080e31065d99ab309ab3bdf41a44adfdd8f8039..203ab76c7045b081578e23bda1099dd1 } -From 05f49e701939bcdc7e6c94926c564e319499fa14 Mon Sep 17 00:00:00 2001 +From cfa12863b7ea4d5ad82a0a551f42a9e8aa14a96c Mon Sep 17 00:00:00 2001 From: BabuSubashChandar Date: Sat, 1 Apr 2017 00:46:52 +0530 -Subject: [PATCH 217/269] Add clock changes and mute gpios (#1938) +Subject: [PATCH 216/305] Add clock changes and mute gpios (#1938) Also improve code style and adhere to ALSA coding conventions. @@ -141491,10 +141447,10 @@ index f66f42abadbd5f9d3fe000676e8297ed91630e47..56e43f98846b41e487b3089813f7edc3 } -From 683456e9671d1b32c57b5169e47999f380471a1c Mon Sep 17 00:00:00 2001 +From eb23d4530014d2c301397098d09b614ad90d81d9 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Tue, 4 Apr 2017 19:20:59 +1000 -Subject: [PATCH 218/269] Audioinjector : make the octo and pi sound cards have +Subject: [PATCH 217/305] Audioinjector : make the octo and pi sound cards have different driver names This patch gives the audioinjector octo and pi soundcards different driver @@ -141531,10 +141487,10 @@ index ef54e0f07ea03f59e9957b5d98f3e7fdc998e469..491906bbf446826e55dd843f28e4860f .of_match_table = audioinjector_pi_soundcard_of_match, }, -From bcecdbafb8a1e3129c0a3b839d44e77dc8a103ab Mon Sep 17 00:00:00 2001 +From 3ebed4e5ae9d4e4e01df37c4b4757ad7ec556782 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Tue, 4 Apr 2017 19:23:04 +1000 -Subject: [PATCH 219/269] Audioinjector octo : Make the playback and capture +Subject: [PATCH 218/305] Audioinjector octo : Make the playback and capture symmetric This patch ensures that the sample rate and channel count of the audioinjector @@ -141557,1382 +141513,10 @@ index 49115c8e20ce1a2ba5a99feb8983a1cafb052ca2..5e79f4eff93a21ed3495c77a90f73525 }; -From d03c6c96e186c92359d791d33515af4bdf39dc11 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 7 Mar 2017 14:51:03 -0800 -Subject: [PATCH 220/269] drm/vc4: Allow using more than 256MB of CMA memory. - -Until now, we've had to limit Raspberry Pi to 256MB of CMA memory to -keep from triggering the hardware addressing bug between of the tile -binner of the tile alloc memory (where the top 4 bits come from the -tile state data array's address). - -To work around that and allow more memory to be reserved for graphics, -allocate a single BO to store tile state data arrays and tile -alloc/overflow memory while the GPU is active, and make sure that that -one BO doesn't happen to cross a 256MB boundary. With that in place, -we can allocate textures and shaders anywhere in system memory (still -contiguous, of course). - -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_drv.h | 28 +++++-- - drivers/gpu/drm/vc4/vc4_gem.c | 12 ++- - drivers/gpu/drm/vc4/vc4_irq.c | 61 +++++++-------- - drivers/gpu/drm/vc4/vc4_render_cl.c | 3 +- - drivers/gpu/drm/vc4/vc4_v3d.c | 150 ++++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_validate.c | 54 ++++++------- - 6 files changed, 234 insertions(+), 74 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 44a8e6fda2b576fed63d93ef34e076cebf90d64c..9e50bc25b2be71079d52a861c25f3fe7c4db0830 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -97,12 +97,23 @@ struct vc4_dev { - */ - struct list_head seqno_cb_list; - -- /* The binner overflow memory that's currently set up in -- * BPOA/BPOS registers. When overflow occurs and a new one is -- * allocated, the previous one will be moved to -- * vc4->current_exec's free list. -+ /* The memory used for storing binner tile alloc, tile state, -+ * and overflow memory allocations. This is freed when V3D -+ * powers down. - */ -- struct vc4_bo *overflow_mem; -+ struct vc4_bo *bin_bo; -+ -+ /* Size of blocks allocated within bin_bo. */ -+ uint32_t bin_alloc_size; -+ -+ /* Bitmask of the bin_alloc_size chunks in bin_bo that are -+ * used. -+ */ -+ uint32_t bin_alloc_used; -+ -+ /* Bitmask of the current bin_alloc used for overflow memory. */ -+ uint32_t bin_alloc_overflow; -+ - struct work_struct overflow_mem_work; - - int power_refcount; -@@ -295,8 +306,12 @@ struct vc4_exec_info { - bool found_increment_semaphore_packet; - bool found_flush; - uint8_t bin_tiles_x, bin_tiles_y; -- struct drm_gem_cma_object *tile_bo; -+ /* Physical address of the start of the tile alloc array -+ * (where each tile's binned CL will start) -+ */ - uint32_t tile_alloc_offset; -+ /* Bitmask of which binner slots are freed when this job completes. */ -+ uint32_t bin_slots; - - /** - * Computed addresses pointing into exec_bo where we start the -@@ -531,6 +546,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, - extern struct platform_driver vc4_v3d_driver; - int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused); - int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused); -+int vc4_v3d_get_bin_slot(struct vc4_dev *vc4); - - /* vc4_validate.c */ - int -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index ab3016982466c3ca35ba479050ee107d26eb50ac..a5029ab49068bdbd69411cccbdb6f5111f387e38 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -695,6 +695,7 @@ static void - vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) - { - struct vc4_dev *vc4 = to_vc4_dev(dev); -+ unsigned long irqflags; - unsigned i; - - if (exec->bo) { -@@ -710,6 +711,11 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) - drm_gem_object_unreference_unlocked(&bo->base.base); - } - -+ /* Free up the allocation of any bin slots we used. */ -+ spin_lock_irqsave(&vc4->job_lock, irqflags); -+ vc4->bin_alloc_used &= ~exec->bin_slots; -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); -+ - mutex_lock(&vc4->power_lock); - if (--vc4->power_refcount == 0) { - pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -@@ -951,9 +957,9 @@ vc4_gem_destroy(struct drm_device *dev) - /* V3D should already have disabled its interrupt and cleared - * the overflow allocation registers. Now free the object. - */ -- if (vc4->overflow_mem) { -- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); -- vc4->overflow_mem = NULL; -+ if (vc4->bin_bo) { -+ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); -+ vc4->bin_bo = NULL; - } - - if (vc4->hang_state) -diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c -index 094bc6a475c1773923dfe8225cba9886fc9e5026..c43ee1e646f6dd68fe19dacdbcf9322da13c4280 100644 ---- a/drivers/gpu/drm/vc4/vc4_irq.c -+++ b/drivers/gpu/drm/vc4/vc4_irq.c -@@ -58,50 +58,45 @@ vc4_overflow_mem_work(struct work_struct *work) - { - struct vc4_dev *vc4 = - container_of(work, struct vc4_dev, overflow_mem_work); -- struct drm_device *dev = vc4->dev; -- struct vc4_bo *bo; -+ struct vc4_bo *bo = vc4->bin_bo; -+ int bin_bo_slot; -+ struct vc4_exec_info *exec; -+ unsigned long irqflags; - -- bo = vc4_bo_create(dev, 256 * 1024, true); -- if (IS_ERR(bo)) { -+ bin_bo_slot = vc4_v3d_get_bin_slot(vc4); -+ if (bin_bo_slot < 0) { - DRM_ERROR("Couldn't allocate binner overflow mem\n"); - return; - } - -- /* If there's a job executing currently, then our previous -- * overflow allocation is getting used in that job and we need -- * to queue it to be released when the job is done. But if no -- * job is executing at all, then we can free the old overflow -- * object direcctly. -- * -- * No lock necessary for this pointer since we're the only -- * ones that update the pointer, and our workqueue won't -- * reenter. -- */ -- if (vc4->overflow_mem) { -- struct vc4_exec_info *current_exec; -- unsigned long irqflags; -- -- spin_lock_irqsave(&vc4->job_lock, irqflags); -- current_exec = vc4_first_bin_job(vc4); -- if (!current_exec) -- current_exec = vc4_last_render_job(vc4); -- if (current_exec) { -- vc4->overflow_mem->seqno = current_exec->seqno; -- list_add_tail(&vc4->overflow_mem->unref_head, -- ¤t_exec->unref_list); -- vc4->overflow_mem = NULL; -+ spin_lock_irqsave(&vc4->job_lock, irqflags); -+ -+ if (vc4->bin_alloc_overflow) { -+ /* If we had overflow memory allocated previously, -+ * then that chunk will free when the current bin job -+ * is done. If we don't have a bin job running, then -+ * the chunk will be done whenever the list of render -+ * jobs has drained. -+ */ -+ exec = vc4_first_bin_job(vc4); -+ if (!exec) -+ exec = vc4_last_render_job(vc4); -+ if (exec) { -+ exec->bin_slots |= vc4->bin_alloc_overflow; -+ } else { -+ /* There's nothing queued in the hardware, so -+ * the old slot is free immediately. -+ */ -+ vc4->bin_alloc_used &= ~vc4->bin_alloc_overflow; - } -- spin_unlock_irqrestore(&vc4->job_lock, irqflags); - } -+ vc4->bin_alloc_overflow = BIT(bin_bo_slot); - -- if (vc4->overflow_mem) -- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); -- vc4->overflow_mem = bo; -- -- V3D_WRITE(V3D_BPOA, bo->base.paddr); -+ V3D_WRITE(V3D_BPOA, bo->base.paddr + bin_bo_slot * vc4->bin_alloc_size); - V3D_WRITE(V3D_BPOS, bo->base.base.size); - V3D_WRITE(V3D_INTCTL, V3D_INT_OUTOMEM); - V3D_WRITE(V3D_INTENA, V3D_INT_OUTOMEM); -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); - } - - static void -diff --git a/drivers/gpu/drm/vc4/vc4_render_cl.c b/drivers/gpu/drm/vc4/vc4_render_cl.c -index 5cdd003605f57c99faf31832e3f3dd38a75b7402..6face6aa0890b59bc91d3740fa063a5c46f7cc21 100644 ---- a/drivers/gpu/drm/vc4/vc4_render_cl.c -+++ b/drivers/gpu/drm/vc4/vc4_render_cl.c -@@ -178,8 +178,7 @@ static void emit_tile(struct vc4_exec_info *exec, - - if (has_bin) { - rcl_u8(setup, VC4_PACKET_BRANCH_TO_SUB_LIST); -- rcl_u32(setup, (exec->tile_bo->paddr + -- exec->tile_alloc_offset + -+ rcl_u32(setup, (exec->tile_alloc_offset + - (y * exec->bin_tiles_x + x) * 32)); - } - -diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c -index 1d9e5a6edd22c29ce8b2990c9c35627aa1af2bd8..da79d8511dfb4f631fd3ad4c3680b312f44bd454 100644 ---- a/drivers/gpu/drm/vc4/vc4_v3d.c -+++ b/drivers/gpu/drm/vc4/vc4_v3d.c -@@ -159,6 +159,144 @@ static void vc4_v3d_init_hw(struct drm_device *dev) - V3D_WRITE(V3D_VPMBASE, 0); - } - -+int vc4_v3d_get_bin_slot(struct vc4_dev *vc4) -+{ -+ struct drm_device *dev = vc4->dev; -+ unsigned long irqflags; -+ int slot; -+ uint64_t seqno = 0; -+ struct vc4_exec_info *exec; -+ -+try_again: -+ spin_lock_irqsave(&vc4->job_lock, irqflags); -+ slot = ffs(~vc4->bin_alloc_used); -+ if (slot != 0) { -+ /* Switch from ffs() bit index to a 0-based index. */ -+ slot--; -+ vc4->bin_alloc_used |= BIT(slot); -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); -+ return slot; -+ } -+ -+ /* Couldn't find an open slot. Wait for render to complete -+ * and try again. -+ */ -+ exec = vc4_last_render_job(vc4); -+ if (exec) -+ seqno = exec->seqno; -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); -+ -+ if (seqno) { -+ int ret = vc4_wait_for_seqno(dev, seqno, ~0ull, true); -+ -+ if (ret == 0) -+ goto try_again; -+ -+ return ret; -+ } -+ -+ return -ENOMEM; -+} -+ -+/** -+ * vc4_allocate_bin_bo() - allocates the memory that will be used for -+ * tile binning. -+ * -+ * The binner has a limitation that the addresses in the tile state -+ * buffer that point into the tile alloc buffer or binner overflow -+ * memory only have 28 bits (256MB), and the top 4 on the bus for -+ * tile alloc references end up coming from the tile state buffer's -+ * address. -+ * -+ * To work around this, we allocate a single large buffer while V3D is -+ * in use, make sure that it has the top 4 bits constant across its -+ * entire extent, and then put the tile state, tile alloc, and binner -+ * overflow memory inside that buffer. -+ * -+ * This creates a limitation where we may not be able to execute a job -+ * if it doesn't fit within the buffer that we allocated up front. -+ * However, it turns out that 16MB is "enough for anybody", and -+ * real-world applications run into allocation failures from the -+ * overall CMA pool before they make scenes complicated enough to run -+ * out of bin space. -+ */ -+int -+vc4_allocate_bin_bo(struct drm_device *drm) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ struct vc4_v3d *v3d = vc4->v3d; -+ uint32_t size = 16 * 1024 * 1024; -+ int ret = 0; -+ struct list_head list; -+ -+ /* We may need to try allocating more than once to get a BO -+ * that doesn't cross 256MB. Track the ones we've allocated -+ * that failed so far, so that we can free them when we've got -+ * one that succeeded (if we freed them right away, our next -+ * allocation would probably be the same chunk of memory). -+ */ -+ INIT_LIST_HEAD(&list); -+ -+ while (true) { -+ struct vc4_bo *bo = vc4_bo_create(drm, size, true); -+ -+ if (IS_ERR(bo)) { -+ ret = PTR_ERR(bo); -+ -+ dev_err(&v3d->pdev->dev, -+ "Failed to allocate memory for tile binning: " -+ "%d. You may need to enable CMA or give it " -+ "more memory.", -+ ret); -+ break; -+ } -+ -+ /* Check if this BO won't trigger the addressing bug. */ -+ if ((bo->base.paddr & 0xf0000000) == -+ ((bo->base.paddr + bo->base.base.size - 1) & 0xf0000000)) { -+ vc4->bin_bo = bo; -+ -+ /* Set up for allocating 512KB chunks of -+ * binner memory. The biggest allocation we -+ * need to do is for the initial tile alloc + -+ * tile state buffer. We can render to a -+ * maximum of ((2048*2048) / (32*32) = 4096 -+ * tiles in a frame (until we do floating -+ * point rendering, at which point it would be -+ * 8192). Tile state is 48b/tile (rounded to -+ * a page), and tile alloc is 32b/tile -+ * (rounded to a page), plus a page of extra, -+ * for a total of 320kb for our worst-case. -+ * We choose 512kb so that it divides evenly -+ * into our 16MB, and the rest of the 512kb -+ * will be used as storage for the overflow -+ * from the initial 32b CL per bin. -+ */ -+ vc4->bin_alloc_size = 512 * 1024; -+ vc4->bin_alloc_used = 0; -+ vc4->bin_alloc_overflow = 0; -+ WARN_ON_ONCE(sizeof(vc4->bin_alloc_used) * 8 != -+ bo->base.base.size / vc4->bin_alloc_size); -+ -+ break; -+ } -+ -+ /* Put it on the list to free later, and try again. */ -+ list_add(&bo->unref_head, &list); -+ } -+ -+ /* Free all the BOs we allocated but didn't choose. */ -+ while (!list_empty(&list)) { -+ struct vc4_bo *bo = list_last_entry(&list, -+ struct vc4_bo, unref_head); -+ -+ list_del(&bo->unref_head); -+ drm_gem_object_unreference_unlocked(&bo->base.base); -+ } -+ -+ return ret; -+} -+ - #ifdef CONFIG_PM - static int vc4_v3d_runtime_suspend(struct device *dev) - { -@@ -167,6 +305,9 @@ static int vc4_v3d_runtime_suspend(struct device *dev) - - vc4_irq_uninstall(vc4->dev); - -+ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); -+ vc4->bin_bo = NULL; -+ - return 0; - } - -@@ -174,6 +315,11 @@ static int vc4_v3d_runtime_resume(struct device *dev) - { - struct vc4_v3d *v3d = dev_get_drvdata(dev); - struct vc4_dev *vc4 = v3d->vc4; -+ int ret; -+ -+ ret = vc4_allocate_bin_bo(vc4->dev); -+ if (ret) -+ return ret; - - vc4_v3d_init_hw(vc4->dev); - vc4_irq_postinstall(vc4->dev); -@@ -226,6 +372,10 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) - return -EINVAL; - } - -+ ret = vc4_allocate_bin_bo(drm); -+ if (ret) -+ return ret; -+ - /* Reset the binner overflow address/size at setup, to be sure - * we don't reuse an old one. - */ -diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c -index 9fd171c361c23b52a4d507919ec7e26fd1e87aac..59d808e2a6cc6f3173b1309cc4f491098886cf36 100644 ---- a/drivers/gpu/drm/vc4/vc4_validate.c -+++ b/drivers/gpu/drm/vc4/vc4_validate.c -@@ -340,10 +340,11 @@ static int - validate_tile_binning_config(VALIDATE_ARGS) - { - struct drm_device *dev = exec->exec_bo->base.dev; -- struct vc4_bo *tile_bo; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - uint8_t flags; -- uint32_t tile_state_size, tile_alloc_size; -- uint32_t tile_count; -+ uint32_t tile_state_size; -+ uint32_t tile_count, bin_addr; -+ int bin_slot; - - if (exec->found_tile_binning_mode_config_packet) { - DRM_ERROR("Duplicate VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); -@@ -369,13 +370,28 @@ validate_tile_binning_config(VALIDATE_ARGS) - return -EINVAL; - } - -+ bin_slot = vc4_v3d_get_bin_slot(vc4); -+ if (bin_slot < 0) { -+ if (bin_slot != -EINTR && bin_slot != -ERESTARTSYS) { -+ DRM_ERROR("Failed to allocate binner memory: %d\n", -+ bin_slot); -+ } -+ return bin_slot; -+ } -+ -+ /* The slot we allocated will only be used by this job, and is -+ * free when the job completes rendering. -+ */ -+ exec->bin_slots |= BIT(bin_slot); -+ bin_addr = vc4->bin_bo->base.paddr + bin_slot * vc4->bin_alloc_size; -+ - /* The tile state data array is 48 bytes per tile, and we put it at - * the start of a BO containing both it and the tile alloc. - */ - tile_state_size = 48 * tile_count; - - /* Since the tile alloc array will follow us, align. */ -- exec->tile_alloc_offset = roundup(tile_state_size, 4096); -+ exec->tile_alloc_offset = bin_addr + roundup(tile_state_size, 4096); - - *(uint8_t *)(validated + 14) = - ((flags & ~(VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_MASK | -@@ -386,35 +402,13 @@ validate_tile_binning_config(VALIDATE_ARGS) - VC4_SET_FIELD(VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_128, - VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE)); - -- /* Initial block size. */ -- tile_alloc_size = 32 * tile_count; -- -- /* -- * The initial allocation gets rounded to the next 256 bytes before -- * the hardware starts fulfilling further allocations. -- */ -- tile_alloc_size = roundup(tile_alloc_size, 256); -- -- /* Add space for the extra allocations. This is what gets used first, -- * before overflow memory. It must have at least 4096 bytes, but we -- * want to avoid overflow memory usage if possible. -- */ -- tile_alloc_size += 1024 * 1024; -- -- tile_bo = vc4_bo_create(dev, exec->tile_alloc_offset + tile_alloc_size, -- true); -- exec->tile_bo = &tile_bo->base; -- if (IS_ERR(exec->tile_bo)) -- return PTR_ERR(exec->tile_bo); -- list_add_tail(&tile_bo->unref_head, &exec->unref_list); -- - /* tile alloc address. */ -- *(uint32_t *)(validated + 0) = (exec->tile_bo->paddr + -- exec->tile_alloc_offset); -+ *(uint32_t *)(validated + 0) = exec->tile_alloc_offset; - /* tile alloc size. */ -- *(uint32_t *)(validated + 4) = tile_alloc_size; -+ *(uint32_t *)(validated + 4) = (bin_addr + vc4->bin_alloc_size - -+ exec->tile_alloc_offset); - /* tile state address. */ -- *(uint32_t *)(validated + 8) = exec->tile_bo->paddr; -+ *(uint32_t *)(validated + 8) = bin_addr; - - return 0; - } - -From 6bab44ea5a558bac94b3fb1579d3e7badb113df2 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 30 Mar 2017 10:23:27 -0700 -Subject: [PATCH 221/269] Revert "drm/vc4: Verify at boot that CMA doesn't - cross a 256MB boundary." - -This reverts commit 016c804fa69381bd23a1a13cba08a3c4557fcdff. The -restriction was lifted by the previous commit. ---- - drivers/base/dma-contiguous.c | 1 - - drivers/gpu/drm/vc4/vc4_v3d.c | 18 ------------------ - mm/cma.c | 2 -- - 3 files changed, 21 deletions(-) - -diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c -index 60f5c2591ccdb0202461458eab4035cfba731b8b..e167a1e1bccb062efef2595fcd5299301a97df80 100644 ---- a/drivers/base/dma-contiguous.c -+++ b/drivers/base/dma-contiguous.c -@@ -35,7 +35,6 @@ - #endif - - struct cma *dma_contiguous_default_area; --EXPORT_SYMBOL(dma_contiguous_default_area); - - /* - * Default global CMA area size can be defined in kernel's .config. -diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c -index da79d8511dfb4f631fd3ad4c3680b312f44bd454..882ec06225f1d5caca71bdb5c69664188192c2e2 100644 ---- a/drivers/gpu/drm/vc4/vc4_v3d.c -+++ b/drivers/gpu/drm/vc4/vc4_v3d.c -@@ -16,10 +16,7 @@ - * this program. If not, see . - */ - --#include "linux/init.h" --#include "linux/cma.h" - #include "linux/component.h" --#include "linux/dma-contiguous.h" - #include "linux/pm_runtime.h" - #include "vc4_drv.h" - #include "vc4_regs.h" -@@ -334,23 +331,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) - struct drm_device *drm = dev_get_drvdata(master); - struct vc4_dev *vc4 = to_vc4_dev(drm); - struct vc4_v3d *v3d = NULL; -- struct cma *cma; - int ret; - -- cma = dev_get_cma_area(dev); -- if (!cma) -- return -EINVAL; -- -- if ((cma_get_base(cma) & 0xf0000000) != -- ((cma_get_base(cma) + cma_get_size(cma) - 1) & 0xf0000000)) { -- DRM_ERROR("V3D requires that the CMA area (0x%08lx - 0x%08lx) " -- "not span a 256MB boundary, or memory corruption " -- "would happen.\n", -- (long)cma_get_base(cma), -- cma_get_base(cma) + cma_get_size(cma)); -- return -EINVAL; -- } -- - v3d = devm_kzalloc(&pdev->dev, sizeof(*v3d), GFP_KERNEL); - if (!v3d) - return -ENOMEM; -diff --git a/mm/cma.c b/mm/cma.c -index b50245282a18bc790da0f901944c2e670ffac2d2..c960459eda7e640ea55be1d4ed80c6a9125a8877 100644 ---- a/mm/cma.c -+++ b/mm/cma.c -@@ -47,13 +47,11 @@ phys_addr_t cma_get_base(const struct cma *cma) - { - return PFN_PHYS(cma->base_pfn); - } --EXPORT_SYMBOL(cma_get_base); - - unsigned long cma_get_size(const struct cma *cma) - { - return cma->count << PAGE_SHIFT; - } --EXPORT_SYMBOL(cma_get_size); - - static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, - int align_order) - -From 0d4a532da7dab2d62ee4bfd0f5949f7a1febaff9 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Mon, 27 Feb 2017 12:28:02 -0800 -Subject: [PATCH 222/269] drm/vc4: Add HDMI audio support - -The HDMI encoder IP embeds all needed blocks to output audio, with a -custom DAI called MAI moving audio between the two parts of the HDMI -core. This driver now exposes a sound card to let users stream audio -to their display. - -Using the hdmi-codec driver has been considered here, but MAI meant -having to significantly rework hdmi-codec, and it would have left -little shared code with the I2S mode anyway. - -The encoder requires that the audio be SPDIF-formatted frames only, -which alsalib will format-convert for us. - -This patch is the combined work of Eric Anholt (initial register setup -with a separate dmaengine driver and using simple-audio-card) and -Boris Brezillon (moving it all into HDMI, massive debug to get it -actually working), and which Eric has the permission to release. - -v2: Drop "-audio" from sound card name, since that's already implied - (suggestion by Boris) - -Signed-off-by: Eric Anholt -Acked-by: Boris Brezillon -Link: http://patchwork.freedesktop.org/patch/msgid/20170227202803.12855-2-eric@anholt.net ---- - drivers/gpu/drm/vc4/Kconfig | 4 + - drivers/gpu/drm/vc4/vc4_hdmi.c | 494 ++++++++++++++++++++++++++++++++++++++++- - drivers/gpu/drm/vc4/vc4_regs.h | 107 ++++++++- - 3 files changed, 603 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig -index e1517d07cb7d22776ca164a5d2d9b87e55a5563a..973b4203c0b264115b7cd9d4a433b449bd0ec3b3 100644 ---- a/drivers/gpu/drm/vc4/Kconfig -+++ b/drivers/gpu/drm/vc4/Kconfig -@@ -2,11 +2,15 @@ config DRM_VC4 - tristate "Broadcom VC4 Graphics" - depends on ARCH_BCM2835 || COMPILE_TEST - depends on DRM -+ depends on SND && SND_SOC - depends on COMMON_CLK - select DRM_KMS_HELPER - select DRM_KMS_CMA_HELPER - select DRM_GEM_CMA_HELPER - select DRM_PANEL -+ select SND_PCM -+ select SND_PCM_ELD -+ select SND_SOC_GENERIC_DMAENGINE_PCM - select DRM_MIPI_DSI - help - Choose this option if you have a system that has a Broadcom -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c4cb2e26de32f06db0abf3fd94b3117c3292eed5..8db1016cad929438f30ea44c6974dcb340b74596 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -31,11 +31,27 @@ - #include "linux/clk.h" - #include "linux/component.h" - #include "linux/i2c.h" -+#include "linux/of_address.h" - #include "linux/of_gpio.h" - #include "linux/of_platform.h" -+#include "linux/rational.h" -+#include "sound/dmaengine_pcm.h" -+#include "sound/pcm_drm_eld.h" -+#include "sound/pcm_params.h" -+#include "sound/soc.h" - #include "vc4_drv.h" - #include "vc4_regs.h" - -+/* HDMI audio information */ -+struct vc4_hdmi_audio { -+ struct snd_soc_card card; -+ struct snd_soc_dai_link link; -+ int samplerate; -+ int channels; -+ struct snd_dmaengine_dai_dma_data dma_data; -+ struct snd_pcm_substream *substream; -+}; -+ - /* General HDMI hardware state. */ - struct vc4_hdmi { - struct platform_device *pdev; -@@ -43,6 +59,8 @@ struct vc4_hdmi { - struct drm_encoder *encoder; - struct drm_connector *connector; - -+ struct vc4_hdmi_audio audio; -+ - struct i2c_adapter *ddc; - void __iomem *hdmicore_regs; - void __iomem *hd_regs; -@@ -98,6 +116,10 @@ static const struct { - HDMI_REG(VC4_HDMI_SW_RESET_CONTROL), - HDMI_REG(VC4_HDMI_HOTPLUG_INT), - HDMI_REG(VC4_HDMI_HOTPLUG), -+ HDMI_REG(VC4_HDMI_MAI_CHANNEL_MAP), -+ HDMI_REG(VC4_HDMI_MAI_CONFIG), -+ HDMI_REG(VC4_HDMI_MAI_FORMAT), -+ HDMI_REG(VC4_HDMI_AUDIO_PACKET_CONFIG), - HDMI_REG(VC4_HDMI_RAM_PACKET_CONFIG), - HDMI_REG(VC4_HDMI_HORZA), - HDMI_REG(VC4_HDMI_HORZB), -@@ -108,6 +130,7 @@ static const struct { - HDMI_REG(VC4_HDMI_VERTB0), - HDMI_REG(VC4_HDMI_VERTB1), - HDMI_REG(VC4_HDMI_TX_PHY_RESET_CTL), -+ HDMI_REG(VC4_HDMI_TX_PHY_CTL0), - }; - - static const struct { -@@ -116,6 +139,9 @@ static const struct { - } hd_regs[] = { - HDMI_REG(VC4_HD_M_CTL), - HDMI_REG(VC4_HD_MAI_CTL), -+ HDMI_REG(VC4_HD_MAI_THR), -+ HDMI_REG(VC4_HD_MAI_FMT), -+ HDMI_REG(VC4_HD_MAI_SMP), - HDMI_REG(VC4_HD_VID_CTL), - HDMI_REG(VC4_HD_CSC_CTL), - HDMI_REG(VC4_HD_FRAME_COUNT), -@@ -215,6 +241,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) - - drm_mode_connector_update_edid_property(connector, edid); - ret = drm_add_edid_modes(connector, edid); -+ drm_edid_to_eld(connector, edid); - - return ret; - } -@@ -300,7 +327,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, - 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; -+ u32 packet_reg = VC4_HDMI_RAM_PACKET(packet_id); - uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; - ssize_t len, i; - int ret; -@@ -385,6 +412,24 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder) - vc4_hdmi_write_infoframe(encoder, &frame); - } - -+static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder) -+{ -+ struct drm_device *drm = encoder->dev; -+ struct vc4_dev *vc4 = drm->dev_private; -+ struct vc4_hdmi *hdmi = vc4->hdmi; -+ union hdmi_infoframe frame; -+ int ret; -+ -+ ret = hdmi_audio_infoframe_init(&frame.audio); -+ -+ frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM; -+ frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM; -+ frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM; -+ frame.audio.channels = hdmi->audio.channels; -+ -+ vc4_hdmi_write_infoframe(encoder, &frame); -+} -+ - static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) - { - vc4_hdmi_set_avi_infoframe(encoder); -@@ -591,6 +636,447 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { - .enable = vc4_hdmi_encoder_enable, - }; - -+/* HDMI audio codec callbacks */ -+static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *hdmi) -+{ -+ struct drm_device *drm = hdmi->encoder->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ u32 hsm_clock = clk_get_rate(hdmi->hsm_clock); -+ unsigned long n, m; -+ -+ rational_best_approximation(hsm_clock, hdmi->audio.samplerate, -+ VC4_HD_MAI_SMP_N_MASK >> -+ VC4_HD_MAI_SMP_N_SHIFT, -+ (VC4_HD_MAI_SMP_M_MASK >> -+ VC4_HD_MAI_SMP_M_SHIFT) + 1, -+ &n, &m); -+ -+ HD_WRITE(VC4_HD_MAI_SMP, -+ VC4_SET_FIELD(n, VC4_HD_MAI_SMP_N) | -+ VC4_SET_FIELD(m - 1, VC4_HD_MAI_SMP_M)); -+} -+ -+static void vc4_hdmi_set_n_cts(struct vc4_hdmi *hdmi) -+{ -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_crtc *crtc = encoder->crtc; -+ struct drm_device *drm = encoder->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ const struct drm_display_mode *mode = &crtc->state->adjusted_mode; -+ u32 samplerate = hdmi->audio.samplerate; -+ u32 n, cts; -+ u64 tmp; -+ -+ n = 128 * samplerate / 1000; -+ tmp = (u64)(mode->clock * 1000) * n; -+ do_div(tmp, 128 * samplerate); -+ cts = tmp; -+ -+ HDMI_WRITE(VC4_HDMI_CRP_CFG, -+ VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN | -+ VC4_SET_FIELD(n, VC4_HDMI_CRP_CFG_N)); -+ -+ /* -+ * We could get slightly more accurate clocks in some cases by -+ * providing a CTS_1 value. The two CTS values are alternated -+ * between based on the period fields -+ */ -+ HDMI_WRITE(VC4_HDMI_CTS_0, cts); -+ HDMI_WRITE(VC4_HDMI_CTS_1, cts); -+} -+ -+static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) -+{ -+ struct snd_soc_card *card = snd_soc_dai_get_drvdata(dai); -+ -+ return snd_soc_card_get_drvdata(card); -+} -+ -+static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct vc4_dev *vc4 = to_vc4_dev(encoder->dev); -+ int ret; -+ -+ if (hdmi->audio.substream && hdmi->audio.substream != substream) -+ return -EINVAL; -+ -+ hdmi->audio.substream = substream; -+ -+ /* -+ * If the HDMI encoder hasn't probed, or the encoder is -+ * currently in DVI mode, treat the codec dai as missing. -+ */ -+ if (!encoder->crtc || !(HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & -+ VC4_HDMI_RAM_PACKET_ENABLE)) -+ return -ENODEV; -+ -+ ret = snd_pcm_hw_constraint_eld(substream->runtime, -+ hdmi->connector->eld); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+ -+static int vc4_hdmi_audio_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) -+{ -+ return 0; -+} -+ -+static void vc4_hdmi_audio_reset(struct vc4_hdmi *hdmi) -+{ -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_device *drm = encoder->dev; -+ struct device *dev = &hdmi->pdev->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ int ret; -+ -+ ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO); -+ if (ret) -+ dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); -+ -+ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_RESET); -+ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_ERRORF); -+ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_FLUSH); -+} -+ -+static void vc4_hdmi_audio_shutdown(struct snd_pcm_substream *substream, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ -+ if (substream != hdmi->audio.substream) -+ return; -+ -+ vc4_hdmi_audio_reset(hdmi); -+ -+ hdmi->audio.substream = NULL; -+} -+ -+/* HDMI audio codec callbacks */ -+static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_device *drm = encoder->dev; -+ struct device *dev = &hdmi->pdev->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ u32 audio_packet_config, channel_mask; -+ u32 channel_map, i; -+ -+ if (substream != hdmi->audio.substream) -+ return -EINVAL; -+ -+ dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, -+ params_rate(params), params_width(params), -+ params_channels(params)); -+ -+ hdmi->audio.channels = params_channels(params); -+ hdmi->audio.samplerate = params_rate(params); -+ -+ HD_WRITE(VC4_HD_MAI_CTL, -+ VC4_HD_MAI_CTL_RESET | -+ VC4_HD_MAI_CTL_FLUSH | -+ VC4_HD_MAI_CTL_DLATE | -+ VC4_HD_MAI_CTL_ERRORE | -+ VC4_HD_MAI_CTL_ERRORF); -+ -+ vc4_hdmi_audio_set_mai_clock(hdmi); -+ -+ audio_packet_config = -+ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT | -+ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS | -+ VC4_SET_FIELD(0xf, VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER); -+ -+ channel_mask = GENMASK(hdmi->audio.channels - 1, 0); -+ audio_packet_config |= VC4_SET_FIELD(channel_mask, -+ VC4_HDMI_AUDIO_PACKET_CEA_MASK); -+ -+ /* Set the MAI threshold. This logic mimics the firmware's. */ -+ if (hdmi->audio.samplerate > 96000) { -+ HD_WRITE(VC4_HD_MAI_THR, -+ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); -+ } else if (hdmi->audio.samplerate > 48000) { -+ HD_WRITE(VC4_HD_MAI_THR, -+ VC4_SET_FIELD(0x14, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); -+ } else { -+ HD_WRITE(VC4_HD_MAI_THR, -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); -+ } -+ -+ HDMI_WRITE(VC4_HDMI_MAI_CONFIG, -+ VC4_HDMI_MAI_CONFIG_BIT_REVERSE | -+ VC4_SET_FIELD(channel_mask, VC4_HDMI_MAI_CHANNEL_MASK)); -+ -+ channel_map = 0; -+ for (i = 0; i < 8; i++) { -+ if (channel_mask & BIT(i)) -+ channel_map |= i << (3 * i); -+ } -+ -+ HDMI_WRITE(VC4_HDMI_MAI_CHANNEL_MAP, channel_map); -+ HDMI_WRITE(VC4_HDMI_AUDIO_PACKET_CONFIG, audio_packet_config); -+ vc4_hdmi_set_n_cts(hdmi); -+ -+ return 0; -+} -+ -+static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_device *drm = encoder->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ -+ switch (cmd) { -+ case SNDRV_PCM_TRIGGER_START: -+ vc4_hdmi_set_audio_infoframe(encoder); -+ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, -+ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) & -+ ~VC4_HDMI_TX_PHY_RNG_PWRDN); -+ HD_WRITE(VC4_HD_MAI_CTL, -+ VC4_SET_FIELD(hdmi->audio.channels, -+ VC4_HD_MAI_CTL_CHNUM) | -+ VC4_HD_MAI_CTL_ENABLE); -+ break; -+ case SNDRV_PCM_TRIGGER_STOP: -+ HD_WRITE(VC4_HD_MAI_CTL, -+ VC4_HD_MAI_CTL_DLATE | -+ VC4_HD_MAI_CTL_ERRORE | -+ VC4_HD_MAI_CTL_ERRORF); -+ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, -+ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) | -+ VC4_HDMI_TX_PHY_RNG_PWRDN); -+ break; -+ default: -+ break; -+ } -+ -+ return 0; -+} -+ -+static inline struct vc4_hdmi * -+snd_component_to_hdmi(struct snd_soc_component *component) -+{ -+ struct snd_soc_card *card = snd_soc_component_get_drvdata(component); -+ -+ return snd_soc_card_get_drvdata(card); -+} -+ -+static int vc4_hdmi_audio_eld_ctl_info(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_info *uinfo) -+{ -+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); -+ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); -+ -+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; -+ uinfo->count = sizeof(hdmi->connector->eld); -+ -+ return 0; -+} -+ -+static int vc4_hdmi_audio_eld_ctl_get(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); -+ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); -+ -+ memcpy(ucontrol->value.bytes.data, hdmi->connector->eld, -+ sizeof(hdmi->connector->eld)); -+ -+ return 0; -+} -+ -+static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { -+ { -+ .access = SNDRV_CTL_ELEM_ACCESS_READ | -+ SNDRV_CTL_ELEM_ACCESS_VOLATILE, -+ .iface = SNDRV_CTL_ELEM_IFACE_PCM, -+ .name = "ELD", -+ .info = vc4_hdmi_audio_eld_ctl_info, -+ .get = vc4_hdmi_audio_eld_ctl_get, -+ }, -+}; -+ -+static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { -+ SND_SOC_DAPM_OUTPUT("TX"), -+}; -+ -+static const struct snd_soc_dapm_route vc4_hdmi_audio_routes[] = { -+ { "TX", NULL, "Playback" }, -+}; -+ -+static const struct snd_soc_codec_driver vc4_hdmi_audio_codec_drv = { -+ .component_driver = { -+ .controls = vc4_hdmi_audio_controls, -+ .num_controls = ARRAY_SIZE(vc4_hdmi_audio_controls), -+ .dapm_widgets = vc4_hdmi_audio_widgets, -+ .num_dapm_widgets = ARRAY_SIZE(vc4_hdmi_audio_widgets), -+ .dapm_routes = vc4_hdmi_audio_routes, -+ .num_dapm_routes = ARRAY_SIZE(vc4_hdmi_audio_routes), -+ }, -+}; -+ -+static const struct snd_soc_dai_ops vc4_hdmi_audio_dai_ops = { -+ .startup = vc4_hdmi_audio_startup, -+ .shutdown = vc4_hdmi_audio_shutdown, -+ .hw_params = vc4_hdmi_audio_hw_params, -+ .set_fmt = vc4_hdmi_audio_set_fmt, -+ .trigger = vc4_hdmi_audio_trigger, -+}; -+ -+static struct snd_soc_dai_driver vc4_hdmi_audio_codec_dai_drv = { -+ .name = "vc4-hdmi-hifi", -+ .playback = { -+ .stream_name = "Playback", -+ .channels_min = 2, -+ .channels_max = 8, -+ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | -+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | -+ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | -+ SNDRV_PCM_RATE_192000, -+ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, -+ }, -+}; -+ -+static const struct snd_soc_component_driver vc4_hdmi_audio_cpu_dai_comp = { -+ .name = "vc4-hdmi-cpu-dai-component", -+}; -+ -+static int vc4_hdmi_audio_cpu_dai_probe(struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ -+ snd_soc_dai_init_dma_data(dai, &hdmi->audio.dma_data, NULL); -+ -+ return 0; -+} -+ -+static struct snd_soc_dai_driver vc4_hdmi_audio_cpu_dai_drv = { -+ .name = "vc4-hdmi-cpu-dai", -+ .probe = vc4_hdmi_audio_cpu_dai_probe, -+ .playback = { -+ .stream_name = "Playback", -+ .channels_min = 1, -+ .channels_max = 8, -+ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | -+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | -+ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | -+ SNDRV_PCM_RATE_192000, -+ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, -+ }, -+ .ops = &vc4_hdmi_audio_dai_ops, -+}; -+ -+static const struct snd_dmaengine_pcm_config pcm_conf = { -+ .chan_names[SNDRV_PCM_STREAM_PLAYBACK] = "audio-rx", -+ .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, -+}; -+ -+static int vc4_hdmi_audio_init(struct vc4_hdmi *hdmi) -+{ -+ struct snd_soc_dai_link *dai_link = &hdmi->audio.link; -+ struct snd_soc_card *card = &hdmi->audio.card; -+ struct device *dev = &hdmi->pdev->dev; -+ const __be32 *addr; -+ int ret; -+ -+ if (!of_find_property(dev->of_node, "dmas", NULL)) { -+ dev_warn(dev, -+ "'dmas' DT property is missing, no HDMI audio\n"); -+ return 0; -+ } -+ -+ /* -+ * Get the physical address of VC4_HD_MAI_DATA. We need to retrieve -+ * the bus address specified in the DT, because the physical address -+ * (the one returned by platform_get_resource()) is not appropriate -+ * for DMA transfers. -+ * This VC/MMU should probably be exposed to avoid this kind of hacks. -+ */ -+ addr = of_get_address(dev->of_node, 1, NULL, NULL); -+ hdmi->audio.dma_data.addr = be32_to_cpup(addr) + VC4_HD_MAI_DATA; -+ hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; -+ hdmi->audio.dma_data.maxburst = 2; -+ -+ ret = devm_snd_dmaengine_pcm_register(dev, &pcm_conf, 0); -+ if (ret) { -+ dev_err(dev, "Could not register PCM component: %d\n", ret); -+ return ret; -+ } -+ -+ ret = devm_snd_soc_register_component(dev, &vc4_hdmi_audio_cpu_dai_comp, -+ &vc4_hdmi_audio_cpu_dai_drv, 1); -+ if (ret) { -+ dev_err(dev, "Could not register CPU DAI: %d\n", ret); -+ return ret; -+ } -+ -+ /* register codec and codec dai */ -+ ret = snd_soc_register_codec(dev, &vc4_hdmi_audio_codec_drv, -+ &vc4_hdmi_audio_codec_dai_drv, 1); -+ if (ret) { -+ dev_err(dev, "Could not register codec: %d\n", ret); -+ return ret; -+ } -+ -+ dai_link->name = "MAI"; -+ dai_link->stream_name = "MAI PCM"; -+ dai_link->codec_dai_name = vc4_hdmi_audio_codec_dai_drv.name; -+ dai_link->cpu_dai_name = dev_name(dev); -+ dai_link->codec_name = dev_name(dev); -+ dai_link->platform_name = dev_name(dev); -+ -+ card->dai_link = dai_link; -+ card->num_links = 1; -+ card->name = "vc4-hdmi"; -+ card->dev = dev; -+ -+ /* -+ * Be careful, snd_soc_register_card() calls dev_set_drvdata() and -+ * stores a pointer to the snd card object in dev->driver_data. This -+ * means we cannot use it for something else. The hdmi back-pointer is -+ * now stored in card->drvdata and should be retrieved with -+ * snd_soc_card_get_drvdata() if needed. -+ */ -+ snd_soc_card_set_drvdata(card, hdmi); -+ ret = devm_snd_soc_register_card(dev, card); -+ if (ret) { -+ dev_err(dev, "Could not register sound card: %d\n", ret); -+ goto unregister_codec; -+ } -+ -+ return 0; -+ -+unregister_codec: -+ snd_soc_unregister_codec(dev); -+ -+ return ret; -+} -+ -+static void vc4_hdmi_audio_cleanup(struct vc4_hdmi *hdmi) -+{ -+ struct device *dev = &hdmi->pdev->dev; -+ -+ /* -+ * If drvdata is not set this means the audio card was not -+ * registered, just skip codec unregistration in this case. -+ */ -+ if (dev_get_drvdata(dev)) -+ snd_soc_unregister_codec(dev); -+} -+ - static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) - { - struct platform_device *pdev = to_platform_device(dev); -@@ -722,6 +1208,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) - goto err_destroy_encoder; - } - -+ ret = vc4_hdmi_audio_init(hdmi); -+ if (ret) -+ goto err_destroy_encoder; -+ - return 0; - - err_destroy_encoder: -@@ -743,6 +1233,8 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, - struct vc4_dev *vc4 = drm->dev_private; - struct vc4_hdmi *hdmi = vc4->hdmi; - -+ vc4_hdmi_audio_cleanup(hdmi); -+ - vc4_hdmi_connector_destroy(hdmi->connector); - vc4_hdmi_encoder_destroy(hdmi->encoder); - -diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index 385405a2df05eb3dd86d4f687aa8205331bec3cc..932093936178674173a84002b33e07e9a37fdfe9 100644 ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -446,11 +446,62 @@ - #define VC4_HDMI_HOTPLUG 0x00c - # define VC4_HDMI_HOTPLUG_CONNECTED BIT(0) - -+/* 3 bits per field, where each field maps from that corresponding MAI -+ * bus channel to the given HDMI channel. -+ */ -+#define VC4_HDMI_MAI_CHANNEL_MAP 0x090 -+ -+#define VC4_HDMI_MAI_CONFIG 0x094 -+# define VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE BIT(27) -+# define VC4_HDMI_MAI_CONFIG_BIT_REVERSE BIT(26) -+# define VC4_HDMI_MAI_CHANNEL_MASK_MASK VC4_MASK(15, 0) -+# define VC4_HDMI_MAI_CHANNEL_MASK_SHIFT 0 -+ -+/* Last received format word on the MAI bus. */ -+#define VC4_HDMI_MAI_FORMAT 0x098 -+ -+#define VC4_HDMI_AUDIO_PACKET_CONFIG 0x09c -+# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT BIT(29) -+# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS BIT(24) -+# define VC4_HDMI_AUDIO_PACKET_FORCE_SAMPLE_PRESENT BIT(19) -+# define VC4_HDMI_AUDIO_PACKET_FORCE_B_FRAME BIT(18) -+# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_MASK VC4_MASK(13, 10) -+# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_SHIFT 10 -+/* If set, then multichannel, otherwise 2 channel. */ -+# define VC4_HDMI_AUDIO_PACKET_AUDIO_LAYOUT BIT(9) -+/* If set, then AUDIO_LAYOUT overrides audio_cea_mask */ -+# define VC4_HDMI_AUDIO_PACKET_FORCE_AUDIO_LAYOUT BIT(8) -+# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_MASK VC4_MASK(7, 0) -+# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_SHIFT 0 -+ - #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_CRP_CFG 0x0a8 -+/* When set, the CTS_PERIOD counts based on MAI bus sync pulse instead -+ * of pixel clock. -+ */ -+# define VC4_HDMI_CRP_USE_MAI_BUS_SYNC_FOR_CTS BIT(26) -+/* When set, no CRP packets will be sent. */ -+# define VC4_HDMI_CRP_CFG_DISABLE BIT(25) -+/* If set, generates CTS values based on N, audio clock, and video -+ * clock. N must be divisible by 128. -+ */ -+# define VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN BIT(24) -+# define VC4_HDMI_CRP_CFG_N_MASK VC4_MASK(19, 0) -+# define VC4_HDMI_CRP_CFG_N_SHIFT 0 -+ -+/* 20-bit fields containing CTS values to be transmitted if !EXTERNAL_CTS_EN */ -+#define VC4_HDMI_CTS_0 0x0ac -+#define VC4_HDMI_CTS_1 0x0b0 -+/* 20-bit fields containing number of clocks to send CTS0/1 before -+ * switching to the other one. -+ */ -+#define VC4_HDMI_CTS_PERIOD_0 0x0b4 -+#define VC4_HDMI_CTS_PERIOD_1 0x0b8 -+ - #define VC4_HDMI_HORZA 0x0c4 - # define VC4_HDMI_HORZA_VPOS BIT(14) - # define VC4_HDMI_HORZA_HPOS BIT(13) -@@ -512,7 +563,11 @@ - - #define VC4_HDMI_TX_PHY_RESET_CTL 0x2c0 - --#define VC4_HDMI_GCP_0 0x400 -+#define VC4_HDMI_TX_PHY_CTL0 0x2c4 -+# define VC4_HDMI_TX_PHY_RNG_PWRDN BIT(25) -+ -+#define VC4_HDMI_GCP(x) (0x400 + ((x) * 0x4)) -+#define VC4_HDMI_RAM_PACKET(x) (0x400 + ((x) * 0x24)) - #define VC4_HDMI_PACKET_STRIDE 0x24 - - #define VC4_HD_M_CTL 0x00c -@@ -522,6 +577,56 @@ - # define VC4_HD_M_ENABLE BIT(0) - - #define VC4_HD_MAI_CTL 0x014 -+/* Set when audio stream is received at a slower rate than the -+ * sampling period, so MAI fifo goes empty. Write 1 to clear. -+ */ -+# define VC4_HD_MAI_CTL_DLATE BIT(15) -+# define VC4_HD_MAI_CTL_BUSY BIT(14) -+# define VC4_HD_MAI_CTL_CHALIGN BIT(13) -+# define VC4_HD_MAI_CTL_WHOLSMP BIT(12) -+# define VC4_HD_MAI_CTL_FULL BIT(11) -+# define VC4_HD_MAI_CTL_EMPTY BIT(10) -+# define VC4_HD_MAI_CTL_FLUSH BIT(9) -+/* If set, MAI bus generates SPDIF (bit 31) parity instead of passing -+ * through. -+ */ -+# define VC4_HD_MAI_CTL_PAREN BIT(8) -+# define VC4_HD_MAI_CTL_CHNUM_MASK VC4_MASK(7, 4) -+# define VC4_HD_MAI_CTL_CHNUM_SHIFT 4 -+# define VC4_HD_MAI_CTL_ENABLE BIT(3) -+/* Underflow error status bit, write 1 to clear. */ -+# define VC4_HD_MAI_CTL_ERRORE BIT(2) -+/* Overflow error status bit, write 1 to clear. */ -+# define VC4_HD_MAI_CTL_ERRORF BIT(1) -+/* Single-shot reset bit. Read value is undefined. */ -+# define VC4_HD_MAI_CTL_RESET BIT(0) -+ -+#define VC4_HD_MAI_THR 0x018 -+# define VC4_HD_MAI_THR_PANICHIGH_MASK VC4_MASK(29, 24) -+# define VC4_HD_MAI_THR_PANICHIGH_SHIFT 24 -+# define VC4_HD_MAI_THR_PANICLOW_MASK VC4_MASK(21, 16) -+# define VC4_HD_MAI_THR_PANICLOW_SHIFT 16 -+# define VC4_HD_MAI_THR_DREQHIGH_MASK VC4_MASK(13, 8) -+# define VC4_HD_MAI_THR_DREQHIGH_SHIFT 8 -+# define VC4_HD_MAI_THR_DREQLOW_MASK VC4_MASK(5, 0) -+# define VC4_HD_MAI_THR_DREQLOW_SHIFT 0 -+ -+/* Format header to be placed on the MAI data. Unused. */ -+#define VC4_HD_MAI_FMT 0x01c -+ -+/* Register for DMAing in audio data to be transported over the MAI -+ * bus to the Falcon core. -+ */ -+#define VC4_HD_MAI_DATA 0x020 -+ -+/* Divider from HDMI HSM clock to MAI serial clock. Sampling period -+ * converges to N / (M + 1) cycles. -+ */ -+#define VC4_HD_MAI_SMP 0x02c -+# define VC4_HD_MAI_SMP_N_MASK VC4_MASK(31, 8) -+# define VC4_HD_MAI_SMP_N_SHIFT 8 -+# define VC4_HD_MAI_SMP_M_MASK VC4_MASK(7, 0) -+# define VC4_HD_MAI_SMP_M_SHIFT 0 - - #define VC4_HD_VID_CTL 0x038 - # define VC4_HD_VID_CTL_ENABLE BIT(31) - -From af76c5218bd78ffb38a2b3646233a01730e2dbb0 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Thu, 2 Feb 2017 11:37:36 +0100 -Subject: [PATCH 223/269] ARM: dts: bcm283x: Add HDMI audio related properties - -Add the dmas and dma-names properties to support HDMI audio. - -Signed-off-by: Boris Brezillon -Signed-off-by: Eric Anholt -(cherry picked from commit d46d2c6380c10e80e99f6af9067356128bffac6b) ---- - arch/arm/boot/dts/bcm283x.dtsi | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi -index 348c71bbc913644c04bab43fcb95abe9b6c9c640..7d58cd79ac6bd99f0b47a909ac827c61aac642d9 100644 ---- a/arch/arm/boot/dts/bcm283x.dtsi -+++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -339,6 +339,8 @@ - clocks = <&clocks BCM2835_PLLH_PIX>, - <&clocks BCM2835_CLOCK_HSM>; - clock-names = "pixel", "hdmi"; -+ dmas = <&dma 17>; -+ dma-names = "audio-rx"; - status = "disabled"; - }; - - -From f46d33a24b5389dcab17fe7c485c804d527675ab Mon Sep 17 00:00:00 2001 +From 482e38ce75d024c03f6f9cda4b07b2704d19962b Mon Sep 17 00:00:00 2001 From: Yasunari Takiguchi Date: Fri, 14 Apr 2017 10:43:57 +0100 -Subject: [PATCH 224/269] This is the driver for Sony CXD2880 DVB-T2/T tuner + +Subject: [PATCH 219/305] This is the driver for Sony CXD2880 DVB-T2/T tuner + demodulator. It includes the CXD2880 driver and the CXD2880 SPI adapter. The current CXD2880 driver version is 1.4.1 - 1.0.1 released on April 13, 2017. @@ -159064,10 +157648,10 @@ index 0000000000000000000000000000000000000000..82e122349055be817eb74ed5bbcd7560 +MODULE_AUTHOR("Sony Semiconductor Solutions Corporation"); +MODULE_LICENSE("GPL v2"); -From 7f8d91d7608e454ef727917e4ef8482e235f6b73 Mon Sep 17 00:00:00 2001 +From f6736cbc445f2d60c9dca0c061715906cce4d329 Mon Sep 17 00:00:00 2001 From: Yasunari Takiguchi Date: Thu, 22 Dec 2016 15:34:12 +0900 -Subject: [PATCH 225/269] BCM2708: Add Raspberry Pi TV HAT Device Tree Support +Subject: [PATCH 220/305] BCM2708: Add Raspberry Pi TV HAT Device Tree Support This is an EXAMPLE CODE of Raspberry Pi TV HAT device tree overlay. Although this is not a part of our release code, it has been used to verify @@ -159163,10 +157747,1382 @@ index 0000000000000000000000000000000000000000..a68f6f793d8efd8b2e2adf9f2fb6426f + +}; -From 3ecd305ad5f28f9ad9ab5962f6b53daae3f2bad0 Mon Sep 17 00:00:00 2001 +From c101af35720cf2a697c17ba245c5b22b7a4679f8 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 7 Mar 2017 14:51:03 -0800 +Subject: [PATCH 221/305] drm/vc4: Allow using more than 256MB of CMA memory. + +Until now, we've had to limit Raspberry Pi to 256MB of CMA memory to +keep from triggering the hardware addressing bug between of the tile +binner of the tile alloc memory (where the top 4 bits come from the +tile state data array's address). + +To work around that and allow more memory to be reserved for graphics, +allocate a single BO to store tile state data arrays and tile +alloc/overflow memory while the GPU is active, and make sure that that +one BO doesn't happen to cross a 256MB boundary. With that in place, +we can allocate textures and shaders anywhere in system memory (still +contiguous, of course). + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_drv.h | 28 +++++-- + drivers/gpu/drm/vc4/vc4_gem.c | 12 ++- + drivers/gpu/drm/vc4/vc4_irq.c | 61 +++++++-------- + drivers/gpu/drm/vc4/vc4_render_cl.c | 3 +- + drivers/gpu/drm/vc4/vc4_v3d.c | 150 ++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_validate.c | 54 ++++++------- + 6 files changed, 234 insertions(+), 74 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 44a8e6fda2b576fed63d93ef34e076cebf90d64c..9e50bc25b2be71079d52a861c25f3fe7c4db0830 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -97,12 +97,23 @@ struct vc4_dev { + */ + struct list_head seqno_cb_list; + +- /* The binner overflow memory that's currently set up in +- * BPOA/BPOS registers. When overflow occurs and a new one is +- * allocated, the previous one will be moved to +- * vc4->current_exec's free list. ++ /* The memory used for storing binner tile alloc, tile state, ++ * and overflow memory allocations. This is freed when V3D ++ * powers down. + */ +- struct vc4_bo *overflow_mem; ++ struct vc4_bo *bin_bo; ++ ++ /* Size of blocks allocated within bin_bo. */ ++ uint32_t bin_alloc_size; ++ ++ /* Bitmask of the bin_alloc_size chunks in bin_bo that are ++ * used. ++ */ ++ uint32_t bin_alloc_used; ++ ++ /* Bitmask of the current bin_alloc used for overflow memory. */ ++ uint32_t bin_alloc_overflow; ++ + struct work_struct overflow_mem_work; + + int power_refcount; +@@ -295,8 +306,12 @@ struct vc4_exec_info { + bool found_increment_semaphore_packet; + bool found_flush; + uint8_t bin_tiles_x, bin_tiles_y; +- struct drm_gem_cma_object *tile_bo; ++ /* Physical address of the start of the tile alloc array ++ * (where each tile's binned CL will start) ++ */ + uint32_t tile_alloc_offset; ++ /* Bitmask of which binner slots are freed when this job completes. */ ++ uint32_t bin_slots; + + /** + * Computed addresses pointing into exec_bo where we start the +@@ -531,6 +546,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, + extern struct platform_driver vc4_v3d_driver; + int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused); + int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused); ++int vc4_v3d_get_bin_slot(struct vc4_dev *vc4); + + /* vc4_validate.c */ + int +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index ab3016982466c3ca35ba479050ee107d26eb50ac..a5029ab49068bdbd69411cccbdb6f5111f387e38 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -695,6 +695,7 @@ static void + vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); ++ unsigned long irqflags; + unsigned i; + + if (exec->bo) { +@@ -710,6 +711,11 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + drm_gem_object_unreference_unlocked(&bo->base.base); + } + ++ /* Free up the allocation of any bin slots we used. */ ++ spin_lock_irqsave(&vc4->job_lock, irqflags); ++ vc4->bin_alloc_used &= ~exec->bin_slots; ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); ++ + mutex_lock(&vc4->power_lock); + if (--vc4->power_refcount == 0) { + pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); +@@ -951,9 +957,9 @@ vc4_gem_destroy(struct drm_device *dev) + /* V3D should already have disabled its interrupt and cleared + * the overflow allocation registers. Now free the object. + */ +- if (vc4->overflow_mem) { +- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); +- vc4->overflow_mem = NULL; ++ if (vc4->bin_bo) { ++ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); ++ vc4->bin_bo = NULL; + } + + if (vc4->hang_state) +diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c +index 094bc6a475c1773923dfe8225cba9886fc9e5026..c43ee1e646f6dd68fe19dacdbcf9322da13c4280 100644 +--- a/drivers/gpu/drm/vc4/vc4_irq.c ++++ b/drivers/gpu/drm/vc4/vc4_irq.c +@@ -58,50 +58,45 @@ vc4_overflow_mem_work(struct work_struct *work) + { + struct vc4_dev *vc4 = + container_of(work, struct vc4_dev, overflow_mem_work); +- struct drm_device *dev = vc4->dev; +- struct vc4_bo *bo; ++ struct vc4_bo *bo = vc4->bin_bo; ++ int bin_bo_slot; ++ struct vc4_exec_info *exec; ++ unsigned long irqflags; + +- bo = vc4_bo_create(dev, 256 * 1024, true); +- if (IS_ERR(bo)) { ++ bin_bo_slot = vc4_v3d_get_bin_slot(vc4); ++ if (bin_bo_slot < 0) { + DRM_ERROR("Couldn't allocate binner overflow mem\n"); + return; + } + +- /* If there's a job executing currently, then our previous +- * overflow allocation is getting used in that job and we need +- * to queue it to be released when the job is done. But if no +- * job is executing at all, then we can free the old overflow +- * object direcctly. +- * +- * No lock necessary for this pointer since we're the only +- * ones that update the pointer, and our workqueue won't +- * reenter. +- */ +- if (vc4->overflow_mem) { +- struct vc4_exec_info *current_exec; +- unsigned long irqflags; +- +- spin_lock_irqsave(&vc4->job_lock, irqflags); +- current_exec = vc4_first_bin_job(vc4); +- if (!current_exec) +- current_exec = vc4_last_render_job(vc4); +- if (current_exec) { +- vc4->overflow_mem->seqno = current_exec->seqno; +- list_add_tail(&vc4->overflow_mem->unref_head, +- ¤t_exec->unref_list); +- vc4->overflow_mem = NULL; ++ spin_lock_irqsave(&vc4->job_lock, irqflags); ++ ++ if (vc4->bin_alloc_overflow) { ++ /* If we had overflow memory allocated previously, ++ * then that chunk will free when the current bin job ++ * is done. If we don't have a bin job running, then ++ * the chunk will be done whenever the list of render ++ * jobs has drained. ++ */ ++ exec = vc4_first_bin_job(vc4); ++ if (!exec) ++ exec = vc4_last_render_job(vc4); ++ if (exec) { ++ exec->bin_slots |= vc4->bin_alloc_overflow; ++ } else { ++ /* There's nothing queued in the hardware, so ++ * the old slot is free immediately. ++ */ ++ vc4->bin_alloc_used &= ~vc4->bin_alloc_overflow; + } +- spin_unlock_irqrestore(&vc4->job_lock, irqflags); + } ++ vc4->bin_alloc_overflow = BIT(bin_bo_slot); + +- if (vc4->overflow_mem) +- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); +- vc4->overflow_mem = bo; +- +- V3D_WRITE(V3D_BPOA, bo->base.paddr); ++ V3D_WRITE(V3D_BPOA, bo->base.paddr + bin_bo_slot * vc4->bin_alloc_size); + V3D_WRITE(V3D_BPOS, bo->base.base.size); + V3D_WRITE(V3D_INTCTL, V3D_INT_OUTOMEM); + V3D_WRITE(V3D_INTENA, V3D_INT_OUTOMEM); ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); + } + + static void +diff --git a/drivers/gpu/drm/vc4/vc4_render_cl.c b/drivers/gpu/drm/vc4/vc4_render_cl.c +index 5cdd003605f57c99faf31832e3f3dd38a75b7402..6face6aa0890b59bc91d3740fa063a5c46f7cc21 100644 +--- a/drivers/gpu/drm/vc4/vc4_render_cl.c ++++ b/drivers/gpu/drm/vc4/vc4_render_cl.c +@@ -178,8 +178,7 @@ static void emit_tile(struct vc4_exec_info *exec, + + if (has_bin) { + rcl_u8(setup, VC4_PACKET_BRANCH_TO_SUB_LIST); +- rcl_u32(setup, (exec->tile_bo->paddr + +- exec->tile_alloc_offset + ++ rcl_u32(setup, (exec->tile_alloc_offset + + (y * exec->bin_tiles_x + x) * 32)); + } + +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index 1d9e5a6edd22c29ce8b2990c9c35627aa1af2bd8..da79d8511dfb4f631fd3ad4c3680b312f44bd454 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -159,6 +159,144 @@ static void vc4_v3d_init_hw(struct drm_device *dev) + V3D_WRITE(V3D_VPMBASE, 0); + } + ++int vc4_v3d_get_bin_slot(struct vc4_dev *vc4) ++{ ++ struct drm_device *dev = vc4->dev; ++ unsigned long irqflags; ++ int slot; ++ uint64_t seqno = 0; ++ struct vc4_exec_info *exec; ++ ++try_again: ++ spin_lock_irqsave(&vc4->job_lock, irqflags); ++ slot = ffs(~vc4->bin_alloc_used); ++ if (slot != 0) { ++ /* Switch from ffs() bit index to a 0-based index. */ ++ slot--; ++ vc4->bin_alloc_used |= BIT(slot); ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); ++ return slot; ++ } ++ ++ /* Couldn't find an open slot. Wait for render to complete ++ * and try again. ++ */ ++ exec = vc4_last_render_job(vc4); ++ if (exec) ++ seqno = exec->seqno; ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); ++ ++ if (seqno) { ++ int ret = vc4_wait_for_seqno(dev, seqno, ~0ull, true); ++ ++ if (ret == 0) ++ goto try_again; ++ ++ return ret; ++ } ++ ++ return -ENOMEM; ++} ++ ++/** ++ * vc4_allocate_bin_bo() - allocates the memory that will be used for ++ * tile binning. ++ * ++ * The binner has a limitation that the addresses in the tile state ++ * buffer that point into the tile alloc buffer or binner overflow ++ * memory only have 28 bits (256MB), and the top 4 on the bus for ++ * tile alloc references end up coming from the tile state buffer's ++ * address. ++ * ++ * To work around this, we allocate a single large buffer while V3D is ++ * in use, make sure that it has the top 4 bits constant across its ++ * entire extent, and then put the tile state, tile alloc, and binner ++ * overflow memory inside that buffer. ++ * ++ * This creates a limitation where we may not be able to execute a job ++ * if it doesn't fit within the buffer that we allocated up front. ++ * However, it turns out that 16MB is "enough for anybody", and ++ * real-world applications run into allocation failures from the ++ * overall CMA pool before they make scenes complicated enough to run ++ * out of bin space. ++ */ ++int ++vc4_allocate_bin_bo(struct drm_device *drm) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_v3d *v3d = vc4->v3d; ++ uint32_t size = 16 * 1024 * 1024; ++ int ret = 0; ++ struct list_head list; ++ ++ /* We may need to try allocating more than once to get a BO ++ * that doesn't cross 256MB. Track the ones we've allocated ++ * that failed so far, so that we can free them when we've got ++ * one that succeeded (if we freed them right away, our next ++ * allocation would probably be the same chunk of memory). ++ */ ++ INIT_LIST_HEAD(&list); ++ ++ while (true) { ++ struct vc4_bo *bo = vc4_bo_create(drm, size, true); ++ ++ if (IS_ERR(bo)) { ++ ret = PTR_ERR(bo); ++ ++ dev_err(&v3d->pdev->dev, ++ "Failed to allocate memory for tile binning: " ++ "%d. You may need to enable CMA or give it " ++ "more memory.", ++ ret); ++ break; ++ } ++ ++ /* Check if this BO won't trigger the addressing bug. */ ++ if ((bo->base.paddr & 0xf0000000) == ++ ((bo->base.paddr + bo->base.base.size - 1) & 0xf0000000)) { ++ vc4->bin_bo = bo; ++ ++ /* Set up for allocating 512KB chunks of ++ * binner memory. The biggest allocation we ++ * need to do is for the initial tile alloc + ++ * tile state buffer. We can render to a ++ * maximum of ((2048*2048) / (32*32) = 4096 ++ * tiles in a frame (until we do floating ++ * point rendering, at which point it would be ++ * 8192). Tile state is 48b/tile (rounded to ++ * a page), and tile alloc is 32b/tile ++ * (rounded to a page), plus a page of extra, ++ * for a total of 320kb for our worst-case. ++ * We choose 512kb so that it divides evenly ++ * into our 16MB, and the rest of the 512kb ++ * will be used as storage for the overflow ++ * from the initial 32b CL per bin. ++ */ ++ vc4->bin_alloc_size = 512 * 1024; ++ vc4->bin_alloc_used = 0; ++ vc4->bin_alloc_overflow = 0; ++ WARN_ON_ONCE(sizeof(vc4->bin_alloc_used) * 8 != ++ bo->base.base.size / vc4->bin_alloc_size); ++ ++ break; ++ } ++ ++ /* Put it on the list to free later, and try again. */ ++ list_add(&bo->unref_head, &list); ++ } ++ ++ /* Free all the BOs we allocated but didn't choose. */ ++ while (!list_empty(&list)) { ++ struct vc4_bo *bo = list_last_entry(&list, ++ struct vc4_bo, unref_head); ++ ++ list_del(&bo->unref_head); ++ drm_gem_object_unreference_unlocked(&bo->base.base); ++ } ++ ++ return ret; ++} ++ + #ifdef CONFIG_PM + static int vc4_v3d_runtime_suspend(struct device *dev) + { +@@ -167,6 +305,9 @@ static int vc4_v3d_runtime_suspend(struct device *dev) + + vc4_irq_uninstall(vc4->dev); + ++ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); ++ vc4->bin_bo = NULL; ++ + return 0; + } + +@@ -174,6 +315,11 @@ static int vc4_v3d_runtime_resume(struct device *dev) + { + struct vc4_v3d *v3d = dev_get_drvdata(dev); + struct vc4_dev *vc4 = v3d->vc4; ++ int ret; ++ ++ ret = vc4_allocate_bin_bo(vc4->dev); ++ if (ret) ++ return ret; + + vc4_v3d_init_hw(vc4->dev); + vc4_irq_postinstall(vc4->dev); +@@ -226,6 +372,10 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + return -EINVAL; + } + ++ ret = vc4_allocate_bin_bo(drm); ++ if (ret) ++ return ret; ++ + /* Reset the binner overflow address/size at setup, to be sure + * we don't reuse an old one. + */ +diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c +index 9fd171c361c23b52a4d507919ec7e26fd1e87aac..59d808e2a6cc6f3173b1309cc4f491098886cf36 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate.c ++++ b/drivers/gpu/drm/vc4/vc4_validate.c +@@ -340,10 +340,11 @@ static int + validate_tile_binning_config(VALIDATE_ARGS) + { + struct drm_device *dev = exec->exec_bo->base.dev; +- struct vc4_bo *tile_bo; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); + uint8_t flags; +- uint32_t tile_state_size, tile_alloc_size; +- uint32_t tile_count; ++ uint32_t tile_state_size; ++ uint32_t tile_count, bin_addr; ++ int bin_slot; + + if (exec->found_tile_binning_mode_config_packet) { + DRM_ERROR("Duplicate VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); +@@ -369,13 +370,28 @@ validate_tile_binning_config(VALIDATE_ARGS) + return -EINVAL; + } + ++ bin_slot = vc4_v3d_get_bin_slot(vc4); ++ if (bin_slot < 0) { ++ if (bin_slot != -EINTR && bin_slot != -ERESTARTSYS) { ++ DRM_ERROR("Failed to allocate binner memory: %d\n", ++ bin_slot); ++ } ++ return bin_slot; ++ } ++ ++ /* The slot we allocated will only be used by this job, and is ++ * free when the job completes rendering. ++ */ ++ exec->bin_slots |= BIT(bin_slot); ++ bin_addr = vc4->bin_bo->base.paddr + bin_slot * vc4->bin_alloc_size; ++ + /* The tile state data array is 48 bytes per tile, and we put it at + * the start of a BO containing both it and the tile alloc. + */ + tile_state_size = 48 * tile_count; + + /* Since the tile alloc array will follow us, align. */ +- exec->tile_alloc_offset = roundup(tile_state_size, 4096); ++ exec->tile_alloc_offset = bin_addr + roundup(tile_state_size, 4096); + + *(uint8_t *)(validated + 14) = + ((flags & ~(VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_MASK | +@@ -386,35 +402,13 @@ validate_tile_binning_config(VALIDATE_ARGS) + VC4_SET_FIELD(VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_128, + VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE)); + +- /* Initial block size. */ +- tile_alloc_size = 32 * tile_count; +- +- /* +- * The initial allocation gets rounded to the next 256 bytes before +- * the hardware starts fulfilling further allocations. +- */ +- tile_alloc_size = roundup(tile_alloc_size, 256); +- +- /* Add space for the extra allocations. This is what gets used first, +- * before overflow memory. It must have at least 4096 bytes, but we +- * want to avoid overflow memory usage if possible. +- */ +- tile_alloc_size += 1024 * 1024; +- +- tile_bo = vc4_bo_create(dev, exec->tile_alloc_offset + tile_alloc_size, +- true); +- exec->tile_bo = &tile_bo->base; +- if (IS_ERR(exec->tile_bo)) +- return PTR_ERR(exec->tile_bo); +- list_add_tail(&tile_bo->unref_head, &exec->unref_list); +- + /* tile alloc address. */ +- *(uint32_t *)(validated + 0) = (exec->tile_bo->paddr + +- exec->tile_alloc_offset); ++ *(uint32_t *)(validated + 0) = exec->tile_alloc_offset; + /* tile alloc size. */ +- *(uint32_t *)(validated + 4) = tile_alloc_size; ++ *(uint32_t *)(validated + 4) = (bin_addr + vc4->bin_alloc_size - ++ exec->tile_alloc_offset); + /* tile state address. */ +- *(uint32_t *)(validated + 8) = exec->tile_bo->paddr; ++ *(uint32_t *)(validated + 8) = bin_addr; + + return 0; + } + +From 06e527d86a6359405901fd7fb682d478ca5ce451 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 30 Mar 2017 10:23:27 -0700 +Subject: [PATCH 222/305] Revert "drm/vc4: Verify at boot that CMA doesn't + cross a 256MB boundary." + +This reverts commit 016c804fa69381bd23a1a13cba08a3c4557fcdff. The +restriction was lifted by the previous commit. +--- + drivers/base/dma-contiguous.c | 1 - + drivers/gpu/drm/vc4/vc4_v3d.c | 18 ------------------ + mm/cma.c | 2 -- + 3 files changed, 21 deletions(-) + +diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c +index 60f5c2591ccdb0202461458eab4035cfba731b8b..e167a1e1bccb062efef2595fcd5299301a97df80 100644 +--- a/drivers/base/dma-contiguous.c ++++ b/drivers/base/dma-contiguous.c +@@ -35,7 +35,6 @@ + #endif + + struct cma *dma_contiguous_default_area; +-EXPORT_SYMBOL(dma_contiguous_default_area); + + /* + * Default global CMA area size can be defined in kernel's .config. +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index da79d8511dfb4f631fd3ad4c3680b312f44bd454..882ec06225f1d5caca71bdb5c69664188192c2e2 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -16,10 +16,7 @@ + * this program. If not, see . + */ + +-#include "linux/init.h" +-#include "linux/cma.h" + #include "linux/component.h" +-#include "linux/dma-contiguous.h" + #include "linux/pm_runtime.h" + #include "vc4_drv.h" + #include "vc4_regs.h" +@@ -334,23 +331,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_v3d *v3d = NULL; +- struct cma *cma; + int ret; + +- cma = dev_get_cma_area(dev); +- if (!cma) +- return -EINVAL; +- +- if ((cma_get_base(cma) & 0xf0000000) != +- ((cma_get_base(cma) + cma_get_size(cma) - 1) & 0xf0000000)) { +- DRM_ERROR("V3D requires that the CMA area (0x%08lx - 0x%08lx) " +- "not span a 256MB boundary, or memory corruption " +- "would happen.\n", +- (long)cma_get_base(cma), +- cma_get_base(cma) + cma_get_size(cma)); +- return -EINVAL; +- } +- + v3d = devm_kzalloc(&pdev->dev, sizeof(*v3d), GFP_KERNEL); + if (!v3d) + return -ENOMEM; +diff --git a/mm/cma.c b/mm/cma.c +index b50245282a18bc790da0f901944c2e670ffac2d2..c960459eda7e640ea55be1d4ed80c6a9125a8877 100644 +--- a/mm/cma.c ++++ b/mm/cma.c +@@ -47,13 +47,11 @@ phys_addr_t cma_get_base(const struct cma *cma) + { + return PFN_PHYS(cma->base_pfn); + } +-EXPORT_SYMBOL(cma_get_base); + + unsigned long cma_get_size(const struct cma *cma) + { + return cma->count << PAGE_SHIFT; + } +-EXPORT_SYMBOL(cma_get_size); + + static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, + int align_order) + +From 88921924d479d4cae78c3a6e5dc6d4ca238715a6 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 27 Feb 2017 12:28:02 -0800 +Subject: [PATCH 223/305] drm/vc4: Add HDMI audio support + +The HDMI encoder IP embeds all needed blocks to output audio, with a +custom DAI called MAI moving audio between the two parts of the HDMI +core. This driver now exposes a sound card to let users stream audio +to their display. + +Using the hdmi-codec driver has been considered here, but MAI meant +having to significantly rework hdmi-codec, and it would have left +little shared code with the I2S mode anyway. + +The encoder requires that the audio be SPDIF-formatted frames only, +which alsalib will format-convert for us. + +This patch is the combined work of Eric Anholt (initial register setup +with a separate dmaengine driver and using simple-audio-card) and +Boris Brezillon (moving it all into HDMI, massive debug to get it +actually working), and which Eric has the permission to release. + +v2: Drop "-audio" from sound card name, since that's already implied + (suggestion by Boris) + +Signed-off-by: Eric Anholt +Acked-by: Boris Brezillon +Link: http://patchwork.freedesktop.org/patch/msgid/20170227202803.12855-2-eric@anholt.net +--- + drivers/gpu/drm/vc4/Kconfig | 4 + + drivers/gpu/drm/vc4/vc4_hdmi.c | 494 ++++++++++++++++++++++++++++++++++++++++- + drivers/gpu/drm/vc4/vc4_regs.h | 107 ++++++++- + 3 files changed, 603 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig +index e1517d07cb7d22776ca164a5d2d9b87e55a5563a..973b4203c0b264115b7cd9d4a433b449bd0ec3b3 100644 +--- a/drivers/gpu/drm/vc4/Kconfig ++++ b/drivers/gpu/drm/vc4/Kconfig +@@ -2,11 +2,15 @@ config DRM_VC4 + tristate "Broadcom VC4 Graphics" + depends on ARCH_BCM2835 || COMPILE_TEST + depends on DRM ++ depends on SND && SND_SOC + depends on COMMON_CLK + select DRM_KMS_HELPER + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER + select DRM_PANEL ++ select SND_PCM ++ select SND_PCM_ELD ++ select SND_SOC_GENERIC_DMAENGINE_PCM + select DRM_MIPI_DSI + help + Choose this option if you have a system that has a Broadcom +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index c4cb2e26de32f06db0abf3fd94b3117c3292eed5..8db1016cad929438f30ea44c6974dcb340b74596 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -31,11 +31,27 @@ + #include "linux/clk.h" + #include "linux/component.h" + #include "linux/i2c.h" ++#include "linux/of_address.h" + #include "linux/of_gpio.h" + #include "linux/of_platform.h" ++#include "linux/rational.h" ++#include "sound/dmaengine_pcm.h" ++#include "sound/pcm_drm_eld.h" ++#include "sound/pcm_params.h" ++#include "sound/soc.h" + #include "vc4_drv.h" + #include "vc4_regs.h" + ++/* HDMI audio information */ ++struct vc4_hdmi_audio { ++ struct snd_soc_card card; ++ struct snd_soc_dai_link link; ++ int samplerate; ++ int channels; ++ struct snd_dmaengine_dai_dma_data dma_data; ++ struct snd_pcm_substream *substream; ++}; ++ + /* General HDMI hardware state. */ + struct vc4_hdmi { + struct platform_device *pdev; +@@ -43,6 +59,8 @@ struct vc4_hdmi { + struct drm_encoder *encoder; + struct drm_connector *connector; + ++ struct vc4_hdmi_audio audio; ++ + struct i2c_adapter *ddc; + void __iomem *hdmicore_regs; + void __iomem *hd_regs; +@@ -98,6 +116,10 @@ static const struct { + HDMI_REG(VC4_HDMI_SW_RESET_CONTROL), + HDMI_REG(VC4_HDMI_HOTPLUG_INT), + HDMI_REG(VC4_HDMI_HOTPLUG), ++ HDMI_REG(VC4_HDMI_MAI_CHANNEL_MAP), ++ HDMI_REG(VC4_HDMI_MAI_CONFIG), ++ HDMI_REG(VC4_HDMI_MAI_FORMAT), ++ HDMI_REG(VC4_HDMI_AUDIO_PACKET_CONFIG), + HDMI_REG(VC4_HDMI_RAM_PACKET_CONFIG), + HDMI_REG(VC4_HDMI_HORZA), + HDMI_REG(VC4_HDMI_HORZB), +@@ -108,6 +130,7 @@ static const struct { + HDMI_REG(VC4_HDMI_VERTB0), + HDMI_REG(VC4_HDMI_VERTB1), + HDMI_REG(VC4_HDMI_TX_PHY_RESET_CTL), ++ HDMI_REG(VC4_HDMI_TX_PHY_CTL0), + }; + + static const struct { +@@ -116,6 +139,9 @@ static const struct { + } hd_regs[] = { + HDMI_REG(VC4_HD_M_CTL), + HDMI_REG(VC4_HD_MAI_CTL), ++ HDMI_REG(VC4_HD_MAI_THR), ++ HDMI_REG(VC4_HD_MAI_FMT), ++ HDMI_REG(VC4_HD_MAI_SMP), + HDMI_REG(VC4_HD_VID_CTL), + HDMI_REG(VC4_HD_CSC_CTL), + HDMI_REG(VC4_HD_FRAME_COUNT), +@@ -215,6 +241,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + + drm_mode_connector_update_edid_property(connector, edid); + ret = drm_add_edid_modes(connector, edid); ++ drm_edid_to_eld(connector, edid); + + return ret; + } +@@ -300,7 +327,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, + 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; ++ u32 packet_reg = VC4_HDMI_RAM_PACKET(packet_id); + uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; + ssize_t len, i; + int ret; +@@ -385,6 +412,24 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder) + vc4_hdmi_write_infoframe(encoder, &frame); + } + ++static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder) ++{ ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dev *vc4 = drm->dev_private; ++ struct vc4_hdmi *hdmi = vc4->hdmi; ++ union hdmi_infoframe frame; ++ int ret; ++ ++ ret = hdmi_audio_infoframe_init(&frame.audio); ++ ++ frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM; ++ frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM; ++ frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM; ++ frame.audio.channels = hdmi->audio.channels; ++ ++ vc4_hdmi_write_infoframe(encoder, &frame); ++} ++ + static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) + { + vc4_hdmi_set_avi_infoframe(encoder); +@@ -591,6 +636,447 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { + .enable = vc4_hdmi_encoder_enable, + }; + ++/* HDMI audio codec callbacks */ ++static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *hdmi) ++{ ++ struct drm_device *drm = hdmi->encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ u32 hsm_clock = clk_get_rate(hdmi->hsm_clock); ++ unsigned long n, m; ++ ++ rational_best_approximation(hsm_clock, hdmi->audio.samplerate, ++ VC4_HD_MAI_SMP_N_MASK >> ++ VC4_HD_MAI_SMP_N_SHIFT, ++ (VC4_HD_MAI_SMP_M_MASK >> ++ VC4_HD_MAI_SMP_M_SHIFT) + 1, ++ &n, &m); ++ ++ HD_WRITE(VC4_HD_MAI_SMP, ++ VC4_SET_FIELD(n, VC4_HD_MAI_SMP_N) | ++ VC4_SET_FIELD(m - 1, VC4_HD_MAI_SMP_M)); ++} ++ ++static void vc4_hdmi_set_n_cts(struct vc4_hdmi *hdmi) ++{ ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_crtc *crtc = encoder->crtc; ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ const struct drm_display_mode *mode = &crtc->state->adjusted_mode; ++ u32 samplerate = hdmi->audio.samplerate; ++ u32 n, cts; ++ u64 tmp; ++ ++ n = 128 * samplerate / 1000; ++ tmp = (u64)(mode->clock * 1000) * n; ++ do_div(tmp, 128 * samplerate); ++ cts = tmp; ++ ++ HDMI_WRITE(VC4_HDMI_CRP_CFG, ++ VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN | ++ VC4_SET_FIELD(n, VC4_HDMI_CRP_CFG_N)); ++ ++ /* ++ * We could get slightly more accurate clocks in some cases by ++ * providing a CTS_1 value. The two CTS values are alternated ++ * between based on the period fields ++ */ ++ HDMI_WRITE(VC4_HDMI_CTS_0, cts); ++ HDMI_WRITE(VC4_HDMI_CTS_1, cts); ++} ++ ++static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) ++{ ++ struct snd_soc_card *card = snd_soc_dai_get_drvdata(dai); ++ ++ return snd_soc_card_get_drvdata(card); ++} ++ ++static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct vc4_dev *vc4 = to_vc4_dev(encoder->dev); ++ int ret; ++ ++ if (hdmi->audio.substream && hdmi->audio.substream != substream) ++ return -EINVAL; ++ ++ hdmi->audio.substream = substream; ++ ++ /* ++ * If the HDMI encoder hasn't probed, or the encoder is ++ * currently in DVI mode, treat the codec dai as missing. ++ */ ++ if (!encoder->crtc || !(HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & ++ VC4_HDMI_RAM_PACKET_ENABLE)) ++ return -ENODEV; ++ ++ ret = snd_pcm_hw_constraint_eld(substream->runtime, ++ hdmi->connector->eld); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++static int vc4_hdmi_audio_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ++{ ++ return 0; ++} ++ ++static void vc4_hdmi_audio_reset(struct vc4_hdmi *hdmi) ++{ ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_device *drm = encoder->dev; ++ struct device *dev = &hdmi->pdev->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ int ret; ++ ++ ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO); ++ if (ret) ++ dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); ++ ++ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_RESET); ++ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_ERRORF); ++ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_FLUSH); ++} ++ ++static void vc4_hdmi_audio_shutdown(struct snd_pcm_substream *substream, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ ++ if (substream != hdmi->audio.substream) ++ return; ++ ++ vc4_hdmi_audio_reset(hdmi); ++ ++ hdmi->audio.substream = NULL; ++} ++ ++/* HDMI audio codec callbacks */ ++static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_device *drm = encoder->dev; ++ struct device *dev = &hdmi->pdev->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ u32 audio_packet_config, channel_mask; ++ u32 channel_map, i; ++ ++ if (substream != hdmi->audio.substream) ++ return -EINVAL; ++ ++ dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, ++ params_rate(params), params_width(params), ++ params_channels(params)); ++ ++ hdmi->audio.channels = params_channels(params); ++ hdmi->audio.samplerate = params_rate(params); ++ ++ HD_WRITE(VC4_HD_MAI_CTL, ++ VC4_HD_MAI_CTL_RESET | ++ VC4_HD_MAI_CTL_FLUSH | ++ VC4_HD_MAI_CTL_DLATE | ++ VC4_HD_MAI_CTL_ERRORE | ++ VC4_HD_MAI_CTL_ERRORF); ++ ++ vc4_hdmi_audio_set_mai_clock(hdmi); ++ ++ audio_packet_config = ++ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT | ++ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS | ++ VC4_SET_FIELD(0xf, VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER); ++ ++ channel_mask = GENMASK(hdmi->audio.channels - 1, 0); ++ audio_packet_config |= VC4_SET_FIELD(channel_mask, ++ VC4_HDMI_AUDIO_PACKET_CEA_MASK); ++ ++ /* Set the MAI threshold. This logic mimics the firmware's. */ ++ if (hdmi->audio.samplerate > 96000) { ++ HD_WRITE(VC4_HD_MAI_THR, ++ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQHIGH) | ++ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); ++ } else if (hdmi->audio.samplerate > 48000) { ++ HD_WRITE(VC4_HD_MAI_THR, ++ VC4_SET_FIELD(0x14, VC4_HD_MAI_THR_DREQHIGH) | ++ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); ++ } else { ++ HD_WRITE(VC4_HD_MAI_THR, ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); ++ } ++ ++ HDMI_WRITE(VC4_HDMI_MAI_CONFIG, ++ VC4_HDMI_MAI_CONFIG_BIT_REVERSE | ++ VC4_SET_FIELD(channel_mask, VC4_HDMI_MAI_CHANNEL_MASK)); ++ ++ channel_map = 0; ++ for (i = 0; i < 8; i++) { ++ if (channel_mask & BIT(i)) ++ channel_map |= i << (3 * i); ++ } ++ ++ HDMI_WRITE(VC4_HDMI_MAI_CHANNEL_MAP, channel_map); ++ HDMI_WRITE(VC4_HDMI_AUDIO_PACKET_CONFIG, audio_packet_config); ++ vc4_hdmi_set_n_cts(hdmi); ++ ++ return 0; ++} ++ ++static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ vc4_hdmi_set_audio_infoframe(encoder); ++ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, ++ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) & ++ ~VC4_HDMI_TX_PHY_RNG_PWRDN); ++ HD_WRITE(VC4_HD_MAI_CTL, ++ VC4_SET_FIELD(hdmi->audio.channels, ++ VC4_HD_MAI_CTL_CHNUM) | ++ VC4_HD_MAI_CTL_ENABLE); ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ HD_WRITE(VC4_HD_MAI_CTL, ++ VC4_HD_MAI_CTL_DLATE | ++ VC4_HD_MAI_CTL_ERRORE | ++ VC4_HD_MAI_CTL_ERRORF); ++ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, ++ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) | ++ VC4_HDMI_TX_PHY_RNG_PWRDN); ++ break; ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static inline struct vc4_hdmi * ++snd_component_to_hdmi(struct snd_soc_component *component) ++{ ++ struct snd_soc_card *card = snd_soc_component_get_drvdata(component); ++ ++ return snd_soc_card_get_drvdata(card); ++} ++ ++static int vc4_hdmi_audio_eld_ctl_info(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_info *uinfo) ++{ ++ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); ++ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); ++ ++ uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; ++ uinfo->count = sizeof(hdmi->connector->eld); ++ ++ return 0; ++} ++ ++static int vc4_hdmi_audio_eld_ctl_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); ++ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); ++ ++ memcpy(ucontrol->value.bytes.data, hdmi->connector->eld, ++ sizeof(hdmi->connector->eld)); ++ ++ return 0; ++} ++ ++static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { ++ { ++ .access = SNDRV_CTL_ELEM_ACCESS_READ | ++ SNDRV_CTL_ELEM_ACCESS_VOLATILE, ++ .iface = SNDRV_CTL_ELEM_IFACE_PCM, ++ .name = "ELD", ++ .info = vc4_hdmi_audio_eld_ctl_info, ++ .get = vc4_hdmi_audio_eld_ctl_get, ++ }, ++}; ++ ++static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { ++ SND_SOC_DAPM_OUTPUT("TX"), ++}; ++ ++static const struct snd_soc_dapm_route vc4_hdmi_audio_routes[] = { ++ { "TX", NULL, "Playback" }, ++}; ++ ++static const struct snd_soc_codec_driver vc4_hdmi_audio_codec_drv = { ++ .component_driver = { ++ .controls = vc4_hdmi_audio_controls, ++ .num_controls = ARRAY_SIZE(vc4_hdmi_audio_controls), ++ .dapm_widgets = vc4_hdmi_audio_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(vc4_hdmi_audio_widgets), ++ .dapm_routes = vc4_hdmi_audio_routes, ++ .num_dapm_routes = ARRAY_SIZE(vc4_hdmi_audio_routes), ++ }, ++}; ++ ++static const struct snd_soc_dai_ops vc4_hdmi_audio_dai_ops = { ++ .startup = vc4_hdmi_audio_startup, ++ .shutdown = vc4_hdmi_audio_shutdown, ++ .hw_params = vc4_hdmi_audio_hw_params, ++ .set_fmt = vc4_hdmi_audio_set_fmt, ++ .trigger = vc4_hdmi_audio_trigger, ++}; ++ ++static struct snd_soc_dai_driver vc4_hdmi_audio_codec_dai_drv = { ++ .name = "vc4-hdmi-hifi", ++ .playback = { ++ .stream_name = "Playback", ++ .channels_min = 2, ++ .channels_max = 8, ++ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | ++ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | ++ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | ++ SNDRV_PCM_RATE_192000, ++ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, ++ }, ++}; ++ ++static const struct snd_soc_component_driver vc4_hdmi_audio_cpu_dai_comp = { ++ .name = "vc4-hdmi-cpu-dai-component", ++}; ++ ++static int vc4_hdmi_audio_cpu_dai_probe(struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ ++ snd_soc_dai_init_dma_data(dai, &hdmi->audio.dma_data, NULL); ++ ++ return 0; ++} ++ ++static struct snd_soc_dai_driver vc4_hdmi_audio_cpu_dai_drv = { ++ .name = "vc4-hdmi-cpu-dai", ++ .probe = vc4_hdmi_audio_cpu_dai_probe, ++ .playback = { ++ .stream_name = "Playback", ++ .channels_min = 1, ++ .channels_max = 8, ++ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | ++ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | ++ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | ++ SNDRV_PCM_RATE_192000, ++ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, ++ }, ++ .ops = &vc4_hdmi_audio_dai_ops, ++}; ++ ++static const struct snd_dmaengine_pcm_config pcm_conf = { ++ .chan_names[SNDRV_PCM_STREAM_PLAYBACK] = "audio-rx", ++ .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, ++}; ++ ++static int vc4_hdmi_audio_init(struct vc4_hdmi *hdmi) ++{ ++ struct snd_soc_dai_link *dai_link = &hdmi->audio.link; ++ struct snd_soc_card *card = &hdmi->audio.card; ++ struct device *dev = &hdmi->pdev->dev; ++ const __be32 *addr; ++ int ret; ++ ++ if (!of_find_property(dev->of_node, "dmas", NULL)) { ++ dev_warn(dev, ++ "'dmas' DT property is missing, no HDMI audio\n"); ++ return 0; ++ } ++ ++ /* ++ * Get the physical address of VC4_HD_MAI_DATA. We need to retrieve ++ * the bus address specified in the DT, because the physical address ++ * (the one returned by platform_get_resource()) is not appropriate ++ * for DMA transfers. ++ * This VC/MMU should probably be exposed to avoid this kind of hacks. ++ */ ++ addr = of_get_address(dev->of_node, 1, NULL, NULL); ++ hdmi->audio.dma_data.addr = be32_to_cpup(addr) + VC4_HD_MAI_DATA; ++ hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; ++ hdmi->audio.dma_data.maxburst = 2; ++ ++ ret = devm_snd_dmaengine_pcm_register(dev, &pcm_conf, 0); ++ if (ret) { ++ dev_err(dev, "Could not register PCM component: %d\n", ret); ++ return ret; ++ } ++ ++ ret = devm_snd_soc_register_component(dev, &vc4_hdmi_audio_cpu_dai_comp, ++ &vc4_hdmi_audio_cpu_dai_drv, 1); ++ if (ret) { ++ dev_err(dev, "Could not register CPU DAI: %d\n", ret); ++ return ret; ++ } ++ ++ /* register codec and codec dai */ ++ ret = snd_soc_register_codec(dev, &vc4_hdmi_audio_codec_drv, ++ &vc4_hdmi_audio_codec_dai_drv, 1); ++ if (ret) { ++ dev_err(dev, "Could not register codec: %d\n", ret); ++ return ret; ++ } ++ ++ dai_link->name = "MAI"; ++ dai_link->stream_name = "MAI PCM"; ++ dai_link->codec_dai_name = vc4_hdmi_audio_codec_dai_drv.name; ++ dai_link->cpu_dai_name = dev_name(dev); ++ dai_link->codec_name = dev_name(dev); ++ dai_link->platform_name = dev_name(dev); ++ ++ card->dai_link = dai_link; ++ card->num_links = 1; ++ card->name = "vc4-hdmi"; ++ card->dev = dev; ++ ++ /* ++ * Be careful, snd_soc_register_card() calls dev_set_drvdata() and ++ * stores a pointer to the snd card object in dev->driver_data. This ++ * means we cannot use it for something else. The hdmi back-pointer is ++ * now stored in card->drvdata and should be retrieved with ++ * snd_soc_card_get_drvdata() if needed. ++ */ ++ snd_soc_card_set_drvdata(card, hdmi); ++ ret = devm_snd_soc_register_card(dev, card); ++ if (ret) { ++ dev_err(dev, "Could not register sound card: %d\n", ret); ++ goto unregister_codec; ++ } ++ ++ return 0; ++ ++unregister_codec: ++ snd_soc_unregister_codec(dev); ++ ++ return ret; ++} ++ ++static void vc4_hdmi_audio_cleanup(struct vc4_hdmi *hdmi) ++{ ++ struct device *dev = &hdmi->pdev->dev; ++ ++ /* ++ * If drvdata is not set this means the audio card was not ++ * registered, just skip codec unregistration in this case. ++ */ ++ if (dev_get_drvdata(dev)) ++ snd_soc_unregister_codec(dev); ++} ++ + static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -722,6 +1208,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + goto err_destroy_encoder; + } + ++ ret = vc4_hdmi_audio_init(hdmi); ++ if (ret) ++ goto err_destroy_encoder; ++ + return 0; + + err_destroy_encoder: +@@ -743,6 +1233,8 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + struct vc4_dev *vc4 = drm->dev_private; + struct vc4_hdmi *hdmi = vc4->hdmi; + ++ vc4_hdmi_audio_cleanup(hdmi); ++ + vc4_hdmi_connector_destroy(hdmi->connector); + vc4_hdmi_encoder_destroy(hdmi->encoder); + +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 385405a2df05eb3dd86d4f687aa8205331bec3cc..932093936178674173a84002b33e07e9a37fdfe9 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -446,11 +446,62 @@ + #define VC4_HDMI_HOTPLUG 0x00c + # define VC4_HDMI_HOTPLUG_CONNECTED BIT(0) + ++/* 3 bits per field, where each field maps from that corresponding MAI ++ * bus channel to the given HDMI channel. ++ */ ++#define VC4_HDMI_MAI_CHANNEL_MAP 0x090 ++ ++#define VC4_HDMI_MAI_CONFIG 0x094 ++# define VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE BIT(27) ++# define VC4_HDMI_MAI_CONFIG_BIT_REVERSE BIT(26) ++# define VC4_HDMI_MAI_CHANNEL_MASK_MASK VC4_MASK(15, 0) ++# define VC4_HDMI_MAI_CHANNEL_MASK_SHIFT 0 ++ ++/* Last received format word on the MAI bus. */ ++#define VC4_HDMI_MAI_FORMAT 0x098 ++ ++#define VC4_HDMI_AUDIO_PACKET_CONFIG 0x09c ++# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT BIT(29) ++# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS BIT(24) ++# define VC4_HDMI_AUDIO_PACKET_FORCE_SAMPLE_PRESENT BIT(19) ++# define VC4_HDMI_AUDIO_PACKET_FORCE_B_FRAME BIT(18) ++# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_MASK VC4_MASK(13, 10) ++# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_SHIFT 10 ++/* If set, then multichannel, otherwise 2 channel. */ ++# define VC4_HDMI_AUDIO_PACKET_AUDIO_LAYOUT BIT(9) ++/* If set, then AUDIO_LAYOUT overrides audio_cea_mask */ ++# define VC4_HDMI_AUDIO_PACKET_FORCE_AUDIO_LAYOUT BIT(8) ++# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_MASK VC4_MASK(7, 0) ++# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_SHIFT 0 ++ + #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_CRP_CFG 0x0a8 ++/* When set, the CTS_PERIOD counts based on MAI bus sync pulse instead ++ * of pixel clock. ++ */ ++# define VC4_HDMI_CRP_USE_MAI_BUS_SYNC_FOR_CTS BIT(26) ++/* When set, no CRP packets will be sent. */ ++# define VC4_HDMI_CRP_CFG_DISABLE BIT(25) ++/* If set, generates CTS values based on N, audio clock, and video ++ * clock. N must be divisible by 128. ++ */ ++# define VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN BIT(24) ++# define VC4_HDMI_CRP_CFG_N_MASK VC4_MASK(19, 0) ++# define VC4_HDMI_CRP_CFG_N_SHIFT 0 ++ ++/* 20-bit fields containing CTS values to be transmitted if !EXTERNAL_CTS_EN */ ++#define VC4_HDMI_CTS_0 0x0ac ++#define VC4_HDMI_CTS_1 0x0b0 ++/* 20-bit fields containing number of clocks to send CTS0/1 before ++ * switching to the other one. ++ */ ++#define VC4_HDMI_CTS_PERIOD_0 0x0b4 ++#define VC4_HDMI_CTS_PERIOD_1 0x0b8 ++ + #define VC4_HDMI_HORZA 0x0c4 + # define VC4_HDMI_HORZA_VPOS BIT(14) + # define VC4_HDMI_HORZA_HPOS BIT(13) +@@ -512,7 +563,11 @@ + + #define VC4_HDMI_TX_PHY_RESET_CTL 0x2c0 + +-#define VC4_HDMI_GCP_0 0x400 ++#define VC4_HDMI_TX_PHY_CTL0 0x2c4 ++# define VC4_HDMI_TX_PHY_RNG_PWRDN BIT(25) ++ ++#define VC4_HDMI_GCP(x) (0x400 + ((x) * 0x4)) ++#define VC4_HDMI_RAM_PACKET(x) (0x400 + ((x) * 0x24)) + #define VC4_HDMI_PACKET_STRIDE 0x24 + + #define VC4_HD_M_CTL 0x00c +@@ -522,6 +577,56 @@ + # define VC4_HD_M_ENABLE BIT(0) + + #define VC4_HD_MAI_CTL 0x014 ++/* Set when audio stream is received at a slower rate than the ++ * sampling period, so MAI fifo goes empty. Write 1 to clear. ++ */ ++# define VC4_HD_MAI_CTL_DLATE BIT(15) ++# define VC4_HD_MAI_CTL_BUSY BIT(14) ++# define VC4_HD_MAI_CTL_CHALIGN BIT(13) ++# define VC4_HD_MAI_CTL_WHOLSMP BIT(12) ++# define VC4_HD_MAI_CTL_FULL BIT(11) ++# define VC4_HD_MAI_CTL_EMPTY BIT(10) ++# define VC4_HD_MAI_CTL_FLUSH BIT(9) ++/* If set, MAI bus generates SPDIF (bit 31) parity instead of passing ++ * through. ++ */ ++# define VC4_HD_MAI_CTL_PAREN BIT(8) ++# define VC4_HD_MAI_CTL_CHNUM_MASK VC4_MASK(7, 4) ++# define VC4_HD_MAI_CTL_CHNUM_SHIFT 4 ++# define VC4_HD_MAI_CTL_ENABLE BIT(3) ++/* Underflow error status bit, write 1 to clear. */ ++# define VC4_HD_MAI_CTL_ERRORE BIT(2) ++/* Overflow error status bit, write 1 to clear. */ ++# define VC4_HD_MAI_CTL_ERRORF BIT(1) ++/* Single-shot reset bit. Read value is undefined. */ ++# define VC4_HD_MAI_CTL_RESET BIT(0) ++ ++#define VC4_HD_MAI_THR 0x018 ++# define VC4_HD_MAI_THR_PANICHIGH_MASK VC4_MASK(29, 24) ++# define VC4_HD_MAI_THR_PANICHIGH_SHIFT 24 ++# define VC4_HD_MAI_THR_PANICLOW_MASK VC4_MASK(21, 16) ++# define VC4_HD_MAI_THR_PANICLOW_SHIFT 16 ++# define VC4_HD_MAI_THR_DREQHIGH_MASK VC4_MASK(13, 8) ++# define VC4_HD_MAI_THR_DREQHIGH_SHIFT 8 ++# define VC4_HD_MAI_THR_DREQLOW_MASK VC4_MASK(5, 0) ++# define VC4_HD_MAI_THR_DREQLOW_SHIFT 0 ++ ++/* Format header to be placed on the MAI data. Unused. */ ++#define VC4_HD_MAI_FMT 0x01c ++ ++/* Register for DMAing in audio data to be transported over the MAI ++ * bus to the Falcon core. ++ */ ++#define VC4_HD_MAI_DATA 0x020 ++ ++/* Divider from HDMI HSM clock to MAI serial clock. Sampling period ++ * converges to N / (M + 1) cycles. ++ */ ++#define VC4_HD_MAI_SMP 0x02c ++# define VC4_HD_MAI_SMP_N_MASK VC4_MASK(31, 8) ++# define VC4_HD_MAI_SMP_N_SHIFT 8 ++# define VC4_HD_MAI_SMP_M_MASK VC4_MASK(7, 0) ++# define VC4_HD_MAI_SMP_M_SHIFT 0 + + #define VC4_HD_VID_CTL 0x038 + # define VC4_HD_VID_CTL_ENABLE BIT(31) + +From 4e8ca7d531bcb9c18c3a684f5aebbefb76242af6 Mon Sep 17 00:00:00 2001 +From: Boris Brezillon +Date: Thu, 2 Feb 2017 11:37:36 +0100 +Subject: [PATCH 224/305] ARM: dts: bcm283x: Add HDMI audio related properties + +Add the dmas and dma-names properties to support HDMI audio. + +Signed-off-by: Boris Brezillon +Signed-off-by: Eric Anholt +(cherry picked from commit d46d2c6380c10e80e99f6af9067356128bffac6b) +--- + arch/arm/boot/dts/bcm283x.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index 348c71bbc913644c04bab43fcb95abe9b6c9c640..7d58cd79ac6bd99f0b47a909ac827c61aac642d9 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -339,6 +339,8 @@ + clocks = <&clocks BCM2835_PLLH_PIX>, + <&clocks BCM2835_CLOCK_HSM>; + clock-names = "pixel", "hdmi"; ++ dmas = <&dma 17>; ++ dma-names = "audio-rx"; + status = "disabled"; + }; + + +From be7726f5eb345ff0fe1dd229a9177551f934c36d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Apr 2017 17:52:56 -0700 -Subject: [PATCH 226/269] panel-raspberrypi-touchscreen: Fix NULL deref if +Subject: [PATCH 225/305] panel-raspberrypi-touchscreen: Fix NULL deref if probe order goes wrong. If the i2c driver hadn't pobed before the panel driver probes, then @@ -159193,10 +159149,10 @@ index 7f315f04b109621ca7f3861fdd8acf956e752629..b57b7ad9aa4c5048186e98553af59ec9 } -From 9bcf9e12ae13d1e928af0d769182a3c663c059f2 Mon Sep 17 00:00:00 2001 +From ec8fcfa9cfe40b5ccefdd2946c09f2e1628d838e Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Wed, 19 Apr 2017 09:59:21 -0700 -Subject: [PATCH 227/269] smsc75xx: use skb_cow_head() to deal with cloned skbs +Subject: [PATCH 226/305] smsc75xx: use skb_cow_head() to deal with cloned skbs We need to ensure there is enough headroom to push extra header, but we also need to check if we are allowed to change headers. @@ -159232,10 +159188,10 @@ index 9af9799935dbbd4baed06eb03402803e0ce8d9c8..4cb9b11a545a9572ab6d248742ec5abe tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS; -From 416209e2665c0d88ecf205fe77c86aeeaa392a29 Mon Sep 17 00:00:00 2001 +From 5dc8bc82994dfdd5946d43c5654c6a66590096fe Mon Sep 17 00:00:00 2001 From: James Hughes Date: Wed, 19 Apr 2017 11:13:40 +0100 -Subject: [PATCH 228/269] smsc95xx: Use skb_cow_head to deal with cloned skbs +Subject: [PATCH 227/305] smsc95xx: Use skb_cow_head to deal with cloned skbs The driver was failing to check that the SKB wasn't cloned before adding checksum data. @@ -159275,35 +159231,10 @@ index df60c989fc229bf0aab3c27e95ccd45323367840..f6661e388f6e801c1b88e48a3b71407b if (csum) { -From b913417a2368cb15a90a2dbfb34bea855bf55347 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 24 Apr 2017 18:26:52 +0100 -Subject: [PATCH 229/269] i2c-bcm2835: Ignore unexpected interrupt - ---- - drivers/i2c/busses/i2c-bcm2835.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c -index 8642f580ce41803bd22c76a0fa80d083d0747be1..47167f403cc8329bd811b47c7011c299b8ecafee 100644 ---- a/drivers/i2c/busses/i2c-bcm2835.c -+++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -279,7 +279,9 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - } - - if (val & BCM2835_I2C_S_DONE) { -- if (i2c_dev->curr_msg->flags & I2C_M_RD) { -+ if (!i2c_dev->curr_msg) { -+ dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n"); -+ } else if (i2c_dev->curr_msg->flags & I2C_M_RD) { - bcm2835_drain_rxfifo(i2c_dev); - val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); - } - -From ff6c45239866c15264dab3f6af013a0a76793ced Mon Sep 17 00:00:00 2001 +From 339ba44d0abb66b6290fca8bae42fdcb73b319b7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 23 Apr 2017 19:36:53 +0100 -Subject: [PATCH 230/269] BCM270X_DT: Add bme280 and bmp180 to i2c-sensor +Subject: [PATCH 228/305] BCM270X_DT: Add bme280 and bmp180 to i2c-sensor overlay Signed-off-by: Phil Elwell @@ -159377,10 +159308,10 @@ index 606b2d5012abf2e85712be631c42ea40a0b512c5..e23e34b32a0a8927c14203d7384e8008 lm75 = <&lm75>,"status"; lm75addr = <&lm75>,"reg:0"; -From 984a27388b849bbf306a576d410049fdace4d571 Mon Sep 17 00:00:00 2001 +From 6399697afb20d138662a2c4f45f52df77a969160 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 23 Apr 2017 19:38:06 +0100 -Subject: [PATCH 231/269] config: Add CONFIG_BMP280 (and CONFIG_BMP280_I2C) +Subject: [PATCH 229/305] config: Add CONFIG_BMP280 (and CONFIG_BMP280_I2C) Signed-off-by: Phil Elwell --- @@ -159465,10 +159396,10 @@ index fd535ff21e7dab6717eb61f1b966b7d92791ec8d..7948b445f1232064dea01273393f3e3b CONFIG_PWM_PCA9685=m CONFIG_RASPBERRYPI_FIRMWARE=y -From 8bb03fb7ba375e21ca3c9d05bc90fd5659e94f90 Mon Sep 17 00:00:00 2001 +From cebc7ddfe5e162584f93677dc7edc0ba266714f0 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Tue, 25 Apr 2017 10:46:09 -0400 -Subject: [PATCH 232/269] config: Enable TI TMP102 temp sensor module +Subject: [PATCH 230/305] config: Enable TI TMP102 temp sensor module Signed-off-by: Scott Ellis --- @@ -159501,10 +159432,10 @@ index 7948b445f1232064dea01273393f3e3b135b4576..a338c313de9e9db3a338d066b5fad989 CONFIG_THERMAL_BCM2835=y CONFIG_WATCHDOG=y -From 1c39224fab012cffdb7f94aed1d05ad00229c10d Mon Sep 17 00:00:00 2001 +From f94d7347e407f7f513887eba3167414e21f3fcdb Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Tue, 25 Apr 2017 13:05:42 -0400 -Subject: [PATCH 233/269] BCM270X_DT: Add tmp102 to i2c sensor overlay +Subject: [PATCH 231/305] BCM270X_DT: Add tmp102 to i2c sensor overlay Signed-off-by: Scott Ellis --- @@ -159584,10 +159515,10 @@ index e23e34b32a0a8927c14203d7384e800878627347..e86a13f92c3f75c14fa4425cdfb081d6 }; }; -From cd695ae66d57e78fba7d191b2ea3711d1ba56343 Mon Sep 17 00:00:00 2001 +From 0f03a9eadfec0fc66365e8cb53a9d169f570f392 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 26 Apr 2017 16:51:48 +0100 -Subject: [PATCH 234/269] dwc_otg: Add the dependency on FIQ +Subject: [PATCH 232/305] dwc_otg: Add the dependency on FIQ Signed-off-by: popcornmix --- @@ -159608,10 +159539,10 @@ index f17b939c149562527937f49d90e23c7ab8b72328..5a5f6c925f43147082dcfaab15f9e05e The Synopsis DWC controller is a dual-role host/peripheral/OTG ("On The Go") USB controllers. -From 1dabdb616b40654daa67f9608c0b1fb21e2cdc3a Mon Sep 17 00:00:00 2001 +From 8d6000ef2b4d05c200209be892e5c7ef0ffc7e96 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 26 Apr 2017 17:28:47 +0100 -Subject: [PATCH 235/269] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER +Subject: [PATCH 233/305] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER It is unwise to use sources other than the oscillator and PLLD_PER for the PCM peripheral (and perhaps others - TBD) because their rate can @@ -159656,10 +159587,10 @@ index fe3298b54cdfb96bd90fb4f39e13921d2e1d4356..c24b4defb2b046e4ecdc109befc2b224 [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( .name = "pwm", -From 643d427136232f669268e0fb8b226d1e51025f4a Mon Sep 17 00:00:00 2001 +From 2c40231160da1f20d2f3a4ea03a4e3a1f973d6eb Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 27 Apr 2017 16:24:34 +0100 -Subject: [PATCH 236/269] dwc_otg: make nak_holdoff work as intended with empty +Subject: [PATCH 234/305] dwc_otg: make nak_holdoff work as intended with empty queues If URBs reading from non-periodic split endpoints were dequeued and @@ -159743,10 +159674,10 @@ index c2dff94e8e6edd22e4427aaa1eac7aad972cb6bd..85a6d431ca54b47dc10573aa72d1ad69 } else { uint16_t frame_number = dwc_otg_hcd_get_frame_number(hcd); -From 291636002ab8241f052b0ac81f3051e63a8f2431 Mon Sep 17 00:00:00 2001 +From b0610522d07c08d3ab1852beb7b4ef17b3119531 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 18 Apr 2017 21:43:46 +0100 -Subject: [PATCH 237/269] vc4_fkms: Apply firmware overscan offset to hardware +Subject: [PATCH 235/305] vc4_fkms: Apply firmware overscan offset to hardware cursor --- @@ -159803,10 +159734,10 @@ index da818a207bfa639b8cea48d94bcf4566f97db816..943cbb38f1f2e6fc7c06870be7904677 return 0; -From d7af8f271c9f2f94bfe8ddbf8deedc3a921a338e Mon Sep 17 00:00:00 2001 +From 9e33ea0d490b3a2ede6fa9227465b34a18617312 Mon Sep 17 00:00:00 2001 From: P33M Date: Tue, 2 May 2017 16:31:15 +0100 -Subject: [PATCH 238/269] dwc_otg: fix split transaction data toggle handling +Subject: [PATCH 236/305] dwc_otg: fix split transaction data toggle handling around dequeues See https://github.com/raspberrypi/linux/issues/1709 @@ -159894,10 +159825,10 @@ index 608e036be2c9484465ab836de70129335d3d2d96..718a1accc0c219a1764ce53d291de6a2 } qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); -From 6f0c7340045599e48f44fc3a9e2af40dcc73eba9 Mon Sep 17 00:00:00 2001 +From 5a52a93c6e26d04f672ec91d7b58e3f917c3066d Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 4 May 2017 14:56:08 +0100 -Subject: [PATCH 239/269] fiq_fsm: Use correct states when starting isoc OUT +Subject: [PATCH 237/305] fiq_fsm: Use correct states when starting isoc OUT transfers (#1991) * fiq_fsm: Use correct states when starting isoc OUT transfers @@ -159936,10 +159867,10 @@ index 9304279592cb5b388086ef91cb52f1e9f94868ce..208252645c09d1d17bf07673989f91b7 break; } -From 7427ad0c899ca7540629c334ac7ff152f33d3923 Mon Sep 17 00:00:00 2001 +From 6733150f9d6ec93c636a65c258a84d855764885c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 May 2017 16:36:05 +0100 -Subject: [PATCH 240/269] vcsm: Treat EBUSY as success rather than SIGBUS +Subject: [PATCH 238/305] vcsm: Treat EBUSY as success rather than SIGBUS Currently if two cores access the same page concurrently one will return VM_FAULT_NOPAGE and the other VM_FAULT_SIGBUS crashing the user code. @@ -159977,10 +159908,10 @@ index 1db6716c2c0c8b2013203391501f92d09db258af..ee4e05948c439a9045e0b65566d57587 } } -From 5e1fb5bbead087e173a638c7d27daa60cadd8a41 Mon Sep 17 00:00:00 2001 +From 7cdea4f7af4b010f73a9ca37871cb05820776845 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 4 May 2017 17:38:22 +0100 -Subject: [PATCH 241/269] bcm2708_fb: Avoid firmware mbox call in vc_mem_copy +Subject: [PATCH 239/305] bcm2708_fb: Avoid firmware mbox call in vc_mem_copy If firmware has locked up it is useful to get vcdbg log out without a firmware mbox response. Issue the mbox call at probe time instead. @@ -160044,326 +159975,34 @@ index 53c5a0bdadb4be9251affdabed66305842a08e72..612293cf9f1bd93ad2f2aefdd7ca0f5e if (ret == 0) { platform_set_drvdata(dev, fb); -From 6432aba0e1eff51f3c1c54fe78f9c6683cd4cd59 Mon Sep 17 00:00:00 2001 +From 3957edf63b084c54c5bdedfbbe299f0a1677757d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Mon, 22 May 2017 15:28:27 +0100 -Subject: [PATCH 242/269] config: Add CONFIG_IPV6_ROUTE_INFO +Date: Fri, 5 May 2017 13:23:10 +0100 +Subject: [PATCH 240/305] Revert "serial: 8250: Don't crash when nr_uarts is 0" +This reverts commit 9c297d9ebd0d8c6d5e6e8675d527d6a221613abc. --- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) + drivers/tty/serial/8250/8250_core.c | 2 -- + 1 file changed, 2 deletions(-) -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index d5624bbf15a669dccdde489e14c1d5c56a8cfa5c..a763d05190d83feaa8a05920056605b6ddd921a8 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -103,6 +103,7 @@ CONFIG_TCP_CONG_ADVANCED=y - CONFIG_TCP_CONG_BBR=m - CONFIG_IPV6=m - CONFIG_IPV6_ROUTER_PREF=y -+CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index a338c313de9e9db3a338d066b5fad989f6ece1ad..1d528ab1129223c580a4b30dc4058efbba7b00aa 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -99,6 +99,7 @@ CONFIG_TCP_CONG_ADVANCED=y - CONFIG_TCP_CONG_BBR=m - CONFIG_IPV6=m - CONFIG_IPV6_ROUTER_PREF=y -+CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m +diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c +index cf9c7d2e3f95e1a19410247a89c2e49c1a2747a8..e8819aa20415603c80547e382838a8fa3ce54792 100644 +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -509,8 +509,6 @@ static void __init serial8250_isa_init_ports(void) + + if (nr_uarts > UART_NR) + nr_uarts = UART_NR; +- if (!nr_uarts) +- return; + + for (i = 0; i < nr_uarts; i++) { + struct uart_8250_port *up = &serial8250_ports[i]; -From e44f9961ef5536f75176909c7f2ec15c5ac49707 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 22 May 2017 13:35:28 +0100 -Subject: [PATCH 243/269] config: Add CONFIG_IPV6_SIT_6RD - ---- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index a763d05190d83feaa8a05920056605b6ddd921a8..bd4750b30f3b30955506bac80a8ae7bc0dae0da6 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -107,6 +107,7 @@ CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -+CONFIG_IPV6_SIT_6RD=y - CONFIG_IPV6_TUNNEL=m - CONFIG_IPV6_MULTIPLE_TABLES=y - CONFIG_IPV6_SUBTREES=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 1d528ab1129223c580a4b30dc4058efbba7b00aa..390171b4a7a377f9523001e2928c47b5ab0801ab 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -103,6 +103,7 @@ CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -+CONFIG_IPV6_SIT_6RD=y - CONFIG_IPV6_TUNNEL=m - CONFIG_IPV6_MULTIPLE_TABLES=y - CONFIG_IPV6_SUBTREES=y - -From d2c492c6079988ff647931dc9a2178a20d8987a9 Mon Sep 17 00:00:00 2001 -From: Anton Onishchenko -Date: Tue, 23 May 2017 18:55:46 +0300 -Subject: [PATCH 244/269] mpu6050 device tree overlay (#2031) - -Add overlay and config options for InvenSense MPU6050 6-axis motion -detector. ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 ++++++ - arch/arm/boot/dts/overlays/mpu6050-overlay.dts | 28 ++++++++++++++++++++++++++ - arch/arm/configs/bcm2709_defconfig | 3 +-- - arch/arm/configs/bcmrpi_defconfig | 3 +-- - 5 files changed, 37 insertions(+), 4 deletions(-) - create mode 100644 arch/arm/boot/dts/overlays/mpu6050-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index e2f66a55dc5afe13d690c2c17827054ac94b7168..0eb0e87c5746a8449162549384eb4a63895ba3c6 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -57,6 +57,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - mcp3008.dtbo \ - midi-uart0.dtbo \ - mmc.dtbo \ -+ mpu6050.dtbo \ - mz61581.dtbo \ - pi3-act-led.dtbo \ - pi3-disable-bt.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 32e5fc4a9968c368e1063aef5fea95caedfba36f..843734740c2cd7438ecd9c956c87371f5803ba06 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -883,6 +883,12 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework - requests 50MHz - - -+Name: mpu6050 -+Info: Overlay for i2c connected mpu6050 imu -+Load: dtoverlay=mpu6050,= -+Params: interrupt GPIO pin for interrupt (default 4) -+ -+ - Name: mz61581 - Info: MZ61581 display by Tontec - Load: dtoverlay=mz61581,= -diff --git a/arch/arm/boot/dts/overlays/mpu6050-overlay.dts b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..06037969c3abba270b3cad45875342f3c730506e ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -@@ -0,0 +1,28 @@ -+// Definitions for MPU6050 -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ clock-frequency = <400000>; -+ -+ mpu6050: mpu6050@68 { -+ compatible = "invensense,mpu6050"; -+ reg = <0x68>; -+ interrupt-parent = <&gpio>; -+ interrupts = <4 1>; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ interrupt = <&mpu6050>,"interrupts:0"; -+ }; -+}; -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index bd4750b30f3b30955506bac80a8ae7bc0dae0da6..6e67f6744780cb6c3a92c5cdea9270e629cef946 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -1170,13 +1170,12 @@ CONFIG_RASPBERRYPI_POWER=y - CONFIG_EXTCON=m - CONFIG_EXTCON_ARIZONA=m - CONFIG_IIO=m --CONFIG_IIO_BUFFER=y - CONFIG_IIO_BUFFER_CB=m --CONFIG_IIO_KFIFO_BUF=m - CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_INV_MPU6050_I2C=m - CONFIG_BMP280=m - CONFIG_PWM_BCM2835=m - CONFIG_PWM_PCA9685=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 390171b4a7a377f9523001e2928c47b5ab0801ab..8dd491e75834ede8221919a97099037b69d43f2c 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1178,13 +1178,12 @@ CONFIG_RASPBERRYPI_POWER=y - CONFIG_EXTCON=m - CONFIG_EXTCON_ARIZONA=m - CONFIG_IIO=m --CONFIG_IIO_BUFFER=y - CONFIG_IIO_BUFFER_CB=m --CONFIG_IIO_KFIFO_BUF=m - CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_INV_MPU6050_I2C=m - CONFIG_BMP280=m - CONFIG_PWM_BCM2835=m - CONFIG_PWM_PCA9685=m - -From 1db1cea7b2bf5291fdd701602789d7fc52ebb622 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 22 May 2017 13:56:41 +0100 -Subject: [PATCH 245/269] clk: bcm2835: Minimise clock jitter for PCM clock - -Fractional clock dividers generate accurate average frequencies but -with jitter, particularly when the integer divisor is small. - -Introduce a new metric of clock accuracy to penalise clocks with a good -average but worse jitter compared to clocks with an average which is no -better but with lower jitter. The metric is the ideal rate minus the -worse deviation from that ideal using the nearest integer divisors. - -Use this metric for parent selection for clocks requiring low jitter -(currently just PCM). - -Signed-off-by: Phil Elwell ---- - drivers/clk/bcm/clk-bcm2835.c | 39 ++++++++++++++++++++++++++++++++++----- - 1 file changed, 34 insertions(+), 5 deletions(-) - -diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index c24b4defb2b046e4ecdc109befc2b22497060647..db3ba74acf78f4dfec0d2206b58bc7c3a09f72fe 100644 ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -534,6 +534,7 @@ struct bcm2835_clock_data { - - bool is_vpu_clock; - bool is_mash_clock; -+ bool low_jitter; - - u32 tcnt_mux; - }; -@@ -1154,7 +1155,8 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - int parent_idx, - unsigned long rate, - u32 *div, -- unsigned long *prate) -+ unsigned long *prate, -+ unsigned long *avgrate) - { - struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); - struct bcm2835_cprman *cprman = clock->cprman; -@@ -1166,11 +1168,33 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - parent = clk_hw_get_parent_by_index(hw, parent_idx); - - if (!(BIT(parent_idx) & data->set_rate_parent)) { -+ unsigned long tmp_rate; -+ - *prate = clk_hw_get_rate(parent); - *div = bcm2835_clock_choose_div(hw, rate, *prate, true); - -- return bcm2835_clock_rate_from_divisor(clock, *prate, -- *div); -+ tmp_rate = bcm2835_clock_rate_from_divisor(clock, *prate, *div); -+ *avgrate = tmp_rate; -+ -+ if (data->low_jitter && (*div & CM_DIV_FRAC_MASK)) { -+ unsigned long high, low; -+ u32 idiv = *div & ~CM_DIV_FRAC_MASK; -+ -+ high = bcm2835_clock_rate_from_divisor(clock, *prate, -+ idiv); -+ idiv += CM_DIV_FRAC_MASK + 1; -+ low = bcm2835_clock_rate_from_divisor(clock, *prate, -+ idiv); -+ -+ /* Return a value which is the maximum deviation -+ * below the ideal rate, for use as a metric. -+ */ -+ if ((tmp_rate - low) < (high - tmp_rate)) -+ tmp_rate = low; -+ else -+ tmp_rate -= high - tmp_rate; -+ } -+ return tmp_rate; - } - - if (data->frac_bits) -@@ -1197,6 +1221,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - - *div = curdiv << CM_DIV_FRAC_BITS; - *prate = curdiv * best_rate; -+ *avgrate = best_rate; - - return best_rate; - } -@@ -1208,6 +1233,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - bool current_parent_is_pllc; - unsigned long rate, best_rate = 0; - unsigned long prate, best_prate = 0; -+ unsigned long avgrate, best_avgrate = 0; - size_t i; - u32 div; - -@@ -1232,11 +1258,13 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - continue; - - rate = bcm2835_clock_choose_div_and_prate(hw, i, req->rate, -- &div, &prate); -+ &div, &prate, -+ &avgrate); - if (rate > best_rate && rate <= req->rate) { - best_parent = parent; - best_prate = prate; - best_rate = rate; -+ best_avgrate = avgrate; - } - } - -@@ -1246,7 +1274,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - req->best_parent_hw = best_parent; - req->best_parent_rate = best_prate; - -- req->rate = best_rate; -+ req->rate = best_avgrate; - - return 0; - } -@@ -2061,6 +2089,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { - .int_bits = 12, - .frac_bits = 12, - .is_mash_clock = true, -+ .low_jitter = true, - .parents = bcm2835_pcm_per_parents, - .tcnt_mux = 23), - [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( - -From 9ca0b52c448cb05df5fe0cabe04ae2a8babb0700 Mon Sep 17 00:00:00 2001 +From 2543c750c26e61704d5c5d6269ac59944388d770 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 8 May 2017 16:30:18 +0100 -Subject: [PATCH 246/269] ARM: dts: bcm283x: Reserve first page for firmware +Subject: [PATCH 241/305] ARM: dts: bcm283x: Reserve first page for firmware The Raspberry Pi startup stub files for multi-core BCM27XX processors make the secondary CPUs spin until the corresponding mailbox is @@ -160410,10 +160049,257 @@ index 7d58cd79ac6bd99f0b47a909ac827c61aac642d9..0bc1932cde435bd151ffc2364bca5cd9 * bcm2835 and bcm2836 implementations, leaving the CPU configuration to * bcm2835.dtsi and bcm2836.dtsi. -From a721f7ae4739afe5ccfba390baac901171fe397b Mon Sep 17 00:00:00 2001 +From 7eff299716f5658789ba463a2dc3c0a9ebf0b527 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 8 May 2017 16:43:40 +0100 +Subject: [PATCH 242/305] irq_bcm2836: Send event when onlining sleeping cores + +In order to reduce power consumption and bus traffic, it is sensible +for secondary cores to enter a low-power idle state when waiting to +be started. The wfe instruction causes a core to wait until an event +or interrupt arrives before continuing to the next instruction. +The sev instruction sends a wakeup event to the other cores, so call +it from bcm2836_smp_boot_secondary, the function that wakes up the +waiting cores during booting. + +It is harmless to use this patch without the corresponding change +adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated +and this patch is not applied then the other cores will sleep forever. + +See: https://github.com/raspberrypi/linux/issues/1989 + +Signed-off-by: Phil Elwell +--- + drivers/irqchip/irq-bcm2836.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c +index e10597c1a1e51e5e27aa574b6a26d87181f26221..6dccdf94f6f3b4c6a3f6cb1cae5a6ab2879a38cc 100644 +--- a/drivers/irqchip/irq-bcm2836.c ++++ b/drivers/irqchip/irq-bcm2836.c +@@ -248,6 +248,9 @@ static int __init bcm2836_smp_boot_secondary(unsigned int cpu, + writel(secondary_startup_phys, + intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu); + ++ dsb(sy); /* Ensure write has completed before waking the other CPUs */ ++ sev(); ++ + return 0; + } + + +From a0d47f428b18b51172bf3db46c4813653f8c5edc Mon Sep 17 00:00:00 2001 +From: Nisar Sayed +Date: Tue, 9 May 2017 18:51:42 +0100 +Subject: [PATCH 243/305] According to RFC 2460, IPv6 UDP calculated checksum + yields a result of zero must be changed to 0xffff, however this feature is + not supported by smsc95xx family hence enable csum offload only for IPv4 + TCP/UDP packets. + +Signed-off-by: Nisar Sayed + +Reported-by: popcorn mix +--- + drivers/net/usb/smsc95xx.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index f6661e388f6e801c1b88e48a3b71407bd70cf56e..b84e98508b5d97165b68dfc30240950e78bb14c3 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -694,7 +694,7 @@ static int smsc95xx_set_features(struct net_device *netdev, + if (ret < 0) + return ret; + +- if (features & NETIF_F_HW_CSUM) ++ if (features & NETIF_F_IP_CSUM) + read_buf |= Tx_COE_EN_; + else + read_buf &= ~Tx_COE_EN_; +@@ -1342,12 +1342,16 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + + spin_lock_init(&pdata->mac_cr_lock); + ++ /* RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be ++ * changed to 0xffff, this feature is not supported by smsc95xx family, ++ * hence enable csum offload only for IPv4 TCP/UDP packets. ++ */ + if (DEFAULT_TX_CSUM_ENABLE) +- dev->net->features |= NETIF_F_HW_CSUM; ++ dev->net->features |= NETIF_F_IP_CSUM; + if (DEFAULT_RX_CSUM_ENABLE) + dev->net->features |= NETIF_F_RXCSUM; + +- dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM; ++ dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM; + + smsc95xx_init_mac_address(dev); + + +From 23df46b4bf493b334c0b5be1480e3b34c5dc3ad9 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 10 May 2017 12:47:46 +0100 +Subject: [PATCH 244/305] dwcotg: Allow to build without FIQ on ARM64 + +Signed-off-by: popcornmix +--- + drivers/usb/host/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig +index 5a5f6c925f43147082dcfaab15f9e05ed966838c..c50476b3d72471faf94c280aab756599fe55ac90 100644 +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -764,7 +764,7 @@ config USB_HWA_HCD + + config USB_DWCOTG + tristate "Synopsis DWC host support" +- depends on USB && FIQ ++ depends on USB && (FIQ || ARM64) + help + The Synopsis DWC controller is a dual-role + host/peripheral/OTG ("On The Go") USB controllers. + +From 5c268166a7521080658e9609aa0e55a9d9ffb4b5 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 11 May 2017 16:58:16 +0100 +Subject: [PATCH 245/305] BCM270X_DT: Tidy up mmc, sdhost, sdio overlays + +The mmc, sdhost, sdio and sdio-1bit overlays had a few +anachronisms and oddities which were overdue for fixing. +The new versions should be functionally equivalent. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/mmc-overlay.dts | 1 + + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 1 - + arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts | 11 ++++++----- + arch/arm/boot/dts/overlays/sdio-overlay.dts | 11 ++++++----- + 4 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts +index d32b02ca01ced5ab3de00d66d5412c8fda4bc510..64f1ff6684b19e76cfd00e6950919ac55227b44b 100644 +--- a/arch/arm/boot/dts/overlays/mmc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts +@@ -21,6 +21,7 @@ + mmc_pins: mmc_pins { + brcm,pins = <48 49 50 51 52 53>; + brcm,function = <7>; /* alt3 */ ++ brcm.pull = <0 2 2 2 2 2>; + }; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index a431177a1c9d320d5432ea448ad4d0f696c34525..de3d1b0a5e403057a8e94f85695de4076d77e31f 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -11,7 +11,6 @@ + frag0: __overlay__ { + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; +- brcm,debug-flags = <0>; + status = "okay"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts +index 46d453859b31f5c700a8a2e39a2c209330bc108f..0b7f2c6f2603b631e1985df7fbf66749149566d6 100644 +--- a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts +@@ -1,11 +1,12 @@ +-/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ ++/dts-v1/; ++/plugin/; + +-/include/ "sdhost-overlay.dts" ++/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ + + /{ + compatible = "brcm,bcm2708"; + +- fragment@3 { ++ fragment@0 { + target = <&mmc>; + sdio_mmc: __overlay__ { + compatible = "brcm,bcm2835-mmc"; +@@ -18,12 +19,12 @@ + }; + }; + +- fragment@4 { ++ fragment@1 { + target = <&gpio>; + __overlay__ { + sdio_pins: sdio_pins { + brcm,pins = <22 23 24 25>; +- brcm,function = <7 7 7 7>; /* ALT3 = SD1 */ ++ brcm,function = <7>; /* ALT3 = SD1 */ + brcm,pull = <0 2 2 2>; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/sdio-overlay.dts b/arch/arm/boot/dts/overlays/sdio-overlay.dts +index 398bd812c716c9e472fbac5aba4fe882114c65d1..215d5e3e8a8ca4363457fed1f7425427bb5086d7 100644 +--- a/arch/arm/boot/dts/overlays/sdio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts +@@ -1,11 +1,12 @@ +-/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ ++/dts-v1/; ++/plugin/; + +-/include/ "sdhost-overlay.dts" ++/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ + + /{ + compatible = "brcm,bcm2708"; + +- fragment@3 { ++ fragment@0 { + target = <&mmc>; + sdio_mmc: __overlay__ { + pinctrl-names = "default"; +@@ -17,12 +18,12 @@ + }; + }; + +- fragment@4 { ++ fragment@1 { + target = <&gpio>; + __overlay__ { + sdio_pins: sdio_pins { + brcm,pins = <22 23 24 25 26 27>; +- brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */ ++ brcm,function = <7>; /* ALT3 = SD1 */ + brcm,pull = <0 2 2 2 2 2>; + }; + }; + +From 490a73cd7c31efbf1f79f342e1ac178e74f55246 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 11 May 2017 22:00:20 +0100 +Subject: [PATCH 246/305] SQUASH: BCM270X_DT: Fix typo in mmc overlay + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/mmc-overlay.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts +index 64f1ff6684b19e76cfd00e6950919ac55227b44b..88251ad653917674f80c2975de2e425fca00b71f 100644 +--- a/arch/arm/boot/dts/overlays/mmc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts +@@ -21,7 +21,7 @@ + mmc_pins: mmc_pins { + brcm,pins = <48 49 50 51 52 53>; + brcm,function = <7>; /* alt3 */ +- brcm.pull = <0 2 2 2 2 2>; ++ brcm,pull = <0 2 2 2 2 2>; + }; + }; + }; + +From ffefd34181cc1591c862298179df965083f1b455 Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 12 May 2017 12:24:00 +0100 -Subject: [PATCH 247/269] dwc_otg: fix several potential crash sources +Subject: [PATCH 247/305] dwc_otg: fix several potential crash sources On root port disconnect events, the host driver state is cleared and in-progress host channels are forcibly stopped. This doesn't play @@ -160609,10 +160495,10 @@ index 718a1accc0c219a1764ce53d291de6a2b6f93608..cf23baaa388562b5843be4cfa6c206cb release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); break; -From 3bad002726b9272b1e3f4f2024ac292def30a1b9 Mon Sep 17 00:00:00 2001 +From 463a15bd951aeee9e3065756a89b2fb3482560a0 Mon Sep 17 00:00:00 2001 From: P33M Date: Mon, 15 May 2017 14:27:48 +0100 -Subject: [PATCH 248/269] dwc_otg: delete hcd->channel_lock +Subject: [PATCH 248/305] dwc_otg: delete hcd->channel_lock The lock serves no purpose as it is only held while the HCD spinlock is already being held. @@ -160764,10 +160650,10 @@ index cf23baaa388562b5843be4cfa6c206cbdc4e780d..a4355afc77b68718fdaba6c5d4be257d /* Try to queue more transfers now that there's a free channel. */ -From 0c2cccd2448ffde803fb8b9f600d3c4f89e61b76 Mon Sep 17 00:00:00 2001 +From 112235c8ca7fe2d477c6da058705a4f0532c7266 Mon Sep 17 00:00:00 2001 From: P33M Date: Mon, 15 May 2017 14:51:42 +0100 -Subject: [PATCH 249/269] dwc_otg: remove unnecessary dma-mode channel halts on +Subject: [PATCH 249/305] dwc_otg: remove unnecessary dma-mode channel halts on disconnect interrupt Host channels are already halted in kill_urbs_in_qh_list() with the @@ -160835,10 +160721,10 @@ index 5ec991624c7865901b22ea01b9f2c58c8535ecfd..a2dc6337836b2719f4c954edeeb2a713 if(fiq_enable) { -From 4adcb9be792ebf709234627923b525e602b73c14 Mon Sep 17 00:00:00 2001 +From 31ab4f56811854594c6f204fcb4d95952f48422f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 15 May 2017 09:28:36 -0700 -Subject: [PATCH 250/269] drm/vc4: Mark the device as active when enabling +Subject: [PATCH 250/305] drm/vc4: Mark the device as active when enabling runtime PM. Failing to do so meant that we got a resume() callback on first use of @@ -160864,10 +160750,10 @@ index 882ec06225f1d5caca71bdb5c69664188192c2e2..77ed4ef3b8c8685a3cd8c871bbd249de pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ pm_runtime_enable(dev); -From 888ae724a02d0b7e81afb0c0a8fde554154e5a76 Mon Sep 17 00:00:00 2001 +From daac5920226d6c880ae13cf13b0bfa583076c36d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 15 May 2017 11:35:13 -0700 -Subject: [PATCH 251/269] BCM270X: Drop position requirement for CMA in VC4 +Subject: [PATCH 251/305] BCM270X: Drop position requirement for CMA in VC4 overlay. No longer necessary since 2aefcd576195a739a7a256099571c9c4a401005f, @@ -160925,10 +160811,10 @@ index c57e795824e9261e0f60bcb40d6a57241019fd91..bf9395041face775d335177583e0b222 }; -From c45ad09ce5906f17631ec87d440a5442a3fec75a Mon Sep 17 00:00:00 2001 +From c907ae9c1dfc0cdf9cb40cfc76517834b7ea1d70 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Mon, 15 May 2017 16:55:56 +0200 -Subject: [PATCH 252/269] config: Add Goodix touch controller module +Subject: [PATCH 252/305] config: Add Goodix touch controller module Signed-off-by: Ahmet Inan --- @@ -160937,10 +160823,10 @@ Signed-off-by: Ahmet Inan 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 6e67f6744780cb6c3a92c5cdea9270e629cef946..b8937da67d842393ee293f4ad83de10595e32da5 100644 +index d5624bbf15a669dccdde489e14c1d5c56a8cfa5c..c4c5b42016e54d87b9f8f99354b164a0548980f7 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -571,6 +571,7 @@ CONFIG_JOYSTICK_RPISENSE=m +@@ -569,6 +569,7 @@ CONFIG_JOYSTICK_RPISENSE=m CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_ADS7846=m CONFIG_TOUCHSCREEN_EGALAX=m @@ -160949,10 +160835,10 @@ index 6e67f6744780cb6c3a92c5cdea9270e629cef946..b8937da67d842393ee293f4ad83de105 CONFIG_TOUCHSCREEN_RPI_FT5406=m CONFIG_TOUCHSCREEN_USB_COMPOSITE=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 8dd491e75834ede8221919a97099037b69d43f2c..20740aaa943d6875f24a2dcfa18078967d2bd829 100644 +index a338c313de9e9db3a338d066b5fad989f6ece1ad..c274e53142ce231819e6421df1257e8a3544fd94 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -567,6 +567,7 @@ CONFIG_JOYSTICK_RPISENSE=m +@@ -565,6 +565,7 @@ CONFIG_JOYSTICK_RPISENSE=m CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_ADS7846=m CONFIG_TOUCHSCREEN_EGALAX=m @@ -160961,10 +160847,10 @@ index 8dd491e75834ede8221919a97099037b69d43f2c..20740aaa943d6875f24a2dcfa1807896 CONFIG_TOUCHSCREEN_USB_COMPOSITE=m CONFIG_TOUCHSCREEN_STMPE=m -From c01f2d9d1a69c3508c1aeb07eda39504b8c395dc Mon Sep 17 00:00:00 2001 +From 1b676078a6e12f70317421b65203a45a9860fe44 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Mon, 15 May 2017 17:10:53 +0200 -Subject: [PATCH 253/269] overlays: Add Goodix overlay +Subject: [PATCH 253/305] overlays: Add Goodix overlay Add support for I2C connected Goodix gt9271 multiple touch controller using GPIOs 4 and 17 (pins 7 and 11 on GPIO header) for interrupt and reset. @@ -160978,7 +160864,7 @@ Signed-off-by: Ahmet Inan create mode 100644 arch/arm/boot/dts/overlays/goodix-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 0eb0e87c5746a8449162549384eb4a63895ba3c6..315ee19036ab85431f2a077101054ba21b2db888 100644 +index e2f66a55dc5afe13d690c2c17827054ac94b7168..b62edf6ce17ed8db18c73ce02b18ca43481691ab 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -25,6 +25,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ @@ -160990,7 +160876,7 @@ index 0eb0e87c5746a8449162549384eb4a63895ba3c6..315ee19036ab85431f2a077101054ba2 gpio-ir.dtbo \ gpio-poweroff.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 843734740c2cd7438ecd9c956c87371f5803ba06..2dade3155e11387de52e5e6150c9a1e9fc4c36cf 100644 +index 32e5fc4a9968c368e1063aef5fea95caedfba36f..b3aadaa6cfafae0e01908a3a2f1f646d06d69b32 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -459,6 +459,14 @@ Load: dtoverlay=fe-pi-audio @@ -161061,10 +160947,102 @@ index 0000000000000000000000000000000000000000..084f74042ed6379ebd9281374d5391a7 + }; +}; -From 8b0da256d949f4721185fd2990932ac397359ed7 Mon Sep 17 00:00:00 2001 +From be5d9a800381ee60c446f628cd4c004066f031fc Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 16 May 2017 16:55:36 +0100 +Subject: [PATCH 254/305] config: Drop CONFIG_TOUCHSCREEN_EKTF2127 + +--- + arch/arm/configs/bcm2709_defconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index c4c5b42016e54d87b9f8f99354b164a0548980f7..fdd17f5625e889257e69c90a0679dc9bb716bb69 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -570,7 +570,6 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_GOODIX=m +-CONFIG_TOUCHSCREEN_EKTF2127=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + +From b85241e64affe0446bcdcc4ba6bed0a2a734becf Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 16 May 2017 15:58:00 +0100 +Subject: [PATCH 255/305] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index fdd17f5625e889257e69c90a0679dc9bb716bb69..6ba9d39f47daf34672806858afa1c2a1a692beb5 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -570,6 +570,7 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_GOODIX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index c274e53142ce231819e6421df1257e8a3544fd94..d50e88455b4ba5a891a47c2416a09f9402435b90 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -566,6 +566,7 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_GOODIX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + +From 48012ce823f271c6e805ce578f32aa9ec2d4997a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 16 May 2017 19:34:52 +0100 +Subject: [PATCH 256/305] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 6ba9d39f47daf34672806858afa1c2a1a692beb5..e5e83af21db0c628838b18f85b37ec569840fba7 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -619,6 +619,7 @@ CONFIG_I2C_MUX_PCA954x=m + CONFIG_I2C_BCM2708=m + CONFIG_I2C_BCM2835=m + CONFIG_I2C_GPIO=m ++CONFIG_I2C_ROBOTFUZZ_OSIF=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index d50e88455b4ba5a891a47c2416a09f9402435b90..9699c93fbb6934b3fded4704316f1ad4c4a639d6 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -615,6 +615,7 @@ CONFIG_I2C_MUX_PCA954x=m + CONFIG_I2C_BCM2708=m + CONFIG_I2C_BCM2835=m + CONFIG_I2C_GPIO=m ++CONFIG_I2C_ROBOTFUZZ_OSIF=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m + +From 19d58ad1708adb37981d8d8c4985037661306bb4 Mon Sep 17 00:00:00 2001 From: chenzhiwo Date: Wed, 17 May 2017 16:34:57 +0800 -Subject: [PATCH 254/269] Add device tree overlay for GPIO connected rotary +Subject: [PATCH 257/305] Add device tree overlay for GPIO connected rotary encoder. See Documentation/input/rotary-encoder.txt for more information. --- @@ -161075,10 +161053,10 @@ Subject: [PATCH 254/269] Add device tree overlay for GPIO connected rotary create mode 100644 arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 315ee19036ab85431f2a077101054ba21b2db888..a2670d3ab9479f34886e0ea5431de39c8bcc21e4 100644 +index b62edf6ce17ed8db18c73ce02b18ca43481691ab..9368f6281dd80f01900b477d97c83047e33ceb36 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile -@@ -76,6 +76,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ +@@ -75,6 +75,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ pwm-2chan.dtbo \ qca7000.dtbo \ raspidac3.dtbo \ @@ -161087,10 +161065,10 @@ index 315ee19036ab85431f2a077101054ba21b2db888..a2670d3ab9479f34886e0ea5431de39c rpi-cirrus-wm5102.dtbo \ rpi-dac.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 2dade3155e11387de52e5e6150c9a1e9fc4c36cf..c0b37e2db6ded6e0f209ab6c7831bd514c4e2bcd 100644 +index b3aadaa6cfafae0e01908a3a2f1f646d06d69b32..95600381448b0b485dbbbeb592ae1e82a8acec08 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README -@@ -1121,6 +1121,15 @@ Load: dtoverlay=raspidac3 +@@ -1115,6 +1115,15 @@ Load: dtoverlay=raspidac3 Params: @@ -161156,10 +161134,10 @@ index 0000000000000000000000000000000000000000..c0c6bccff60cc15d9a9bf59d2c7cba41 + }; +}; -From d18c0f6cab6149a21be496f581611923a37618cb Mon Sep 17 00:00:00 2001 +From 8ec8edc1fd98ddb21846c8dd5235ccb3ad68928a Mon Sep 17 00:00:00 2001 From: Ed Blake Date: Thu, 10 Nov 2016 18:07:54 +0000 -Subject: [PATCH 255/269] serial: 8250: Add IrDA to UART capabilities +Subject: [PATCH 258/305] serial: 8250: Add IrDA to UART capabilities commit 98838d95075a5295f3478ceba18bcccf472e30f4 upstream. @@ -161202,7 +161180,7 @@ index a697a8585ddc346a72de6e30cdb77785a5688e71..0c23b0079a51977275a16a3c3849dc70 #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index cf9c7d2e3f95e1a19410247a89c2e49c1a2747a8..2d45863da0e3fecaf339f3e9cdf3c385081f1a9b 100644 +index e8819aa20415603c80547e382838a8fa3ce54792..9bfdb0e549e626082be8fd6f350e9f801e1a1eed 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -425,10 +425,10 @@ struct uart_8250_port *serial8250_get_port(int line) @@ -161240,10 +161218,10 @@ index 48ec7651989b093fc015e44b59657c7000e11012..04185e03d7bec56197cb765377320044 #endif -From 6017b95d474d641bc430a1e98e774607bf5a205c Mon Sep 17 00:00:00 2001 +From f11b6a3d4dea9a821bad6e0fc2ee7f5c083384ed Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 May 2017 15:07:27 +0100 -Subject: [PATCH 256/269] serial: 8250: Add CAP_MINI, set for bcm2835aux +Subject: [PATCH 259/305] serial: 8250: Add CAP_MINI, set for bcm2835aux The AUX/mini-UART in the BCM2835 family of procesors is a cut-down 8250 clone. In particular it is lacking support for the following @@ -161295,7 +161273,7 @@ index e10f1244409b344b850ffbbd4af5757a66c875f1..a23c7da42ea81342efc26fb35a92a69d data->uart.port.regshift = 2; data->uart.port.type = PORT_16550; diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 080d5a59d0a7f41ee0578d1f6e2fbecf00409bce..6d0d42d06670eba7cd56204083efd6f60a1f1ee1 100644 +index f24d3030b98c8d7543ac52e3ebadc65ecfe745ee..2d7a63f69b90415d6e1b6eb1c10612f4aa9fbed2 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2558,6 +2558,12 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, @@ -161312,10 +161290,10 @@ index 080d5a59d0a7f41ee0578d1f6e2fbecf00409bce..6d0d42d06670eba7cd56204083efd6f6 baud = serial8250_get_baud_rate(port, termios, old); -From 610ddaec2bdfbbb5a181d0b994e9a8abf0ac45ea Mon Sep 17 00:00:00 2001 +From a3d7fd03b3e8e2aad38b2a16546c168972bcf25f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 May 2017 11:40:43 +0100 -Subject: [PATCH 257/269] config: Add FB_TFT_ST7789V module +Subject: [PATCH 260/305] config: Add FB_TFT_ST7789V module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -161323,10 +161301,10 @@ Subject: [PATCH 257/269] config: Add FB_TFT_ST7789V module 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index b8937da67d842393ee293f4ad83de10595e32da5..d6f3db7620639f1cf377a935dd93710db4ec9c82 100644 +index e5e83af21db0c628838b18f85b37ec569840fba7..7f46612d43773bd1ab88fef2bcd10f20e34f16e8 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -1157,6 +1157,7 @@ CONFIG_FB_TFT_SSD1306=m +@@ -1156,6 +1156,7 @@ CONFIG_FB_TFT_SSD1306=m CONFIG_FB_TFT_SSD1331=m CONFIG_FB_TFT_SSD1351=m CONFIG_FB_TFT_ST7735R=m @@ -161335,7 +161313,7 @@ index b8937da67d842393ee293f4ad83de10595e32da5..d6f3db7620639f1cf377a935dd93710d CONFIG_FB_TFT_TLS8204=m CONFIG_FB_TFT_UC1701=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 20740aaa943d6875f24a2dcfa18078967d2bd829..e3878cdcbc8d17ee7cb1af10592477b56308669b 100644 +index 9699c93fbb6934b3fded4704316f1ad4c4a639d6..b4554044aad7faabd4db57a87c11dba8e088d7d4 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -1165,6 +1165,7 @@ CONFIG_FB_TFT_SSD1306=m @@ -161347,290 +161325,10 @@ index 20740aaa943d6875f24a2dcfa18078967d2bd829..e3878cdcbc8d17ee7cb1af10592477b5 CONFIG_FB_TFT_TLS8204=m CONFIG_FB_TFT_UC1701=m -From 71c3f3b39cabeada04087460b92d382ee31abc57 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 8 May 2017 16:43:40 +0100 -Subject: [PATCH 258/269] irq_bcm2836: Send event when onlining sleeping cores - -In order to reduce power consumption and bus traffic, it is sensible -for secondary cores to enter a low-power idle state when waiting to -be started. The wfe instruction causes a core to wait until an event -or interrupt arrives before continuing to the next instruction. -The sev instruction sends a wakeup event to the other cores, so call -it from bcm2836_smp_boot_secondary, the function that wakes up the -waiting cores during booting. - -It is harmless to use this patch without the corresponding change -adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated -and this patch is not applied then the other cores will sleep forever. - -See: https://github.com/raspberrypi/linux/issues/1989 - -Signed-off-by: Phil Elwell ---- - drivers/irqchip/irq-bcm2836.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c -index e10597c1a1e51e5e27aa574b6a26d87181f26221..6dccdf94f6f3b4c6a3f6cb1cae5a6ab2879a38cc 100644 ---- a/drivers/irqchip/irq-bcm2836.c -+++ b/drivers/irqchip/irq-bcm2836.c -@@ -248,6 +248,9 @@ static int __init bcm2836_smp_boot_secondary(unsigned int cpu, - writel(secondary_startup_phys, - intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu); - -+ dsb(sy); /* Ensure write has completed before waking the other CPUs */ -+ sev(); -+ - return 0; - } - - -From 94b13af3bf364587f3ebfaad846dc040412b0ebe Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Sat, 20 May 2017 22:10:14 +0100 -Subject: [PATCH 259/269] overlays: README: remove vestigial SDIO parameters - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 24 ++---------------------- - 1 file changed, 2 insertions(+), 22 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index c0b37e2db6ded6e0f209ab6c7831bd514c4e2bcd..2f762bcf23859ccb0e922935ad158227514b34c5 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1231,19 +1231,9 @@ Name: sdio - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, - and enables SDIO via GPIOs 22-27. - Load: dtoverlay=sdio,= --Params: overclock_50 SD Clock (in MHz) to use when the MMC framework -- requests 50MHz -- -- sdio_overclock SDIO Clock (in MHz) to use when the MMC -+Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC - framework requests 50MHz - -- force_pio Disable DMA support (default off) -- -- pio_limit Number of blocks above which to use DMA -- (default 1) -- -- debug Enable debug output (default off) -- - poll_once Disable SDIO-device polling every second - (default on: polling once at boot-time) - -@@ -1254,19 +1244,9 @@ Name: sdio-1bit - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, - and enables 1-bit SDIO via GPIOs 22-25. - Load: dtoverlay=sdio-1bit,= --Params: overclock_50 SD Clock (in MHz) to use when the MMC framework -- requests 50MHz -- -- sdio_overclock SDIO Clock (in MHz) to use when the MMC -+Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC - framework requests 50MHz - -- force_pio Disable DMA support (default off) -- -- pio_limit Number of blocks above which to use DMA -- (default 1) -- -- debug Enable debug output (default off) -- - poll_once Disable SDIO-device polling every second - (default on: polling once at boot-time) - - -From 955b9301c6a4cf750817d3a2a60173433213fb38 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 11 May 2017 16:58:16 +0100 -Subject: [PATCH 260/269] BCM270X_DT: Tidy up mmc, sdhost, sdio overlays - -The mmc, sdhost, sdio and sdio-1bit overlays had a few -anachronisms and oddities which were overdue for fixing. -The new versions should be functionally equivalent. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/mmc-overlay.dts | 1 + - arch/arm/boot/dts/overlays/sdhost-overlay.dts | 1 - - arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts | 11 ++++++----- - arch/arm/boot/dts/overlays/sdio-overlay.dts | 11 ++++++----- - 4 files changed, 13 insertions(+), 11 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts -index d32b02ca01ced5ab3de00d66d5412c8fda4bc510..64f1ff6684b19e76cfd00e6950919ac55227b44b 100644 ---- a/arch/arm/boot/dts/overlays/mmc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts -@@ -21,6 +21,7 @@ - mmc_pins: mmc_pins { - brcm,pins = <48 49 50 51 52 53>; - brcm,function = <7>; /* alt3 */ -+ brcm.pull = <0 2 2 2 2 2>; - }; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts -index a431177a1c9d320d5432ea448ad4d0f696c34525..de3d1b0a5e403057a8e94f85695de4076d77e31f 100644 ---- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts -@@ -11,7 +11,6 @@ - frag0: __overlay__ { - brcm,overclock-50 = <0>; - brcm,pio-limit = <1>; -- brcm,debug-flags = <0>; - status = "okay"; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -index 46d453859b31f5c700a8a2e39a2c209330bc108f..0b7f2c6f2603b631e1985df7fbf66749149566d6 100644 ---- a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -@@ -1,11 +1,12 @@ --/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ -+/dts-v1/; -+/plugin/; - --/include/ "sdhost-overlay.dts" -+/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ - - /{ - compatible = "brcm,bcm2708"; - -- fragment@3 { -+ fragment@0 { - target = <&mmc>; - sdio_mmc: __overlay__ { - compatible = "brcm,bcm2835-mmc"; -@@ -18,12 +19,12 @@ - }; - }; - -- fragment@4 { -+ fragment@1 { - target = <&gpio>; - __overlay__ { - sdio_pins: sdio_pins { - brcm,pins = <22 23 24 25>; -- brcm,function = <7 7 7 7>; /* ALT3 = SD1 */ -+ brcm,function = <7>; /* ALT3 = SD1 */ - brcm,pull = <0 2 2 2>; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdio-overlay.dts b/arch/arm/boot/dts/overlays/sdio-overlay.dts -index 398bd812c716c9e472fbac5aba4fe882114c65d1..215d5e3e8a8ca4363457fed1f7425427bb5086d7 100644 ---- a/arch/arm/boot/dts/overlays/sdio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts -@@ -1,11 +1,12 @@ --/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ -+/dts-v1/; -+/plugin/; - --/include/ "sdhost-overlay.dts" -+/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ - - /{ - compatible = "brcm,bcm2708"; - -- fragment@3 { -+ fragment@0 { - target = <&mmc>; - sdio_mmc: __overlay__ { - pinctrl-names = "default"; -@@ -17,12 +18,12 @@ - }; - }; - -- fragment@4 { -+ fragment@1 { - target = <&gpio>; - __overlay__ { - sdio_pins: sdio_pins { - brcm,pins = <22 23 24 25 26 27>; -- brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */ -+ brcm,function = <7>; /* ALT3 = SD1 */ - brcm,pull = <0 2 2 2 2 2>; - }; - }; - -From 8163070dc6a469b9c64512f82f7a160d2ad0509c Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 11 May 2017 22:00:20 +0100 -Subject: [PATCH 261/269] SQUASH: BCM270X_DT: Fix typo in mmc overlay - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/mmc-overlay.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts -index 64f1ff6684b19e76cfd00e6950919ac55227b44b..88251ad653917674f80c2975de2e425fca00b71f 100644 ---- a/arch/arm/boot/dts/overlays/mmc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts -@@ -21,7 +21,7 @@ - mmc_pins: mmc_pins { - brcm,pins = <48 49 50 51 52 53>; - brcm,function = <7>; /* alt3 */ -- brcm.pull = <0 2 2 2 2 2>; -+ brcm,pull = <0 2 2 2 2 2>; - }; - }; - }; - -From 32e01de8efab7210d864eb2daff3d3eccbc12ffc Mon Sep 17 00:00:00 2001 -From: Nisar Sayed -Date: Tue, 9 May 2017 18:51:42 +0100 -Subject: [PATCH 262/269] According to RFC 2460, IPv6 UDP calculated checksum - yields a result of zero must be changed to 0xffff, however this feature is - not supported by smsc95xx family hence enable csum offload only for IPv4 - TCP/UDP packets. - -Signed-off-by: Nisar Sayed - -Reported-by: popcorn mix ---- - drivers/net/usb/smsc95xx.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index f6661e388f6e801c1b88e48a3b71407bd70cf56e..b84e98508b5d97165b68dfc30240950e78bb14c3 100644 ---- a/drivers/net/usb/smsc95xx.c -+++ b/drivers/net/usb/smsc95xx.c -@@ -694,7 +694,7 @@ static int smsc95xx_set_features(struct net_device *netdev, - if (ret < 0) - return ret; - -- if (features & NETIF_F_HW_CSUM) -+ if (features & NETIF_F_IP_CSUM) - read_buf |= Tx_COE_EN_; - else - read_buf &= ~Tx_COE_EN_; -@@ -1342,12 +1342,16 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) - - spin_lock_init(&pdata->mac_cr_lock); - -+ /* RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be -+ * changed to 0xffff, this feature is not supported by smsc95xx family, -+ * hence enable csum offload only for IPv4 TCP/UDP packets. -+ */ - if (DEFAULT_TX_CSUM_ENABLE) -- dev->net->features |= NETIF_F_HW_CSUM; -+ dev->net->features |= NETIF_F_IP_CSUM; - if (DEFAULT_RX_CSUM_ENABLE) - dev->net->features |= NETIF_F_RXCSUM; - -- dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM; -+ dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM; - - smsc95xx_init_mac_address(dev); - - -From 2af672ce3d6de0430b4e1578561347fa5c28175c Mon Sep 17 00:00:00 2001 +From 0347406f27599b9d64ab3751f3fbb9aecd3b1016 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 18 Mar 2014 23:33:27 +0000 -Subject: [PATCH 263/269] usb/serial/ch341: Add parity support +Subject: [PATCH 261/305] usb/serial/ch341: Add parity support Based on wireshark packet traces from a windows machine. @@ -161695,58 +161393,67 @@ index e98590aab633cd6491f2886842179d314ded5fe6..4f25aba5bdfcabe7304b18860be85275 if (C_BAUD(tty) == B0) priv->line_control &= ~(CH341_BIT_DTR | CH341_BIT_RTS); -From 6f7b4c2fd93af047338593994594b651f863f3e9 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 5 May 2017 13:23:10 +0100 -Subject: [PATCH 264/269] Revert "serial: 8250: Don't crash when nr_uarts is 0" +From 10eeb1be0aee5ae942462976cb7959c7280aba93 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sat, 20 May 2017 22:10:14 +0100 +Subject: [PATCH 262/305] overlays: README: remove vestigial SDIO parameters -This reverts commit 9c297d9ebd0d8c6d5e6e8675d527d6a221613abc. +Signed-off-by: Phil Elwell --- - drivers/tty/serial/8250/8250_core.c | 2 -- - 1 file changed, 2 deletions(-) + arch/arm/boot/dts/overlays/README | 24 ++---------------------- + 1 file changed, 2 insertions(+), 22 deletions(-) -diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index 2d45863da0e3fecaf339f3e9cdf3c385081f1a9b..9bfdb0e549e626082be8fd6f350e9f801e1a1eed 100644 ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -509,8 +509,6 @@ static void __init serial8250_isa_init_ports(void) +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 95600381448b0b485dbbbeb592ae1e82a8acec08..d5aebbe2d514c07c0fae72f80173c086cd19a83b 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1225,19 +1225,9 @@ Name: sdio + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, + and enables SDIO via GPIOs 22-27. + Load: dtoverlay=sdio,= +-Params: overclock_50 SD Clock (in MHz) to use when the MMC framework +- requests 50MHz +- +- sdio_overclock SDIO Clock (in MHz) to use when the MMC ++Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC + framework requests 50MHz - if (nr_uarts > UART_NR) - nr_uarts = UART_NR; -- if (!nr_uarts) -- return; +- force_pio Disable DMA support (default off) +- +- pio_limit Number of blocks above which to use DMA +- (default 1) +- +- debug Enable debug output (default off) +- + poll_once Disable SDIO-device polling every second + (default on: polling once at boot-time) - for (i = 0; i < nr_uarts; i++) { - struct uart_8250_port *up = &serial8250_ports[i]; - -From 8fe8bab6cdfd41751ec0c74e95857b98dbc5c193 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 May 2017 12:47:46 +0100 -Subject: [PATCH 265/269] dwcotg: Allow to build without FIQ on ARM64 - -Signed-off-by: popcornmix ---- - drivers/usb/host/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index 5a5f6c925f43147082dcfaab15f9e05ed966838c..c50476b3d72471faf94c280aab756599fe55ac90 100644 ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -764,7 +764,7 @@ config USB_HWA_HCD +@@ -1248,19 +1238,9 @@ Name: sdio-1bit + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, + and enables 1-bit SDIO via GPIOs 22-25. + Load: dtoverlay=sdio-1bit,= +-Params: overclock_50 SD Clock (in MHz) to use when the MMC framework +- requests 50MHz +- +- sdio_overclock SDIO Clock (in MHz) to use when the MMC ++Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC + framework requests 50MHz + +- force_pio Disable DMA support (default off) +- +- pio_limit Number of blocks above which to use DMA +- (default 1) +- +- debug Enable debug output (default off) +- + poll_once Disable SDIO-device polling every second + (default on: polling once at boot-time) - config USB_DWCOTG - tristate "Synopsis DWC host support" -- depends on USB && FIQ -+ depends on USB && (FIQ || ARM64) - help - The Synopsis DWC controller is a dual-role - host/peripheral/OTG ("On The Go") USB controllers. -From a017d2c8d33ea20e73ae94b931d361d60b76c664 Mon Sep 17 00:00:00 2001 +From b04d8e1044a9bc05fcd14fd0c1ec2a7c5f59a904 Mon Sep 17 00:00:00 2001 From: Liviu Dudau Date: Wed, 1 Mar 2017 12:26:28 +0000 -Subject: [PATCH 266/269] ASoC: TLV320AIC23: Unquote NULL from control name +Subject: [PATCH 263/305] ASoC: TLV320AIC23: Unquote NULL from control name commit a03faba972cb0f9b3a46d8054e674d5492e06c38 upstream. @@ -161787,32 +161494,10 @@ index 410cae0f2060474313872d6b9110bf05d3368e43..628a8eeaab689eb85b6d3dba54ec5a98 /* input mux */ {"Capture Source", "Line", "Line Input"}, -From 553e258c1407e42f4b4eba21806fd2b2cf855280 Mon Sep 17 00:00:00 2001 +From 37e50f264a8297bc649337a871d4d101b4e73951 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 16 May 2017 16:55:36 +0100 -Subject: [PATCH 267/269] config: Drop CONFIG_TOUCHSCREEN_EKTF2127 - ---- - arch/arm/configs/bcm2709_defconfig | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index d6f3db7620639f1cf377a935dd93710db4ec9c82..dc3523343c39cacdf6f913fe8fbcaa38c5f5374a 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -572,7 +572,6 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m --CONFIG_TOUCHSCREEN_EKTF2127=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m - -From 6132c29f1f8aeef3b19cc7a9ed53e82e447908af Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 16 May 2017 15:58:00 +0100 -Subject: [PATCH 268/269] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 +Date: Mon, 22 May 2017 15:28:27 +0100 +Subject: [PATCH 264/305] config: Add CONFIG_IPV6_ROUTE_INFO --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -161820,34 +161505,34 @@ Subject: [PATCH 268/269] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index dc3523343c39cacdf6f913fe8fbcaa38c5f5374a..b4eb06e990b2d6b11e4645d9c79ae6a75fc2655b 100644 +index 7f46612d43773bd1ab88fef2bcd10f20e34f16e8..c6ad0d3259c06e85071327086553a1c5c2ab7e99 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -572,6 +572,7 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m -+CONFIG_TOUCHSCREEN_EDT_FT5X06=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m +@@ -103,6 +103,7 @@ CONFIG_TCP_CONG_ADVANCED=y + CONFIG_TCP_CONG_BBR=m + CONFIG_IPV6=m + CONFIG_IPV6_ROUTER_PREF=y ++CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index e3878cdcbc8d17ee7cb1af10592477b56308669b..693ac252ce29f3aae94424e892c6206d48be3265 100644 +index b4554044aad7faabd4db57a87c11dba8e088d7d4..d92392cbdfa6b76184bf22da7c69ecb09ffdc842 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -568,6 +568,7 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m -+CONFIG_TOUCHSCREEN_EDT_FT5X06=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m +@@ -99,6 +99,7 @@ CONFIG_TCP_CONG_ADVANCED=y + CONFIG_TCP_CONG_BBR=m + CONFIG_IPV6=m + CONFIG_IPV6_ROUTER_PREF=y ++CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m -From 435c831bb5f68a59f4c9b4e6eb5d74d714a74766 Mon Sep 17 00:00:00 2001 +From e40dd8c0c847874d396f72753709365de9f459f6 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 16 May 2017 19:34:52 +0100 -Subject: [PATCH 269/269] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF +Date: Mon, 22 May 2017 13:35:28 +0100 +Subject: [PATCH 265/305] config: Add CONFIG_IPV6_SIT_6RD --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -161855,26 +161540,5326 @@ Subject: [PATCH 269/269] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index b4eb06e990b2d6b11e4645d9c79ae6a75fc2655b..17fac298f4e5a07fb5292f5e42d43a09208b21c5 100644 +index c6ad0d3259c06e85071327086553a1c5c2ab7e99..df6c738ee38bc26a3895f9fdc4a1bfbb4a7e0347 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -621,6 +621,7 @@ CONFIG_I2C_MUX_PCA954x=m - CONFIG_I2C_BCM2708=m - CONFIG_I2C_BCM2835=m - CONFIG_I2C_GPIO=m -+CONFIG_I2C_ROBOTFUZZ_OSIF=m - CONFIG_SPI=y - CONFIG_SPI_BCM2835=m - CONFIG_SPI_BCM2835AUX=m +@@ -107,6 +107,7 @@ CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m ++CONFIG_IPV6_SIT_6RD=y + CONFIG_IPV6_TUNNEL=m + CONFIG_IPV6_MULTIPLE_TABLES=y + CONFIG_IPV6_SUBTREES=y diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 693ac252ce29f3aae94424e892c6206d48be3265..442eb48d4cb418d596e0dbad4bf0742d9e8e80b0 100644 +index d92392cbdfa6b76184bf22da7c69ecb09ffdc842..65f16f4f64dd7ad9e9d4a337ec64d769bbff2bee 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -617,6 +617,7 @@ CONFIG_I2C_MUX_PCA954x=m - CONFIG_I2C_BCM2708=m - CONFIG_I2C_BCM2835=m - CONFIG_I2C_GPIO=m -+CONFIG_I2C_ROBOTFUZZ_OSIF=m - CONFIG_SPI=y - CONFIG_SPI_BCM2835=m - CONFIG_SPI_BCM2835AUX=m +@@ -103,6 +103,7 @@ CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m ++CONFIG_IPV6_SIT_6RD=y + CONFIG_IPV6_TUNNEL=m + CONFIG_IPV6_MULTIPLE_TABLES=y + CONFIG_IPV6_SUBTREES=y + +From 359bf250157840153dbafffb543bc5bd24ece1bf Mon Sep 17 00:00:00 2001 +From: Anton Onishchenko +Date: Tue, 23 May 2017 18:55:46 +0300 +Subject: [PATCH 266/305] mpu6050 device tree overlay (#2031) + +Add overlay and config options for InvenSense MPU6050 6-axis motion +detector. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 ++++++ + arch/arm/boot/dts/overlays/mpu6050-overlay.dts | 28 ++++++++++++++++++++++++++ + arch/arm/configs/bcm2709_defconfig | 3 +-- + arch/arm/configs/bcmrpi_defconfig | 3 +-- + 5 files changed, 37 insertions(+), 4 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/mpu6050-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 9368f6281dd80f01900b477d97c83047e33ceb36..a2670d3ab9479f34886e0ea5431de39c8bcc21e4 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -58,6 +58,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mcp3008.dtbo \ + midi-uart0.dtbo \ + mmc.dtbo \ ++ mpu6050.dtbo \ + mz61581.dtbo \ + pi3-act-led.dtbo \ + pi3-disable-bt.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d5aebbe2d514c07c0fae72f80173c086cd19a83b..2f762bcf23859ccb0e922935ad158227514b34c5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -891,6 +891,12 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework + requests 50MHz + + ++Name: mpu6050 ++Info: Overlay for i2c connected mpu6050 imu ++Load: dtoverlay=mpu6050,= ++Params: interrupt GPIO pin for interrupt (default 4) ++ ++ + Name: mz61581 + Info: MZ61581 display by Tontec + Load: dtoverlay=mz61581,= +diff --git a/arch/arm/boot/dts/overlays/mpu6050-overlay.dts b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..06037969c3abba270b3cad45875342f3c730506e +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts +@@ -0,0 +1,28 @@ ++// Definitions for MPU6050 ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ mpu6050: mpu6050@68 { ++ compatible = "invensense,mpu6050"; ++ reg = <0x68>; ++ interrupt-parent = <&gpio>; ++ interrupts = <4 1>; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ interrupt = <&mpu6050>,"interrupts:0"; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index df6c738ee38bc26a3895f9fdc4a1bfbb4a7e0347..17fac298f4e5a07fb5292f5e42d43a09208b21c5 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1173,13 +1173,12 @@ CONFIG_RASPBERRYPI_POWER=y + CONFIG_EXTCON=m + CONFIG_EXTCON_ARIZONA=m + CONFIG_IIO=m +-CONFIG_IIO_BUFFER=y + CONFIG_IIO_BUFFER_CB=m +-CONFIG_IIO_KFIFO_BUF=m + CONFIG_MCP320X=m + CONFIG_MCP3422=m + CONFIG_DHT11=m + CONFIG_HTU21=m ++CONFIG_INV_MPU6050_I2C=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 65f16f4f64dd7ad9e9d4a337ec64d769bbff2bee..442eb48d4cb418d596e0dbad4bf0742d9e8e80b0 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1182,13 +1182,12 @@ CONFIG_RASPBERRYPI_POWER=y + CONFIG_EXTCON=m + CONFIG_EXTCON_ARIZONA=m + CONFIG_IIO=m +-CONFIG_IIO_BUFFER=y + CONFIG_IIO_BUFFER_CB=m +-CONFIG_IIO_KFIFO_BUF=m + CONFIG_MCP320X=m + CONFIG_MCP3422=m + CONFIG_DHT11=m + CONFIG_HTU21=m ++CONFIG_INV_MPU6050_I2C=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m + +From 11605abeb458d621455e30d59262b4275d13e648 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 22 May 2017 13:56:41 +0100 +Subject: [PATCH 267/305] clk: bcm2835: Minimise clock jitter for PCM clock + +Fractional clock dividers generate accurate average frequencies but +with jitter, particularly when the integer divisor is small. + +Introduce a new metric of clock accuracy to penalise clocks with a good +average but worse jitter compared to clocks with an average which is no +better but with lower jitter. The metric is the ideal rate minus the +worse deviation from that ideal using the nearest integer divisors. + +Use this metric for parent selection for clocks requiring low jitter +(currently just PCM). + +Signed-off-by: Phil Elwell +--- + drivers/clk/bcm/clk-bcm2835.c | 39 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 34 insertions(+), 5 deletions(-) + +diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c +index c24b4defb2b046e4ecdc109befc2b22497060647..db3ba74acf78f4dfec0d2206b58bc7c3a09f72fe 100644 +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -534,6 +534,7 @@ struct bcm2835_clock_data { + + bool is_vpu_clock; + bool is_mash_clock; ++ bool low_jitter; + + u32 tcnt_mux; + }; +@@ -1154,7 +1155,8 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, + int parent_idx, + unsigned long rate, + u32 *div, +- unsigned long *prate) ++ unsigned long *prate, ++ unsigned long *avgrate) + { + struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); + struct bcm2835_cprman *cprman = clock->cprman; +@@ -1166,11 +1168,33 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, + parent = clk_hw_get_parent_by_index(hw, parent_idx); + + if (!(BIT(parent_idx) & data->set_rate_parent)) { ++ unsigned long tmp_rate; ++ + *prate = clk_hw_get_rate(parent); + *div = bcm2835_clock_choose_div(hw, rate, *prate, true); + +- return bcm2835_clock_rate_from_divisor(clock, *prate, +- *div); ++ tmp_rate = bcm2835_clock_rate_from_divisor(clock, *prate, *div); ++ *avgrate = tmp_rate; ++ ++ if (data->low_jitter && (*div & CM_DIV_FRAC_MASK)) { ++ unsigned long high, low; ++ u32 idiv = *div & ~CM_DIV_FRAC_MASK; ++ ++ high = bcm2835_clock_rate_from_divisor(clock, *prate, ++ idiv); ++ idiv += CM_DIV_FRAC_MASK + 1; ++ low = bcm2835_clock_rate_from_divisor(clock, *prate, ++ idiv); ++ ++ /* Return a value which is the maximum deviation ++ * below the ideal rate, for use as a metric. ++ */ ++ if ((tmp_rate - low) < (high - tmp_rate)) ++ tmp_rate = low; ++ else ++ tmp_rate -= high - tmp_rate; ++ } ++ return tmp_rate; + } + + if (data->frac_bits) +@@ -1197,6 +1221,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, + + *div = curdiv << CM_DIV_FRAC_BITS; + *prate = curdiv * best_rate; ++ *avgrate = best_rate; + + return best_rate; + } +@@ -1208,6 +1233,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, + bool current_parent_is_pllc; + unsigned long rate, best_rate = 0; + unsigned long prate, best_prate = 0; ++ unsigned long avgrate, best_avgrate = 0; + size_t i; + u32 div; + +@@ -1232,11 +1258,13 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, + continue; + + rate = bcm2835_clock_choose_div_and_prate(hw, i, req->rate, +- &div, &prate); ++ &div, &prate, ++ &avgrate); + if (rate > best_rate && rate <= req->rate) { + best_parent = parent; + best_prate = prate; + best_rate = rate; ++ best_avgrate = avgrate; + } + } + +@@ -1246,7 +1274,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, + req->best_parent_hw = best_parent; + req->best_parent_rate = best_prate; + +- req->rate = best_rate; ++ req->rate = best_avgrate; + + return 0; + } +@@ -2061,6 +2089,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { + .int_bits = 12, + .frac_bits = 12, + .is_mash_clock = true, ++ .low_jitter = true, + .parents = bcm2835_pcm_per_parents, + .tcnt_mux = 23), + [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( + +From bc7652be6fbd93e460c8de2f7411d70dca9f2287 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 24 May 2017 18:06:02 +0100 +Subject: [PATCH 268/305] Revert "hid: Reduce default mouse polling interval to + 60Hz" + +This reverts commit b45c0448b60d691508251cdccf242ea43bbabb14. +--- + drivers/hid/usbhid/hid-core.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index 4a7af9d0b910f59d17421ce14138400dfd5834f3..ae83af649a607f67239f1a64bf45dd4b5770cc7d 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -49,7 +49,7 @@ + * Module parameters. + */ + +-static unsigned int hid_mousepoll_interval = ~0; ++static unsigned int hid_mousepoll_interval; + module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); + MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); + +@@ -1083,12 +1083,8 @@ static int usbhid_start(struct hid_device *hid) + } + + /* Change the polling interval of mice. */ +- if (hid->collection->usage == HID_GD_MOUSE) { +- if (hid_mousepoll_interval == ~0 && interval < 16) +- interval = 16; +- else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0) +- interval = hid_mousepoll_interval; +- } ++ if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) ++ interval = hid_mousepoll_interval; + + ret = -ENOMEM; + if (usb_endpoint_dir_in(endpoint)) { + +From 50be44a48e60fb53d94746c9f6153683f868a1a5 Mon Sep 17 00:00:00 2001 +From: Tobias Jakobi +Date: Sat, 25 Feb 2017 20:27:27 +0100 +Subject: [PATCH 269/305] HID: usbhid: extend polling interval configuration to + joysticks + +For mouse devices we can currently change the polling interval +via usbhid.mousepoll. Implement the same thing for joysticks, so +users can reduce input latency this way. + +This has been tested with a Logitech RumblePad 2 with jspoll=2, +resulting in a polling rate of 500Hz (verified with evhz). + +Signed-off-by: Tobias Jakobi +Acked-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +--- + Documentation/kernel-parameters.txt | 3 +++ + drivers/hid/usbhid/hid-core.c | 18 +++++++++++++++--- + 2 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt +index 86a6746f683393982cc93a6c3b99b989adbb1df8..d2e1858cf7e1d8ddfb0b81bc1e32e11a3b5f930c 100644 +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -4281,6 +4281,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. + usbhid.mousepoll= + [USBHID] The interval which mice are to be polled at. + ++ usbhid.jspoll= ++ [USBHID] The interval which joysticks are to be polled at. ++ + usb-storage.delay_use= + [UMS] The delay in seconds before a new device is + scanned for Logical Units (default 1). +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index ae83af649a607f67239f1a64bf45dd4b5770cc7d..f7a692f9e50cdc80ebebab1ea260cde29b32d147 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -53,6 +53,10 @@ static unsigned int hid_mousepoll_interval; + module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); + MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); + ++static unsigned int hid_jspoll_interval; ++module_param_named(jspoll, hid_jspoll_interval, uint, 0644); ++MODULE_PARM_DESC(jspoll, "Polling interval of joysticks"); ++ + static unsigned int ignoreled; + module_param_named(ignoreled, ignoreled, uint, 0644); + MODULE_PARM_DESC(ignoreled, "Autosuspend with active leds"); +@@ -1082,9 +1086,17 @@ static int usbhid_start(struct hid_device *hid) + hid->name, endpoint->bInterval, interval); + } + +- /* Change the polling interval of mice. */ +- if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) +- interval = hid_mousepoll_interval; ++ /* Change the polling interval of mice and joysticks. */ ++ switch (hid->collection->usage) { ++ case HID_GD_MOUSE: ++ if (hid_mousepoll_interval > 0) ++ interval = hid_mousepoll_interval; ++ break; ++ case HID_GD_JOYSTICK: ++ if (hid_jspoll_interval > 0) ++ interval = hid_jspoll_interval; ++ break; ++ } + + ret = -ENOMEM; + if (usb_endpoint_dir_in(endpoint)) { + +From 600845fe2736cede780074bc674046b88d24bcec Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 14 Jul 2014 22:02:09 +0100 +Subject: [PATCH 270/305] hid: Reduce default mouse polling interval to 60Hz + +Reduces overhead when using X +--- + drivers/hid/usbhid/hid-core.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index f7a692f9e50cdc80ebebab1ea260cde29b32d147..dbe506d3ceecb6d47e21f060d0bbac2b3c0165fe 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -49,7 +49,7 @@ + * Module parameters. + */ + +-static unsigned int hid_mousepoll_interval; ++static unsigned int hid_mousepoll_interval = ~0; + module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); + MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); + +@@ -1089,7 +1089,9 @@ static int usbhid_start(struct hid_device *hid) + /* Change the polling interval of mice and joysticks. */ + switch (hid->collection->usage) { + case HID_GD_MOUSE: +- if (hid_mousepoll_interval > 0) ++ if (hid_mousepoll_interval == ~0 && interval < 16) ++ interval = 16; ++ else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0) + interval = hid_mousepoll_interval; + break; + case HID_GD_JOYSTICK: + +From cb08472f4ee59309cad227a3c8df76a473c65670 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Thu, 25 May 2017 16:04:53 +0100 +Subject: [PATCH 271/305] dwc_otg: make periodic scheduling behave properly for + FS buses + +If the root port is in full-speed mode, transfer times at 12mbit/s +would be calculated but matched against high-speed quotas. + +Reinitialise hcd->frame_usecs[i] on each port enable event so that +full-speed bandwidth can be tracked sensibly. + +Also, don't bother using the FIQ for transfers when in full-speed +mode - at the slower bus speed, interrupt frequency is reduced by +an order of magnitude. + +Related issue: https://github.com/raspberrypi/linux/issues/2020 +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 15 ++++++++++----- + drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 7 +++++-- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 4 ++++ + drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 19 ++++++++++++------- + 4 files changed, 31 insertions(+), 14 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index a2dc6337836b2719f4c954edeeb2a71301931b04..38bf5fc792d32352f9e208e0e90f968599b9bc31 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -926,8 +926,6 @@ static void dwc_otg_hcd_free(dwc_otg_hcd_t * dwc_otg_hcd) + DWC_FREE(dwc_otg_hcd); + } + +-int init_hcd_usecs(dwc_otg_hcd_t *_hcd); +- + int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) + { + struct device *dev = dwc_otg_hcd_to_dev(hcd); +@@ -1429,6 +1427,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + + /** + * fiq_fsm_transaction_suitable() - Test a QH for compatibility with the FIQ ++ * @hcd: Pointer to the dwc_otg_hcd struct + * @qh: pointer to the endpoint's queue head + * + * Transaction start/end control flow is grafted onto the existing dwc_otg +@@ -1438,8 +1437,14 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + * Returns: 0 for unsuitable, 1 implies the FIQ can be enabled for this transaction. + */ + +-int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh) ++int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + { ++ /* There is little benefit in using the FIQ to perform transfers if ++ * the root port is not in high-speed mode. ++ */ ++ if (hcd->flags.b.port_speed != DWC_HPRT0_PRTSPD_HIGH_SPEED) ++ return 0; ++ + if (qh->do_split) { + switch (qh->ep_type) { + case UE_CONTROL: +@@ -2218,7 +2223,7 @@ static void process_periodic_channels(dwc_otg_hcd_t * hcd) + continue; + } + +- if (fiq_fsm_enable && fiq_fsm_transaction_suitable(qh)) { ++ if (fiq_fsm_enable && fiq_fsm_transaction_suitable(hcd, qh)) { + if (qh->do_split) + fiq_fsm_queue_split_transaction(hcd, qh); + else +@@ -2355,7 +2360,7 @@ static void process_non_periodic_channels(dwc_otg_hcd_t * hcd) + qh = DWC_LIST_ENTRY(hcd->non_periodic_qh_ptr, dwc_otg_qh_t, + qh_list_entry); + +- if(fiq_fsm_enable && fiq_fsm_transaction_suitable(qh)) { ++ if(fiq_fsm_enable && fiq_fsm_transaction_suitable(hcd, qh)) { + fiq_fsm_queue_split_transaction(hcd, qh); + } else { + status = queue_transaction(hcd, qh->channel, +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +index 7f7e9eaffd6a3c3d898855562fbec11289f77f53..5ed8dccf03959a610849aa6c8946ca745dbae207 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +@@ -410,7 +410,8 @@ struct dwc_otg_hcd { + unsigned port_suspend_change:1; + unsigned port_over_current_change:1; + unsigned port_l1_change:1; +- unsigned reserved:26; ++ unsigned port_speed:2; ++ unsigned reserved:24; + } b; + } flags; + +@@ -629,7 +630,7 @@ int dwc_otg_hcd_allocate_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh); + void dwc_otg_hcd_release_port(dwc_otg_hcd_t * dwc_otg_hcd, dwc_otg_qh_t *qh); + + extern int fiq_fsm_queue_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh); +-extern int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh); ++extern int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh); + extern void dwc_otg_cleanup_fiq_channel(dwc_otg_hcd_t *hcd, uint32_t num); + + /** @} */ +@@ -823,6 +824,8 @@ static inline uint16_t dwc_micro_frame_num(uint16_t frame) + return frame & 0x7; + } + ++extern void init_hcd_usecs(dwc_otg_hcd_t *_hcd); ++ + void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc, + dwc_otg_hc_regs_t * hc_regs, + dwc_otg_qtd_t * qtd); +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +index a4355afc77b68718fdaba6c5d4be257dadc75036..c8f52709a7d24974c0a38dcf1708f91073e96b0e 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -515,6 +515,10 @@ int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd) + dwc_otg_host_if_t *host_if = + dwc_otg_hcd->core_if->host_if; + ++ dwc_otg_hcd->flags.b.port_speed = hprt0.b.prtspd; ++ if (microframe_schedule) ++ init_hcd_usecs(dwc_otg_hcd); ++ + /* Every time when port enables calculate + * HFIR.FrInterval + */ +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +index 85a6d431ca54b47dc10573aa72d1ad69d06f2e36..4b1dd9de99e9e08b2e006fb5f8a7ef92f20c2553 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +@@ -408,13 +408,17 @@ const unsigned short max_uframe_usecs[]={ 100, 100, 100, 100, 100, 100, 30, 0 }; + /* + * called from dwc_otg_hcd.c:dwc_otg_hcd_init + */ +-int init_hcd_usecs(dwc_otg_hcd_t *_hcd) ++void init_hcd_usecs(dwc_otg_hcd_t *_hcd) + { + int i; +- for (i=0; i<8; i++) { +- _hcd->frame_usecs[i] = max_uframe_usecs[i]; ++ if (_hcd->flags.b.port_speed == DWC_HPRT0_PRTSPD_FULL_SPEED) { ++ _hcd->frame_usecs[0] = 900; ++ for (i = 1; i < 8; i++) ++ _hcd->frame_usecs[i] = 0; ++ } else { ++ for (i = 0; i < 8; i++) ++ _hcd->frame_usecs[i] = max_uframe_usecs[i]; + } +- return 0; + } + + static int find_single_uframe(dwc_otg_hcd_t * _hcd, dwc_otg_qh_t * _qh) +@@ -541,8 +545,9 @@ static int find_uframe(dwc_otg_hcd_t * _hcd, dwc_otg_qh_t * _qh) + int ret; + ret = -1; + +- if (_qh->speed == USB_SPEED_HIGH) { +- /* if this is a hs transaction we need a full frame */ ++ if (_qh->speed == USB_SPEED_HIGH || ++ _hcd->flags.b.port_speed == DWC_HPRT0_PRTSPD_FULL_SPEED) { ++ /* if this is a hs transaction we need a full frame - or account for FS usecs */ + ret = find_single_uframe(_hcd, _qh); + } else { + /* if this is a fs transaction we may need a sequence of frames */ +@@ -627,7 +632,7 @@ static int schedule_periodic(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + if (status) { + DWC_INFO("%s: Insufficient periodic bandwidth for " + "periodic transfer.\n", __func__); +- return status; ++ return -DWC_E_NO_SPACE; + } + status = check_max_xfer_size(hcd, qh); + if (status) { + +From bad5a9beb71519961754efc15579463a04752c70 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 31 May 2017 09:33:55 +0100 +Subject: [PATCH 272/305] config: Adding SENSOR_JC42 + +The jc42 module supports a number of I2C-based temperature +sensor modules. + +[ DM_RAID0 config lost because now selected by DM_RAID ] + +See: https://github.com/raspberrypi/linux/issues/2046 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 2 +- + arch/arm/configs/bcmrpi_defconfig | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 17fac298f4e5a07fb5292f5e42d43a09208b21c5..40d7ffe33cbd3e1f068ef540cb6297842b7d8130 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -440,7 +440,6 @@ CONFIG_ISCSI_TCP=m + CONFIG_ISCSI_BOOT_SYSFS=m + CONFIG_MD=y + CONFIG_MD_LINEAR=m +-CONFIG_MD_RAID0=m + CONFIG_BLK_DEV_DM=m + CONFIG_DM_CRYPT=m + CONFIG_DM_SNAPSHOT=m +@@ -657,6 +656,7 @@ CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m + CONFIG_HWMON=m ++CONFIG_SENSORS_JC42=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 442eb48d4cb418d596e0dbad4bf0742d9e8e80b0..9dc64f7985cc1f91952ea382fac7920e46b3f8c4 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -436,7 +436,6 @@ CONFIG_ISCSI_TCP=m + CONFIG_ISCSI_BOOT_SYSFS=m + CONFIG_MD=y + CONFIG_MD_LINEAR=m +-CONFIG_MD_RAID0=m + CONFIG_BLK_DEV_DM=m + CONFIG_DM_CRYPT=m + CONFIG_DM_SNAPSHOT=m +@@ -651,6 +650,7 @@ CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m + CONFIG_HWMON=m ++CONFIG_SENSORS_JC42=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m + +From d40d6afc796dbe38fe266d6cbd6e80fe5cf495d8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 31 May 2017 15:27:39 +0100 +Subject: [PATCH 273/305] BCM270X_DT: Improve i2c-sensor and i2c-rtc overlay + +Use the "__dormant__" feature to permit multiple instances of each +overlay, which is more useful now that changing the "reg" property +also changes the node address. Although the overlay grows slightly, +when applied only the requested node is included. + +Usage does not change, except that the "lm75addr" parameter of the +i2c-sensor overlay has been deprecated in favour of the generic +"addr" parameter. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 8 +- + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 119 ++++++++++++++++++---- + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 87 +++++++++++++--- + 3 files changed, 175 insertions(+), 39 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 2f762bcf23859ccb0e922935ad158227514b34c5..bd7563be019c5a8086d6369c8fc24af7303f8610 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -660,8 +660,8 @@ Name: i2c-sensor + Info: Adds support for a number of I2C barometric pressure and temperature + sensors on i2c_arm + Load: dtoverlay=i2c-sensor,= +-Params: addr Set the address for the BME280, BMP280 or +- TMP102 ++Params: addr Set the address for the BME280, BMP280, TMP102 ++ or LM75 + + bme280 Select the Bosch Sensortronic BME280 + Valid addresses 0x76-0x77, default 0x76 +@@ -674,9 +674,9 @@ Params: addr Set the address for the BME280, BMP280 or + Valid addresses 0x76-0x77, default 0x76 + + lm75 Select the Maxim LM75 temperature sensor ++ Valid addresses 0x48-0x4f, default 0x4f + +- lm75addr Choose the address for the LM75 (0x48-0x4f - +- default 0x4f) ++ lm75addr Deprecated - use addr parameter instead + + si7020 Select the Silicon Labs Si7013/20/21 humidity/ + temperature sensor +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index 1efcf0b712c9c5c19210545002ac1f0931db58f5..b73f902289c8e52705665d8da6d0e904eeaaaf18 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -7,7 +7,7 @@ + + fragment@0 { + target = <&i2c_arm>; +- __overlay__ { ++ __dormant__ { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; +@@ -17,61 +17,142 @@ + reg = <0x69>; + abracon,tc-diode = "standard"; + abracon,tc-resistor = <0>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + ds1307: ds1307@68 { + compatible = "maxim,ds1307"; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + ds1339: ds1339@68 { + compatible = "dallas,ds1339"; + trickle-resistor-ohms = <0>; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + mcp7940x: mcp7940x@6f { + compatible = "microchip,mcp7940x"; + reg = <0x6f>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + mcp7941x: mcp7941x@6f { + compatible = "microchip,mcp7941x"; + reg = <0x6f>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + ds3231: ds3231@68 { + compatible = "maxim,ds3231"; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + pcf2127: pcf2127@51 { + compatible = "nxp,pcf2127"; + reg = <0x51>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@7 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + pcf8523: pcf8523@68 { + compatible = "nxp,pcf8523"; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@8 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + pcf8563: pcf8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; +- status = "disable"; ++ status = "okay"; + }; + }; + }; ++ + __overrides__ { +- abx80x = <&abx80x>,"status"; +- ds1307 = <&ds1307>,"status"; +- ds1339 = <&ds1339>,"status"; +- ds3231 = <&ds3231>,"status"; +- mcp7940x = <&mcp7940x>,"status"; +- mcp7941x = <&mcp7941x>,"status"; +- pcf2127 = <&pcf2127>,"status"; +- pcf8523 = <&pcf8523>,"status"; +- pcf8563 = <&pcf8563>,"status"; ++ abx80x = <0>,"+0"; ++ ds1307 = <0>,"+1"; ++ ds1339 = <0>,"+2"; ++ ds3231 = <0>,"+3"; ++ mcp7940x = <0>,"+4"; ++ mcp7941x = <0>,"+5"; ++ pcf2127 = <0>,"+6"; ++ pcf8523 = <0>,"+7"; ++ pcf8563 = <0>,"+8"; + trickle-diode-type = <&abx80x>,"abracon,tc-diode"; + trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0", + <&abx80x>,"abracon,tc-resistor"; +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index e86a13f92c3f75c14fa4425cdfb081d6795ff76a..d2f0008addfadac8f6ed774a6e4f3f97871c0d61 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -7,7 +7,7 @@ + + fragment@0 { + target = <&i2c_arm>; +- __overlay__ { ++ __dormant__ { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; +@@ -15,57 +15,112 @@ + bme280: bme280@76 { + compatible = "bosch,bme280"; + reg = <0x76>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + bmp085: bmp085@77 { + compatible = "bosch,bmp085"; + reg = <0x77>; + default-oversampling = <3>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + bmp180: bmp180@77 { + compatible = "bosch,bmp180"; + reg = <0x77>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + bmp280: bmp280@76 { + compatible = "bosch,bmp280"; + reg = <0x76>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + lm75: lm75@4f { + compatible = "lm75"; + reg = <0x4f>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + si7020: si7020@40 { + compatible = "si7020"; + reg = <0x40>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + tmp102: tmp102@48 { + compatible = "ti,tmp102"; + reg = <0x48>; +- status = "disable"; ++ status = "okay"; + }; + }; + }; + + __overrides__ { +- addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0"; +- bme280 = <&bme280>,"status"; +- bmp085 = <&bmp085>,"status"; +- bmp180 = <&bmp180>,"status"; +- bmp280 = <&bmp280>,"status"; +- lm75 = <&lm75>,"status"; ++ addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0", ++ <&lm75>,"reg:0"; ++ bme280 = <0>,"+0"; ++ bmp085 = <0>,"+1"; ++ bmp180 = <0>,"+2"; ++ bmp280 = <0>,"+3"; ++ lm75 = <0>,"+4"; + lm75addr = <&lm75>,"reg:0"; +- si7020 = <&si7020>,"status"; +- tmp102 = <&tmp102>,"status"; ++ si7020 = <0>,"+5"; ++ tmp102 = <0>,"+6"; + }; + }; + +From 24ae795e0ab2f8147423da4c14988ef01ba81743 Mon Sep 17 00:00:00 2001 +From: Stefan Tatschner +Date: Mon, 29 May 2017 21:46:16 +0200 +Subject: [PATCH 274/305] Add device tree config for htu21 + +See: https://github.com/raspberrypi/linux/pull/2041 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 2 ++ + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 26 ++++++++++++++++++----- + 2 files changed, 23 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index bd7563be019c5a8086d6369c8fc24af7303f8610..1a905dba7fe1fa03c7ab842c64345988774c88e0 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -673,6 +673,8 @@ Params: addr Set the address for the BME280, BMP280, TMP102 + bmp280 Select the Bosch Sensortronic BMP280 + Valid addresses 0x76-0x77, default 0x76 + ++ htu21 Select the HTU21 temperature and humidity sensor ++ + lm75 Select the Maxim LM75 temperature sensor + Valid addresses 0x48-0x4f, default 0x4f + +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index d2f0008addfadac8f6ed774a6e4f3f97871c0d61..17c27e3b666a7a83619471b50c63bb93836653c5 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -73,6 +73,21 @@ + #size-cells = <0>; + status = "okay"; + ++ htu21: htu21@40 { ++ compatible = "htu21"; ++ reg = <0x40>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + lm75: lm75@4f { + compatible = "lm75"; + reg = <0x4f>; +@@ -81,7 +96,7 @@ + }; + }; + +- fragment@5 { ++ fragment@6 { + target = <&i2c_arm>; + __dormant__ { + #address-cells = <1>; +@@ -96,7 +111,7 @@ + }; + }; + +- fragment@6 { ++ fragment@7 { + target = <&i2c_arm>; + __dormant__ { + #address-cells = <1>; +@@ -118,9 +133,10 @@ + bmp085 = <0>,"+1"; + bmp180 = <0>,"+2"; + bmp280 = <0>,"+3"; +- lm75 = <0>,"+4"; ++ htu21 = <0>,"+4"; ++ lm75 = <0>,"+5"; + lm75addr = <&lm75>,"reg:0"; +- si7020 = <0>,"+5"; +- tmp102 = <0>,"+6"; ++ si7020 = <0>,"+6"; ++ tmp102 = <0>,"+7"; + }; + }; + +From 99a71a6c154986e69b25817d8eebd7688d0f1de6 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Fri, 26 May 2017 12:50:31 +0100 +Subject: [PATCH 275/305] dwc_otg: fiq_fsm: Make isochronous compatibility + checks work properly + +Get rid of the spammy printk and local pointer mangling. +Also, there is a nominal benefit for using fiq_fsm for isochronous +transfers in FS mode (~1.1k IRQs per second vs 2.1k IRQs per second) +so remove the root port speed check. +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 24 ++++++------------------ + 1 file changed, 6 insertions(+), 18 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index 38bf5fc792d32352f9e208e0e90f968599b9bc31..71834cf365e67d7ad995bba7869216c4091c3a74 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -1439,12 +1439,6 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + + int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + { +- /* There is little benefit in using the FIQ to perform transfers if +- * the root port is not in high-speed mode. +- */ +- if (hcd->flags.b.port_speed != DWC_HPRT0_PRTSPD_HIGH_SPEED) +- return 0; +- + if (qh->do_split) { + switch (qh->ep_type) { + case UE_CONTROL: +@@ -1462,28 +1456,22 @@ int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + } + } else if (qh->ep_type == UE_ISOCHRONOUS) { + if (fiq_fsm_mask & (1 << 2)) { +- /* HS ISOCH support. We test for compatibility: ++ /* ISOCH support. We test for compatibility: + * - DWORD aligned buffers + * - Must be at least 2 transfers (otherwise pointless to use the FIQ) + * If yes, then the fsm enqueue function will handle the state machine setup. + */ + dwc_otg_qtd_t *qtd = DWC_CIRCLEQ_FIRST(&qh->qtd_list); + dwc_otg_hcd_urb_t *urb = qtd->urb; +- struct dwc_otg_hcd_iso_packet_desc (*iso_descs)[0] = &urb->iso_descs; +- int nr_iso_frames = urb->packet_count; ++ dwc_dma_t ptr; + int i; +- uint32_t ptr; + +- if (nr_iso_frames < 2) ++ if (urb->packet_count < 2) + return 0; +- for (i = 0; i < nr_iso_frames; i++) { +- ptr = urb->dma + iso_descs[i]->offset; +- if (ptr & 0x3) { +- printk_ratelimited("%s: Non-Dword aligned isochronous frame offset." +- " Cannot queue FIQ-accelerated transfer to device %d endpoint %d\n", +- __FUNCTION__, qh->channel->dev_addr, qh->channel->ep_num); ++ for (i = 0; i < urb->packet_count; i++) { ++ ptr = urb->dma + urb->iso_descs[i].offset; ++ if (ptr & 0x3) + return 0; +- } + } + return 1; + } + +From 4e7b343c8e589baf28430d197538821650983bad Mon Sep 17 00:00:00 2001 +From: sandeepal +Date: Fri, 2 Jun 2017 18:59:46 +0530 +Subject: [PATCH 276/305] Allo Digione Driver (#2048) + +Driver for the Allo Digione soundcard +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../arm/boot/dts/overlays/allo-digione-overlay.dts | 44 ++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 6 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-digione.c | 268 +++++++++++++++++++++ + 8 files changed, 329 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/allo-digione-overlay.dts + create mode 100644 sound/soc/bcm/allo-digione.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index a2670d3ab9479f34886e0ea5431de39c8bcc21e4..f19e06055dec6760205ebccde31f65b4d5793fca 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -8,6 +8,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ads7846.dtbo \ + akkordion-iqdacplus.dtbo \ + allo-boss-dac-pcm512x-audio.dtbo \ ++ allo-digione.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ + allo-piano-dac-plus-pcm512x-audio.dtbo \ + at86rf233.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 1a905dba7fe1fa03c7ab842c64345988774c88e0..984a0f1c4240cc30806a9a596e038ab2ae4fa4ab 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -287,6 +287,12 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + slave" + + ++Name: allo-digione ++Info: Configures the Allo Digione audio card ++Load: dtoverlay=allo-digione ++Params: ++ ++ + Name: allo-piano-dac-pcm512x-audio + Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. + (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. +diff --git a/arch/arm/boot/dts/overlays/allo-digione-overlay.dts b/arch/arm/boot/dts/overlays/allo-digione-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..101277a11a24e9b3eb441c44c3f19c61836fe77c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-digione-overlay.dts +@@ -0,0 +1,44 @@ ++// Definitions for Allo DigiOne ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ wm8804@3b { ++ #sound-dai-cells = <0>; ++ compatible = "wlf,wm8804"; ++ reg = <0x3b>; ++ PVDD-supply = <&vdd_3v3_reg>; ++ DVDD-supply = <&vdd_3v3_reg>; ++ status = "okay"; ++ wlf,reset-gpio = <&gpio 17 0>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "allo,allo-digione"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ clock44-gpio = <&gpio 5 0>; ++ clock48-gpio = <&gpio 6 0>; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 40d7ffe33cbd3e1f068ef540cb6297842b7d8130..8962d1b9c10140bb1af43e01f7eae629adbdeece 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -903,6 +903,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 9dc64f7985cc1f91952ea382fac7920e46b3f8c4..372bfe1ca1fb638d78b1ece096ca1a8e5f5a13a8 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -897,6 +897,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index ede81ecbfa2ac6e0430768ddf31cb957201eb3fd..bf754c0b9fc1c5cb99196ef4c94120c81d7f6cf2 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -182,6 +182,12 @@ config SND_BCM2708_SOC_ALLO_BOSS_DAC + help + Say Y or M if you want to add support for Allo Boss DAC. + ++config SND_BCM2708_SOC_ALLO_DIGIONE ++ tristate "Support for Allo DigiOne" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for Allo DigiOne. + + config SND_PISOUND + tristate "Support for Blokas Labs pisound" +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 72e1620fa4038035804cf3b2a09c6b12e7ae0fe1..53ea8229d7ac2065176983385dd7ba85ee3915ea 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -34,6 +34,7 @@ snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o + snd-soc-allo-boss-dac-objs := allo-boss-dac.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o ++snd-soc-allo-digione-objs := allo-digione.o + snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + +@@ -60,5 +61,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE) += snd-soc-allo-digione.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o + obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o +diff --git a/sound/soc/bcm/allo-digione.c b/sound/soc/bcm/allo-digione.c +new file mode 100644 +index 0000000000000000000000000000000000000000..e3664e44c699d0102120ecf99e8b780a4505ebad +--- /dev/null ++++ b/sound/soc/bcm/allo-digione.c +@@ -0,0 +1,268 @@ ++/* ++ * ASoC Driver for Allo DigiOne ++ * ++ * Author: Baswaraj ++ * Copyright 2017 ++ * based on code by Daniel Matuschek ++ * based on code by Florian Meier ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "../codecs/wm8804.h" ++ ++static short int auto_shutdown_output = 0; ++module_param(auto_shutdown_output, short, ++ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); ++MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped"); ++ ++#define CLK_44EN_RATE 22579200UL ++#define CLK_48EN_RATE 24576000UL ++ ++static struct gpio_desc *snd_allo_clk44gpio; ++static struct gpio_desc *snd_allo_clk48gpio; ++ ++static int samplerate = 44100; ++ ++static uint32_t snd_allo_digione_enable_clock(int sample_rate) ++{ ++ switch (sample_rate) { ++ case 11025: ++ case 22050: ++ case 44100: ++ case 88200: ++ case 176400: ++ gpiod_set_value_cansleep(snd_allo_clk44gpio, 1); ++ gpiod_set_value_cansleep(snd_allo_clk48gpio, 0); ++ return CLK_44EN_RATE; ++ default: ++ gpiod_set_value_cansleep(snd_allo_clk48gpio, 1); ++ gpiod_set_value_cansleep(snd_allo_clk44gpio, 0); ++ return CLK_48EN_RATE; ++ } ++} ++ ++ ++static int snd_allo_digione_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ /* enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ return 0; ++} ++ ++static int snd_allo_digione_startup(struct snd_pcm_substream *substream) ++{ ++ /* turn on digital output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); ++ return 0; ++} ++ ++static void snd_allo_digione_shutdown(struct snd_pcm_substream *substream) ++{ ++ /* turn off output */ ++ if (auto_shutdown_output) { ++ /* turn off output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); ++ } ++} ++ ++static int snd_allo_digione_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ int sysclk = 27000000; /* This is fixed on this board */ ++ ++ long mclk_freq = 0; ++ int mclk_div = 1; ++ int sampling_freq = 1; ++ ++ int ret; ++ ++ samplerate = params_rate(params); ++ ++ if (samplerate <= 96000) { ++ mclk_freq = samplerate * 256; ++ mclk_div = WM8804_MCLKDIV_256FS; ++ } else { ++ mclk_freq = samplerate * 128; ++ mclk_div = WM8804_MCLKDIV_128FS; ++ } ++ ++ sysclk = snd_allo_digione_enable_clock(samplerate); ++ ++ switch (samplerate) { ++ case 32000: ++ sampling_freq=0x03; ++ break; ++ case 44100: ++ sampling_freq=0x00; ++ break; ++ case 48000: ++ sampling_freq=0x02; ++ break; ++ case 88200: ++ sampling_freq=0x08; ++ break; ++ case 96000: ++ sampling_freq=0x0a; ++ break; ++ case 176400: ++ sampling_freq=0x0c; ++ break; ++ case 192000: ++ sampling_freq=0x0e; ++ break; ++ default: ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", ++ samplerate); ++ } ++ ++ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); ++ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); ++ ++ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, ++ sysclk, SND_SOC_CLOCK_OUT); ++ ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK: %d\n", ret); ++ return ret; ++ } ++ ++ /* Enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ /* Power on */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); ++ ++ /* set sampling frequency status bits */ ++ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_digione_ops = { ++ .hw_params = snd_allo_digione_hw_params, ++ .startup = snd_allo_digione_startup, ++ .shutdown = snd_allo_digione_shutdown, ++}; ++ ++static struct snd_soc_dai_link snd_allo_digione_dai[] = { ++{ ++ .name = "Allo DigiOne", ++ .stream_name = "Allo DigiOne HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "wm8804-spdif", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "wm8804.1-003b", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBM_CFM, ++ .ops = &snd_allo_digione_ops, ++ .init = snd_allo_digione_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_digione = { ++ .name = "snd_allo_digione", ++ .driver_name = "AlloDigiOne", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_digione_dai, ++ .num_links = ARRAY_SIZE(snd_allo_digione_dai), ++}; ++ ++static int snd_allo_digione_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_allo_digione.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_allo_digione_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ snd_allo_clk44gpio = ++ devm_gpiod_get(&pdev->dev, "clock44", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_allo_clk44gpio)) ++ dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); ++ ++ snd_allo_clk48gpio = ++ devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_allo_clk48gpio)) ++ dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); ++ } ++ ++ ret = snd_soc_register_card(&snd_allo_digione); ++ if (ret && ret != -EPROBE_DEFER) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int snd_allo_digione_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_allo_digione); ++} ++ ++static const struct of_device_id snd_allo_digione_of_match[] = { ++ { .compatible = "allo,allo-digione", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_allo_digione_of_match); ++ ++static struct platform_driver snd_allo_digione_driver = { ++ .driver = { ++ .name = "snd-allo-digione", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_digione_of_match, ++ }, ++ .probe = snd_allo_digione_probe, ++ .remove = snd_allo_digione_remove, ++}; ++ ++module_platform_driver(snd_allo_digione_driver); ++ ++MODULE_AUTHOR("Baswaraj "); ++MODULE_DESCRIPTION("ASoC Driver for Allo DigiOne"); ++MODULE_LICENSE("GPL v2"); + +From 27ca0234d2bcf6bebb336f6e4ff2f6117e3e25fa Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Fri, 28 Apr 2017 15:14:55 -0400 +Subject: [PATCH 277/305] cgroup_get() expected to be called only on live + cgroups and triggers warning on a dead cgroup; however, cgroup_sk_alloc() may + be called while cloning a socket which is left in an empty and removed cgroup + and thus may legitimately duplicate its reference on a dead cgroup. This + currently triggers the following warning spuriously. + + WARNING: CPU: 14 PID: 0 at kernel/cgroup.c:490 cgroup_get+0x55/0x60 + ... + [] __warn+0xd3/0xf0 + [] warn_slowpath_null+0x1e/0x20 + [] cgroup_get+0x55/0x60 + [] cgroup_sk_alloc+0x51/0xe0 + [] sk_clone_lock+0x2db/0x390 + [] inet_csk_clone_lock+0x16/0xc0 + [] tcp_create_openreq_child+0x23/0x4b0 + [] tcp_v6_syn_recv_sock+0x91/0x670 + [] tcp_check_req+0x3a6/0x4e0 + [] tcp_v6_rcv+0x693/0xa00 + [] ip6_input_finish+0x59/0x3e0 + [] ip6_input+0x32/0xb0 + [] ip6_rcv_finish+0x57/0xa0 + [] ipv6_rcv+0x318/0x4d0 + [] __netif_receive_skb_core+0x2d7/0x9a0 + [] __netif_receive_skb+0x16/0x70 + [] netif_receive_skb_internal+0x23/0x80 + [] napi_gro_frags+0x208/0x270 + [] mlx4_en_process_rx_cq+0x74c/0xf40 + [] mlx4_en_poll_rx_cq+0x30/0x90 + [] net_rx_action+0x210/0x350 + [] __do_softirq+0x106/0x2c7 + [] irq_exit+0x9d/0xa0 [] do_IRQ+0x54/0xd0 + [] common_interrupt+0x7f/0x7f + [] cpuidle_enter+0x17/0x20 + [] cpu_startup_entry+0x2a9/0x2f0 + [] start_secondary+0xf1/0x100 + +This patch renames the existing cgroup_get() with the dead cgroup +warning to cgroup_get_live() after cgroup_kn_lock_live() and +introduces the new cgroup_get() which doesn't check whether the cgroup +is live or dead. + +All existing cgroup_get() users except for cgroup_sk_alloc() are +converted to use cgroup_get_live(). + +Fixes: d979a39d7242 ("cgroup: duplicate cgroup reference when cloning sockets") +Cc: stable@vger.kernel.org # v4.5+ +Cc: Johannes Weiner +Reported-by: Chris Mason +Signed-off-by: Tejun Heo +--- + kernel/cgroup.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/kernel/cgroup.c b/kernel/cgroup.c +index e22af4287b4ba084a7cfe7b6fcbf28956796b113..84f45a33d69fc7f187cab1ee7374afe971915f05 100644 +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -489,6 +489,11 @@ static inline bool cgroup_is_dead(const struct cgroup *cgrp) + + static void cgroup_get(struct cgroup *cgrp) + { ++ css_get(&cgrp->self); ++} ++ ++static void cgroup_get_live(struct cgroup *cgrp) ++{ + WARN_ON_ONCE(cgroup_is_dead(cgrp)); + css_get(&cgrp->self); + } +@@ -1049,7 +1054,7 @@ static void link_css_set(struct list_head *tmp_links, struct css_set *cset, + list_add_tail(&link->cgrp_link, &cset->cgrp_links); + + if (cgroup_parent(cgrp)) +- cgroup_get(cgrp); ++ cgroup_get_live(cgrp); + } + + /** +@@ -2118,7 +2123,7 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, + } + cgrp_dfl_visible = true; + root = &cgrp_dfl_root; +- cgroup_get(&root->cgrp); ++ cgroup_get_live(&root->cgrp); + goto out_mount; + } + +@@ -3151,7 +3156,7 @@ static void cgroup_lock_and_drain_offline(struct cgroup *cgrp) + if (!css || !percpu_ref_is_dying(&css->refcnt)) + continue; + +- cgroup_get(dsct); ++ cgroup_get_live(dsct); + prepare_to_wait(&dsct->offline_waitq, &wait, + TASK_UNINTERRUPTIBLE); + +@@ -5096,7 +5101,7 @@ static void init_and_link_css(struct cgroup_subsys_state *css, + { + lockdep_assert_held(&cgroup_mutex); + +- cgroup_get(cgrp); ++ cgroup_get_live(cgrp); + + memset(css, 0, sizeof(*css)); + css->cgroup = cgrp; +@@ -5272,7 +5277,7 @@ static struct cgroup *cgroup_create(struct cgroup *parent) + /* allocation complete, commit to creation */ + list_add_tail_rcu(&cgrp->self.sibling, &cgroup_parent(cgrp)->self.children); + atomic_inc(&root->nr_cgrps); +- cgroup_get(parent); ++ cgroup_get_live(parent); + + /* + * @cgrp is now fully operational. If something fails after this +@@ -6265,7 +6270,7 @@ struct cgroup *cgroup_get_from_path(const char *path) + if (kn) { + if (kernfs_type(kn) == KERNFS_DIR) { + cgrp = kn->priv; +- cgroup_get(cgrp); ++ cgroup_get_live(cgrp); + } else { + cgrp = ERR_PTR(-ENOTDIR); + } +@@ -6345,6 +6350,11 @@ void cgroup_sk_alloc(struct sock_cgroup_data *skcd) + + /* Socket clone path */ + if (skcd->val) { ++ /* ++ * We might be cloning a socket which is left in an empty ++ * cgroup and the cgroup might have already been rmdir'd. ++ * Don't use cgroup_get_live(). ++ */ + cgroup_get(sock_cgroup_ptr(skcd)); + return; + } + +From a156fa530007d19880994f47d185148b495b87bc Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 May 2017 13:03:41 +0100 +Subject: [PATCH 278/305] BCM270X_DT: Add midi-uart1 overlay + +Add a scaler to the ttyS0 clock so that requesting 38400 baud results +in an approximately 31250 baud signal. This is analagous to +midi-uart0, except for ttyS0, which may be useful on Pi3 and also +may avoid an issue with ttyAMA0 failing to synchronise to an active +data stream. + +See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=183860 + +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-uart1-overlay.dts | 43 +++++++++++++++++++++++ + 3 files changed, 51 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/midi-uart1-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index f19e06055dec6760205ebccde31f65b4d5793fca..eca81982c0f19988abd05165fc62a80d26f539cb 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -58,6 +58,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mcp2515-can1.dtbo \ + mcp3008.dtbo \ + midi-uart0.dtbo \ ++ midi-uart1.dtbo \ + mmc.dtbo \ + mpu6050.dtbo \ + mz61581.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 984a0f1c4240cc30806a9a596e038ab2ae4fa4ab..19df6883be4277240283d5f63f27e34a22a2eec5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -892,6 +892,13 @@ Load: dtoverlay=midi-uart0 + Params: + + ++Name: midi-uart1 ++Info: Configures UART1 (ttyS0) so that a requested 38.4kbaud actually gets ++ 31.25kbaud, the frequency required for MIDI ++Load: dtoverlay=midi-uart1 ++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-uart1-overlay.dts b/arch/arm/boot/dts/overlays/midi-uart1-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..e0bc410acbff3a7a175dd5d53b3ab0d0802e8239 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/midi-uart1-overlay.dts +@@ -0,0 +1,43 @@ ++/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: clock@5 { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clocks = <&aux BCM2835_AUX_CLOCK_UART>; ++ clock-mult = <38400>; ++ clock-div = <31250>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart1>; ++ __overlay__ { ++ clocks = <&midi_clk>; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&aux>; ++ __overlay__ { ++ clock-output-names = "aux_uart", "aux_spi1", "aux_spi2"; ++ }; ++ }; ++}; + +From 0a0b11755a929dc43aa16385d482e5c412f787e9 Mon Sep 17 00:00:00 2001 +From: Andrei Gherzan +Date: Mon, 5 Jun 2017 16:40:38 +0100 +Subject: [PATCH 279/305] dma-bcm2708: Fix module compilation of + CONFIG_DMA_BCM2708 + +bcm2708-dmaengine.c defines functions like bcm_dma_start which are +defined as well in dma-bcm2708.h as inline versions when +CONFIG_DMA_BCM2708 is not defined. This works fine when +CONFIG_DMA_BCM2708 is built in, but when it is selected as module build +fails with redefinition errors because in the build system when +CONFIG_DMA_BCM2708 is selected as module, the macro becomes +CONFIG_DMA_BCM2708_MODULE. + +This patch makes the header use CONFIG_DMA_BCM2708_MODULE too when +available. + +Fixes https://github.com/raspberrypi/linux/issues/2056 + +Signed-off-by: Andrei Gherzan +--- + include/linux/platform_data/dma-bcm2708.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/linux/platform_data/dma-bcm2708.h b/include/linux/platform_data/dma-bcm2708.h +index c5bfff2765be4606077e6c8af73040ec13ee8974..6ca874d332a8bc666b1c9576ac51f479b98de14d 100644 +--- a/include/linux/platform_data/dma-bcm2708.h ++++ b/include/linux/platform_data/dma-bcm2708.h +@@ -75,7 +75,7 @@ struct bcm2708_dma_cb { + struct scatterlist; + struct platform_device; + +-#ifdef CONFIG_DMA_BCM2708 ++#if defined(CONFIG_DMA_BCM2708) || defined(CONFIG_DMA_BCM2708_MODULE) + + int bcm_sg_suitable_for_dma(struct scatterlist *sg_ptr, int sg_len); + void bcm_dma_start(void __iomem *dma_chan_base, dma_addr_t control_block); +@@ -138,6 +138,6 @@ static inline int bcm_dmaman_remove(struct platform_device *pdev) + return 0; + } + +-#endif /* CONFIG_DMA_BCM2708 */ ++#endif /* CONFIG_DMA_BCM2708 || CONFIG_DMA_BCM2708_MODULE */ + + #endif /* _PLAT_BCM2708_DMA_H */ + +From 6ae8c6dc14d3662deadde5f5370f3fcd26eb6b73 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 7 Jun 2017 08:53:36 +0100 +Subject: [PATCH 280/305] overlays: Fix i2c-rtc order and fragment numbering + +See: https://github.com/raspberrypi/linux/issues/2059 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index b73f902289c8e52705665d8da6d0e904eeaaaf18..6140f172a86b8731782f938f76cb5dac9f28b662 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -60,9 +60,9 @@ + #size-cells = <0>; + status = "okay"; + +- mcp7940x: mcp7940x@6f { +- compatible = "microchip,mcp7940x"; +- reg = <0x6f>; ++ ds3231: ds3231@68 { ++ compatible = "maxim,ds3231"; ++ reg = <0x68>; + status = "okay"; + }; + }; +@@ -75,8 +75,8 @@ + #size-cells = <0>; + status = "okay"; + +- mcp7941x: mcp7941x@6f { +- compatible = "microchip,mcp7941x"; ++ mcp7940x: mcp7940x@6f { ++ compatible = "microchip,mcp7940x"; + reg = <0x6f>; + status = "okay"; + }; +@@ -90,9 +90,9 @@ + #size-cells = <0>; + status = "okay"; + +- ds3231: ds3231@68 { +- compatible = "maxim,ds3231"; +- reg = <0x68>; ++ mcp7941x: mcp7941x@6f { ++ compatible = "microchip,mcp7941x"; ++ reg = <0x6f>; + status = "okay"; + }; + }; + +From 532e3156aa6ea5754f90474249b440fc3c4dc0bd Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 12:16:10 -0700 +Subject: [PATCH 281/305] drm/vc4: Add T-format scanout support. + +The T tiling format is what V3D uses for textures, with no raster +support at all until later revisions of the hardware (and always at a +large 3D performance penalty). If we can't scan out V3D's format, +then we often need to do a relayout at some stage of the pipeline, +either right before texturing from the scanout buffer (common in X11 +without a compositor) or between a tiled screen buffer right before +scanout (an option I've considered in trying to resolve this +inconsistency, but which means needing to use the dirty fb ioctl and +having some update policy). + +T-format scanout lets us avoid either of those shadow copies, for a +massive, obvious performance improvement to X11 window dragging +without a compositor. Unfortunately, enabling a compositor to work +around the discrepancy has turned out to be too costly in memory +consumption for the Raspbian distribution. + +Because the HVS operates a scanline at a time, compositing from T does +increase the memory bandwidth cost of scanout. On my 1920x1080@32bpp +display on a RPi3, we go from about 15% of system memory bandwidth +with linear to about 20% with tiled. However, for X11 this still ends +up being a huge performance win in active usage. + +This patch doesn't yet handle src_x/src_y offsetting within the tiled +buffer. However, we fail to do so for untiled buffers already. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 32 ++++++++++++++++++++++++++++---- + drivers/gpu/drm/vc4/vc4_regs.h | 19 +++++++++++++++++++ + include/uapi/drm/drm_fourcc.h | 22 ++++++++++++++++++++++ + 3 files changed, 69 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 14d69bb4967dedcd3bbc475639a8c27e38662fb3..62c5f7df0f1a0034bf0b5630eba1344a0f85897b 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -22,6 +22,7 @@ + #include "vc4_regs.h" + #include "drm_atomic.h" + #include "drm_atomic_helper.h" ++#include "drm_fourcc.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" + +@@ -499,8 +500,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + u32 ctl0_offset = vc4_state->dlist_count; + const struct hvs_format *format = vc4_get_hvs_format(fb->pixel_format); + int num_planes = drm_format_num_planes(format->drm); +- u32 scl0, scl1; +- u32 lbm_size; ++ u32 scl0, scl1, pitch0; ++ u32 lbm_size, tiling = SCALER_CTL0_TILING_LINEAR; + unsigned long irqflags; + int ret, i; + +@@ -541,11 +542,31 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + scl1 = vc4_get_scl_field(state, 0); + } + ++ switch (fb->modifier[0]) { ++ case DRM_FORMAT_MOD_NONE: ++ tiling = SCALER_CTL0_TILING_LINEAR; ++ pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ tiling = SCALER_CTL0_TILING_256B_OR_T; ++ ++ pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET), ++ VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L), ++ VC4_SET_FIELD((vc4_state->src_w[0] + 31) >> 5, ++ SCALER_PITCH0_TILE_WIDTH_R)); ++ break; ++ default: ++ DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", ++ (long long)fb->modifier[0]); ++ return -EINVAL; ++ } ++ + /* Control word */ + vc4_dlist_write(vc4_state, + SCALER_CTL0_VALID | + (format->pixel_order << SCALER_CTL0_ORDER_SHIFT) | + (format->hvs << SCALER_CTL0_PIXEL_FORMAT_SHIFT) | ++ VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) | + (vc4_state->is_unity ? SCALER_CTL0_UNITY : 0) | + VC4_SET_FIELD(scl0, SCALER_CTL0_SCL0) | + VC4_SET_FIELD(scl1, SCALER_CTL0_SCL1)); +@@ -599,8 +620,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + for (i = 0; i < num_planes; i++) + vc4_dlist_write(vc4_state, 0xc0c0c0c0); + +- /* Pitch word 0/1/2 */ +- for (i = 0; i < num_planes; i++) { ++ /* Pitch word 0 */ ++ vc4_dlist_write(vc4_state, pitch0); ++ ++ /* Pitch word 1/2 */ ++ for (i = 1; i < num_planes; i++) { + vc4_dlist_write(vc4_state, + VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); + } +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 932093936178674173a84002b33e07e9a37fdfe9..d382c34c1b9e0c6d5b949ca09bf1e8401d44f91a 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -709,6 +709,13 @@ enum hvs_pixel_format { + #define SCALER_CTL0_SIZE_MASK VC4_MASK(29, 24) + #define SCALER_CTL0_SIZE_SHIFT 24 + ++#define SCALER_CTL0_TILING_MASK VC4_MASK(21, 20) ++#define SCALER_CTL0_TILING_SHIFT 20 ++#define SCALER_CTL0_TILING_LINEAR 0 ++#define SCALER_CTL0_TILING_64B 1 ++#define SCALER_CTL0_TILING_128B 2 ++#define SCALER_CTL0_TILING_256B_OR_T 3 ++ + #define SCALER_CTL0_HFLIP BIT(16) + #define SCALER_CTL0_VFLIP BIT(15) + +@@ -838,7 +845,19 @@ enum hvs_pixel_format { + #define SCALER_PPF_KERNEL_OFFSET_SHIFT 0 + #define SCALER_PPF_KERNEL_UNCACHED BIT(31) + ++/* PITCH0/1/2 fields for raster. */ + #define SCALER_SRC_PITCH_MASK VC4_MASK(15, 0) + #define SCALER_SRC_PITCH_SHIFT 0 + ++/* PITCH0 fields for T-tiled. */ ++#define SCALER_PITCH0_TILE_WIDTH_L_MASK VC4_MASK(22, 16) ++#define SCALER_PITCH0_TILE_WIDTH_L_SHIFT 16 ++#define SCALER_PITCH0_TILE_LINE_DIR BIT(15) ++#define SCALER_PITCH0_TILE_INITIAL_LINE_DIR BIT(14) ++/* Y offset within a tile. */ ++#define SCALER_PITCH0_TILE_Y_OFFSET_MASK VC4_MASK(13, 7) ++#define SCALER_PITCH0_TILE_Y_OFFSET_SHIFT 7 ++#define SCALER_PITCH0_TILE_WIDTH_R_MASK VC4_MASK(6, 0) ++#define SCALER_PITCH0_TILE_WIDTH_R_SHIFT 0 ++ + #endif /* VC4_REGS_H */ +diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h +index a5890bf44c0afa3b78d1cfa66308b097d1c38710..4fccf9b898b1242877362ca0be872478c1f0ec8d 100644 +--- a/include/uapi/drm/drm_fourcc.h ++++ b/include/uapi/drm/drm_fourcc.h +@@ -159,6 +159,7 @@ extern "C" { + #define DRM_FORMAT_MOD_VENDOR_NV 0x03 + #define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 + #define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 ++#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 + /* add more to the end as needed */ + + #define fourcc_mod_code(vendor, val) \ +@@ -233,6 +234,27 @@ extern "C" { + */ + #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) + ++/* ++ * Broadcom VC4 "T" format ++ * ++ * This is the primary layout that the V3D GPU can texture from (it ++ * can't do linear). The T format has: ++ * ++ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 ++ * pixels at 32 bit depth. ++ * ++ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually ++ * 16x16 pixels). ++ * ++ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On ++ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows ++ * they're (TR, BR, BL, TL), where bottom left is start of memory. ++ * ++ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k ++ * tiles) or right-to-left (odd rows of 4k tiles). ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) ++ + #if defined(__cplusplus) + } + #endif + +From a8d844ca3a3085a7cd2d8187b9e2856f50c25b8f Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 14:00:45 -0700 +Subject: [PATCH 282/305] drm/vc4: Add get/set tiling ioctls. + +This allows mesa to set the tiling format for a BO and have that +tiling format be respected by mesa on the other side of an +import/export (and by vc4 scanout in the kernel), without defining a +protocol to pass the tiling through userspace. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_bo.c | 83 +++++++++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_drv.c | 2 ++ + drivers/gpu/drm/vc4/vc4_drv.h | 6 ++++ + drivers/gpu/drm/vc4/vc4_kms.c | 41 ++++++++++++++++++++- + include/uapi/drm/vc4_drm.h | 16 +++++++++ + 5 files changed, 147 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index fd83a28076564b9ea5cf0f2ba29b884ee3c5af43..55bbadc86a1ee45205360fb26e8525a8326db017 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -534,6 +534,89 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + return ret; + } + ++/** ++ * vc4_set_tiling_ioctl() - Sets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * The tiling state of the BO decides the default modifier of an fb if ++ * no specific modifier was set by userspace, and the return value of ++ * vc4_get_tiling_ioctl() (so that a BO shared to another DRM fd can ++ * treat the BO as the same tiling format). ++ */ ++ ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_set_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ bool t_format; ++ ++ if (args->flags != 0) ++ return -EINVAL; ++ ++ switch (args->modifier) { ++ case DRM_FORMAT_MOD_NONE: ++ t_format = false; ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ t_format = true; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ bo->t_format = t_format; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ ++/** ++ * vc4_get_tiling_ioctl() - Gets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * Returns the tiling modifier for a BO as set by vc4_set_tiling_ioctl(). ++ */ ++ ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_get_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ if (args->flags != 0 || args->modifier != 0) ++ return -EINVAL; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ if (bo->t_format) ++ args->modifier = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ else ++ args->modifier = DRM_FORMAT_MOD_NONE; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ + void vc4_bo_cache_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 457e5e79ec8dc863fc66759662232c7160592f6e..f528edc4b389e2e3843cd8be2faccf62947cbda4 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -124,6 +124,8 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = { + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_SET_TILING, vc4_set_tiling_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_GET_TILING, vc4_get_tiling_ioctl, DRM_RENDER_ALLOW), + }; + + static struct drm_driver vc4_drm_driver = { +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 9e50bc25b2be71079d52a861c25f3fe7c4db0830..fcf1c45783736413c058a33f31e189ebaddb446e 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -148,6 +148,8 @@ struct vc4_bo { + */ + uint64_t write_seqno; + ++ bool t_format; ++ + /* List entry for the BO's position in either + * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list + */ +@@ -450,6 +452,10 @@ int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); + int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap(struct file *filp, struct vm_area_struct *vma); +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 67af2af70af091bf4b13ac03eb1078f867bc6cea..78080c3e966cacf4756d58d34069c3fb0bafdd87 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -201,11 +201,50 @@ static int vc4_atomic_commit(struct drm_device *dev, + return 0; + } + ++static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, ++ struct drm_file *file_priv, ++ const struct drm_mode_fb_cmd2 *mode_cmd) ++{ ++ struct drm_mode_fb_cmd2 mode_cmd_local; ++ ++ /* If the user didn't specify a modifier, use the ++ * vc4_set_tiling_ioctl() state for the BO. ++ */ ++ if (!(mode_cmd->flags & DRM_MODE_FB_MODIFIERS)) { ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", ++ mode_cmd->handles[0]); ++ return ERR_PTR(-ENOENT); ++ ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ mode_cmd_local = *mode_cmd; ++ ++ if (bo->t_format) { ++ mode_cmd_local.modifier[0] = ++ DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ } else { ++ mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; ++ } ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ mode_cmd = &mode_cmd_local; ++ } ++ ++ return drm_fb_cma_create(dev, file_priv, mode_cmd); ++} ++ + static const struct drm_mode_config_funcs vc4_mode_funcs = { + .output_poll_changed = vc4_output_poll_changed, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = vc4_atomic_commit, +- .fb_create = drm_fb_cma_create, ++ .fb_create = vc4_fb_create, + }; + + int vc4_kms_load(struct drm_device *dev) +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index f07a090167261131076438960c1dec175d7d376e..6ac4c5c014cb9b98343f25721f74b727a88f2bb5 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -38,6 +38,8 @@ extern "C" { + #define DRM_VC4_CREATE_SHADER_BO 0x05 + #define DRM_VC4_GET_HANG_STATE 0x06 + #define DRM_VC4_GET_PARAM 0x07 ++#define DRM_VC4_SET_TILING 0x08 ++#define DRM_VC4_GET_TILING 0x09 + + #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) + #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +@@ -47,6 +49,8 @@ extern "C" { + #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) + #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) + #define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) ++#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) ++#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) + + struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ +@@ -295,6 +299,18 @@ struct drm_vc4_get_param { + __u64 value; + }; + ++struct drm_vc4_get_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ ++struct drm_vc4_set_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ + #if defined(__cplusplus) + } + #endif + +From 26d5ae3d4a282490696904a186aa12c98c6ef54c Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 7 Jun 2017 14:39:49 -0700 +Subject: [PATCH 283/305] drm/vc4: Add FB modifier support to firmwarekms. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 943cbb38f1f2e6fc7c06870be7904677e0a9c7a3..40a0cdc179ceabafb387724e1b835895fa3e2ca2 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -18,6 +18,7 @@ + #include "drm_atomic_helper.h" + #include "drm_plane_helper.h" + #include "drm_crtc_helper.h" ++#include "drm_fourcc.h" + #include "linux/clk.h" + #include "linux/debugfs.h" + #include "drm_fb_cma_helper.h" +@@ -136,6 +137,10 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + fbinfo->yoffset = state->crtc_y; + fbinfo->base = bo->paddr + fb->offsets[0]; + fbinfo->pitch = fb->pitches[0]; ++ ++ if (fb->modifier[0] == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED) ++ fbinfo->bpp |= BIT(31); ++ + /* 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 + +From 60be33928c5b79c21defe47cf6de96b348601f10 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 12 Jun 2017 13:05:43 +0100 +Subject: [PATCH 284/305] config: Add CONFIG_CAN_GS_USB + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 8962d1b9c10140bb1af43e01f7eae629adbdeece..0fbabb1c0d56943871c3ad2b700f4c81de1c81ae 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -365,6 +365,7 @@ CONFIG_CAN=m + CONFIG_CAN_VCAN=m + CONFIG_CAN_SLCAN=m + CONFIG_CAN_MCP251X=m ++CONFIG_CAN_GS_USB=m + CONFIG_IRDA=m + CONFIG_IRLAN=m + CONFIG_IRNET=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 372bfe1ca1fb638d78b1ece096ca1a8e5f5a13a8..83cfb1e8738bdb7ef3ee1502b9a64d654de80c1b 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -361,6 +361,7 @@ CONFIG_CAN=m + CONFIG_CAN_VCAN=m + CONFIG_CAN_SLCAN=m + CONFIG_CAN_MCP251X=m ++CONFIG_CAN_GS_USB=m + CONFIG_IRDA=m + CONFIG_IRLAN=m + CONFIG_IRNET=m + +From b0eaba9a38164cead5ad05fc384932ccb5e9573b Mon Sep 17 00:00:00 2001 +From: P33M +Date: Mon, 12 Jun 2017 16:10:03 +0100 +Subject: [PATCH 285/305] dwc_otg: add module parameter int_ep_interval_min + +Add a module parameter (defaulting to ignored) that clamps the polling rate +of high-speed Interrupt endpoints to a minimum microframe interval. + +The parameter is modifiable at runtime as it is used when activating new +endpoints (such as on device connect). +--- + drivers/usb/host/dwc_otg/dwc_otg_driver.c | 6 +++++- + drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 25 ++++++++++++------------- + 2 files changed, 17 insertions(+), 14 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +index cb060a7179a3eec791506ed2779b553cad9841b0..95943e07528276b26b51ea2d57a1f433f280aaef 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +@@ -249,6 +249,7 @@ uint16_t nak_holdoff = 8; + + unsigned short fiq_fsm_mask = 0x0F; + ++unsigned short int_ep_interval_min = 0; + /** + * This function shows the Driver Version. + */ +@@ -1398,7 +1399,10 @@ MODULE_PARM_DESC(fiq_fsm_mask, "Bitmask of transactions to perform in the FIQ.\n + "Bit 1 : Periodic split transactions\n" + "Bit 2 : High-speed multi-transfer isochronous\n" + "All other bits should be set 0."); +- ++module_param(int_ep_interval_min, ushort, 0644); ++MODULE_PARM_DESC(int_ep_interval_min, "Clamp high-speed Interrupt endpoints to a minimum polling interval.\n" ++ "0..1 = Use endpoint default\n" ++ "2..n = Minimum interval n microframes. Use powers of 2.\n"); + + /** @page "Module Parameters" + * +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +index 4b1dd9de99e9e08b2e006fb5f8a7ef92f20c2553..fe8e8f841f03660c2ad49ab8e66193bec62558d3 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +@@ -43,6 +43,7 @@ + #include "dwc_otg_regs.h" + + extern bool microframe_schedule; ++extern unsigned short int_ep_interval_min; + + /** + * Free each QTD in the QH's QTD-list then free the QH. QH should already be +@@ -218,21 +219,19 @@ void qh_init(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, dwc_otg_hcd_urb_t * urb) + SCHEDULE_SLOP); + qh->interval = urb->interval; + +-#if 0 +- /* Increase interrupt polling rate for debugging. */ +- if (qh->ep_type == UE_INTERRUPT) { +- qh->interval = 8; +- } +-#endif + hprt.d32 = DWC_READ_REG32(hcd->core_if->host_if->hprt0); +- if ((hprt.b.prtspd == DWC_HPRT0_PRTSPD_HIGH_SPEED) && +- ((dev_speed == USB_SPEED_LOW) || +- (dev_speed == USB_SPEED_FULL))) { +- qh->interval *= 8; +- qh->sched_frame |= 0x7; +- qh->start_split_frame = qh->sched_frame; ++ if (hprt.b.prtspd == DWC_HPRT0_PRTSPD_HIGH_SPEED) { ++ if (dev_speed == USB_SPEED_LOW || ++ dev_speed == USB_SPEED_FULL) { ++ qh->interval *= 8; ++ qh->sched_frame |= 0x7; ++ qh->start_split_frame = qh->sched_frame; ++ } else if (int_ep_interval_min >= 2 && ++ qh->interval < int_ep_interval_min && ++ qh->ep_type == UE_INTERRUPT) { ++ qh->interval = int_ep_interval_min; ++ } + } +- + } + + DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD QH Initialized\n"); + +From b248733d5e32dafa86c0bf7b9dcc3fb3d91c0ccc Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 13 Jun 2017 15:06:22 +0100 +Subject: [PATCH 286/305] Revert "drm/vc4: Add FB modifier support to + firmwarekms." + +This reverts commit 9183dfdbf2cb3ec8e981204847b345f7ab95662d. +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 40a0cdc179ceabafb387724e1b835895fa3e2ca2..943cbb38f1f2e6fc7c06870be7904677e0a9c7a3 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -18,7 +18,6 @@ + #include "drm_atomic_helper.h" + #include "drm_plane_helper.h" + #include "drm_crtc_helper.h" +-#include "drm_fourcc.h" + #include "linux/clk.h" + #include "linux/debugfs.h" + #include "drm_fb_cma_helper.h" +@@ -137,10 +136,6 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + fbinfo->yoffset = state->crtc_y; + fbinfo->base = bo->paddr + fb->offsets[0]; + fbinfo->pitch = fb->pitches[0]; +- +- if (fb->modifier[0] == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED) +- fbinfo->bpp |= BIT(31); +- + /* 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 + +From 46be68eb92eed7df464b2974ff8ae5bee7c7a05b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 13 Jun 2017 15:06:24 +0100 +Subject: [PATCH 287/305] Revert "drm/vc4: Add get/set tiling ioctls." + +This reverts commit 3ea95503a626b7e4157afa0745d11908546654b1. +--- + drivers/gpu/drm/vc4/vc4_bo.c | 83 ------------------------------------------- + drivers/gpu/drm/vc4/vc4_drv.c | 2 -- + drivers/gpu/drm/vc4/vc4_drv.h | 6 ---- + drivers/gpu/drm/vc4/vc4_kms.c | 41 +-------------------- + include/uapi/drm/vc4_drm.h | 16 --------- + 5 files changed, 1 insertion(+), 147 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index 55bbadc86a1ee45205360fb26e8525a8326db017..fd83a28076564b9ea5cf0f2ba29b884ee3c5af43 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -534,89 +534,6 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + return ret; + } + +-/** +- * vc4_set_tiling_ioctl() - Sets the tiling modifier for a BO. +- * @dev: DRM device +- * @data: ioctl argument +- * @file_priv: DRM file for this fd +- * +- * The tiling state of the BO decides the default modifier of an fb if +- * no specific modifier was set by userspace, and the return value of +- * vc4_get_tiling_ioctl() (so that a BO shared to another DRM fd can +- * treat the BO as the same tiling format). +- */ +- +-int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv) +-{ +- struct drm_vc4_set_tiling *args = data; +- struct drm_gem_object *gem_obj; +- struct vc4_bo *bo; +- bool t_format; +- +- if (args->flags != 0) +- return -EINVAL; +- +- switch (args->modifier) { +- case DRM_FORMAT_MOD_NONE: +- t_format = false; +- break; +- case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: +- t_format = true; +- break; +- default: +- return -EINVAL; +- } +- +- gem_obj = drm_gem_object_lookup(file_priv, args->handle); +- if (!gem_obj) { +- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); +- return -ENOENT; +- } +- bo = to_vc4_bo(gem_obj); +- bo->t_format = t_format; +- +- drm_gem_object_unreference_unlocked(gem_obj); +- +- return 0; +-} +- +-/** +- * vc4_get_tiling_ioctl() - Gets the tiling modifier for a BO. +- * @dev: DRM device +- * @data: ioctl argument +- * @file_priv: DRM file for this fd +- * +- * Returns the tiling modifier for a BO as set by vc4_set_tiling_ioctl(). +- */ +- +-int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv) +-{ +- struct drm_vc4_get_tiling *args = data; +- struct drm_gem_object *gem_obj; +- struct vc4_bo *bo; +- +- if (args->flags != 0 || args->modifier != 0) +- return -EINVAL; +- +- gem_obj = drm_gem_object_lookup(file_priv, args->handle); +- if (!gem_obj) { +- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); +- return -ENOENT; +- } +- bo = to_vc4_bo(gem_obj); +- +- if (bo->t_format) +- args->modifier = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; +- else +- args->modifier = DRM_FORMAT_MOD_NONE; +- +- drm_gem_object_unreference_unlocked(gem_obj); +- +- return 0; +-} +- + void vc4_bo_cache_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index f528edc4b389e2e3843cd8be2faccf62947cbda4..457e5e79ec8dc863fc66759662232c7160592f6e 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -124,8 +124,6 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = { + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), +- DRM_IOCTL_DEF_DRV(VC4_SET_TILING, vc4_set_tiling_ioctl, DRM_RENDER_ALLOW), +- DRM_IOCTL_DEF_DRV(VC4_GET_TILING, vc4_get_tiling_ioctl, DRM_RENDER_ALLOW), + }; + + static struct drm_driver vc4_drm_driver = { +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index fcf1c45783736413c058a33f31e189ebaddb446e..9e50bc25b2be71079d52a861c25f3fe7c4db0830 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -148,8 +148,6 @@ struct vc4_bo { + */ + uint64_t write_seqno; + +- bool t_format; +- + /* List entry for the BO's position in either + * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list + */ +@@ -452,10 +450,6 @@ int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); +-int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv); +-int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv); + int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap(struct file *filp, struct vm_area_struct *vma); +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 78080c3e966cacf4756d58d34069c3fb0bafdd87..67af2af70af091bf4b13ac03eb1078f867bc6cea 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -201,50 +201,11 @@ static int vc4_atomic_commit(struct drm_device *dev, + return 0; + } + +-static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, +- struct drm_file *file_priv, +- const struct drm_mode_fb_cmd2 *mode_cmd) +-{ +- struct drm_mode_fb_cmd2 mode_cmd_local; +- +- /* If the user didn't specify a modifier, use the +- * vc4_set_tiling_ioctl() state for the BO. +- */ +- if (!(mode_cmd->flags & DRM_MODE_FB_MODIFIERS)) { +- struct drm_gem_object *gem_obj; +- struct vc4_bo *bo; +- +- gem_obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); +- if (!gem_obj) { +- DRM_ERROR("Failed to look up GEM BO %d\n", +- mode_cmd->handles[0]); +- return ERR_PTR(-ENOENT); +- +- } +- bo = to_vc4_bo(gem_obj); +- +- mode_cmd_local = *mode_cmd; +- +- if (bo->t_format) { +- mode_cmd_local.modifier[0] = +- DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; +- } else { +- mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; +- } +- +- drm_gem_object_unreference_unlocked(gem_obj); +- +- mode_cmd = &mode_cmd_local; +- } +- +- return drm_fb_cma_create(dev, file_priv, mode_cmd); +-} +- + static const struct drm_mode_config_funcs vc4_mode_funcs = { + .output_poll_changed = vc4_output_poll_changed, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = vc4_atomic_commit, +- .fb_create = vc4_fb_create, ++ .fb_create = drm_fb_cma_create, + }; + + int vc4_kms_load(struct drm_device *dev) +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index 6ac4c5c014cb9b98343f25721f74b727a88f2bb5..f07a090167261131076438960c1dec175d7d376e 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -38,8 +38,6 @@ extern "C" { + #define DRM_VC4_CREATE_SHADER_BO 0x05 + #define DRM_VC4_GET_HANG_STATE 0x06 + #define DRM_VC4_GET_PARAM 0x07 +-#define DRM_VC4_SET_TILING 0x08 +-#define DRM_VC4_GET_TILING 0x09 + + #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) + #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +@@ -49,8 +47,6 @@ extern "C" { + #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) + #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) + #define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) +-#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) +-#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) + + struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ +@@ -299,18 +295,6 @@ struct drm_vc4_get_param { + __u64 value; + }; + +-struct drm_vc4_get_tiling { +- __u32 handle; +- __u32 flags; +- __u64 modifier; +-}; +- +-struct drm_vc4_set_tiling { +- __u32 handle; +- __u32 flags; +- __u64 modifier; +-}; +- + #if defined(__cplusplus) + } + #endif + +From 5a340c227213a85b63fc7a411d333a1e925b2546 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 13 Jun 2017 15:06:25 +0100 +Subject: [PATCH 288/305] Revert "drm/vc4: Add T-format scanout support." + +This reverts commit 85e9ae254717d2e4a313945a465230a3102cad42. +--- + drivers/gpu/drm/vc4/vc4_plane.c | 32 ++++---------------------------- + drivers/gpu/drm/vc4/vc4_regs.h | 19 ------------------- + include/uapi/drm/drm_fourcc.h | 22 ---------------------- + 3 files changed, 4 insertions(+), 69 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 62c5f7df0f1a0034bf0b5630eba1344a0f85897b..14d69bb4967dedcd3bbc475639a8c27e38662fb3 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -22,7 +22,6 @@ + #include "vc4_regs.h" + #include "drm_atomic.h" + #include "drm_atomic_helper.h" +-#include "drm_fourcc.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" + +@@ -500,8 +499,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + u32 ctl0_offset = vc4_state->dlist_count; + const struct hvs_format *format = vc4_get_hvs_format(fb->pixel_format); + int num_planes = drm_format_num_planes(format->drm); +- u32 scl0, scl1, pitch0; +- u32 lbm_size, tiling = SCALER_CTL0_TILING_LINEAR; ++ u32 scl0, scl1; ++ u32 lbm_size; + unsigned long irqflags; + int ret, i; + +@@ -542,31 +541,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + scl1 = vc4_get_scl_field(state, 0); + } + +- switch (fb->modifier[0]) { +- case DRM_FORMAT_MOD_NONE: +- tiling = SCALER_CTL0_TILING_LINEAR; +- pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); +- break; +- case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: +- tiling = SCALER_CTL0_TILING_256B_OR_T; +- +- pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET), +- VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L), +- VC4_SET_FIELD((vc4_state->src_w[0] + 31) >> 5, +- SCALER_PITCH0_TILE_WIDTH_R)); +- break; +- default: +- DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", +- (long long)fb->modifier[0]); +- return -EINVAL; +- } +- + /* Control word */ + vc4_dlist_write(vc4_state, + SCALER_CTL0_VALID | + (format->pixel_order << SCALER_CTL0_ORDER_SHIFT) | + (format->hvs << SCALER_CTL0_PIXEL_FORMAT_SHIFT) | +- VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) | + (vc4_state->is_unity ? SCALER_CTL0_UNITY : 0) | + VC4_SET_FIELD(scl0, SCALER_CTL0_SCL0) | + VC4_SET_FIELD(scl1, SCALER_CTL0_SCL1)); +@@ -620,11 +599,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + for (i = 0; i < num_planes; i++) + vc4_dlist_write(vc4_state, 0xc0c0c0c0); + +- /* Pitch word 0 */ +- vc4_dlist_write(vc4_state, pitch0); +- +- /* Pitch word 1/2 */ +- for (i = 1; i < num_planes; i++) { ++ /* Pitch word 0/1/2 */ ++ for (i = 0; i < num_planes; i++) { + vc4_dlist_write(vc4_state, + VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); + } +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index d382c34c1b9e0c6d5b949ca09bf1e8401d44f91a..932093936178674173a84002b33e07e9a37fdfe9 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -709,13 +709,6 @@ enum hvs_pixel_format { + #define SCALER_CTL0_SIZE_MASK VC4_MASK(29, 24) + #define SCALER_CTL0_SIZE_SHIFT 24 + +-#define SCALER_CTL0_TILING_MASK VC4_MASK(21, 20) +-#define SCALER_CTL0_TILING_SHIFT 20 +-#define SCALER_CTL0_TILING_LINEAR 0 +-#define SCALER_CTL0_TILING_64B 1 +-#define SCALER_CTL0_TILING_128B 2 +-#define SCALER_CTL0_TILING_256B_OR_T 3 +- + #define SCALER_CTL0_HFLIP BIT(16) + #define SCALER_CTL0_VFLIP BIT(15) + +@@ -845,19 +838,7 @@ enum hvs_pixel_format { + #define SCALER_PPF_KERNEL_OFFSET_SHIFT 0 + #define SCALER_PPF_KERNEL_UNCACHED BIT(31) + +-/* PITCH0/1/2 fields for raster. */ + #define SCALER_SRC_PITCH_MASK VC4_MASK(15, 0) + #define SCALER_SRC_PITCH_SHIFT 0 + +-/* PITCH0 fields for T-tiled. */ +-#define SCALER_PITCH0_TILE_WIDTH_L_MASK VC4_MASK(22, 16) +-#define SCALER_PITCH0_TILE_WIDTH_L_SHIFT 16 +-#define SCALER_PITCH0_TILE_LINE_DIR BIT(15) +-#define SCALER_PITCH0_TILE_INITIAL_LINE_DIR BIT(14) +-/* Y offset within a tile. */ +-#define SCALER_PITCH0_TILE_Y_OFFSET_MASK VC4_MASK(13, 7) +-#define SCALER_PITCH0_TILE_Y_OFFSET_SHIFT 7 +-#define SCALER_PITCH0_TILE_WIDTH_R_MASK VC4_MASK(6, 0) +-#define SCALER_PITCH0_TILE_WIDTH_R_SHIFT 0 +- + #endif /* VC4_REGS_H */ +diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h +index 4fccf9b898b1242877362ca0be872478c1f0ec8d..a5890bf44c0afa3b78d1cfa66308b097d1c38710 100644 +--- a/include/uapi/drm/drm_fourcc.h ++++ b/include/uapi/drm/drm_fourcc.h +@@ -159,7 +159,6 @@ extern "C" { + #define DRM_FORMAT_MOD_VENDOR_NV 0x03 + #define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 + #define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 +-#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 + /* add more to the end as needed */ + + #define fourcc_mod_code(vendor, val) \ +@@ -234,27 +233,6 @@ extern "C" { + */ + #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) + +-/* +- * Broadcom VC4 "T" format +- * +- * This is the primary layout that the V3D GPU can texture from (it +- * can't do linear). The T format has: +- * +- * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 +- * pixels at 32 bit depth. +- * +- * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually +- * 16x16 pixels). +- * +- * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On +- * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows +- * they're (TR, BR, BL, TL), where bottom left is start of memory. +- * +- * - an image made of 4k tiles in rows either left-to-right (even rows of 4k +- * tiles) or right-to-left (odd rows of 4k tiles). +- */ +-#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) +- + #if defined(__cplusplus) + } + #endif + +From 5bf833343957e53f3c74386124def88931fcb15b Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 12:16:10 -0700 +Subject: [PATCH 289/305] drm/vc4: Add T-format scanout support. + +The T tiling format is what V3D uses for textures, with no raster +support at all until later revisions of the hardware (and always at a +large 3D performance penalty). If we can't scan out V3D's format, +then we often need to do a relayout at some stage of the pipeline, +either right before texturing from the scanout buffer (common in X11 +without a compositor) or between a tiled screen buffer right before +scanout (an option I've considered in trying to resolve this +inconsistency, but which means needing to use the dirty fb ioctl and +having some update policy). + +T-format scanout lets us avoid either of those shadow copies, for a +massive, obvious performance improvement to X11 window dragging +without a compositor. Unfortunately, enabling a compositor to work +around the discrepancy has turned out to be too costly in memory +consumption for the Raspbian distribution. + +Because the HVS operates a scanline at a time, compositing from T does +increase the memory bandwidth cost of scanout. On my 1920x1080@32bpp +display on a RPi3, we go from about 15% of system memory bandwidth +with linear to about 20% with tiled. However, for X11 this still ends +up being a huge performance win in active usage. + +This patch doesn't yet handle src_x/src_y offsetting within the tiled +buffer. However, we fail to do so for untiled buffers already. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 32 ++++++++++++++++++++++++++++---- + drivers/gpu/drm/vc4/vc4_regs.h | 19 +++++++++++++++++++ + include/uapi/drm/drm_fourcc.h | 22 ++++++++++++++++++++++ + 3 files changed, 69 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 14d69bb4967dedcd3bbc475639a8c27e38662fb3..62c5f7df0f1a0034bf0b5630eba1344a0f85897b 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -22,6 +22,7 @@ + #include "vc4_regs.h" + #include "drm_atomic.h" + #include "drm_atomic_helper.h" ++#include "drm_fourcc.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" + +@@ -499,8 +500,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + u32 ctl0_offset = vc4_state->dlist_count; + const struct hvs_format *format = vc4_get_hvs_format(fb->pixel_format); + int num_planes = drm_format_num_planes(format->drm); +- u32 scl0, scl1; +- u32 lbm_size; ++ u32 scl0, scl1, pitch0; ++ u32 lbm_size, tiling = SCALER_CTL0_TILING_LINEAR; + unsigned long irqflags; + int ret, i; + +@@ -541,11 +542,31 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + scl1 = vc4_get_scl_field(state, 0); + } + ++ switch (fb->modifier[0]) { ++ case DRM_FORMAT_MOD_NONE: ++ tiling = SCALER_CTL0_TILING_LINEAR; ++ pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ tiling = SCALER_CTL0_TILING_256B_OR_T; ++ ++ pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET), ++ VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L), ++ VC4_SET_FIELD((vc4_state->src_w[0] + 31) >> 5, ++ SCALER_PITCH0_TILE_WIDTH_R)); ++ break; ++ default: ++ DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", ++ (long long)fb->modifier[0]); ++ return -EINVAL; ++ } ++ + /* Control word */ + vc4_dlist_write(vc4_state, + SCALER_CTL0_VALID | + (format->pixel_order << SCALER_CTL0_ORDER_SHIFT) | + (format->hvs << SCALER_CTL0_PIXEL_FORMAT_SHIFT) | ++ VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) | + (vc4_state->is_unity ? SCALER_CTL0_UNITY : 0) | + VC4_SET_FIELD(scl0, SCALER_CTL0_SCL0) | + VC4_SET_FIELD(scl1, SCALER_CTL0_SCL1)); +@@ -599,8 +620,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + for (i = 0; i < num_planes; i++) + vc4_dlist_write(vc4_state, 0xc0c0c0c0); + +- /* Pitch word 0/1/2 */ +- for (i = 0; i < num_planes; i++) { ++ /* Pitch word 0 */ ++ vc4_dlist_write(vc4_state, pitch0); ++ ++ /* Pitch word 1/2 */ ++ for (i = 1; i < num_planes; i++) { + vc4_dlist_write(vc4_state, + VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); + } +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 932093936178674173a84002b33e07e9a37fdfe9..d382c34c1b9e0c6d5b949ca09bf1e8401d44f91a 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -709,6 +709,13 @@ enum hvs_pixel_format { + #define SCALER_CTL0_SIZE_MASK VC4_MASK(29, 24) + #define SCALER_CTL0_SIZE_SHIFT 24 + ++#define SCALER_CTL0_TILING_MASK VC4_MASK(21, 20) ++#define SCALER_CTL0_TILING_SHIFT 20 ++#define SCALER_CTL0_TILING_LINEAR 0 ++#define SCALER_CTL0_TILING_64B 1 ++#define SCALER_CTL0_TILING_128B 2 ++#define SCALER_CTL0_TILING_256B_OR_T 3 ++ + #define SCALER_CTL0_HFLIP BIT(16) + #define SCALER_CTL0_VFLIP BIT(15) + +@@ -838,7 +845,19 @@ enum hvs_pixel_format { + #define SCALER_PPF_KERNEL_OFFSET_SHIFT 0 + #define SCALER_PPF_KERNEL_UNCACHED BIT(31) + ++/* PITCH0/1/2 fields for raster. */ + #define SCALER_SRC_PITCH_MASK VC4_MASK(15, 0) + #define SCALER_SRC_PITCH_SHIFT 0 + ++/* PITCH0 fields for T-tiled. */ ++#define SCALER_PITCH0_TILE_WIDTH_L_MASK VC4_MASK(22, 16) ++#define SCALER_PITCH0_TILE_WIDTH_L_SHIFT 16 ++#define SCALER_PITCH0_TILE_LINE_DIR BIT(15) ++#define SCALER_PITCH0_TILE_INITIAL_LINE_DIR BIT(14) ++/* Y offset within a tile. */ ++#define SCALER_PITCH0_TILE_Y_OFFSET_MASK VC4_MASK(13, 7) ++#define SCALER_PITCH0_TILE_Y_OFFSET_SHIFT 7 ++#define SCALER_PITCH0_TILE_WIDTH_R_MASK VC4_MASK(6, 0) ++#define SCALER_PITCH0_TILE_WIDTH_R_SHIFT 0 ++ + #endif /* VC4_REGS_H */ +diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h +index a5890bf44c0afa3b78d1cfa66308b097d1c38710..4fccf9b898b1242877362ca0be872478c1f0ec8d 100644 +--- a/include/uapi/drm/drm_fourcc.h ++++ b/include/uapi/drm/drm_fourcc.h +@@ -159,6 +159,7 @@ extern "C" { + #define DRM_FORMAT_MOD_VENDOR_NV 0x03 + #define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 + #define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 ++#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 + /* add more to the end as needed */ + + #define fourcc_mod_code(vendor, val) \ +@@ -233,6 +234,27 @@ extern "C" { + */ + #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) + ++/* ++ * Broadcom VC4 "T" format ++ * ++ * This is the primary layout that the V3D GPU can texture from (it ++ * can't do linear). The T format has: ++ * ++ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 ++ * pixels at 32 bit depth. ++ * ++ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually ++ * 16x16 pixels). ++ * ++ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On ++ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows ++ * they're (TR, BR, BL, TL), where bottom left is start of memory. ++ * ++ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k ++ * tiles) or right-to-left (odd rows of 4k tiles). ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) ++ + #if defined(__cplusplus) + } + #endif + +From 159aa96f948a1f52a4e88cf61ca2c8f053f7e149 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 14:00:45 -0700 +Subject: [PATCH 290/305] drm/vc4: Add get/set tiling ioctls. + +This allows mesa to set the tiling format for a BO and have that +tiling format be respected by mesa on the other side of an +import/export (and by vc4 scanout in the kernel), without defining a +protocol to pass the tiling through userspace. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_bo.c | 83 +++++++++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_drv.c | 2 ++ + drivers/gpu/drm/vc4/vc4_drv.h | 6 ++++ + drivers/gpu/drm/vc4/vc4_kms.c | 41 ++++++++++++++++++++- + include/uapi/drm/vc4_drm.h | 16 +++++++++ + 5 files changed, 147 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index fd83a28076564b9ea5cf0f2ba29b884ee3c5af43..55bbadc86a1ee45205360fb26e8525a8326db017 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -534,6 +534,89 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + return ret; + } + ++/** ++ * vc4_set_tiling_ioctl() - Sets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * The tiling state of the BO decides the default modifier of an fb if ++ * no specific modifier was set by userspace, and the return value of ++ * vc4_get_tiling_ioctl() (so that a BO shared to another DRM fd can ++ * treat the BO as the same tiling format). ++ */ ++ ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_set_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ bool t_format; ++ ++ if (args->flags != 0) ++ return -EINVAL; ++ ++ switch (args->modifier) { ++ case DRM_FORMAT_MOD_NONE: ++ t_format = false; ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ t_format = true; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ bo->t_format = t_format; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ ++/** ++ * vc4_get_tiling_ioctl() - Gets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * Returns the tiling modifier for a BO as set by vc4_set_tiling_ioctl(). ++ */ ++ ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_get_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ if (args->flags != 0 || args->modifier != 0) ++ return -EINVAL; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ if (bo->t_format) ++ args->modifier = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ else ++ args->modifier = DRM_FORMAT_MOD_NONE; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ + void vc4_bo_cache_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 457e5e79ec8dc863fc66759662232c7160592f6e..f528edc4b389e2e3843cd8be2faccf62947cbda4 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -124,6 +124,8 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = { + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_SET_TILING, vc4_set_tiling_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_GET_TILING, vc4_get_tiling_ioctl, DRM_RENDER_ALLOW), + }; + + static struct drm_driver vc4_drm_driver = { +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 9e50bc25b2be71079d52a861c25f3fe7c4db0830..fcf1c45783736413c058a33f31e189ebaddb446e 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -148,6 +148,8 @@ struct vc4_bo { + */ + uint64_t write_seqno; + ++ bool t_format; ++ + /* List entry for the BO's position in either + * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list + */ +@@ -450,6 +452,10 @@ int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); + int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap(struct file *filp, struct vm_area_struct *vma); +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 67af2af70af091bf4b13ac03eb1078f867bc6cea..78080c3e966cacf4756d58d34069c3fb0bafdd87 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -201,11 +201,50 @@ static int vc4_atomic_commit(struct drm_device *dev, + return 0; + } + ++static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, ++ struct drm_file *file_priv, ++ const struct drm_mode_fb_cmd2 *mode_cmd) ++{ ++ struct drm_mode_fb_cmd2 mode_cmd_local; ++ ++ /* If the user didn't specify a modifier, use the ++ * vc4_set_tiling_ioctl() state for the BO. ++ */ ++ if (!(mode_cmd->flags & DRM_MODE_FB_MODIFIERS)) { ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", ++ mode_cmd->handles[0]); ++ return ERR_PTR(-ENOENT); ++ ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ mode_cmd_local = *mode_cmd; ++ ++ if (bo->t_format) { ++ mode_cmd_local.modifier[0] = ++ DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ } else { ++ mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; ++ } ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ mode_cmd = &mode_cmd_local; ++ } ++ ++ return drm_fb_cma_create(dev, file_priv, mode_cmd); ++} ++ + static const struct drm_mode_config_funcs vc4_mode_funcs = { + .output_poll_changed = vc4_output_poll_changed, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = vc4_atomic_commit, +- .fb_create = drm_fb_cma_create, ++ .fb_create = vc4_fb_create, + }; + + int vc4_kms_load(struct drm_device *dev) +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index f07a090167261131076438960c1dec175d7d376e..6ac4c5c014cb9b98343f25721f74b727a88f2bb5 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -38,6 +38,8 @@ extern "C" { + #define DRM_VC4_CREATE_SHADER_BO 0x05 + #define DRM_VC4_GET_HANG_STATE 0x06 + #define DRM_VC4_GET_PARAM 0x07 ++#define DRM_VC4_SET_TILING 0x08 ++#define DRM_VC4_GET_TILING 0x09 + + #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) + #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +@@ -47,6 +49,8 @@ extern "C" { + #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) + #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) + #define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) ++#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) ++#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) + + struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ +@@ -295,6 +299,18 @@ struct drm_vc4_get_param { + __u64 value; + }; + ++struct drm_vc4_get_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ ++struct drm_vc4_set_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ + #if defined(__cplusplus) + } + #endif + +From 567afa31d5e52d04d094a70bee991d78b36334e6 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 7 Jun 2017 14:39:49 -0700 +Subject: [PATCH 291/305] drm/vc4: Add FB modifier support to firmwarekms. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 943cbb38f1f2e6fc7c06870be7904677e0a9c7a3..40a0cdc179ceabafb387724e1b835895fa3e2ca2 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -18,6 +18,7 @@ + #include "drm_atomic_helper.h" + #include "drm_plane_helper.h" + #include "drm_crtc_helper.h" ++#include "drm_fourcc.h" + #include "linux/clk.h" + #include "linux/debugfs.h" + #include "drm_fb_cma_helper.h" +@@ -136,6 +137,10 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + fbinfo->yoffset = state->crtc_y; + fbinfo->base = bo->paddr + fb->offsets[0]; + fbinfo->pitch = fb->pitches[0]; ++ ++ if (fb->modifier[0] == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED) ++ fbinfo->bpp |= BIT(31); ++ + /* 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 + +From 2194d686cc9236aaf8509148e90c955b425f4ee1 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 6 Jan 2017 19:15:23 +0100 +Subject: [PATCH 292/305] USB: serial: ch341: change initial line-control + settings + +commit 7c61b0d5e82bfe29b8dda55745afbf65b6ccc901 upstream. + +Some CH340 devices appear unable to change the initial LCR settings, so +set a sane 8N1 default during probe to enable basic support for such +devices. + +Also drop a redundant LCR read during device initialisation. + +Signed-off-by: Johan Hovold +--- + drivers/usb/serial/ch341.c | 187 +++++++++++++++++++++++++-------------------- + 1 file changed, 103 insertions(+), 84 deletions(-) + +diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c +index 4f25aba5bdfcabe7304b18860be8527587390467..b27593a02734a1def9412e848c91feb553088e3c 100644 +--- a/drivers/usb/serial/ch341.c ++++ b/drivers/usb/serial/ch341.c +@@ -61,13 +61,26 @@ + * the Net/FreeBSD uchcom.c driver by Takanori Watanabe. Domo arigato. + */ + ++#define CH341_REQ_READ_VERSION 0x5F + #define CH341_REQ_WRITE_REG 0x9A + #define CH341_REQ_READ_REG 0x95 +-#define CH341_REG_BREAK1 0x05 +-#define CH341_REG_BREAK2 0x18 +-#define CH341_NBREAK_BITS_REG1 0x01 +-#define CH341_NBREAK_BITS_REG2 0x40 +- ++#define CH341_REQ_SERIAL_INIT 0xA1 ++#define CH341_REQ_MODEM_CTRL 0xA4 ++ ++#define CH341_REG_BREAK 0x05 ++#define CH341_REG_LCR 0x18 ++#define CH341_NBREAK_BITS 0x01 ++ ++#define CH341_LCR_ENABLE_RX 0x80 ++#define CH341_LCR_ENABLE_TX 0x40 ++#define CH341_LCR_MARK_SPACE 0x20 ++#define CH341_LCR_PAR_EVEN 0x10 ++#define CH341_LCR_ENABLE_PAR 0x08 ++#define CH341_LCR_STOP_BITS_2 0x04 ++#define CH341_LCR_CS8 0x03 ++#define CH341_LCR_CS7 0x02 ++#define CH341_LCR_CS6 0x01 ++#define CH341_LCR_CS5 0x00 + + static const struct usb_device_id id_table[] = { + { USB_DEVICE(0x4348, 0x5523) }, +@@ -82,6 +95,7 @@ struct ch341_private { + unsigned baud_rate; /* set baud rate */ + u8 line_control; /* set line control value RTS/DTR */ + u8 line_status; /* active status of modem control inputs */ ++ u8 lcr; + }; + + static void ch341_set_termios(struct tty_struct *tty, +@@ -134,10 +148,10 @@ static int ch341_control_in(struct usb_device *dev, + return 0; + } + +-static int ch341_set_baudrate(struct usb_device *dev, +- struct ch341_private *priv) ++static int ch341_set_baudrate_lcr(struct usb_device *dev, ++ struct ch341_private *priv, u8 lcr) + { +- short a, b; ++ short a; + int r; + unsigned long factor; + short divisor; +@@ -157,18 +171,27 @@ static int ch341_set_baudrate(struct usb_device *dev, + + factor = 0x10000 - factor; + a = (factor & 0xff00) | divisor; +- b = factor & 0xff; + +- r = ch341_control_out(dev, 0x9a, 0x1312, a); +- if (!r) +- r = ch341_control_out(dev, 0x9a, 0x0f2c, b); ++ /* ++ * CH341A buffers data until a full endpoint-size packet (32 bytes) ++ * has been received unless bit 7 is set. ++ */ ++ a |= BIT(7); ++ ++ r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x1312, a); ++ if (r) ++ return r; ++ ++ r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x2518, lcr); ++ if (r) ++ return r; + + return r; + } + + static int ch341_set_handshake(struct usb_device *dev, u8 control) + { +- return ch341_control_out(dev, 0xa4, ~control, 0); ++ return ch341_control_out(dev, CH341_REQ_MODEM_CTRL, ~control, 0); + } + + static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv) +@@ -182,7 +205,7 @@ static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv) + if (!buffer) + return -ENOMEM; + +- r = ch341_control_in(dev, 0x95, 0x0706, 0, buffer, size); ++ r = ch341_control_in(dev, CH341_REQ_READ_REG, 0x0706, 0, buffer, size); + if (r < 0) + goto out; + +@@ -207,46 +230,20 @@ static int ch341_configure(struct usb_device *dev, struct ch341_private *priv) + return -ENOMEM; + + /* expect two bytes 0x27 0x00 */ +- r = ch341_control_in(dev, 0x5f, 0, 0, buffer, size); +- if (r < 0) +- goto out; +- +- r = ch341_control_out(dev, 0xa1, 0, 0); +- if (r < 0) +- goto out; +- +- r = ch341_set_baudrate(dev, priv); ++ r = ch341_control_in(dev, CH341_REQ_READ_VERSION, 0, 0, buffer, size); + if (r < 0) + goto out; ++ dev_dbg(&dev->dev, "Chip version: 0x%02x\n", buffer[0]); + +- /* expect two bytes 0x56 0x00 */ +- r = ch341_control_in(dev, 0x95, 0x2518, 0, buffer, size); ++ r = ch341_control_out(dev, CH341_REQ_SERIAL_INIT, 0, 0); + if (r < 0) + goto out; + +- r = ch341_control_out(dev, 0x9a, 0x2518, 0x0050); +- if (r < 0) +- goto out; +- +- /* expect 0xff 0xee */ +- r = ch341_get_status(dev, priv); +- if (r < 0) +- goto out; +- +- r = ch341_control_out(dev, 0xa1, 0x501f, 0xd90a); +- if (r < 0) +- goto out; +- +- r = ch341_set_baudrate(dev, priv); ++ r = ch341_set_baudrate_lcr(dev, priv, priv->lcr); + if (r < 0) + goto out; + + r = ch341_set_handshake(dev, priv->line_control); +- if (r < 0) +- goto out; +- +- /* expect 0x9f 0xee */ +- r = ch341_get_status(dev, priv); + + out: kfree(buffer); + return r; +@@ -263,6 +260,11 @@ static int ch341_port_probe(struct usb_serial_port *port) + + spin_lock_init(&priv->lock); + priv->baud_rate = DEFAULT_BAUD_RATE; ++ /* ++ * Some CH340 devices appear unable to change the initial LCR ++ * settings, so set a sane 8N1 default. ++ */ ++ priv->lcr = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX | CH341_LCR_CS8; + + r = ch341_configure(port->serial->dev, priv); + if (r < 0) +@@ -318,14 +320,9 @@ static void ch341_close(struct usb_serial_port *port) + /* open this device, set default parameters */ + static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port) + { +- struct usb_serial *serial = port->serial; + struct ch341_private *priv = usb_get_serial_port_data(port); + int r; + +- r = ch341_configure(serial->dev, priv); +- if (r) +- return r; +- + if (tty) + ch341_set_termios(tty, port, NULL); + +@@ -337,6 +334,12 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port) + return r; + } + ++ r = ch341_get_status(port->serial->dev, priv); ++ if (r < 0) { ++ dev_err(&port->dev, "failed to read modem status: %d\n", r); ++ goto err_kill_interrupt_urb; ++ } ++ + r = usb_serial_generic_open(tty, port); + if (r) + goto err_kill_interrupt_urb; +@@ -358,44 +361,54 @@ static void ch341_set_termios(struct tty_struct *tty, + struct ch341_private *priv = usb_get_serial_port_data(port); + unsigned baud_rate; + unsigned long flags; +- unsigned int par_flags; ++ unsigned char ctrl; ++ int r; ++ ++ /* redundant changes may cause the chip to lose bytes */ ++ if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios)) ++ return; + + baud_rate = tty_get_baud_rate(tty); + +- if (baud_rate) { +- priv->baud_rate = baud_rate; +- ch341_set_baudrate(port->serial->dev, priv); +- } ++ ctrl = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX; + +- /* Unimplemented: +- * (cflag & CSIZE) : data bits [5, 8] +- * (cflag & CSTOPB) : stop bits [1, 2] +- */ ++ switch (C_CSIZE(tty)) { ++ case CS5: ++ ctrl |= CH341_LCR_CS5; ++ break; ++ case CS6: ++ ctrl |= CH341_LCR_CS6; ++ break; ++ case CS7: ++ ctrl |= CH341_LCR_CS7; ++ break; ++ case CS8: ++ ctrl |= CH341_LCR_CS8; ++ break; ++ } + +- /* CH340 doesn't appear to support variable stop bits or data bits */ + if (C_PARENB(tty)) { +- if (C_PARODD(tty)) { +- if (tty->termios.c_cflag & CMSPAR) { +- dev_dbg(&port->dev, "parity = mark\n"); +- par_flags = 0xeb; +- } else { +- dev_dbg(&port->dev, "parity = odd\n"); +- par_flags = 0xcb; +- } +- } else { +- if (tty->termios.c_cflag & CMSPAR) { +- dev_dbg(&port->dev, "parity = space\n"); +- par_flags = 0xfb; +- } else { +- dev_dbg(&port->dev, "parity = even\n"); +- par_flags = 0xdb; +- } ++ ctrl |= CH341_LCR_ENABLE_PAR; ++ if (C_PARODD(tty) == 0) ++ ctrl |= CH341_LCR_PAR_EVEN; ++ if (C_CMSPAR(tty)) ++ ctrl |= CH341_LCR_MARK_SPACE; ++ } ++ ++ if (C_CSTOPB(tty)) ++ ctrl |= CH341_LCR_STOP_BITS_2; ++ ++ if (baud_rate) { ++ priv->baud_rate = baud_rate; ++ ++ r = ch341_set_baudrate_lcr(port->serial->dev, priv, ctrl); ++ if (r < 0 && old_termios) { ++ priv->baud_rate = tty_termios_baud_rate(old_termios); ++ tty_termios_copy_hw(&tty->termios, old_termios); ++ } else if (r == 0) { ++ priv->lcr = ctrl; + } +- } else { +- dev_dbg(&port->dev, "parity = none\n"); +- par_flags = 0xc3; + } +- ch341_control_out(port->serial->dev, 0x9a, 0x2518, par_flags); + + spin_lock_irqsave(&priv->lock, flags); + if (C_BAUD(tty) == B0) +@@ -410,7 +423,7 @@ static void ch341_set_termios(struct tty_struct *tty, + static void ch341_break_ctl(struct tty_struct *tty, int break_state) + { + const uint16_t ch341_break_reg = +- ((uint16_t) CH341_REG_BREAK2 << 8) | CH341_REG_BREAK1; ++ ((uint16_t) CH341_REG_LCR << 8) | CH341_REG_BREAK; + struct usb_serial_port *port = tty->driver_data; + int r; + uint16_t reg_contents; +@@ -431,12 +444,12 @@ static void ch341_break_ctl(struct tty_struct *tty, int break_state) + __func__, break_reg[0], break_reg[1]); + if (break_state != 0) { + dev_dbg(&port->dev, "%s - Enter break state requested\n", __func__); +- break_reg[0] &= ~CH341_NBREAK_BITS_REG1; +- break_reg[1] &= ~CH341_NBREAK_BITS_REG2; ++ break_reg[0] &= ~CH341_NBREAK_BITS; ++ break_reg[1] &= ~CH341_LCR_ENABLE_TX; + } else { + dev_dbg(&port->dev, "%s - Leave break state requested\n", __func__); +- break_reg[0] |= CH341_NBREAK_BITS_REG1; +- break_reg[1] |= CH341_NBREAK_BITS_REG2; ++ break_reg[0] |= CH341_NBREAK_BITS; ++ break_reg[1] |= CH341_LCR_ENABLE_TX; + } + dev_dbg(&port->dev, "%s - New ch341 break register contents - reg1: %x, reg2: %x\n", + __func__, break_reg[0], break_reg[1]); +@@ -593,6 +606,12 @@ static int ch341_reset_resume(struct usb_serial *serial) + ret); + return ret; + } ++ ++ ret = ch341_get_status(port->serial->dev, priv); ++ if (ret < 0) { ++ dev_err(&port->dev, "failed to read modem status: %d\n", ++ ret); ++ } + } + + return usb_serial_generic_resume(serial); + +From 9e381fa0502e45e35fed132290b5d9c859c47d38 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Tue, 20 Jun 2017 13:44:01 +0100 +Subject: [PATCH 293/305] dwc_otg: fiq_fsm: Add non-periodic TT exclusivity + constraints + +Certain hub types do not discriminate between pipe direction (IN or OUT) +when considering non-periodic transfers. Therefore these hubs get confused +if multiple transfers are issued in different directions with the same +device address and endpoint number. + +Constrain queuing non-periodic split transactions so they are performed +serially in such cases. + +Related: https://github.com/raspberrypi/linux/issues/2024 +--- + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 32 ++++++++++++++++++ + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h | 2 ++ + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 53 ++++++++++++++++++++++++++++-- + 3 files changed, 85 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +index 208252645c09d1d17bf07673989f91b7f4b3ef7a..0163e9cf620ba58df36a872b82cea92734baada6 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +@@ -191,6 +191,32 @@ static void notrace fiq_fsm_setup_csplit(struct fiq_state *st, int n) + mb(); + } + ++/** ++ * fiq_fsm_restart_np_pending() - Restart a single non-periodic contended transfer ++ * @st: Pointer to the channel's state ++ * @num_channels: Total number of host channels ++ * @orig_channel: Channel index of completed transfer ++ * ++ * In the case where an IN and OUT transfer are simultaneously scheduled to the ++ * same device/EP, inadequate hub implementations will misbehave. Once the first ++ * transfer is complete, a pending non-periodic split can then be issued. ++ */ ++static void notrace fiq_fsm_restart_np_pending(struct fiq_state *st, int num_channels, int orig_channel) ++{ ++ int i; ++ int dev_addr = st->channel[orig_channel].hcchar_copy.b.devaddr; ++ int ep_num = st->channel[orig_channel].hcchar_copy.b.epnum; ++ for (i = 0; i < num_channels; i++) { ++ if (st->channel[i].fsm == FIQ_NP_SSPLIT_PENDING && ++ st->channel[i].hcchar_copy.b.devaddr == dev_addr && ++ st->channel[i].hcchar_copy.b.epnum == ep_num) { ++ st->channel[i].fsm = FIQ_NP_SSPLIT_STARTED; ++ fiq_fsm_restart_channel(st, i, 0); ++ break; ++ } ++ } ++} ++ + static inline int notrace fiq_get_xfer_len(struct fiq_state *st, int n) + { + /* The xfersize register is a bit wonky. For IN transfers, it decrements by the packet size. */ +@@ -870,6 +896,9 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c + st->fsm = FIQ_NP_SPLIT_HS_ABORTED; + } + } ++ if (st->fsm != FIQ_NP_IN_CSPLIT_RETRY) { ++ fiq_fsm_restart_np_pending(state, num_channels, n); ++ } + break; + + case FIQ_NP_OUT_CSPLIT_RETRY: +@@ -919,6 +948,9 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c + st->fsm = FIQ_NP_SPLIT_HS_ABORTED; + } + } ++ if (st->fsm != FIQ_NP_OUT_CSPLIT_RETRY) { ++ fiq_fsm_restart_np_pending(state, num_channels, n); ++ } + break; + + /* Periodic split states (except isoc out) */ +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h +index 0a1ddf3f89f45ca75b8880722fbc22cbdc9f4a2f..ed088f34f210e9a337ab9b80fff0cf9e9b0241ea 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h +@@ -178,6 +178,8 @@ enum fiq_fsm_state { + /* Nonperiodic state groups */ + FIQ_NP_SSPLIT_STARTED = 1, + FIQ_NP_SSPLIT_RETRY = 2, ++ /* TT contention - working around hub bugs */ ++ FIQ_NP_SSPLIT_PENDING = 33, + FIQ_NP_OUT_CSPLIT_RETRY = 3, + FIQ_NP_IN_CSPLIT_RETRY = 4, + FIQ_NP_SPLIT_DONE = 5, +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index 71834cf365e67d7ad995bba7869216c4091c3a74..7710370b30363e3170bf9bf522597c5f41dfb908 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -1572,6 +1572,45 @@ int fiq_fsm_setup_periodic_dma(dwc_otg_hcd_t *hcd, struct fiq_channel_state *st, + } + } + ++/** ++ * fiq_fsm_np_tt_contended() - Avoid performing contended non-periodic transfers ++ * @hcd: Pointer to the dwc_otg_hcd struct ++ * @qh: Pointer to the endpoint's queue head ++ * ++ * Certain hub chips don't differentiate between IN and OUT non-periodic pipes ++ * with the same endpoint number. If transfers get completed out of order ++ * (disregarding the direction token) then the hub can lock up ++ * or return erroneous responses. ++ * ++ * Returns 1 if initiating the transfer would cause contention, 0 otherwise. ++ */ ++int fiq_fsm_np_tt_contended(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) ++{ ++ int i; ++ struct fiq_channel_state *st; ++ int dev_addr = qh->channel->dev_addr; ++ int ep_num = qh->channel->ep_num; ++ for (i = 0; i < hcd->core_if->core_params->host_channels; i++) { ++ if (i == qh->channel->hc_num) ++ continue; ++ st = &hcd->fiq_state->channel[i]; ++ switch (st->fsm) { ++ case FIQ_NP_SSPLIT_STARTED: ++ case FIQ_NP_SSPLIT_RETRY: ++ case FIQ_NP_SSPLIT_PENDING: ++ case FIQ_NP_OUT_CSPLIT_RETRY: ++ case FIQ_NP_IN_CSPLIT_RETRY: ++ if (st->hcchar_copy.b.devaddr == dev_addr && ++ st->hcchar_copy.b.epnum == ep_num) ++ return 1; ++ break; ++ default: ++ break; ++ } ++ } ++ return 0; ++} ++ + /* + * Pushing a periodic request into the queue near the EOF1 point + * in a microframe causes erroneous behaviour (frmovrun) interrupt. +@@ -1894,7 +1933,12 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + switch (hc->ep_type) { + case UE_CONTROL: + case UE_BULK: +- st->fsm = FIQ_NP_SSPLIT_STARTED; ++ if (fiq_fsm_np_tt_contended(hcd, qh)) { ++ st->fsm = FIQ_NP_SSPLIT_PENDING; ++ start_immediate = 0; ++ } else { ++ st->fsm = FIQ_NP_SSPLIT_STARTED; ++ } + break; + case UE_ISOCHRONOUS: + if (hc->ep_is_in) { +@@ -1918,7 +1962,12 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + break; + case UE_INTERRUPT: + if (fiq_fsm_mask & 0x8) { +- st->fsm = FIQ_NP_SSPLIT_STARTED; ++ if (fiq_fsm_np_tt_contended(hcd, qh)) { ++ st->fsm = FIQ_NP_SSPLIT_PENDING; ++ start_immediate = 0; ++ } else { ++ st->fsm = FIQ_NP_SSPLIT_STARTED; ++ } + } else if (start_immediate) { + st->fsm = FIQ_PER_SSPLIT_STARTED; + } else { + +From 2310d30585b5fa865c133a179fafe5f543194103 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 20 Jun 2017 17:51:47 +0100 +Subject: [PATCH 294/305] bcm2835-cpufreq: Change licence to GPLv2 + +Signed-off-by: Eben Upton +Signed-off-by: Dom Cobley +--- + drivers/cpufreq/bcm2835-cpufreq.c | 36 ++++++++++++++---------------------- + 1 file changed, 14 insertions(+), 22 deletions(-) + +diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c +index 414fbdc10dfbfc6e4bb47870a7af3fd5780f9c9a..99345969b0e4d651fd9033d67de2febb13fc0892 100644 +--- a/drivers/cpufreq/bcm2835-cpufreq.c ++++ b/drivers/cpufreq/bcm2835-cpufreq.c +@@ -1,25 +1,17 @@ +-/***************************************************************************** +-* Copyright 2011 Broadcom Corporation. All rights reserved. +-* +-* Unless you and Broadcom execute a separate written software license +-* agreement governing use of this software, this software is licensed to you +-* under the terms of the GNU General Public License version 2, available at +-* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). +-* +-* Notwithstanding the above, under no circumstances may you combine this +-* software in any way with any other Broadcom software provided under a +-* license other than the GPL, without Broadcom's express prior written +-* consent. +-*****************************************************************************/ +- +-/***************************************************************************** +-* FILENAME: bcm2835-cpufreq.h +-* DESCRIPTION: This driver dynamically manages the CPU Frequency of the ARM +-* processor. Messages are sent to Videocore either setting or requesting the +-* frequency of the ARM in order to match an appropiate frequency to the current +-* usage of the processor. The policy which selects the frequency to use is +-* defined in the kernel .config file, but can be changed during runtime. +-*****************************************************************************/ ++/* ++ * Copyright 2011 Broadcom Corporation. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; version 2 ++ * of the License. ++ * ++ * This driver dynamically manages the CPU Frequency of the ARM ++ * processor. Messages are sent to Videocore either setting or requesting the ++ * frequency of the ARM in order to match an appropiate frequency to the current ++ * usage of the processor. The policy which selects the frequency to use is ++ * defined in the kernel .config file, but can be changed during runtime. ++ */ + + /* ---------- INCLUDES ---------- */ + #include + +From 7889c33408eac5140410e993fde3def6e51709d9 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 21 Jun 2017 09:03:51 -0700 +Subject: [PATCH 295/305] bcm2708: Drop CMA alignment from FKMS mode as well. + +I dropped it from KMS mode in d88274d88ed81de1ade8e18e4c0ed91792ec82ea +and should have done both of them at that time. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +index 95a595a35cb4fbb707bf4b18161f6a46860aa4ae..36fbf6c8c2e612a6dc5aa02d77cc8173098c16ca 100644 +--- a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts ++++ b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +@@ -11,35 +11,35 @@ + fragment@0 { + target-path = "/chosen"; + __overlay__ { +- bootargs = "cma=256M@256M"; ++ bootargs = "cma=256M"; + }; + }; + + fragment@1 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=192M@256M"; ++ bootargs = "cma=192M"; + }; + }; + + fragment@2 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=128M@128M"; ++ bootargs = "cma=128M"; + }; + }; + + fragment@3 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=96M@128M"; ++ bootargs = "cma=96M"; + }; + }; + + fragment@4 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=64M@64M"; ++ bootargs = "cma=64M"; + }; + }; + + +From a23b416acd38c5323be774e555ca2d117a6d759c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 21 Jun 2017 17:19:04 +0100 +Subject: [PATCH 296/305] serial: 8250: Fix THRE flag usage for CAP_MINI + +The BCM2835 MINI UART has non-standard THRE semantics. Conventionally +the bit means that the FIFO is empty (although there may still be a +byte in the transmit register), but on 2835 it indicates that the FIFO +is not empty. This causes interrupts after every byte is transmitted, +with the FIFO providing some interrupt latency tolerance. + +A consequence of this difference is that the usual strategy of writing +multiple bytes into the TX FIFO after checking THRE once is unsafe. +In the worst case of 7 bytes in the FIFO, writing 8 bytes loses all +but the first since by then the FIFO is full. + +There is an HFIFO ("Hidden FIFO") bit which is almost what is needed, +but it only adds more bytes while both THRE and TEMT are set, i.e. +when the TX side is completely idle. This is unnecessarily pessimistic. + +Add a new special case, predicated on CAP_MINI, that loops until THRE +is no longer set. With this change, the FIFO fills quickly but +subsequent writes are paced by the transmission rate. + +See: https://github.com/raspberrypi/linux/issues/1855 + +Signed-off-by: Phil Elwell +--- + drivers/tty/serial/8250/8250_port.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 2d7a63f69b90415d6e1b6eb1c10612f4aa9fbed2..d2ecdb80e5f2d6bcb7e4edbb28280853bf1fd440 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -1746,6 +1746,10 @@ void serial8250_tx_chars(struct uart_8250_port *up) + if ((up->capabilities & UART_CAP_HFIFO) && + (serial_in(up, UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY) + break; ++ /* The BCM2835 MINI UART THRE bit is really a not-full bit. */ ++ if ((up->capabilities & UART_CAP_MINI) && ++ !(serial_in(up, UART_LSR) & UART_LSR_THRE)) ++ break; + } while (--count > 0); + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + +From fe0e2484ec702fff8d0e2f5b8c3bb1d8045ccd7e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Jun 2016 16:37:46 +0100 +Subject: [PATCH 297/305] mmc: Apply ERASE_BROKEN quirks correctly + +Signed-off-by: Phil Elwell +--- + drivers/mmc/card/block.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c +index 894c105be9ce7f83147a62c433c787b90a5e7c17..f1aeab19e10a465bffe69d24fc3331c80426e6b8 100644 +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -2584,12 +2584,9 @@ static const struct mmc_fixup blk_fixups[] = + * On some Kingston SD cards, multiple erases of less than 64 + * sectors can cause corruption. + */ +- MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), +- MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), +- MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), + + END_FIXUP + }; + +From 7008aa63f65db75fc7057e6da19527e8004ccd0c Mon Sep 17 00:00:00 2001 +From: Steve Conner +Date: Thu, 29 Jun 2017 15:56:19 +0100 +Subject: [PATCH 298/305] New i2c-rtc-gpio device overlay (#2092) + +Created new i2c-rtc-gpio device overlay by combining i2c-rtc and i2c-gpio. Tested with PCF2127 on CM3. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 41 +++++ + .../arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts | 183 +++++++++++++++++++++ + 3 files changed, 225 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index eca81982c0f19988abd05165fc62a80d26f539cb..8a3131f5a4bc90d4a597b416416953e8e49d41ec 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -42,6 +42,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + i2c-mux.dtbo \ + i2c-pwm-pca9685a.dtbo \ + i2c-rtc.dtbo \ ++ i2c-rtc-gpio.dtbo \ + i2c-sensor.dtbo \ + i2c0-bcm2708.dtbo \ + i2c1-bcm2708.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 19df6883be4277240283d5f63f27e34a22a2eec5..a69e3a0d8dce1633598dd3cd8e00cad9509eee03 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -662,6 +662,47 @@ Params: abx80x Select one of the ABx80x family: + source + + ++Name: i2c-rtc-gpio ++Info: Adds support for a number of I2C Real Time Clock devices ++ using the software i2c controller ++Load: dtoverlay=i2c-rtc-gpio,= ++Params: abx80x Select one of the ABx80x family: ++ AB0801, AB0803, AB0804, AB0805, ++ AB1801, AB1803, AB1804, AB1805 ++ ++ ds1307 Select the DS1307 device ++ ++ ds1339 Select the DS1339 device ++ ++ ds3231 Select the DS3231 device ++ ++ mcp7940x Select the MCP7940x device ++ ++ mcp7941x Select the MCP7941x device ++ ++ pcf2127 Select the PCF2127 device ++ ++ pcf8523 Select the PCF8523 device ++ ++ pcf8563 Select the PCF8563 device ++ ++ trickle-diode-type Diode type for trickle charge - "standard" or ++ "schottky" (ABx80x only) ++ ++ trickle-resistor-ohms Resistor value for trickle charge (DS1339, ++ ABx80x) ++ ++ wakeup-source Specify that the RTC can be used as a wakeup ++ source ++ ++ i2c_gpio_sda GPIO used for I2C data (default "23") ++ ++ i2c_gpio_scl GPIO used for I2C clock (default "24") ++ ++ i2c_gpio_delay_us Clock delay in microseconds ++ (default "2" = ~100kHz) ++ ++ + Name: i2c-sensor + Info: Adds support for a number of I2C barometric pressure and temperature + sensors on i2c_arm +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..8415e6081428fba9a47682964174fc023cfd2b0c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts +@@ -0,0 +1,183 @@ ++// Definitions for several I2C based Real Time Clocks ++// Available through i2c-gpio ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ i2c_gpio: i2c-gpio-rtc@0 { ++ compatible = "i2c-gpio"; ++ gpios = <&gpio 23 0 /* sda */ ++ &gpio 24 0 /* scl */ ++ >; ++ i2c-gpio,delay-us = <2>; /* ~100 kHz */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ abx80x: abx80x@69 { ++ compatible = "abracon,abx80x"; ++ reg = <0x69>; ++ abracon,tc-diode = "standard"; ++ abracon,tc-resistor = <0>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ds1307: ds1307@68 { ++ compatible = "maxim,ds1307"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ds1339: ds1339@68 { ++ compatible = "dallas,ds1339"; ++ trickle-resistor-ohms = <0>; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ds3231: ds3231@68 { ++ compatible = "maxim,ds3231"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ mcp7940x: mcp7940x@6f { ++ compatible = "microchip,mcp7940x"; ++ reg = <0x6f>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ mcp7941x: mcp7941x@6f { ++ compatible = "microchip,mcp7941x"; ++ reg = <0x6f>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@7 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcf2127: pcf2127@51 { ++ compatible = "nxp,pcf2127"; ++ reg = <0x51>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@8 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcf8523: pcf8523@68 { ++ compatible = "nxp,pcf8523"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@9 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcf8563: pcf8563@51 { ++ compatible = "nxp,pcf8563"; ++ reg = <0x51>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ abx80x = <0>,"+1"; ++ ds1307 = <0>,"+2"; ++ ds1339 = <0>,"+3"; ++ ds3231 = <0>,"+4"; ++ mcp7940x = <0>,"+5"; ++ mcp7941x = <0>,"+6"; ++ pcf2127 = <0>,"+7"; ++ pcf8523 = <0>,"+8"; ++ pcf8563 = <0>,"+9"; ++ trickle-diode-type = <&abx80x>,"abracon,tc-diode"; ++ trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0", ++ <&abx80x>,"abracon,tc-resistor"; ++ wakeup-source = <&ds1339>,"wakeup-source?", ++ <&ds3231>,"wakeup-source?", ++ <&mcp7940x>,"wakeup-source?", ++ <&mcp7941x>,"wakeup-source?"; ++ i2c_gpio_sda = <&i2c_gpio>,"gpios:4"; ++ i2c_gpio_scl = <&i2c_gpio>,"gpios:16"; ++ i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0"; ++ }; ++}; + +From e1a4ad113967eacc936c19fcc79335b8df174cc3 Mon Sep 17 00:00:00 2001 +From: Allo +Date: Mon, 3 Jul 2017 15:45:20 +0530 +Subject: [PATCH 299/305] PianoPlus: Dual Mono & Dual Stereo features added + (#2069) + +--- + sound/soc/bcm/allo-piano-dac-plus.c | 160 +++++++++++++++++++++++++++++++----- + 1 file changed, 141 insertions(+), 19 deletions(-) + +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +index 56e43f98846b41e487b3089813f7edc3c08517eb..d4e99e3c6a383d92fb0cf9e8c1cd1e7657358d49 100644 +--- a/sound/soc/bcm/allo-piano-dac-plus.c ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -36,6 +36,7 @@ struct dsp_code { + + struct glb_pool { + struct mutex lock; ++ unsigned int dual_mode; + unsigned int set_lowpass; + unsigned int set_mode; + unsigned int set_rate; +@@ -47,8 +48,8 @@ bool glb_mclk; + + static struct gpio_desc *mute_gpio[2]; + +- + static const char * const allo_piano_mode_texts[] = { ++ "None", + "2.0", + "2.1", + "2.2", +@@ -57,6 +58,15 @@ static const char * const allo_piano_mode_texts[] = { + static const SOC_ENUM_SINGLE_DECL(allo_piano_mode_enum, + 0, 0, allo_piano_mode_texts); + ++static const char * const allo_piano_dual_mode_texts[] = { ++ "None", ++ "Dual-Mono", ++ "Dual-Stereo", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_dual_mode_enum, ++ 0, 0, allo_piano_dual_mode_texts); ++ + static const char * const allo_piano_dsp_low_pass_texts[] = { + "60", + "70", +@@ -82,10 +92,10 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + unsigned int mode, unsigned int rate, unsigned int lowpass) + { + const struct firmware *fw; +- char firmware_name[60]; +- int ret = 0, dac = 0; + struct snd_soc_card *card = rtd->card; + struct glb_pool *glb_ptr = card->drvdata; ++ char firmware_name[60]; ++ int ret = 0, dac = 0; + + if (rate <= 46000) + rate = 44100; +@@ -100,26 +110,35 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + else + rate = 192000; + +- if ((lowpass > 14) || (lowpass < 0)) +- lowpass = 3; +- if ((mode > 2) || (mode < 0)) +- mode = 0; ++ if (lowpass > 14) ++ glb_ptr->set_lowpass = lowpass = 3; ++ ++ if (mode > 3) ++ glb_ptr->set_mode = mode = 0; ++ ++ if (mode > 0) ++ glb_ptr->dual_mode = 0; + + /* same configuration loaded */ + if ((rate == glb_ptr->set_rate) && (lowpass == glb_ptr->set_lowpass) + && (mode == glb_ptr->set_mode)) + return 0; + +- if (mode == 0) { /* 2.0 */ +- snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x11); ++ switch (mode) { ++ case 0: /* None */ ++ return 1; ++ ++ case 1: /* 2.0 */ ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x11); + glb_ptr->set_rate = rate; + glb_ptr->set_mode = mode; + glb_ptr->set_lowpass = lowpass; + return 1; +- } else { +- snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x00); ++ ++ default: ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x00); + } + + for (dac = 0; dac < rtd->num_codecs; dac++) { +@@ -128,13 +147,13 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + int i = 1; + + if (dac == 0) { /* high */ +- sprintf(firmware_name, ++ snprintf(firmware_name, sizeof(firmware_name), + "allo/piano/2.2/allo-piano-dsp-%d-%d-%d.bin", + rate, ((lowpass * 10) + 60), dac); + } else { /* low */ +- sprintf(firmware_name, ++ snprintf(firmware_name, sizeof(firmware_name), + "allo/piano/2.%d/allo-piano-dsp-%d-%d-%d.bin", +- mode, rate, ((lowpass * 10) + 60), dac); ++ (mode - 1), rate, ((lowpass * 10) + 60), dac); + } + + dev_info(codec->dev, "Dsp Firmware File Name: %s\n", +@@ -199,6 +218,80 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + return ret; + } + ++static int snd_allo_piano_dual_mode_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->dual_mode; ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dual_mode_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_card *snd_card_ptr = card->snd_card; ++ struct snd_kcontrol *kctl; ++ struct soc_mixer_control *mc; ++ unsigned int left_val = 0; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ++ if (ucontrol->value.integer.value[0] > 0) { ++ glb_ptr->dual_mode = ucontrol->value.integer.value[0]; ++ glb_ptr->set_mode = 0; ++ } else if (ucontrol->value.integer.value[0] <= 0) { ++ if (glb_ptr->set_mode <= 0) { ++ glb_ptr->dual_mode = 1; ++ glb_ptr->set_mode = 0; ++ } ++ } else { ++ glb_ptr->dual_mode = 0; ++ return 0; ++ } ++ ++ if (glb_ptr->dual_mode == 1) { ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x01); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x10); ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_3, 0xff); ++ ++ list_for_each_entry(kctl, &snd_card_ptr->controls, list) { ++ if (!strncmp(kctl->id.name, "Digital Playback Volume", ++ sizeof(kctl->id.name))) { ++ mc = (struct soc_mixer_control *) ++ kctl->private_value; ++ mc->rreg = mc->reg; ++ break; ++ } ++ } ++ } else { ++ left_val = snd_soc_read(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ list_for_each_entry(kctl, &snd_card_ptr->controls, list) { ++ if (!strncmp(kctl->id.name, "Digital Playback Volume", ++ sizeof(kctl->id.name))) { ++ mc = (struct soc_mixer_control *) ++ kctl->private_value; ++ mc->rreg = PCM512x_DIGITAL_VOLUME_3; ++ break; ++ } ++ } ++ ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_3, left_val); ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x00); ++ } ++ ++ return 0; ++} ++ + static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +@@ -215,8 +308,30 @@ static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, + struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); + struct snd_soc_pcm_runtime *rtd; + struct glb_pool *glb_ptr = card->drvdata; ++ struct snd_card *snd_card_ptr = card->snd_card; ++ struct snd_kcontrol *kctl; ++ struct soc_mixer_control *mc; ++ unsigned int left_val = 0; + + rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ++ if ((glb_ptr->dual_mode == 1) && ++ (ucontrol->value.integer.value[0] > 0)) { ++ left_val = snd_soc_read(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ list_for_each_entry(kctl, &snd_card_ptr->controls, list) { ++ if (!strncmp(kctl->id.name, "Digital Playback Volume", ++ sizeof(kctl->id.name))) { ++ mc = (struct soc_mixer_control *) ++ kctl->private_value; ++ mc->rreg = PCM512x_DIGITAL_VOLUME_3; ++ break; ++ } ++ } ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_3, left_val); ++ } ++ + return(snd_allo_piano_dsp_program(rtd, + ucontrol->value.integer.value[0], + glb_ptr->set_rate, glb_ptr->set_lowpass)); +@@ -344,6 +459,11 @@ static const struct snd_kcontrol_new allo_piano_controls[] = { + snd_allo_piano_mode_get, + snd_allo_piano_mode_put), + ++ SOC_ENUM_EXT("Dual Mode Route", ++ allo_piano_dual_mode_enum, ++ snd_allo_piano_dual_mode_get, ++ snd_allo_piano_dual_mode_put), ++ + SOC_ENUM_EXT("Lowpass Route", allo_piano_enum, + snd_allo_piano_lowpass_get, + snd_allo_piano_lowpass_put), +@@ -472,7 +592,7 @@ static int snd_allo_piano_dac_hw_params( + PCM512x_RATE_DET_4); + if (val < 0) { + dev_err(rtd->codec_dais[dac]->codec->dev, +- "Failed to read register PCM512x_RATE_DET_4\n"); ++ "Failed to read register PCM512x_RATE_DET_4\n"); + return val; + } + +@@ -482,7 +602,7 @@ static int snd_allo_piano_dac_hw_params( + PCM512x_SREF_BCK); + + dev_info(rtd->codec_dais[dac]->codec->dev, +- "Setting BCLK as input clock & Enable PLL\n"); ++ "Setting BCLK as input clock & Enable PLL\n"); + } else { + snd_soc_write(rtd->codec_dais[dac]->codec, + PCM512x_PLL_EN, +@@ -493,7 +613,7 @@ static int snd_allo_piano_dac_hw_params( + PCM512x_SREF_SCK); + + dev_info(rtd->codec_dais[dac]->codec->dev, +- "Setting SCLK as input clock & disabled PLL\n"); ++ "Setting SCLK as input clock & disabled PLL\n"); + } + } + +@@ -504,6 +624,7 @@ static int snd_allo_piano_dac_hw_params( + dev_warn(card->dev, "Failed to set volume limit: %d\n", + ret); + } ++ + ret = snd_allo_piano_dsp_program(rtd, glb_ptr->set_mode, rate, + glb_ptr->set_lowpass); + if (ret < 0) +@@ -521,6 +642,7 @@ static int snd_allo_piano_dac_prepare( + struct snd_soc_card *card = rtd->card; + + snd_allo_piano_gpio_unmute(card); ++ + return 0; + } + + +From 7c6b5d91f231a1543ac00bfe452d33b73a1f1734 Mon Sep 17 00:00:00 2001 +From: Marta Lofstedt +Date: Mon, 5 Dec 2016 14:04:08 +0200 +Subject: [PATCH 300/305] drm: allow changing DPMS mode + +The drm_atomic_helper_connector_dpms +will set the connector back the old DPMS state +before returning. This makes it impossible to change +DPMS state of the connector. + +Fixes: 0853695c3ba46f97dfc0b5885f7b7e640ca212dd +v2: edit of commit message +Cc: Chris Wilson +Cc: Daniel Vetter +Cc: Eric Engestrom +Cc: Sean Paul +Cc: dri-devel@lists.freedesktop.org +Cc: +Signed-off-by: Marta Lofstedt +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/20161205120408.13056-1-marta.lofstedt@intel.com +(cherry picked from commit 8f5040e421ca4bbd8cd5216dec509da188eb74bc) +--- + drivers/gpu/drm/drm_atomic_helper.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c +index 50acd799babe1824e47e4bba6b9f03875429c17a..06572ffdb4082fe290b51bbd4c54b84cd11f73d3 100644 +--- a/drivers/gpu/drm/drm_atomic_helper.c ++++ b/drivers/gpu/drm/drm_atomic_helper.c +@@ -2932,7 +2932,8 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector, + if (ret == -EDEADLK) + goto backoff; + +- connector->dpms = old_mode; ++ if (ret != 0) ++ connector->dpms = old_mode; + drm_atomic_state_free(state); + + return ret; + +From 1752286157f8017a5a21163c1206df43362052bb Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 6 Jul 2017 11:45:48 -0700 +Subject: [PATCH 301/305] drm/vc4: Add support for setting DPMS in firmwarekms. + +This ensures that the screen goes blank during DPMS (screensaver), +including the cursor. Planes don't necessarily get disabled during +CRTC disable, so we need to be careful to not leave them on or turn +them back on early. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 40 +++++++++++++++++++++++++++++++--- + 1 file changed, 37 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 40a0cdc179ceabafb387724e1b835895fa3e2ca2..c85cae7d2f5f88cd41d3cf41dafa1449e3416c01 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -38,6 +38,8 @@ struct vc4_crtc { + struct drm_crtc base; + struct drm_encoder *encoder; + struct drm_connector *connector; ++ struct drm_plane *primary; ++ struct drm_plane *cursor; + void __iomem *regs; + + struct drm_pending_vblank_event *event; +@@ -126,8 +128,6 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + 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; +@@ -175,6 +175,12 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + vc4_plane->fbinfo_bus_addr); + WARN_ON_ONCE(fbinfo->pitch != fb->pitches[0]); + WARN_ON_ONCE(fbinfo->base != bo->paddr + fb->offsets[0]); ++ ++ /* If the CRTC is on (or going to be on) and we're enabled, ++ * then unblank. Otherwise, stay blank until CRTC enable. ++ */ ++ if (state->crtc->state->active) ++ vc4_plane_set_primary_blank(plane, false); + } + + static void vc4_primary_plane_atomic_disable(struct drm_plane *plane, +@@ -192,7 +198,12 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, + 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_state[] = { ++ state->crtc->state->active, ++ state->crtc_x, ++ state->crtc_y, ++ 0 ++ }; + u32 packet_info[] = { state->crtc_w, state->crtc_h, + 0, /* unused */ + bo->paddr + fb->offsets[0], +@@ -336,10 +347,30 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + + static void vc4_crtc_disable(struct drm_crtc *crtc) + { ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ ++ /* Always turn the planes off on CRTC disable. In DRM, planes ++ * are enabled/disabled through the update/disable hooks ++ * above, and the CRTC enable/disable independently controls ++ * whether anything scans out at all, but the firmware doesn't ++ * give us a CRTC-level control for that. ++ */ ++ vc4_cursor_plane_atomic_disable(vc4_crtc->cursor, ++ vc4_crtc->cursor->state); ++ vc4_plane_set_primary_blank(vc4_crtc->primary, true); + } + + static void vc4_crtc_enable(struct drm_crtc *crtc) + { ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ ++ /* Unblank the planes (if they're supposed to be displayed). */ ++ if (vc4_crtc->primary->state->fb) ++ vc4_plane_set_primary_blank(vc4_crtc->primary, false); ++ if (vc4_crtc->cursor->state->fb) { ++ vc4_cursor_plane_atomic_update(vc4_crtc->cursor, ++ vc4_crtc->cursor->state); ++ } + } + + static int vc4_crtc_atomic_check(struct drm_crtc *crtc, +@@ -635,6 +666,9 @@ static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) + cursor_plane->crtc = crtc; + vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; + ++ vc4_crtc->primary = primary_plane; ++ vc4_crtc->cursor = cursor_plane; ++ + vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL); + if (!vc4_encoder) + return -ENOMEM; + +From 2f978a18335396172a43ab837f391fed419ef446 Mon Sep 17 00:00:00 2001 +From: Matthijs Kooijman +Date: Sun, 9 Jul 2017 15:15:22 +0200 +Subject: [PATCH 302/305] overlays: Add gpio-shutdown overlay (#2103) + +This overlay facilitates the addition of a powerbutton by converting +GPIO edges into KEY_POWER keypresses, which can be handled by +systemd-logind to shut down the system. + +Signed-off-by: Matthijs Kooijman +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 32 +++++++++ + .../boot/dts/overlays/gpio-shutdown-overlay.dts | 80 ++++++++++++++++++++++ + 3 files changed, 113 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 8a3131f5a4bc90d4a597b416416953e8e49d41ec..c50b1dfa9d7334df47ce087f9d2a7a816afa05ba 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -30,6 +30,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + googlevoicehat-soundcard.dtbo \ + gpio-ir.dtbo \ + gpio-poweroff.dtbo \ ++ gpio-shutdown.dtbo \ + hifiberry-amp.dtbo \ + hifiberry-dac.dtbo \ + hifiberry-dacplus.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index a69e3a0d8dce1633598dd3cd8e00cad9509eee03..e6d777a601c91d192bc5713f9a73e1a2d4d708ef 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -508,6 +508,38 @@ Params: gpiopin GPIO for signalling (default 26) + will also cause the pin to go low. + + ++Name: gpio-shutdown ++Info: Initiates a shutdown when GPIO pin changes. The given GPIO pin ++ is configured as an input key that generates KEY_POWER events. ++ This event is handled by systemd-logind by initiating a ++ shutdown. Systemd versions older than 225 need an udev rule ++ enable listening to the input device: ++ ++ ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \ ++ SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \ ++ ATTRS{keys}=="116", TAG+="power-switch" ++ ++ This overlay only handles shutdown. After shutdown, the system ++ can be powered up again by driving GPIO3 low. The default ++ configuration uses GPIO3 with a pullup, so if you connect a ++ button between GPIO3 and GND (pin 5 and 6 on the 40-pin header), ++ you get a shutdown and power-up button. ++Load: dtoverlay=gpio-shutdown,= ++Params: gpio_pin GPIO pin to trigger on (default 3) ++ ++ active_low When this is 1 (active low), a falling ++ edge generates a key down event and a ++ rising edge generates a key up event. ++ When this is 0 (active high), this is ++ reversed. The default is 1 (active low). ++ ++ gpio_pull Desired pull-up/down state (off, down, up) ++ Default is "up". ++ ++ Note that the default pin (GPIO3) has an ++ external pullup. ++ ++ + Name: hifiberry-amp + Info: Configures the HifiBerry Amp and Amp+ audio cards + Load: dtoverlay=hifiberry-amp +diff --git a/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..863fb395c8539734b658682b900e1fbd96c9443e +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts +@@ -0,0 +1,80 @@ ++// Definitions for gpio-poweroff module ++/dts-v1/; ++/plugin/; ++ ++// This overlay sets up an input device that generates KEY_POWER events ++// when a given GPIO pin changes. It defaults to using GPIO3, which can ++// also be used to wake up (start) the Rpi again after shutdown. Since ++// wakeup is active-low, this defaults to active-low with a pullup ++// enabled, but all of this can be changed using overlay parameters (but ++// note that GPIO3 has an external pullup on at least some boards). ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ // Configure the gpio pin controller ++ target = <&gpio>; ++ __overlay__ { ++ // Define a pinctrl state, that sets up the gpio ++ // as an input with a pullup enabled. This does ++ // not take effect by itself, only when referenced ++ // by a "pinctrl client", as is done below. See: ++ // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt ++ // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt ++ pin_state: shutdown_button_pins { ++ brcm,pins = <3>; // gpio number ++ brcm,function = <0>; // 0 = input, 1 = output ++ brcm,pull = <2>; // 0 = none, 1 = pull down, 2 = pull up ++ }; ++ }; ++ }; ++ fragment@1 { ++ // Add a new device to the /soc devicetree node ++ target-path = "/soc"; ++ __overlay__ { ++ shutdown_button { ++ // Let the gpio-keys driver handle this device. See: ++ // https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt ++ compatible = "gpio-keys"; ++ ++ // Declare a single pinctrl state (referencing the one declared above) and name it ++ // default, so it is activated automatically. ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pin_state>; ++ ++ // Enable this device ++ status = "okay"; ++ ++ // Define a single key, called "shutdown" that monitors the gpio and sends KEY_POWER ++ // (keycode 116, see ++ // https://github.com/torvalds/linux/blob/v4.12/include/uapi/linux/input-event-codes.h#L190) ++ button: shutdown { ++ label = "shutdown"; ++ linux,code = <116>; // KEY_POWER ++ gpios = <&gpio 3 1>; ++ }; ++ }; ++ }; ++ }; ++ ++ // This defines parameters that can be specified when loading ++ // the overlay. Each foo = line specifies one parameter, named ++ // foo. The rest of the specification gives properties where the ++ // parameter value is inserted into (changing the values above ++ // or adding new ones). ++ __overrides__ { ++ // Allow overriding the GPIO number. ++ gpio_pin = <&button>,"gpios:4", ++ <&pin_state>,"brcm,pins:0"; ++ ++ // Allow changing the internal pullup/down state. 0 = none, 1 = pulldown, 2 = pullup ++ // Note that GPIO3 and GPIO2 are the I2c pins and have an external pullup (at least ++ // on some boards). ++ gpio_pull = <&pin_state>,"brcm,pull:0"; ++ ++ // Allow setting the active_low flag. 0 = active high, 1 = active low ++ active_low = <&button>,"gpios:8"; ++ }; ++ ++}; + +From 0cc897e19bb87825805834fbff13fe58392d3e13 Mon Sep 17 00:00:00 2001 +From: Matthias Reichl +Date: Mon, 10 Jul 2017 11:05:17 +0200 +Subject: [PATCH 303/305] config: enable generic S/PDIF codec drivers (#2104) + +These drivers can be used as dummy ADC/DAC drivers for +attaching general codecs that don't need to be configured. + +This option will build 2 additional drivers, spdif_receiver +and spdif_transmitter. + +Since these drivers have DT bindings they are handy for quick +testing of I2S peripherals with simple-audio-card. + +eg: + +fragment@0 { + target-path = "/"; + __overlay__ { + dummy_receiver: spdif-receiver { + #address-cells = <0>; + #size-cells = <0>; + #sound-dai-cells = <0>; + compatible = "linux,spdif-dir"; + status = "okay"; + }; + }; +}; + +Signed-off-by: Matthias Reichl +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 0fbabb1c0d56943871c3ad2b700f4c81de1c81ae..51f83ba0cf0f7fd3a44501ba521d4453e83ce46f 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -909,6 +909,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_SPDIF=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 83cfb1e8738bdb7ef3ee1502b9a64d654de80c1b..646d69bea48befde89bec7c85895d41cd644d226 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -903,6 +903,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_SPDIF=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + +From 86f8b06fb2dffeee207f12048aa801c9f66e3dc5 Mon Sep 17 00:00:00 2001 +From: Krzysztof Opasiak +Date: Tue, 24 Jan 2017 03:27:24 +0100 +Subject: [PATCH 304/305] usb: gadget: f_hid: fix: Move IN request allocation + to set_alt() + +Since commit: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") +we cannot allocate any requests in bind() as we check if we should +align request buffer based on endpoint descriptor which is assigned +in set_alt(). + +Allocating request in bind() function causes a NULL pointer +dereference. + +This commit moves allocation of IN request from bind() to set_alt() +to prevent this issue. + +Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") +Cc: stable@vger.kernel.org +Tested-by: David Lechner +Signed-off-by: Krzysztof Opasiak +Signed-off-by: Felipe Balbi +--- + drivers/usb/gadget/function/f_hid.c | 91 +++++++++++++++++++++++++++---------- + 1 file changed, 68 insertions(+), 23 deletions(-) + +diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c +index b0f71957d00bded60c8f8da92e2cc15b376cce00..5815120c04021695d2453dece631bdbd43c51885 100644 +--- a/drivers/usb/gadget/function/f_hid.c ++++ b/drivers/usb/gadget/function/f_hid.c +@@ -284,6 +284,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + size_t count, loff_t *offp) + { + struct f_hidg *hidg = file->private_data; ++ struct usb_request *req; + unsigned long flags; + ssize_t status = -ENOMEM; + +@@ -293,7 +294,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + spin_lock_irqsave(&hidg->write_spinlock, flags); + + #define WRITE_COND (!hidg->write_pending) +- ++try_again: + /* write queue */ + while (!WRITE_COND) { + spin_unlock_irqrestore(&hidg->write_spinlock, flags); +@@ -308,6 +309,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + } + + hidg->write_pending = 1; ++ req = hidg->req; + count = min_t(unsigned, count, hidg->report_length); + + spin_unlock_irqrestore(&hidg->write_spinlock, flags); +@@ -320,24 +322,38 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + goto release_write_pending; + } + +- hidg->req->status = 0; +- hidg->req->zero = 0; +- hidg->req->length = count; +- hidg->req->complete = f_hidg_req_complete; +- hidg->req->context = hidg; ++ spin_lock_irqsave(&hidg->write_spinlock, flags); ++ ++ /* we our function has been disabled by host */ ++ if (!hidg->req) { ++ free_ep_req(hidg->in_ep, hidg->req); ++ /* ++ * TODO ++ * Should we fail with error here? ++ */ ++ goto try_again; ++ } ++ ++ req->status = 0; ++ req->zero = 0; ++ req->length = count; ++ req->complete = f_hidg_req_complete; ++ req->context = hidg; + + status = usb_ep_queue(hidg->in_ep, hidg->req, GFP_ATOMIC); + if (status < 0) { + ERROR(hidg->func.config->cdev, + "usb_ep_queue error on int endpoint %zd\n", status); +- goto release_write_pending; ++ goto release_write_pending_unlocked; + } else { + status = count; + } ++ spin_unlock_irqrestore(&hidg->write_spinlock, flags); + + return status; + release_write_pending: + spin_lock_irqsave(&hidg->write_spinlock, flags); ++release_write_pending_unlocked: + hidg->write_pending = 0; + spin_unlock_irqrestore(&hidg->write_spinlock, flags); + +@@ -541,12 +557,23 @@ static void hidg_disable(struct usb_function *f) + kfree(list); + } + spin_unlock_irqrestore(&hidg->read_spinlock, flags); ++ ++ spin_lock_irqsave(&hidg->write_spinlock, flags); ++ if (!hidg->write_pending) { ++ free_ep_req(hidg->in_ep, hidg->req); ++ hidg->write_pending = 1; ++ } ++ ++ hidg->req = NULL; ++ spin_unlock_irqrestore(&hidg->write_spinlock, flags); + } + + static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + { + struct usb_composite_dev *cdev = f->config->cdev; + struct f_hidg *hidg = func_to_hidg(f); ++ struct usb_request *req_in = NULL; ++ unsigned long flags; + int i, status = 0; + + VDBG(cdev, "hidg_set_alt intf:%d alt:%d\n", intf, alt); +@@ -567,6 +594,12 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + goto fail; + } + hidg->in_ep->driver_data = hidg; ++ ++ req_in = hidg_alloc_ep_req(hidg->in_ep, hidg->report_length); ++ if (!req_in) { ++ status = -ENOMEM; ++ goto disable_ep_in; ++ } + } + + +@@ -578,12 +611,12 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + hidg->out_ep); + if (status) { + ERROR(cdev, "config_ep_by_speed FAILED!\n"); +- goto fail; ++ goto free_req_in; + } + status = usb_ep_enable(hidg->out_ep); + if (status < 0) { +- ERROR(cdev, "Enable IN endpoint FAILED!\n"); +- goto fail; ++ ERROR(cdev, "Enable OUT endpoint FAILED!\n"); ++ goto free_req_in; + } + hidg->out_ep->driver_data = hidg; + +@@ -599,17 +632,37 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + req->context = hidg; + status = usb_ep_queue(hidg->out_ep, req, + GFP_ATOMIC); +- if (status) ++ if (status) { + ERROR(cdev, "%s queue req --> %d\n", + hidg->out_ep->name, status); ++ free_ep_req(hidg->out_ep, req); ++ } + } else { +- usb_ep_disable(hidg->out_ep); + status = -ENOMEM; +- goto fail; ++ goto disable_out_ep; + } + } + } + ++ if (hidg->in_ep != NULL) { ++ spin_lock_irqsave(&hidg->write_spinlock, flags); ++ hidg->req = req_in; ++ hidg->write_pending = 0; ++ spin_unlock_irqrestore(&hidg->write_spinlock, flags); ++ ++ wake_up(&hidg->write_queue); ++ } ++ return 0; ++disable_out_ep: ++ usb_ep_disable(hidg->out_ep); ++free_req_in: ++ if (req_in) ++ free_ep_req(hidg->in_ep, req_in); ++ ++disable_ep_in: ++ if (hidg->in_ep) ++ usb_ep_disable(hidg->in_ep); ++ + fail: + return status; + } +@@ -658,12 +711,6 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) + goto fail; + hidg->out_ep = ep; + +- /* preallocate request and buffer */ +- status = -ENOMEM; +- hidg->req = alloc_ep_req(hidg->in_ep, hidg->report_length); +- if (!hidg->req) +- goto fail; +- + /* set descriptor dynamic values */ + hidg_interface_desc.bInterfaceSubClass = hidg->bInterfaceSubClass; + hidg_interface_desc.bInterfaceProtocol = hidg->bInterfaceProtocol; +@@ -690,6 +737,8 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) + goto fail; + + spin_lock_init(&hidg->write_spinlock); ++ hidg->write_pending = 1; ++ hidg->req = NULL; + spin_lock_init(&hidg->read_spinlock); + init_waitqueue_head(&hidg->write_queue); + init_waitqueue_head(&hidg->read_queue); +@@ -954,10 +1003,6 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f) + device_destroy(hidg_class, MKDEV(major, hidg->minor)); + cdev_del(&hidg->cdev); + +- /* disable/free request and end point */ +- usb_ep_disable(hidg->in_ep); +- free_ep_req(hidg->in_ep, hidg->req); +- + usb_free_all_descriptors(f); + } + + +From 5df301bee659e92133e86c68b5a0a89103836c12 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 12 Jul 2017 17:34:59 +0100 +Subject: [PATCH 305/305] fixups from rpi-4.9.y + +--- + drivers/hv/channel.c | 5 ----- + drivers/i2c/busses/i2c-bcm2835.c | 4 +++- + 2 files changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c +index 9aff4f6f5423a3b03fa834d4f69d4bb5cbc07a07..1606e7f08f4b36750be747feb5d0e9f36b3e6dd0 100644 +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -506,11 +506,6 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) + + wait_for_completion(&info->waitevent); + +- if (channel->rescind) { +- ret = -ENODEV; +- goto post_msg_err; +- } +- + post_msg_err: + /* + * If the channel has been rescinded; +diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c +index 8642f580ce41803bd22c76a0fa80d083d0747be1..47167f403cc8329bd811b47c7011c299b8ecafee 100644 +--- a/drivers/i2c/busses/i2c-bcm2835.c ++++ b/drivers/i2c/busses/i2c-bcm2835.c +@@ -279,7 +279,9 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) + } + + if (val & BCM2835_I2C_S_DONE) { +- if (i2c_dev->curr_msg->flags & I2C_M_RD) { ++ if (!i2c_dev->curr_msg) { ++ dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n"); ++ } else if (i2c_dev->curr_msg->flags & I2C_M_RD) { + bcm2835_drain_rxfifo(i2c_dev); + val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); + } diff --git a/projects/RPi2/patches/linux/linux-01-RPi_support.patch b/projects/RPi2/patches/linux/linux-01-RPi_support.patch index fe35e11120..3aeabbe929 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 79015824ce4b54ba9699bed89dc186b3c50b762e Mon Sep 17 00:00:00 2001 +From 3e3e899278bea795e955bec7c8436d58e29a12bd Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/269] smsx95xx: fix crimes against truesize +Subject: [PATCH 001/305] 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. @@ -48,10 +48,10 @@ index 831aa33d078ae7d2dd57fdded5de71d1eb915f99..b77935bded8c0ff7808b00f170ff10e5 usbnet_skb_return(dev, ax_skb); } -From 732a0b24284eb08d1265a280c39f08e5fa57bd9a Mon Sep 17 00:00:00 2001 +From 761f30fd312357c5e8397565a70931536118a8ae Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 002/269] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 002/305] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -94,10 +94,10 @@ index b77935bded8c0ff7808b00f170ff10e594300ad0..693f163684de921404738e33244881e0 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From 43376d16055cd5782e3b3ced15da7c6cd0f5bf60 Mon Sep 17 00:00:00 2001 +From 3aa7ecebbe0720eaa1a5fd216f5244af7cbfb1a0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 003/269] Allow mac address to be set in smsc95xx +Subject: [PATCH 003/305] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -193,10 +193,10 @@ index 693f163684de921404738e33244881e0aab92ec9..df60c989fc229bf0aab3c27e95ccd453 eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From caec1794edbfc3ab80abdcb3d65a47f885c8fe87 Mon Sep 17 00:00:00 2001 +From 42ea42facfb41779b87d74a36f8ca050dcb3f5c5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 004/269] Protect __release_resource against resources without +Subject: [PATCH 004/305] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -224,10 +224,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From b486dc6bb81c88815f8ed3fcb9662e1d931341aa Mon Sep 17 00:00:00 2001 +From cc04a45be26f4f522ba621a49cdb0c82369c00e4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 005/269] mm: Remove the PFN busy warning +Subject: [PATCH 005/305] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -239,10 +239,10 @@ Signed-off-by: Eric Anholt 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 5b06fb385dd714847143bc15a07fd086ff343992..83ae950cff28bc79c46b7acf35e0af8a3c7715bc 100644 +index 56df8c24689db1433a7e0df6ad8903b4b3f8a294..f85430ac34de36ff1d087cf2159cd341fbebfe38 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7324,8 +7324,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, +@@ -7335,8 +7335,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, /* Make sure the range is really isolated. */ if (test_pages_isolated(outer_start, end, false)) { @@ -252,10 +252,10 @@ index 5b06fb385dd714847143bc15a07fd086ff343992..83ae950cff28bc79c46b7acf35e0af8a goto done; } -From d19c9df4f4c53747d9077428647b8020460f88ec Mon Sep 17 00:00:00 2001 +From 5529625939f2c81efac0e28b10ae94a95a215dd7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 006/269] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 006/305] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -282,10 +282,10 @@ index d96b2c947e74e3edab3917551c64fbd1ced0f34c..93e3f7660c4230c9f1dd3b195958cb49 #endif } else if (stat) { -From 2acf37b5d17ebfbb754f21fb4bfb30cc3cbf91f4 Mon Sep 17 00:00:00 2001 +From b5d5f6d0afc1ad128422bd7b4db4b4031fc82389 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 007/269] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 007/305] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -414,10 +414,10 @@ index 44d7c38dde479d771f3552e914bf8c1c1f5019f7..42ff5e6a8e0d532f5b60a1e7af7cc4d9 } -From b4d77f69db5e28050db4de7b62217f2aa298ab47 Mon Sep 17 00:00:00 2001 +From 7090f3d2365c4d5fa4044308e4a35a28ac6bc890 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 008/269] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 008/305] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -516,10 +516,10 @@ index 42ff5e6a8e0d532f5b60a1e7af7cc4d941bd5008..eccf6ed025299cb480884f5bcbe77abf for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From a89119580285bc108c1507723ec5b0ab511be9ff Mon Sep 17 00:00:00 2001 +From 033f11d95c4c94959312bf3496775e744d0437e8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 009/269] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 009/305] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -540,10 +540,10 @@ index 2e05046f866bd01bf87edcdeff0d5b76d4d0aea7..d780491b8013a4e97fa843958964454e }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From f48bb049bc5cd3efe385c0202f268b65a1e824f8 Mon Sep 17 00:00:00 2001 +From 4b59d984cba365c9778f6f4cde0cc4df274e26af Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 010/269] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 010/305] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -563,10 +563,10 @@ index e8819aa20415603c80547e382838a8fa3ce54792..cf9c7d2e3f95e1a19410247a89c2e49c for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From 52fceb45cd09ed8a6169a6ef43089e3dcf4b0fff Mon Sep 17 00:00:00 2001 +From 98fedd06e2d9c221bfec769304d6a582362a890e Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 011/269] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 011/305] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -588,10 +588,10 @@ index fa77165fab2c1348163979da507df17e7168c49b..d11e2e4ea189466e686d762cb6c6fef9 .can_sleep = false, }; -From abef3b2d3950764fc95d2677a60725826a8d8697 Mon Sep 17 00:00:00 2001 +From 3edbafe419f3b148f9e975461cb384df8fed0f5e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 012/269] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 012/305] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -737,10 +737,10 @@ index d11e2e4ea189466e686d762cb6c6fef9111ecf8e..107ad7d58de8f8a7f55e09c9cdcf7d66 }, }; -From ea406cc2d3889cbdaa8049cd190d030d6340d085 Mon Sep 17 00:00:00 2001 +From db0f201b31994fdda1cca0bb3f416c5bc7a79c16 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 013/269] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 013/305] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -767,10 +767,10 @@ index 107ad7d58de8f8a7f55e09c9cdcf7d66fa7ab66b..644bdecbcfcb79d3b84a33769265fca5 pc->irq_data[i].irqgroup = i; -From 7d03ef81a2071d491f72c3361b6638efd4e8f490 Mon Sep 17 00:00:00 2001 +From 5159d742f6efcf74f8e99f867064b88595eeb2ad Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 May 2016 12:32:47 +0100 -Subject: [PATCH 014/269] pinctrl-bcm2835: Return pins to inputs when freed +Subject: [PATCH 014/305] 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 @@ -811,10 +811,10 @@ index 644bdecbcfcb79d3b84a33769265fca5d3d0c9e5..81a66cba2ab0f7e3ae179de7edd10122 .get_function_name = bcm2835_pmx_get_function_name, .get_function_groups = bcm2835_pmx_get_function_groups, -From d85d172287e58dbb99e40666d9822d6db01e1f5c Mon Sep 17 00:00:00 2001 +From 43c8c89b397aba792c0b5298adeb7b82d83355df Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 015/269] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 015/305] 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 @@ -895,10 +895,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 2586dbdfee1bc39270dd390e5e8bef0e0e506ffc Mon Sep 17 00:00:00 2001 +From acae2ee6b74f5333d0845f1956810c58911f3777 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 016/269] spi-bcm2835: Disable forced software CS +Subject: [PATCH 016/305] 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 @@ -932,10 +932,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From 2648dc560f4a9c92eed36c537880640ae2de0173 Mon Sep 17 00:00:00 2001 +From a344d6589055f9fa8a1cb1c978bc7fed6a819ac3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 017/269] spi-bcm2835: Remove unused code +Subject: [PATCH 017/305] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -1023,10 +1023,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From 8fe2ebf8cbfb79647aa63d7cc8d76ffecc585628 Mon Sep 17 00:00:00 2001 +From ca1cda118deb5778e4c9d50c400ffffb2a725e61 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 018/269] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 018/305] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1079,10 +1079,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From 14fd76962dee82784349d1a39a7f419e046acf88 Mon Sep 17 00:00:00 2001 +From 997cbdd8dcb0ab73ed3ee664f8a29ca68e82cfd3 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 019/269] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 019/305] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1113,7 +1113,7 @@ index 141aefbe37ec93d1f4f38d1be5e2cf8d93266725..9c931d36c6a499a02f4f215f8cd77d3f select DMA_VIRTUAL_CHANNELS diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c -index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538bac3892a4d 100644 +index 6204cc32d09c5096df8aec304c3c37b3bcb6be44..599c218dc8a73172dd4bd4a058fc8f95a73f982f 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -37,6 +37,7 @@ @@ -1132,7 +1132,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba struct bcm2835_dmadev { struct dma_device ddev; -@@ -922,6 +924,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) +@@ -925,6 +927,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(base)) return PTR_ERR(base); @@ -1142,7 +1142,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba od->base = base; -@@ -959,6 +964,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) +@@ -962,6 +967,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev) goto err_no_dma; } @@ -1152,7 +1152,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba /* get irqs for each channel that we support */ for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) { /* skip masked out channels */ -@@ -1033,6 +1041,7 @@ static int bcm2835_dma_remove(struct platform_device *pdev) +@@ -1036,6 +1044,7 @@ static int bcm2835_dma_remove(struct platform_device *pdev) { struct bcm2835_dmadev *od = platform_get_drvdata(pdev); @@ -1160,7 +1160,7 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba dma_async_device_unregister(&od->ddev); bcm2835_dma_free(od); -@@ -1048,7 +1057,22 @@ static struct platform_driver bcm2835_dma_driver = { +@@ -1051,7 +1060,22 @@ static struct platform_driver bcm2835_dma_driver = { }, }; @@ -1185,10 +1185,10 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From d696a17375d536f12298e92daceb600dc76204d4 Mon Sep 17 00:00:00 2001 +From af5c6e9c706e0ae8431707ac49c592d8e9fc32dd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 020/269] firmware: Updated mailbox header +Subject: [PATCH 020/305] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 11 +++++++++++ @@ -1251,10 +1251,10 @@ index 3fb357193f09914fe21f8555a4b8613f74f22bc3..227a107214a02deadcca3db202da265e RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From af5f7cea1b68d9493451c236bfd885b874e5abb4 Mon Sep 17 00:00:00 2001 +From 4802def18f9314236d353b81300807540c3d6ce7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 021/269] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 021/305] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -1292,10 +1292,10 @@ index 2acaa77ad482a99f28ea64ea43c891501125304c..d13cbbf5bbe06314bfdf103ff85d5cd7 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From bc8a0df1f9fa1ab79f34d941d6849d7468d79469 Mon Sep 17 00:00:00 2001 +From b043b445cf8cca09c5e86f5f6ccf081d4d32b9c0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 022/269] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 022/305] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1315,10 +1315,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From f4109d9f80f848317c141ea72bf2a3d4d0a411a3 Mon Sep 17 00:00:00 2001 +From b2c093aaaae250966a741fa5729b8777cd19739b 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 023/269] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 023/305] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1442,10 +1442,10 @@ index 4dddd8298a227d64862f2e92954a465f2e44b3f6..1f545e024422f59280932713e6a1b051 register_restart_handler(&wdt->restart_handler); if (pm_power_off == NULL) -From 92fd7c705b975f380ed3b4882e24f7f9d32e2f58 Mon Sep 17 00:00:00 2001 +From ac2a2b6c3e08bb1d4336e235090b6f1ad03d6420 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 024/269] reboot: Use power off rather than busy spinning when +Subject: [PATCH 024/305] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1468,10 +1468,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From ba07abff2715476c89b49f06063c3a16bd688ea6 Mon Sep 17 00:00:00 2001 +From 3f9fa51201312e1972e06045610ed3756b033fb2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 025/269] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 025/305] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1490,10 +1490,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..e037a6dd79d1881a09e3ca9115782709 help This enables support for the RPi power domains which can be enabled -From 7f075a5e8d20e793329859e52b28f83a8aa5fe79 Mon Sep 17 00:00:00 2001 +From 7f4f8dcf7dfaac04cd711321d329e8bf820a859a Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 026/269] Register the clocks early during the boot process, so +Subject: [PATCH 026/305] 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. @@ -1538,10 +1538,10 @@ index d13cbbf5bbe06314bfdf103ff85d5cd73cbf7f7a..a99ccf9f056d3a3e7c482339e08483f3 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From ea22a6e92e62ecf4466cf0d9eae0ee772e8183dc Mon Sep 17 00:00:00 2001 +From fc20b0621026f5be366f1d23f1f227ab980250ee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 027/269] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 027/305] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1567,10 +1567,10 @@ index 574211a495491d9d6021dcaefe4274a63ed02055..e66c0fca8c6090e32f72796c0877a1cf err = hwrng_register(&bcm2835_rng_ops); if (err) { -From a6c91433ce9d179a872ebbd3b6b8712ec0dfd2a1 Mon Sep 17 00:00:00 2001 +From 7f4f5acd4e06e1c46f47d776e4f0ad6c241f7530 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 028/269] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 028/305] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -1590,10 +1590,10 @@ index 179219845dfcdfbeb586d12c5ec1296095d9fbf4..e0743e44f84188667a0c322e8c3d36f1 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From 0d7da923aa7bb70d36b7dcb55d2285cc18bbeb00 Mon Sep 17 00:00:00 2001 +From 047a10c8f73616aca8769393b4833ef0adb911e1 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 029/269] BCM2835_DT: Fix I2S register map +Subject: [PATCH 029/305] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -1631,10 +1631,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 4f4d87ae96216a2c749f5c60e5f8b208b9b60e6c Mon Sep 17 00:00:00 2001 +From 539882daae6a62c09c129b1753e1aed59554ee03 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 030/269] Main bcm2708/bcm2709 linux port +Subject: [PATCH 030/305] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1841,10 +1841,10 @@ index cfb4b4496dd9f61362dea012176c146120fada07..d9c6c217c4d6a2408abe2665bf7f2700 MODULE_AUTHOR("Lubomir Rintel "); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); -From 7bff94f3aa10014a64ff85746934309d4834409d Mon Sep 17 00:00:00 2001 +From 4c1833856221253fa3a8f517abc5119c6b061bd6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 031/269] Add dwc_otg driver +Subject: [PATCH 031/305] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2546,10 +2546,10 @@ index 358ca8dd784fe43700ae070764fa783500a792fe..abaac7c7142d8887c1516957fc52162c return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index 579900640faabb84b68f344951193f860fab598d..1704f1d8c2f5d174e4b059dd7fda6b75e6c3ec0d 100644 +index f953d6d647f245be5452f6db70ea503552dff525..e17e9e094e5a85798579b25b34bd2b6f7f18c898 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5025,7 +5025,7 @@ static void port_event(struct usb_hub *hub, int port1) +@@ -5040,7 +5040,7 @@ static void port_event(struct usb_hub *hub, int port1) if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; @@ -62901,10 +62901,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From 50fa5fe5e07da8f2d41c99486f4bb8c3b7d6cc7f Mon Sep 17 00:00:00 2001 +From ab92478ebf40178f9b6a22b59847fa44b8c24cd8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 032/269] bcm2708 framebuffer driver +Subject: [PATCH 032/305] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66363,10 +66363,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 b5792c84a6067b64d0e594bde8b3b8e699f166d7 Mon Sep 17 00:00:00 2001 +From 8e9b3795a2eb00a19e28a42810bd07d4a3956307 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 033/269] dmaengine: Add support for BCM2708 +Subject: [PATCH 033/305] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66997,10 +66997,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From 31ef18993d95147073260061725da8b7408a5729 Mon Sep 17 00:00:00 2001 +From 6675aab5cec3935e15007c26b05fc2418e0c822d Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 034/269] MMC: added alternative MMC driver +Subject: [PATCH 034/305] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68750,10 +68750,10 @@ index 0000000000000000000000000000000000000000..4fe8d1fe44578fbefcd48f8c327ba3d0 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 099cfb48eaa9d6c2aa9009188d25dfe6c9b3e9c3 Mon Sep 17 00:00:00 2001 +From 4532400c2a5a071cc67a169b5dd4f597bbc65d01 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 035/269] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 035/305] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -71158,10 +71158,10 @@ index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f165144 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 4610911ae7d2ab9c6e51ecb5e5fb5545e1acf083 Mon Sep 17 00:00:00 2001 +From 3ac0cd57a1d960d456be7296f7d4eb3c441839aa Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 036/269] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 036/305] 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, @@ -71297,10 +71297,10 @@ index 73fad83acbcb6a157587180516f9ffe7c61eb7d7..e7c9d3098ac06e3c6554fa3373a311f9 unsigned int erase_shift; /* if erase unit is power 2 */ unsigned int pref_erase; /* in sectors */ -From ff78d0a7689b0a5c4aab838a8acabbad47e0128d Mon Sep 17 00:00:00 2001 +From 57cfa41bb9ca5061d8286f5f2d269aef622aeddc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 037/269] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 037/305] 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 @@ -72636,10 +72636,10 @@ index 0000000000000000000000000000000000000000..be2819d5d41f9d5ed65daf8eedb94c9e + +#endif /* VC_CMA_H */ -From 476d9005edbd948a8650cd9c191438a51d17ea1a Mon Sep 17 00:00:00 2001 +From 5f1ce6ad61187a4e40aedcadb5334a2a024141a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 038/269] bcm2708: alsa sound driver +Subject: [PATCH 038/305] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75374,10 +75374,10 @@ index 0000000000000000000000000000000000000000..af3e6eb690113fc32ce9e06bd2f0f294 + +#endif // _VC_AUDIO_DEFS_H_ -From 97ed9e26481ecb89c62fe2f205308843690fe2d3 Mon Sep 17 00:00:00 2001 +From 6dfa16b231ec746345b5faaf97d2592bc5913843 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 039/269] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 039/305] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -75901,10 +75901,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From ab0ea172ef575913b63f7893a0c41da050b8ad75 Mon Sep 17 00:00:00 2001 +From a06191e7ef0728ca1d031a9a0f5edff0e5207cb1 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 040/269] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 040/305] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -80311,10 +80311,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From e52946361a8e8e795a8001c27a8a5381f045c274 Mon Sep 17 00:00:00 2001 +From 7a02754167032fc87db6eda7d0588967aaed241c Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 041/269] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 041/305] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -80625,10 +80625,10 @@ index 0000000000000000000000000000000000000000..911f5b7393ed48ceed8751f06967ae64 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From 08d0749e9c634b24e4aa793b8f4aa4fcb25470be Mon Sep 17 00:00:00 2001 +From e4a52e521605066b0bb8e49ce44ca5166e009280 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 042/269] Add SMI driver +Subject: [PATCH 042/305] Add SMI driver Signed-off-by: Luke Wren --- @@ -82579,10 +82579,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 11400a6db1c81cbce1bb6dce8d225231f82b6859 Mon Sep 17 00:00:00 2001 +From daee6ffd810b931cfa4dd2b6f60fb8778fbbd012 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 043/269] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 043/305] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -82752,10 +82752,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 74a992992502f182c76e414c4adc46b48b23dc6c Mon Sep 17 00:00:00 2001 +From a29ce213a14be31ca1acfc987de1a4adbd6c23da Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 044/269] Add SMI NAND driver +Subject: [PATCH 044/305] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -83120,10 +83120,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From 911feabd59b70016a059eed6aa5d5103a8777eee Mon Sep 17 00:00:00 2001 +From 944b5bf55e2a73df1cd10e53bd8b93c56cbf7bc9 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 045/269] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 045/305] 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 @@ -83986,10 +83986,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From 2178915a09cce0414ad54d991a3a648eb7d74f19 Mon Sep 17 00:00:00 2001 +From 661d3b6e4a9cab6c1bb641680cfa6c32cb0bb168 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 046/269] Add cpufreq driver +Subject: [PATCH 046/305] Add cpufreq driver Signed-off-by: popcornmix --- @@ -84256,10 +84256,10 @@ index 0000000000000000000000000000000000000000..414fbdc10dfbfc6e4bb47870a7af3fd5 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 321d95c9c599c0c4a3d320c7f22dfa61c19606cf Mon Sep 17 00:00:00 2001 +From 9df33b551c35cfb5a747840252b3758108f71c08 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 047/269] Added hwmon/thermal driver for reporting core +Subject: [PATCH 047/305] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -84425,10 +84425,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From ec44ec502547d427fb6b1bf148dbde31c3000261 Mon Sep 17 00:00:00 2001 +From 91e1d6740ab2f1398f5efb84ac3fb1e3da1c7f4b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 048/269] Add Chris Boot's i2c driver +Subject: [PATCH 048/305] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85093,10 +85093,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From ceb9c52e8528b600055dd8125b9247702a3dd0a6 Mon Sep 17 00:00:00 2001 +From 33ef2dd8967ff3e499a9debb3d5b23f37cedda5f 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 049/269] char: broadcom: Add vcio module +Subject: [PATCH 049/305] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85322,10 +85322,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 89388ba84f0c79ae29ce5c3ca7fd4cbbc7116648 Mon Sep 17 00:00:00 2001 +From d9c0dd6378bb15f7c3215bc46f67451ac28558c8 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 050/269] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 050/305] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85408,10 +85408,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..3f070bd38a91511c986e3fb114b15bd4 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 0cf6d0049c108b7613c4a902694aad08ba74d4c5 Mon Sep 17 00:00:00 2001 +From b56905e0b6a48769d95c5e4a68f03c2633e27580 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 051/269] bcm2835: add v4l2 camera device +Subject: [PATCH 051/305] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -93153,10 +93153,10 @@ index 0000000000000000000000000000000000000000..9d1d11e4a53e510c04a416d92d195a7d + +#endif /* MMAL_VCHIQ_H */ -From 94396fb17f4db40a5ad4a3373005013a9a789cb3 Mon Sep 17 00:00:00 2001 +From 83b77047a0e8f20d11f159e0a92ffc915c814c1f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 052/269] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 052/305] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -93676,10 +93676,10 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + return $trailer; +} -From 9cebc064fccb57147ed38a40fbc85450e817912b Mon Sep 17 00:00:00 2001 +From e15aa78af8c0ac8cc26cebe8f811825495b3cdd2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 053/269] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH 053/305] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. @@ -96530,10 +96530,10 @@ index ad9b05ae698b0495ecbda42ffcf4743555313a27..2595dfda020fd9e03f0beff5006f229d -#define DTC_VERSION "DTC 1.4.1-g53bf130b" +#define DTC_VERSION "DTC 1.4.1-g25efc119" -From 24eaf4ba165808168d4780fc09554965044399e0 Mon Sep 17 00:00:00 2001 +From 41333985a0bbb860dff9ae6359e363f16378ed1f Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 054/269] BCM2708: Add core Device Tree support +Subject: [PATCH 054/305] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -106661,10 +106661,10 @@ index 0a07f9014944ed92a8e2e42983ae43be60b3e471..1967878a843461c3ff1f473b9a030eb0 # Bzip2 -From 9343c744be717bfeb6ff750eedada9ce1962730e Mon Sep 17 00:00:00 2001 +From c1cc5914d43c8861e15e1ebade7beb026968dd3a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 055/269] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 055/305] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -106840,10 +106840,10 @@ index ddfcb2df3656cf0ab6aebd1fa3d624a6ec2e94e9..271563eb835f9018712e2076a88f341d /* Set LED brightness level * Must not sleep. Use brightness_set_blocking for drivers -From adfcfa34ccbb5819fced283fcf792d5daf6df55d Mon Sep 17 00:00:00 2001 +From c8246ac66a521480f4e10dfa69eacbb07bd7ff73 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 056/269] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 056/305] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -107095,10 +107095,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..703fa8a70574323abe2fb32599254582 __u32 dx; /* screen-relative */ __u32 dy; -From 0033178bba78f6f6d2a19a5c6a7b6c201a8e28cf Mon Sep 17 00:00:00 2001 +From 8d87aae72904eb8bcfc2f99cc902f6cc6f749234 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 057/269] Speed up console framebuffer imageblit function +Subject: [PATCH 057/305] 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 @@ -107307,10 +107307,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From ad863573d9b4897c225463b30772858427afc96b Mon Sep 17 00:00:00 2001 +From 4371ec3cf395dbcf5a2cf024be1e2272c98ac997 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 058/269] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 058/305] 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 @@ -107560,10 +107560,10 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 57d3f0cf1f645fd8bd8101fa008525c7591f5bf1 Mon Sep 17 00:00:00 2001 +From e53ec94adef7c06684b9371eb8e0bd725b281178 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 059/269] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 059/305] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -107571,10 +107571,10 @@ Subject: [PATCH 059/269] config: Enable CONFIG_MEMCG, but leave it disabled 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c -index a3d2aad2443f3314396d25086d891eca22317cf8..45db7dee21858fc80e571f463717e51afce4262c 100644 +index 1fde8eec95297ec442a90dfcf59a873d357aa5bf..e22af4287b4ba084a7cfe7b6fcbf28956796b113 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c -@@ -5627,7 +5627,7 @@ int __init cgroup_init_early(void) +@@ -5632,7 +5632,7 @@ int __init cgroup_init_early(void) return 0; } @@ -107583,7 +107583,7 @@ index a3d2aad2443f3314396d25086d891eca22317cf8..45db7dee21858fc80e571f463717e51a /** * cgroup_init - cgroup initialization -@@ -6164,6 +6164,28 @@ static int __init cgroup_no_v1(char *str) +@@ -6169,6 +6169,28 @@ static int __init cgroup_no_v1(char *str) } __setup("cgroup_no_v1=", cgroup_no_v1); @@ -107613,10 +107613,10 @@ index a3d2aad2443f3314396d25086d891eca22317cf8..45db7dee21858fc80e571f463717e51a * css_tryget_online_from_dir - get corresponding css from a cgroup dentry * @dentry: directory dentry of interest -From 800020ec64d0125524ad6900ad9e5e48081520b2 Mon Sep 17 00:00:00 2001 +From 46445638df685e893b7dc180a0a5e2117f67c7e8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 060/269] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 060/305] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -107652,10 +107652,10 @@ index ae83af649a607f67239f1a64bf45dd4b5770cc7d..4a7af9d0b910f59d17421ce14138400d ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From d8a72ba362b98060fdb0ac3da3f195f914c40d27 Mon Sep 17 00:00:00 2001 +From aaef3225c0d839d0bc3a989f2b4d10d9ed31c02b Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 061/269] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 061/305] 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 @@ -108013,10 +108013,10 @@ index 227a107214a02deadcca3db202da265eba1fdd21..b0f6e33bd30c35664ceee057f4c3ad32 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 9b5ec1177407b8ab94ec2e7379f2b3c76443483d Mon Sep 17 00:00:00 2001 +From 5b59da22bd0f92250b3149bd7adc30291db182b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 062/269] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 062/305] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -109591,10 +109591,10 @@ index 333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20..46b787a6474ffa857da9b663948863ec bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 -From 52ee4b138ebb31b1cdc49fac30425d7b6565ee26 Mon Sep 17 00:00:00 2001 +From d0c34721e9d17a8d98e7b23016481e10fa455d0a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 063/269] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 063/305] 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 @@ -109629,10 +109629,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From 7af6a352ddc4a4aebd73719d86b091aa957e42e3 Mon Sep 17 00:00:00 2001 +From 6b76776fb66b3b5cde6d047e0eec336b4389dab9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 064/269] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 064/305] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -110497,10 +110497,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From 6383fcdd234ae04b11f5c6d39bf67be87443744b Mon Sep 17 00:00:00 2001 +From cb63feaccfd98341199e793f3f65cc441bbf886e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 065/269] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 065/305] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -110675,10 +110675,10 @@ index 0000000000000000000000000000000000000000..45f2b770ad9e67728ca599a7445d6ae9 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 26b6f466e82f8cdf82a037c3b4b7a8bdac1f2bca Mon Sep 17 00:00:00 2001 +From 6b6cf37841abc54199e3fb1b173f547592aaa6eb Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 066/269] ASoC: Add support for Rpi-DAC +Subject: [PATCH 066/305] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -110962,10 +110962,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 54bce83bc79f84b40e93f42266daa1c116819246 Mon Sep 17 00:00:00 2001 +From e18a0dd9a5ebab50b34bb532a26fafd53b7a7839 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 067/269] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 067/305] 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 @@ -111014,10 +111014,10 @@ index af95d648265b3e92e345101542b332aee35191d4..513f56ba132929662802d15cdc653af3 .component_driver = { .dapm_widgets = wm8804_dapm_widgets, -From fa059db83ae953d6f104c56b0f118a3c1b95d123 Mon Sep 17 00:00:00 2001 +From d4386447e2b2e4f99c2bb9436d6ed573835cd6a2 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 068/269] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 068/305] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -111361,10 +111361,10 @@ index 0000000000000000000000000000000000000000..19dc953b7227ba86123fc7a2ba654499 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 976d11db746a5621b01a13ac1fc1d6829a3033fa Mon Sep 17 00:00:00 2001 +From 02f571d1d2a6e825318ac67aafd339788d42aae8 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 069/269] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 069/305] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -111694,10 +111694,10 @@ index 0000000000000000000000000000000000000000..4e8e6dec14bcf4a1ff286c43742d4097 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From cdb9c4a0d174c8e35d6ff6c0a61cd7bf5a27052b Mon Sep 17 00:00:00 2001 +From bcadd273625cce0cfe8cd7e970f10f68e65a19a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jul 2016 17:06:50 +0100 -Subject: [PATCH 070/269] iqaudio-dac: Compile fix - untested +Subject: [PATCH 070/305] iqaudio-dac: Compile fix - untested --- sound/soc/bcm/iqaudio-dac.c | 6 +++++- @@ -111721,10 +111721,10 @@ index 4e8e6dec14bcf4a1ff286c43742d4097249d6777..aa15bc4b49ca95edec905fddd8fd0a6d if (dapm->dev != codec_dai->dev) return 0; -From 32645a1dac87204737663854c325811cd41a413e Mon Sep 17 00:00:00 2001 +From c71d125bd3281458f54a7ecec9ce67db0af1d68d Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 071/269] Added support for HiFiBerry DAC+ +Subject: [PATCH 071/305] 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. @@ -112354,10 +112354,10 @@ index 72b19e62f6267698aea45d2410d616d91c1825cb..c6839ef6e16754ed9de2698507b8986a dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From 5fa4f242e074f3f7ca33ef31c099c93a6d1cb25b Mon Sep 17 00:00:00 2001 +From 10c9bf4d92fbe2094009bc00a9969183a6e4afaa Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 072/269] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 072/305] 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. @@ -113197,10 +113197,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From b620a6dc0b07848c1ececeb779b8ad87b75886f1 Mon Sep 17 00:00:00 2001 +From 0b5f4e14db59fad8fce397f3020abf3f47a66521 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 073/269] Update ds1307 driver for device-tree support +Subject: [PATCH 073/305] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -113227,10 +113227,10 @@ index 4e31036ee2596dec93accd26f627c5b95591ae9f..b92044cf03e750afa521a93519500e9d .driver = { .name = "rtc-ds1307", -From 4bd384e4f3039ac2b10763e5fce5452d9a85b8a1 Mon Sep 17 00:00:00 2001 +From 8a110c28585805d903c1089c63c3c53ad46593f1 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 074/269] Add driver for rpi-proto +Subject: [PATCH 074/305] 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 @@ -113446,10 +113446,10 @@ index 0000000000000000000000000000000000000000..9db678e885efd63d84d60a098a84ed67 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 426ea22201429e2d4ea2e32817eb2517d5798f5f Mon Sep 17 00:00:00 2001 +From c6d0651bb58713a27105d5d2884c2a3433d2c368 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 075/269] RaspiDAC3 support +Subject: [PATCH 075/305] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -113692,10 +113692,10 @@ index 0000000000000000000000000000000000000000..dd9eeea2af0382307f437e6db09d1546 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From d3ffc86453d9c6faaad26f4a1b5c679d140597cd Mon Sep 17 00:00:00 2001 +From a424d10c2f501afda3a85a8788dd62e434e6cf8b Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 076/269] Add Support for JustBoom Audio boards +Subject: [PATCH 076/305] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -114149,10 +114149,10 @@ index 0000000000000000000000000000000000000000..91acb666380faa3c0deb2230f8a0f8bb +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From 5ac19586717d639a422648b5e8ab74ee3ab21432 Mon Sep 17 00:00:00 2001 +From 2b3b4f246c8ab3be270564b0b051f75c5ce22c65 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 077/269] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 077/305] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -114334,10 +114334,10 @@ index 0000000000000000000000000000000000000000..6e2ee027926ee63c89222f75ceb89e3d +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From e3a8db083e0d33b1ca2bd8359beb495681192333 Mon Sep 17 00:00:00 2001 +From 5494f36deb3bc2e0a5cd0e72ee577592a265d928 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 078/269] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 078/305] 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. @@ -114588,10 +114588,10 @@ index 0000000000000000000000000000000000000000..ef54e0f07ea03f59e9957b5d98f3e7fd +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From 2ffdbfa91860d7c0fd6e7bb34a65726e35fd41eb Mon Sep 17 00:00:00 2001 +From 1412b1ddb330ecace845e633ae884ae145bdd062 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 079/269] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 079/305] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -114891,10 +114891,10 @@ index 0000000000000000000000000000000000000000..9b6e829bcb5b1762a853775e78163196 +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From 1cdbc4130e598ad8cd32503e38339ed3a9e99a58 Mon Sep 17 00:00:00 2001 +From 4b728e675f4f88678dc92d8daaec2d5ea2cd15ca Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 080/269] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 080/305] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -115367,10 +115367,10 @@ index 0000000000000000000000000000000000000000..446796e7e4c14a7d95b2f2a01211d9a0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From 8a2204cd8e782bc5d3aaef71b0c1e67d914d0b56 Mon Sep 17 00:00:00 2001 +From 7a38bc81a17b39e61764018a65d6ffc172e0b407 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 081/269] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 081/305] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -115543,10 +115543,10 @@ index 0000000000000000000000000000000000000000..89e65317512bc774453ac8d0d5b0ff98 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 48b62591ffd63a84b65d6a31efc9c993db75176f Mon Sep 17 00:00:00 2001 +From a5cf02d9e6e60ca249c48da7c61beace717dd97d Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 082/269] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 082/305] 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, @@ -115753,10 +115753,10 @@ index 0000000000000000000000000000000000000000..8e8e62e5a36a279b425ed4655cfbac99 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From 8d0c8d76aca2bea8df8fca2fc7bf6b6cd4166782 Mon Sep 17 00:00:00 2001 +From 39c4147b35866243f166186b54d5df30cb02b51c Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 083/269] Support for Blokas Labs pisound board +Subject: [PATCH 083/305] Support for Blokas Labs pisound board Pisound dynamic overlay (#1760) @@ -116933,10 +116933,10 @@ index 0000000000000000000000000000000000000000..4b8545487d06e4ea70073a5d063fb231 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From 4c67995f8c22187e16ef3ff79e8b07108b8bb007 Mon Sep 17 00:00:00 2001 +From 54d0ef5494c9feab2e25c81f1a747af2df5bfe07 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 084/269] rpi_display: add backlight driver and overlay +Subject: [PATCH 084/305] 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 @@ -117105,10 +117105,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From 61fb1bd55d8a32aba77c179589a9111cd6b7946f Mon Sep 17 00:00:00 2001 +From fa7303c635e18453a2a53be5cf2eb6f90e40eaba Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 085/269] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 085/305] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -117382,10 +117382,10 @@ index b0f6e33bd30c35664ceee057f4c3ad32b914291d..e92278968b2b979db2a1f855f70e7aaf RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 3cf12d62433ad0b06197a895e7a5524bc139a661 Mon Sep 17 00:00:00 2001 +From 72dcc1ef21da085e822a165cde58db574b3cbada Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 086/269] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 086/305] 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 @@ -117414,10 +117414,10 @@ index e2c33b9528d82ed7a2c27d083d7b1d222da68178..5a11ff833e1fd112ba04df3a427cd94b uap->old_cr = 0; uap->port.dev = dev; -From 770a744fce53d99aadfa995ea826112730df9584 Mon Sep 17 00:00:00 2001 +From 013d6b8242981329098c330cfc5b564093c7b6da Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 087/269] OF: DT-Overlay configfs interface +Subject: [PATCH 087/305] 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. @@ -117849,10 +117849,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From 7e65bb1597e90ed605c43e65e289064922ea1eec Mon Sep 17 00:00:00 2001 +From 6fbb2ff08ab9a34bffae14fc7471aed8a955b782 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 088/269] brcm: adds support for BCM43341 wifi +Subject: [PATCH 088/305] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -117899,7 +117899,7 @@ Signed-off-by: Phil Elwell 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -index 78d9966a3957b2b934fe6b21de5cade494ec2839..3fcb1887b2d312e050c02e9fe66ea20f48f0abcb 100644 +index 0f5dde1f224831ab68ece84a94fba6aca97b9bc0..121a697455caba5a9e15145c96c7fb7055dd5ad7 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2756,6 +2756,8 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, @@ -117930,7 +117930,7 @@ index 78d9966a3957b2b934fe6b21de5cade494ec2839..3fcb1887b2d312e050c02e9fe66ea20f if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) brcmf_fil_iovar_int_set(ifp, "mbss", 0); brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, -@@ -6737,12 +6742,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +@@ -6739,12 +6744,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], struct brcmfmac_pd_cc *country_codes; struct brcmfmac_pd_cc_entry *cc; s32 found_index; @@ -117951,7 +117951,7 @@ index 78d9966a3957b2b934fe6b21de5cade494ec2839..3fcb1887b2d312e050c02e9fe66ea20f } if ((alpha2[0] == ccreq->country_abbrev[0]) && -@@ -6766,10 +6777,14 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +@@ -6768,10 +6779,14 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], brcmf_dbg(TRACE, "No country code match found\n"); return -EINVAL; } @@ -117983,7 +117983,7 @@ index 3e15d64c64813513bc22202dd9e468588699abb0..4051780f64f44a5ce522babe6c371a1b MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -index 2458e6e05276c3ff7cb067bdfa1edf34a1eec09b..d13826095c09f5b4037625371fe648900c9d670a 100644 +index 8744b9beda336f468250577243514c942b9fc3ed..3a993a57b69a52ebb40f7ce7d8358e05ad0f5f90 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -604,6 +604,7 @@ BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt"); @@ -118015,10 +118015,10 @@ index d0407d9ad7827cd756b6311410ffe2d9a7cacc78..f1fb8a3c7a3211e8429585861f2f42e0 #define BRCM_CC_4335_CHIP_ID 0x4335 #define BRCM_CC_4339_CHIP_ID 0x4339 -From 7b41569a2a8b2c8073c9877fd4bcee35672f946f Mon Sep 17 00:00:00 2001 +From c4899a1421c447a0d4cb45e3cd362367731c9429 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 089/269] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 089/305] 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. @@ -118041,10 +118041,10 @@ index 0879d64b1caf58afb6e5d494c07d9ab7e7cdf983..5161ab30fd533d50f516bb93d5b9f402 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From b7ef0b7ecd67f609c172d13d969f63ea90aa1618 Mon Sep 17 00:00:00 2001 +From 19541411f5b83653d8660e43913300fda74ac3d9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 090/269] config: Add default configs +Subject: [PATCH 090/305] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1297 +++++++++++++++++++++++++++++++++++ @@ -120671,10 +120671,10 @@ index 0000000000000000000000000000000000000000..8acee9f31202ec14f2933d92dd70831c +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 444787979857bef59d2c9e7c3c10db80591bfb62 Mon Sep 17 00:00:00 2001 +From 06331145cccde21851eb1296eb1fe473ede28423 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 091/269] Add arm64 configuration and device tree differences. +Subject: [PATCH 091/305] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -122089,10 +122089,10 @@ index 0000000000000000000000000000000000000000..d7406f5a4620151044b8f716b4d10bb8 +CONFIG_LIBCRC32C=y +CONFIG_BCM2708_VCHIQ=n -From 46933ecb02977c39375083ebae2edb806ea9ba38 Mon Sep 17 00:00:00 2001 +From d073a5d3feb542d3c6411faff568c977af44df4c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 15:05:11 +0000 -Subject: [PATCH 092/269] vchiq_arm: Tweak the logging output +Subject: [PATCH 092/305] vchiq_arm: Tweak the logging output Signed-off-by: Phil Elwell --- @@ -122167,10 +122167,10 @@ index 2c98da4307dff994a00dc246574ef0aaee05d5da..160db24aeea33a8296923501009c1f02 switch (type) { -From bc9e796c9a5a6d54ab745ad2c60375a30fea36fa Mon Sep 17 00:00:00 2001 +From ef35d1e5ed0639a8d421189af5519d00d062620b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 14:16:25 +0000 -Subject: [PATCH 093/269] vchiq_arm: Access the dequeue_pending flag locked +Subject: [PATCH 093/305] vchiq_arm: Access the dequeue_pending flag locked Reading through this code looking for another problem (now found in userland) the use of dequeue_pending outside a lock didn't seem safe. @@ -122228,10 +122228,10 @@ index 7b6cd4d80621e38ff6d47fcd87b45fbe9cd4259b..d8669fa7f39b077877eca1829ba9538b return add_completion(instance, reason, header, user_service, -From 51412de6b7ff20c5c2c9ba2bb91e605217f759fd Mon Sep 17 00:00:00 2001 +From 03536abed6a3de02b8eec7deb319c920979fe961 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 20:53:47 +0000 -Subject: [PATCH 094/269] vchiq_arm: Service callbacks must not fail +Subject: [PATCH 094/305] vchiq_arm: Service callbacks must not fail Service callbacks are not allowed to return an error. The internal callback that delivers events and messages to user tasks does not enqueue them if @@ -122257,10 +122257,10 @@ index d8669fa7f39b077877eca1829ba9538bf2e21a82..54552c6ce54f413c9781ba279b936f98 DEBUG_TRACE(SERVICE_CALLBACK_LINE); } -From 214a4a348965b0dfc215a4eb793fbe8376943073 Mon Sep 17 00:00:00 2001 +From fff4b063b230fad7bac57817da9a16993bf3e9ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 13:49:32 +0100 -Subject: [PATCH 095/269] vchiq_arm: Add completion records under the mutex +Subject: [PATCH 095/305] vchiq_arm: Add completion records under the mutex An issue was observed when flushing openmax components which generate a large number of messages returning @@ -122323,10 +122323,10 @@ index 54552c6ce54f413c9781ba279b936f98be4f47b0..bde8955b7d8505d73579b77b5b392154 return VCHIQ_SUCCESS; -From 0178bac3eaccf0df78011c49309d0d7bfec7c610 Mon Sep 17 00:00:00 2001 +From 143c06724d173b818b005f707a77a1c96e8c8049 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jun 2016 13:51:44 +0100 -Subject: [PATCH 096/269] vchiq_arm: Avoid use of mutex in add_completion +Subject: [PATCH 096/305] vchiq_arm: Avoid use of mutex in add_completion Claiming the completion_mutex within add_completion did prevent some messages appearing twice, but provokes a deadlock caused by vcsm using @@ -122520,10 +122520,10 @@ index 160db24aeea33a8296923501009c1f02bc41e599..71a3bedc55314f3b22dbff40c05dedf0 up(&state->slot_available_event); } -From 5e9ea98df8770d36acc27e6e57f3fdd17220cad1 Mon Sep 17 00:00:00 2001 +From a305f5385dd8ac01dc644578e6ea5e6487aed125 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:14:10 -0700 -Subject: [PATCH 097/269] staging/vchi: Convert to current get_user_pages() +Subject: [PATCH 097/305] staging/vchi: Convert to current get_user_pages() arguments. Signed-off-by: Eric Anholt @@ -122560,10 +122560,10 @@ index e5cdda12c7e5c35c69eb96991cfdb8326def167f..085d37588c59198b4e5f00b9249bb842 num_pages, /* len */ 0, /* gup_flags */ -From 4918a6e968d302e1572a148205d0899de121deda Mon Sep 17 00:00:00 2001 +From a099d8b2a6794b5572a188fa64225a47344e3b50 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:16:03 -0700 -Subject: [PATCH 098/269] staging/vchi: Update for rename of +Subject: [PATCH 098/305] staging/vchi: Update for rename of page_cache_release() to put_page(). Signed-off-by: Eric Anholt @@ -122608,10 +122608,10 @@ index 085d37588c59198b4e5f00b9249bb8421695854f..5a2b8fb459ebe086ec229f37b6381bdb kfree(pages); } -From 98f7ab2f25b47f304b724dab8c432c67b1582369 Mon Sep 17 00:00:00 2001 +From cda9154ea37aa44fbdfc23dfffbd06ac5826f060 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:21:17 -0700 -Subject: [PATCH 099/269] drivers/vchi: Remove dependency on CONFIG_BROKEN. +Subject: [PATCH 099/305] drivers/vchi: Remove dependency on CONFIG_BROKEN. The driver builds now. @@ -122633,10 +122633,10 @@ index 9676fb29075a457109e4d4235f086987aec74868..db8e1beb89f9f8c48ea5964016c8285e help Kernel to VideoCore communication interface for the -From 056024e6d4a399172716ea53bae6b6726bf4f741 Mon Sep 17 00:00:00 2001 +From c914108e446efd2c072e65d05483603de46643ce Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 100/269] raspberrypi-firmware: Export the general transaction +Subject: [PATCH 100/305] raspberrypi-firmware: Export the general transaction function. The vc4-firmware-kms module is going to be doing the MBOX FB call. @@ -122680,10 +122680,10 @@ index e92278968b2b979db2a1f855f70e7aafb224fa98..09e3d871d110eb0762ebdb5ea3293537 #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From 8b94268c00fd97fe98a5149b4a0c5f81ba2b72e6 Mon Sep 17 00:00:00 2001 +From 2abbd865bdb3a6188f3aa1369194819da9b452f5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:18:09 +0100 -Subject: [PATCH 101/269] raspberrypi-firmware: Define the MBOX channel in the +Subject: [PATCH 101/305] raspberrypi-firmware: Define the MBOX channel in the header. Signed-off-by: Eric Anholt @@ -122705,10 +122705,10 @@ index 09e3d871d110eb0762ebdb5ea329353738d58661..2859db09e25bb945251e85edb39bc434 enum rpi_firmware_property_status { -From 2454c6f20b2c892d6807aa67c3840605ffcf64ad Mon Sep 17 00:00:00 2001 +From ecbaf3c47d97ca7611f76806ad03068197b015cf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 08:39:33 +0100 -Subject: [PATCH 102/269] drm/vc4: Add a mode for using the closed firmware for +Subject: [PATCH 102/305] drm/vc4: Add a mode for using the closed firmware for display. Signed-off-by: Eric Anholt @@ -123475,10 +123475,10 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + }, +}; -From d590e0a75b1bdf54ec40fa5cba6fe1456fa1c35b Mon Sep 17 00:00:00 2001 +From 89236de15f88a9a24ef97a70bc5eff025d09f443 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 103/269] i2c: bcm2835: Protect against unexpected TXW/RXR +Subject: [PATCH 103/305] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123603,10 +123603,10 @@ index f283b714aa79e2e4685ed95b04b6b289f7e9eee7..d2ba1a4de36af512e8e3c97251bd3537 return -ETIMEDOUT; } -From d6ce79564eb31ba3fe92772b6e19eb1d7fff372d Mon Sep 17 00:00:00 2001 +From 8b44abd412cb0be1485ad29dfb66158863c139d8 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 104/269] i2c: bcm2835: Use dev_dbg logging on transfer errors +Subject: [PATCH 104/305] i2c: bcm2835: Use dev_dbg logging on transfer errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123638,10 +123638,10 @@ index d2ba1a4de36af512e8e3c97251bd3537ae61591a..54d510abd46a117c9238fc6d7edec840 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From d0042963f07b66371d97dd146f8c0c67f1925de8 Mon Sep 17 00:00:00 2001 +From e68f89a3f00f0b0c1b1012fdfcf522276891cc7a 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 105/269] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK +Subject: [PATCH 105/305] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123685,10 +123685,10 @@ index 54d510abd46a117c9238fc6d7edec84019d1f60d..565ef69ce61423544dc0558c85ef318b if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) -From a57cd62b8f6e515caf6ac5f86a22dc0472e1ec1b Mon Sep 17 00:00:00 2001 +From e77f93c32b40bc783991491f41e5fe7d844b9a0c 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 106/269] i2c: bcm2835: Add support for Repeated Start +Subject: [PATCH 106/305] i2c: bcm2835: Add support for Repeated Start Condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123870,10 +123870,10 @@ index 565ef69ce61423544dc0558c85ef318b0ae9c324..241e08ae7c27cec23fad3c1bf3ebad3a static u32 bcm2835_i2c_func(struct i2c_adapter *adap) -From a31352ef30492721335e4ca695e4b74d380db80e Mon Sep 17 00:00:00 2001 +From a8fa929731451ea6d7f618dc542b0fea3b3d91c6 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 107/269] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT +Subject: [PATCH 107/305] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123910,10 +123910,10 @@ index 241e08ae7c27cec23fad3c1bf3ebad3a4d2a8e6f..d2085dd3742eabebc537621968088261 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -From 1e22c3a0caef822de0c25ca6f93562e52a84d992 Mon Sep 17 00:00:00 2001 +From 510a4fc68acdecde66a2727ff6a62ee7fcaa0f55 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 108/269] i2c: bcm2835: Add support for dynamic clock +Subject: [PATCH 108/305] i2c: bcm2835: Add support for dynamic clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124029,10 +124029,10 @@ index d2085dd3742eabebc537621968088261f8dc7ea8..c3436f627028477f7e21b47e079fd5ab irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq) { -From f3df2e3003af536614907cb0db26d42aa339396d Mon Sep 17 00:00:00 2001 +From 8c45feb7add7280d137dd3420256068284b0f604 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 109/269] i2c: bcm2835: Add debug support +Subject: [PATCH 109/305] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124221,10 +124221,10 @@ index c3436f627028477f7e21b47e079fd5ab06ec188a..8642f580ce41803bd22c76a0fa80d083 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 772a2bc20c10aa7675c8a8eb395e3de8dcd278e8 Mon Sep 17 00:00:00 2001 +From 611d00b287e6043f595a863fcd66d698e11ccbea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 31 Dec 2016 14:15:50 +0000 -Subject: [PATCH 110/269] arm64: Add CONFIG_ARCH_BCM2835 +Subject: [PATCH 110/305] arm64: Add CONFIG_ARCH_BCM2835 --- arch/arm64/configs/bcmrpi3_defconfig | 1 + @@ -124240,10 +124240,10 @@ index d7406f5a4620151044b8f716b4d10bb818648e06..53da5c7a33e5898a66e549fb0c39fe3d CONFIG_BCM2708_VCHIQ=n +CONFIG_ARCH_BCM2835=y -From 89f35cb59dd5281e7ad66e7c6afb12229a86de8b Mon Sep 17 00:00:00 2001 +From 7166357bd62767614e1bcf5221e2878a56eeeceb Mon Sep 17 00:00:00 2001 From: Alex Tucker Date: Tue, 13 Dec 2016 19:50:18 +0000 -Subject: [PATCH 111/269] Add support for Silicon Labs Si7013/20/21 +Subject: [PATCH 111/305] Add support for Silicon Labs Si7013/20/21 humidity/temperature sensor. --- @@ -124318,10 +124318,10 @@ index f6d134c095af2398fc55ae7d2b0e86456c30627c..31bda8da4cb6a56bfe493a81b9189009 }; }; -From 8f567a8fd736cb2637761ba100d7d759e45401c5 Mon Sep 17 00:00:00 2001 +From c8e0addfc4e02de515e1ea5acf1fe1c84c793ab4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Jan 2017 21:27:46 +0000 -Subject: [PATCH 112/269] Document the si7020 option +Subject: [PATCH 112/305] Document the si7020 option --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -124342,10 +124342,10 @@ index 81d991803be335e5a1bc3bb0a8c7a2c9f5c392bd..e8fa4ccb44c34a20485c4e6155467af9 Name: i2c0-bcm2708 Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations -From b395d0b06ace0b43219f73da425ca2839998ac4e Mon Sep 17 00:00:00 2001 +From bb2d2aeaa53e6f35ce98e434453831f54b8832e1 Mon Sep 17 00:00:00 2001 From: Giedrius Trainavicius Date: Thu, 5 Jan 2017 02:38:16 +0200 -Subject: [PATCH 113/269] pisound improvements: +Subject: [PATCH 113/305] pisound improvements: * Added a writable sysfs object to enable scripts / user space software to blink MIDI activity LEDs for variable duration. @@ -124639,10 +124639,10 @@ index 4b8545487d06e4ea70073a5d063fb2310b3b94d0..ba70734b89e61a11201657406223f0b3 }; -From 6c4ae519e04992c1dd6816e1227234075f21f245 Mon Sep 17 00:00:00 2001 +From 8c38985ce16eebf11a860adbef745891ee8e205d Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:05:41 +0000 -Subject: [PATCH 114/269] Add driver_name property +Subject: [PATCH 114/305] Add driver_name property Add driver name property for use with 5.1 passthrough audio in LibreElec and other Kodi based OSs --- @@ -124662,10 +124662,10 @@ index 8fd50dbe681508a2cfe8fdde1c9fedbe9a507fa7..05a224ec712d06b8b7587ab6b8bb562d .dai_link = snd_rpi_justboom_dac_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_dac_dai), -From a027a9645d93afa0ae99c46ead3d29851faee82e Mon Sep 17 00:00:00 2001 +From c331b967a82dbe3de83a64c5de0e5dee0eaf11fd Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:11:04 +0000 -Subject: [PATCH 115/269] Add driver_name paramater +Subject: [PATCH 115/305] Add driver_name paramater Add driver_name parameter for use with 5.1 passthrough audio in LibreElec and other Kodi OSs --- @@ -124685,10 +124685,10 @@ index 91acb666380faa3c0deb2230f8a0f8bbec59417b..abfdc5c4dd5811e6847bddda4921abe3 .dai_link = snd_rpi_justboom_digi_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_digi_dai), -From 565dc6bbc215b231ff756b3ba8d67360b52af333 Mon Sep 17 00:00:00 2001 +From b9d6176c4a6673ab633e406b1344730a1914e473 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Jan 2017 13:01:21 +0000 -Subject: [PATCH 116/269] BCM270X_DT: Add pi3-disable-wifi overlay +Subject: [PATCH 116/305] BCM270X_DT: Add pi3-disable-wifi overlay pi3-disable-wifi is a minimal overlay to disable the onboard WiFi. @@ -124749,10 +124749,10 @@ index 0000000000000000000000000000000000000000..017199554bf2f4e381efcc7bb71e750c + }; +}; -From 862bda77c8696cf9505e47203c6451d908c17cdd Mon Sep 17 00:00:00 2001 +From 0278e297c27e51fe99cbe1a799fe28b84fe93e07 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Thu, 12 Jan 2017 07:07:08 -0800 -Subject: [PATCH 117/269] ARM64: Make it work again on 4.9 (#1790) +Subject: [PATCH 117/305] ARM64: Make it work again on 4.9 (#1790) * Invoke the dtc compiler with the same options used in arm mode. * ARM64 now uses the bcm2835 platform just like ARM32. @@ -125157,10 +125157,10 @@ index 53da5c7a33e5898a66e549fb0c39fe3da555ca87..c7e891d72969a388d9b135a36dbfc9c9 -CONFIG_BCM2708_VCHIQ=n -CONFIG_ARCH_BCM2835=y -From 5d408444f1beb55ecb96301fea7d204379840fca Mon Sep 17 00:00:00 2001 +From 66c0b59cd07c274c28a4d60b0c9fd85f7f2c0712 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 14 Jan 2017 02:54:26 -0800 -Subject: [PATCH 118/269] ARM64: Enable Kernel Address Space Randomization +Subject: [PATCH 118/305] ARM64: Enable Kernel Address Space Randomization (#1792) Randomization allows the mapping between virtual addresses and physical @@ -125192,10 +125192,10 @@ index c7e891d72969a388d9b135a36dbfc9c9cb609bf8..974d8889c0cf695eb88b57bbef11bc5a CONFIG_BINFMT_MISC=y CONFIG_COMPAT=y -From 083def6f1a370b3511679cf710a3df60ef0507f9 Mon Sep 17 00:00:00 2001 +From b3f3cb9413496e558cdea23164cd3bb9ef11cbea Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sun, 15 Jan 2017 07:31:59 -0800 -Subject: [PATCH 119/269] ARM64: Enable RTL8187/RTL8192CU wifi in build config +Subject: [PATCH 119/305] ARM64: Enable RTL8187/RTL8192CU wifi in build config These drivers build now, so they can be enabled back in the build configuration just like they are for @@ -125220,10 +125220,10 @@ index 974d8889c0cf695eb88b57bbef11bc5aa556b635..4670a490dfb1e582ec24a3b39a3cb9b2 CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From 4cbe4cc4fd52a6f81e6e84a6d3cbe41d6feffccf Mon Sep 17 00:00:00 2001 +From 82df269fda8a5a4e22c673e0fe1852a71ed7f69e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Jan 2017 14:53:12 +0000 -Subject: [PATCH 120/269] BCM270X_DT: Add spi0-cs overlay +Subject: [PATCH 120/305] BCM270X_DT: Add spi0-cs overlay The spi0-cs overlay allows the software chip selectts to be modified using the cs0_pin and cs1_pin parameters. @@ -125311,10 +125311,10 @@ index 0000000000000000000000000000000000000000..7f79029d043c04d7496c7c3480450c69 + }; +}; -From cb1dd524a34034616c63f3506c7c8e28a7258f0f Mon Sep 17 00:00:00 2001 +From 0d48e23c56d7e9dd4cc374e0c50592790c3cbedb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 121/269] spi-bcm2835: Disable forced software CS +Subject: [PATCH 121/305] 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 @@ -125340,10 +125340,10 @@ index 74dd21b7373c7564ede01d84a4f63b93a6d52fa7..51cdefbf5eb265f49bd05e0aa91dfbee i2c0: i2c@7e205000 { -From e2d9c3dae2dec8478317936cfbc451477bb5c4ad Mon Sep 17 00:00:00 2001 +From b72225aba1f4511e239644003fafd7edabc8dba9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jan 2017 16:33:54 +0000 -Subject: [PATCH 122/269] config: Add CONFIG_TCP_CONG_BBR See: +Subject: [PATCH 122/305] config: Add CONFIG_TCP_CONG_BBR See: https://github.com/raspberrypi/linux/issues/1784 --- @@ -125378,10 +125378,10 @@ index 8acee9f31202ec14f2933d92dd70831cda8d7b51..219f67051a2542329449b0099165ae28 CONFIG_IPV6_ROUTER_PREF=y CONFIG_INET6_AH=m -From 85276a1c75389311370999f568fcb9c853edf52b Mon Sep 17 00:00:00 2001 +From eb19c4d78c36bb7af31d8cbd0b600ab0b0a45abd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 11:34:58 +0000 -Subject: [PATCH 123/269] BCM270X_DT: Enable UART0 on CM3 +Subject: [PATCH 123/305] BCM270X_DT: Enable UART0 on CM3 Signed-off-by: Phil Elwell --- @@ -125404,10 +125404,10 @@ index 41874c25a84226c0e4af92ec4059e0a571fe6123..3ba6e621856c288ae4694f758604619f sdhost_pins: sdhost_pins { brcm,pins = <48 49 50 51 52 53>; -From 0641d754211b34c6dea150fed3ab4500edf6e100 Mon Sep 17 00:00:00 2001 +From 170ac907c4cf80719e252353ddd735430f0b2ad8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 14:39:39 +0000 -Subject: [PATCH 124/269] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR +Subject: [PATCH 124/305] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR See: https://github.com/raspberrypi/linux/issues/1781 @@ -125446,10 +125446,10 @@ index 219f67051a2542329449b0099165ae2885022bec..c4898d63d74718097ec3a1d1fe60b230 CONFIG_OF_CONFIGFS=y CONFIG_ZRAM=m -From 01042ae26b288e092169323d79fa70b385337e92 Mon Sep 17 00:00:00 2001 +From 64fff99f57cde8fecc5273e3a389ed19b952b546 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:33:51 -0800 -Subject: [PATCH 125/269] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 +Subject: [PATCH 125/305] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 In ARM64, the FIQ mechanism used by this driver is not current implemented. As a workaround, reqular IRQ is used instead @@ -125792,10 +125792,10 @@ index 6b2c7d0c93f36a63863ff4b0ecc1f3eab77e058b..d7b700ff17821ad1944e36721fe6b2db /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE -From 406bbc0a91e1f18603b396e3901ffc534666a5d7 Mon Sep 17 00:00:00 2001 +From 6cf7feb6a67d85455219ca62a69b9b26d10f9278 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 126/269] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 126/305] ARM64: Round-Robin dispatch IRQs between CPUs. IRQ-CPU mapping is round robined on ARM64 to increase concurrency and allow multiple interrupts to be serviced @@ -125869,10 +125869,10 @@ index 93e3f7660c4230c9f1dd3b195958cb498949b0ca..486bcbfb32305ee417f6b3be7e91a3ff .name = "bcm2836-gpu", .irq_mask = bcm2836_arm_irqchip_mask_gpu_irq, -From d122d3c1bf7ba8c87b7f732cafdc253a0a8fac6d Mon Sep 17 00:00:00 2001 +From 851b375e9baa8c25dfdb661b9123d7dbb355ba1c Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:45:03 -0800 -Subject: [PATCH 127/269] ARM64: Enable DWC_OTG Driver In ARM64 Build +Subject: [PATCH 127/305] ARM64: Enable DWC_OTG Driver In ARM64 Build Config(bcmrpi3_defconfig) Signed-off-by: Michael Zoran @@ -125893,10 +125893,10 @@ index 4670a490dfb1e582ec24a3b39a3cb9b2488b1864..8c4392344eb4495689c220d5d176ee8c CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From 9b05f4da446413be9549298b19056d978a7a8df6 Mon Sep 17 00:00:00 2001 +From 2fc4fb119736ca3562188302e9963834a18c13bc Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:46:04 -0800 -Subject: [PATCH 128/269] ARM64: Use dwc_otg driver by default for USB. +Subject: [PATCH 128/305] ARM64: Use dwc_otg driver by default for USB. If it breaks on anybody, they can use the standard device tree overlays to switch back to the dwc2 driver. @@ -125922,10 +125922,10 @@ index f6def5d7e5d622cf09e8f87332c7374fe28da08b..3e134a1208610b90e2d0fc22f03c6e9f -}; -#endif -From 0db182d163fca2e9092e3f59a2f368cc92b8f0bd Mon Sep 17 00:00:00 2001 +From 7a2062cf663d281ace259cec78a343009cf59049 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Jan 2017 17:36:50 +0000 -Subject: [PATCH 129/269] BCM270X_DT: Add reference to audio_pins to CM dtb +Subject: [PATCH 129/305] BCM270X_DT: Add reference to audio_pins to CM dtb The CM1 dtb contains an empty audio_pins node, but no reference to it. Adding the usual pinctrl reference from the audio node enables the @@ -125953,10 +125953,10 @@ index eb8662f0d222b4c0a9a2bcb8bccb13e86a0006b3..10be69972bd1440f574e35d515f3d6a0 hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; }; -From fd85f1b1fb028559bece5c168e2f295373c2920e Mon Sep 17 00:00:00 2001 +From 3000b5fd15918d438ed9a645aafce893605e0e09 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 25 Jan 2017 11:30:38 +0000 -Subject: [PATCH 130/269] config: Add additional network scheduling modules +Subject: [PATCH 130/305] config: Add additional network scheduling modules --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -126008,10 +126008,10 @@ index c4898d63d74718097ec3a1d1fe60b2307a6a3140..b448eaa866c200f48351819072c7fefc CONFIG_NET_SCH_PLUG=m CONFIG_NET_CLS_BASIC=m -From a00a45f2d0e3558ce7d1b7231cdcac1dd4f50160 Mon Sep 17 00:00:00 2001 +From a086c72446121c3313ae780d8400d3202e2f4167 Mon Sep 17 00:00:00 2001 From: chris johnson Date: Sun, 22 Jan 2017 03:27:31 +0000 -Subject: [PATCH 131/269] ASoC: A simple-card overlay for ADAU7002 +Subject: [PATCH 131/305] ASoC: A simple-card overlay for ADAU7002 Usage: `dtoverlay=adau7002-simple` --- @@ -126109,10 +126109,10 @@ index 0000000000000000000000000000000000000000..e67e6625d7967abc92cf00cb604d4c12 + }; +}; -From 407ac69a801b923ea3b802dd46780c95f959afa4 Mon Sep 17 00:00:00 2001 +From 73b3ac3f70a7fafa5a4f0aa8e65b8a9760e29c10 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Jan 2017 21:17:23 +0000 -Subject: [PATCH 132/269] config: Add SND_SOC_ADAU7002 codec module +Subject: [PATCH 132/305] config: Add SND_SOC_ADAU7002 codec module As there is now an overlay requiring it, build the codec module. @@ -126147,10 +126147,10 @@ index b448eaa866c200f48351819072c7fefcd8ad8132..5105a592c9bcfee1cc6a8b50fd1c6c32 CONFIG_SND_SOC_WM8804_I2C=m CONFIG_SND_SIMPLE_CARD=m -From 4a36c6f1d7752712eb2c99d5de16d48eac14f8ef Mon Sep 17 00:00:00 2001 +From 9fc3d21b9e00a5f2dfa69b05a79344ed04a3558d Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Fri, 27 Jan 2017 06:42:42 -0500 -Subject: [PATCH 133/269] Add overlay for mcp3008 adc (#1818) +Subject: [PATCH 133/305] Add overlay for mcp3008 adc (#1818) Some example usage: @@ -126436,10 +126436,10 @@ index 0000000000000000000000000000000000000000..06bf4264959c380d8a9f90f74e780397 + }; +}; -From f357cec2b0951db19978e5ab96be4990a890386b Mon Sep 17 00:00:00 2001 +From a4b658a6ef29e6e94aa8ff003baec75730540362 Mon Sep 17 00:00:00 2001 From: ED6E0F17 Date: Fri, 3 Feb 2017 14:52:42 +0000 -Subject: [PATCH 134/269] usb: dwc2: Avoid suspending if we're in gadget mode +Subject: [PATCH 134/305] usb: dwc2: Avoid suspending if we're in gadget mode (#1825) I've found when booting HiKey with the usb gadget cable attached @@ -126491,10 +126491,10 @@ index df5a065780054f21841ca9f08b8ab118922c530b..619ccfe1eafc4643b16970f8a1129ff9 goto skip_power_saving; -From 7e11c3845d325b6853f8341523bf6e1d9fafd06c Mon Sep 17 00:00:00 2001 +From ea6ecd3bed504822ea97b57304212198f3df79e8 Mon Sep 17 00:00:00 2001 From: JamesH65 Date: Mon, 6 Feb 2017 15:24:47 +0000 -Subject: [PATCH 135/269] gpio_mem: Remove unnecessary dev_info output (#1830) +Subject: [PATCH 135/305] gpio_mem: Remove unnecessary dev_info output (#1830) The open function was spamming syslog every time called, so have removed call completely. @@ -126516,10 +126516,10 @@ index 911f5b7393ed48ceed8751f06967ae6463453f9c..f5e7f1ba8fb6f18dee77fad06a17480c dev_err(inst->dev, "Unknown minor device: %d", dev); ret = -ENXIO; -From c679dac6774aa47321b448e5fe9c5df0a524f0b7 Mon Sep 17 00:00:00 2001 +From 34eafc1e4bc0b806c0c78921ec142434828c11b6 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 136/269] config: Enable regulator support +Subject: [PATCH 136/305] config: Enable regulator support Signed-off-by: Matthias Reichl --- @@ -126554,10 +126554,10 @@ index 5105a592c9bcfee1cc6a8b50fd1c6c32f1381158..74bc0d81bcb4d7f6676368926cdcc10e CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -From 90036eb53e5f3912aa06960282a18b60a9b58ce5 Mon Sep 17 00:00:00 2001 +From c331c813cb26ad20bfc6fc5391d4e8cd4bd42615 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 137/269] BCM270x DT: expose 3.3V and 5V system rails +Subject: [PATCH 137/305] BCM270x DT: expose 3.3V and 5V system rails Signed-off-by: Matthias Reichl --- @@ -126590,10 +126590,10 @@ index a46cb4a8b1419edd95e0e07c18b0f373222dc2bf..36d853715f2379e1952ce3d3be58dd67 + }; }; -From b1cf376677e437a354c47e103784001d1f82721f Mon Sep 17 00:00:00 2001 +From 1e9ad55be7048c6d6e39f64a628e817b734c2469 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 138/269] BCM270x DT: Consolidate audio card overlays +Subject: [PATCH 138/305] BCM270x DT: Consolidate audio card overlays Reference 3.3V / 5V system rails instead of instantiating local regulators. @@ -126888,10 +126888,10 @@ index 16b1247bfa618ff85936ddf78c3aea58075eaa67..f8d48233e28c7c18509b4a95692f6aff __overlay__ { compatible = "rra,digidac1-soundcard"; -From 7d144e423572838549369774143f2f396e78391d Mon Sep 17 00:00:00 2001 +From 122493e12881ef1c74aad4743d24b2b71e976bd6 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 139/269] ASoC: Add driver for Cirrus Logic Audio Card +Subject: [PATCH 139/305] ASoC: Add driver for Cirrus Logic Audio Card Note: due to problems with deferred probing of regulators the following softdep should be added to a modprobe.d file @@ -128141,10 +128141,10 @@ index 0000000000000000000000000000000000000000..ac8651ddff7bd3701dffe22c7fb88352 +MODULE_DESCRIPTION("ASoC driver for Cirrus Logic Audio Card"); +MODULE_LICENSE("GPL"); -From 819acde6b44a9aaa6693b58e37cefafcbf18dc23 Mon Sep 17 00:00:00 2001 +From 33310d492a98aeb754008683d52cef7f8b12b4f5 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 140/269] config: enable Cirrus Logic Audio Card +Subject: [PATCH 140/305] config: enable Cirrus Logic Audio Card Signed-off-by: Matthias Reichl --- @@ -128193,10 +128193,10 @@ index 74bc0d81bcb4d7f6676368926cdcc10e581fbcae..f0b87d15e959d88eb26e5a11244365da CONFIG_SND_BCM2708_SOC_RPI_PROTO=m CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m -From cd8e08e2a75007fd2f9d1bf1ed9ca6d99d47b74a Mon Sep 17 00:00:00 2001 +From 797be587fdf6b0dcd1f1f27a493a228674ebb463 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 141/269] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 141/305] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -128220,10 +128220,10 @@ index 486bcbfb32305ee417f6b3be7e91a3ff069a586c..e10597c1a1e51e5e27aa574b6a26d871 static void -From 983954c6c0113f7b0466e3dfe5002b4e9de74046 Mon Sep 17 00:00:00 2001 +From b92f2b349ee93cd0cedbde5e62f51a38fb15791e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 142/269] sound: Demote deferral errors to INFO level +Subject: [PATCH 142/305] sound: Demote deferral errors to INFO level At present there is no mechanism to specify driver load order, which can lead to deferrals and repeated retries until successful. @@ -128236,7 +128236,7 @@ Signed-off-by: Phil Elwell 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c -index c0bbcd9032613a78aef551ce697cabc792880bad..a2504d8c83d74d7227e65be142a26cc9d0a88158 100644 +index 4e3de566809c6b4776415482490ff80df2003351..d83f645de9ef60a05c6b8bb44bb2ae850fb22477 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1013,7 +1013,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, @@ -128258,10 +128258,10 @@ index c0bbcd9032613a78aef551ce697cabc792880bad..a2504d8c83d74d7227e65be142a26cc9 goto _err_defer; } -From df52afbfd051ab9768238de5c9f1a965d03ee4d6 Mon Sep 17 00:00:00 2001 +From 8f2c541e395f3a7b951e931a361507a16a04de26 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:40:33 +0000 -Subject: [PATCH 143/269] sound: Suppress error message about deferrals +Subject: [PATCH 143/305] sound: Suppress error message about deferrals Since driver load deferrals are expected and will already have resulted in a kernel message, suppress an essentially @@ -128508,10 +128508,10 @@ index 9db678e885efd63d84d60a098a84ed6772b19a2d..fadbfade100228aaafabb0d3bdf35c01 return ret; } -From ecbaee0e39dcf28b4c6f5dc60375b218e581395b Mon Sep 17 00:00:00 2001 +From 4c6b8b975633f2482c399265d077beb07b517666 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 144/269] Update vfpmodule.c +Subject: [PATCH 144/305] Update vfpmodule.c Christopher Alexander Tobias Schulze - May 2, 2015, 11:57 a.m. This patch fixes a problem with VFP state save and restore related @@ -128648,10 +128648,10 @@ index da0b33deba6d3c2906eef271f253ab7a30a92680..c6f1d6da808cda78a58f184e19e83522 /* * Save the userland NEON/VFP state. Under UP, -From 664d3815fe18c5215242e27c104efd12aa101fdf Mon Sep 17 00:00:00 2001 +From f7b55cbdda0651cdc3b13ed7e961756f04a62dab Mon Sep 17 00:00:00 2001 From: Martin Cerveny Date: Mon, 13 Feb 2017 17:23:47 +0100 -Subject: [PATCH 145/269] dwc_otg: fix summarize urb->actual_length for +Subject: [PATCH 145/305] dwc_otg: fix summarize urb->actual_length for isochronous transfers Kernel does not copy input data of ISO transfers to userspace @@ -128679,10 +128679,10 @@ index 162a656501988e56c9d780b7793d365fde09f801..992269d61ecf48126379a38e528f7190 dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_urb, i); } -From c3123867d09256cc952f574d5252258d9adbb902 Mon Sep 17 00:00:00 2001 +From 034ce986f970d1e41d5b651b4c77d23633997c4d Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:19 +0100 -Subject: [PATCH 146/269] clk: bcm: Support rate change propagation on bcm2835 +Subject: [PATCH 146/305] clk: bcm: Support rate change propagation on bcm2835 clocks Some peripheral clocks, like the VEC (Video EnCoder) clock need to be set @@ -128807,10 +128807,10 @@ index a99ccf9f056d3a3e7c482339e08483f3701ebc04..dafaa6b22724ab41dac1327cfa81de09 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From 9a4e2e6a6391621567638620f13baaf983842c16 Mon Sep 17 00:00:00 2001 +From 065c526daa5ba3bfa0fef6dac2446f3b8e10b2d8 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:20 +0100 -Subject: [PATCH 147/269] clk: bcm: Allow rate change propagation to PLLH_AUX +Subject: [PATCH 147/305] clk: bcm: Allow rate change propagation to PLLH_AUX on VEC clock The VEC clock requires needs to be set at exactly 108MHz. Allow rate @@ -128845,10 +128845,10 @@ index dafaa6b22724ab41dac1327cfa81de09908a4dfd..0453d7c6a63923370e4191db2c4d083b /* dsi clocks */ [BCM2835_CLOCK_DSI0E] = REGISTER_PER_CLK( -From 775c2c3bc8c33fe331211f26cd0b9b63971fbfd9 Mon Sep 17 00:00:00 2001 +From 6244a8edb76c50d30c2a9e6790549640c441a5bd Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 12 Dec 2016 09:00:53 +0100 -Subject: [PATCH 148/269] clk: bcm: Fix 'maybe-uninitialized' warning in +Subject: [PATCH 148/305] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() best_rate is reported as potentially uninitialized by gcc. @@ -128877,10 +128877,10 @@ index 0453d7c6a63923370e4191db2c4d083b893b3b47..9d895726ebb24bc78a2014870dbdd7c7 struct clk_hw *parent; -From 622fc529526eea0833138036509ed311d40bdf8b Mon Sep 17 00:00:00 2001 +From 54d6cf47e389e827e418d64c0750134b25441d92 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:55 +1100 -Subject: [PATCH 149/269] clk: bcm2835: Don't rate change PLLs on behalf of DSI +Subject: [PATCH 149/305] clk: bcm2835: Don't rate change PLLs on behalf of DSI PLL dividers. Our core PLLs are intended to be configured once and left alone. With @@ -129052,10 +129052,10 @@ index 9d895726ebb24bc78a2014870dbdd7c779cd1cdf..b58cff2756581ba7e0be8a818cdbdf72 /* the clocks */ -From 30801d8b04094f6b70029e1f44e68c3fc7fc4787 Mon Sep 17 00:00:00 2001 +From a3035568cd6d7302f8faf78d63691898af336b98 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:56 +1100 -Subject: [PATCH 150/269] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. +Subject: [PATCH 150/305] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. The DSI pixel clocks are muxed from clocks generated in the analog phy by the DSI driver. In order to set them as parents, we need to do the @@ -129297,10 +129297,10 @@ index 360e00cefd35679b49890234b5c369fb52b89e20..a0c812b0fa391d149b4f546db39bdc4b +#define BCM2835_CLOCK_DSI0P 49 +#define BCM2835_CLOCK_DSI1P 50 -From becfa52776c0b6841c5da28f76ee381271480872 Mon Sep 17 00:00:00 2001 +From a36f6f067a52d4621dad21f83b58641a542ebab7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:57 +1100 -Subject: [PATCH 151/269] clk: bcm2835: Add leaf clock measurement support, +Subject: [PATCH 151/305] clk: bcm2835: Add leaf clock measurement support, disabled by default This proved incredibly useful during debugging of the DSI driver, to @@ -129646,10 +129646,10 @@ index b2c277b378ee799a4f8e05ad076d1253e85cb392..136e5d28f9eaeaa10d45382a0f31da9f /* the gates */ -From 9b69201bb11e75d042085cf0ad87434d1a02f32a Mon Sep 17 00:00:00 2001 +From 2d81389a35919ea1729afe4f6275b68b32306455 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Apr 2016 13:46:13 -0700 -Subject: [PATCH 152/269] drm/panel: Add support for the Raspberry Pi 7" +Subject: [PATCH 152/305] drm/panel: Add support for the Raspberry Pi 7" Touchscreen. This driver communicates with the Atmel microcontroller for sequencing @@ -130230,10 +130230,10 @@ index 0000000000000000000000000000000000000000..1a536fe4d040f5fafe324baee110a622 +MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver"); +MODULE_LICENSE("GPL v2"); -From 1b5605926a00a2f41fa422a3b3b188770cac6696 Mon Sep 17 00:00:00 2001 +From e90c52604dabe80e1df907b565b118a8ce85ca90 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 12:29:45 -0700 -Subject: [PATCH 153/269] BCM270X: Add the DSI panel to the defconfig. +Subject: [PATCH 153/305] BCM270X: Add the DSI panel to the defconfig. Signed-off-by: Eric Anholt --- @@ -130282,10 +130282,10 @@ index 8c4392344eb4495689c220d5d176ee8c189079fd..301611d2283f5f8800339271cea59aed CONFIG_DRM_VC4=m CONFIG_FB=y -From 235128aeb90a0fcce31f7437245211c808239311 Mon Sep 17 00:00:00 2001 +From 3f00797a3a94d732cbab92f20902b735e08dd8d3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Dec 2016 15:15:10 -0800 -Subject: [PATCH 154/269] ARM: bcm2835: dt: Add the DSI module nodes and +Subject: [PATCH 154/305] ARM: bcm2835: dt: Add the DSI module nodes and clocks. The modules stay disabled by default, and if you want to enable DSI @@ -130389,10 +130389,10 @@ index 51cdefbf5eb265f49bd05e0aa91dfbeee3fbfdcc..41776b97b4b6b1c053d07fd357fac4ba compatible = "brcm,bcm2835-i2c"; reg = <0x7e804000 0x1000>; -From 70321de284e9cac0b2222c68c01de38f9de3ca0e Mon Sep 17 00:00:00 2001 +From cc8a3b78b10f85462123dca5403e243e58abf3c6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 15:09:35 -0700 -Subject: [PATCH 155/269] BCM270X: Enable the DSI panel node in the VC4 +Subject: [PATCH 155/305] BCM270X: Enable the DSI panel node in the VC4 overlay. Signed-off-by: Eric Anholt @@ -130543,10 +130543,10 @@ index 4f1cc20f90dc6780f74e08ebee00e5a1a6062c85..f25cd9a3936861920b0d518ff2d773ee cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From 61da2e14ac9447cc4f1a9e81ed4a485724293728 Mon Sep 17 00:00:00 2001 +From e7887522a69a916c4635d440ec8c832a46db7809 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Nov 2016 18:53:10 -0700 -Subject: [PATCH 156/269] drm/vc4: Add support for rendering with ETC1 +Subject: [PATCH 156/305] drm/vc4: Add support for rendering with ETC1 textures. The validation for it ends up being quite simple, but I hadn't got @@ -130606,10 +130606,10 @@ index ad7edc3edf7ca1d653a0bc025a5eda6692b74370..69caa21f0cb23c9439238f6239c0041b struct drm_vc4_get_param { __u32 param; -From 4baae56b542704259ba0853709bb2a2b67ce97c7 Mon Sep 17 00:00:00 2001 +From e8c384af07b41fca487a78957ab0cf593e472505 Mon Sep 17 00:00:00 2001 From: Jonas Pfeil Date: Tue, 8 Nov 2016 00:18:39 +0100 -Subject: [PATCH 157/269] drm/vc4: Add fragment shader threading support +Subject: [PATCH 157/305] drm/vc4: Add fragment shader threading support FS threading brings performance improvements of 0-20% in glmark2. @@ -130845,10 +130845,10 @@ index 69caa21f0cb23c9439238f6239c0041b178d5669..f07a090167261131076438960c1dec17 struct drm_vc4_get_param { __u32 param; -From d192b83ab1c6af390d4cc2692ca833621b697058 Mon Sep 17 00:00:00 2001 +From e970c76555e9b5f71f3505b8bcddafde522a1ef3 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:09 +0100 -Subject: [PATCH 158/269] drm: Add TV connector states to drm_connector_state +Subject: [PATCH 158/305] drm: Add TV connector states to drm_connector_state Some generic TV connector properties are exposed in drm_mode_config, but they are currently handled independently in each DRM encoder driver. @@ -130944,7 +130944,7 @@ index 4e19bde4bbffac08e700460b69db882f42d5463b..846da4f6416435221cb8d08a8c124f05 return connector->funcs->atomic_get_property(connector, state, property, val); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h -index ac9d7d8e0e43a807e9fc9a0b66de5f26b49d3348..2645e803857253ff98eb94aa1bacc8257f37ae76 100644 +index d8bb8d151825fe818a0fc8cf0b1d685feae6b686..c9fbc52e88879c9b91c63b4d1f7abf0fd789ebdd 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -194,10 +194,40 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info, @@ -130998,10 +130998,10 @@ index ac9d7d8e0e43a807e9fc9a0b66de5f26b49d3348..2645e803857253ff98eb94aa1bacc825 /** -From f87fb38e402437d64c20ff9064be77d0fcbb53ca Mon Sep 17 00:00:00 2001 +From 4cb96f5521e5725efe0e42e6811ac691529d4f3f Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:08 +0100 -Subject: [PATCH 159/269] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into +Subject: [PATCH 159/305] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum List of values like the DRM_MODE_SUBCONNECTOR_xx ones are better @@ -131048,10 +131048,10 @@ index df0e3504c349a950bf41540fbcd6cd944cf11d2f..970bfc0d7107451e5bc4e29c524a764c #define DRM_MODE_CONNECTOR_Unknown 0 #define DRM_MODE_CONNECTOR_VGA 1 -From 3cc14c6165143f9086528f14318e496f31ae1370 Mon Sep 17 00:00:00 2001 +From 962e6bdb8b1be8a4315921cf9332956bf12d64b0 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:10 +0100 -Subject: [PATCH 160/269] drm/vc4: Add support for the VEC (Video Encoder) IP +Subject: [PATCH 160/305] drm/vc4: Add support for the VEC (Video Encoder) IP The VEC IP is a TV DAC, providing support for PAL and NTSC standards. @@ -131790,10 +131790,10 @@ index 0000000000000000000000000000000000000000..32bb8ef985fbc6f39f9e5f459846bb77 + }, +}; -From e5719838142ba3ac3e07a6b51bc28706bf66661d Mon Sep 17 00:00:00 2001 +From eb74deaeb4521f2b1d7fc613d3e0d070105a7b62 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 15 Sep 2016 15:25:23 +0100 -Subject: [PATCH 161/269] drm/vc4: Set up SCALER_DISPCTRL at boot. +Subject: [PATCH 161/305] drm/vc4: Set up SCALER_DISPCTRL at boot. We want the HVS on, obviously, and we also want DSP3 (PV1's source) to be muxed from HVS channel 2 like we expect in vc4_crtc.c. The @@ -131853,10 +131853,10 @@ index 39f6886b24100c43b590e47e0c7bc44846721d65..b3b297fba7097bc495fa8916292c5479 * SCALER_DISPSTAT_IRQDISP0. Note that short frame contributions are * always enabled. -From 96cae40ca7cf676d5225c1d2279b3364cd13eb44 Mon Sep 17 00:00:00 2001 +From fcf66b59def66b4581cb4250cdef7aba72fc95c9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 16:17:29 -0800 -Subject: [PATCH 162/269] drm/vc4: Add support for feeding DSI encoders from +Subject: [PATCH 162/305] drm/vc4: Add support for feeding DSI encoders from the pixel valve. We have to set a different pixel format, which tells the hardware to @@ -131971,10 +131971,10 @@ index b3b297fba7097bc495fa8916292c547925720199..385405a2df05eb3dd86d4f687aa82053 # define PV_VCONTROL_VIDEN BIT(0) -From 75985f22a474066700ecc466f480c5fe9d2b1f19 Mon Sep 17 00:00:00 2001 +From be61d1081cf504427a95f53d83e53265820dbf62 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 11:42:32 -0800 -Subject: [PATCH 163/269] drm/vc4: Add DSI driver +Subject: [PATCH 163/305] drm/vc4: Add DSI driver The DSI0 and DSI1 blocks on the 2835 are related hardware blocks. Some registers move around, and the featureset is slightly different, @@ -133802,10 +133802,10 @@ index 0000000000000000000000000000000000000000..17fcac381dbb37cd9a5ff210ad8578f4 + }, +}; -From 762f3576707e21a2ed1bb77a8571468016fb8451 Mon Sep 17 00:00:00 2001 +From 13804e779fbc1d06203fc39ad6dabb432a066991 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:12 +0100 -Subject: [PATCH 164/269] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi +Subject: [PATCH 164/305] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi Add the VEC (Video EnCoder) node definition in bcm283x.dtsi. @@ -133836,10 +133836,10 @@ index 41776b97b4b6b1c053d07fd357fac4ba4787ac53..d3cc586661f903e67a840189c0446aa8 compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>; -From 9cef0c51873c19bb846dd1eeb909bbb6d6706130 Mon Sep 17 00:00:00 2001 +From cb26f4bda3766107ab4005d2f825b584f2151c59 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:13 +0100 -Subject: [PATCH 165/269] ARM: dts: bcm283x: Enable the VEC IP on all +Subject: [PATCH 165/305] ARM: dts: bcm283x: Enable the VEC IP on all RaspberryPi boards Enable the VEC IP on all RaspberryPi boards. @@ -133865,10 +133865,10 @@ index 365648898f3acc4f82dc6cb58e4bbebbe249be94..d4577a51e678cb600b475d3d3395ca4e + status = "okay"; +}; -From 5c15341b00c9ca553477984365cedb69971ec5d2 Mon Sep 17 00:00:00 2001 +From 856ff0b9d52c835e3353edb635518736215844ad Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 23 Jan 2017 11:41:54 -0800 -Subject: [PATCH 166/269] BCM270X: Disable VEC unless vc4-kms-v3d is present. +Subject: [PATCH 166/305] BCM270X: Disable VEC unless vc4-kms-v3d is present. Signed-off-by: Eric Anholt --- @@ -133907,10 +133907,10 @@ index f25cd9a3936861920b0d518ff2d773ee467e2f49..a8ef8c9051668a7477dea30aa262568c cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From daa86e71b7c1e317e960bcce7bea1f251593e4f4 Mon Sep 17 00:00:00 2001 +From 28c80efcf33d7d4e3d4fa5f6a04d55e4407b0b7f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:09:18 -0800 -Subject: [PATCH 167/269] drm/vc4: Name the primary and cursor planes in fkms. +Subject: [PATCH 167/305] drm/vc4: Name the primary and cursor planes in fkms. This makes debugging nicer, compared to trying to remember what the IDs are. @@ -133934,10 +133934,10 @@ index d18a1dae51a2275846c9826b5bf1ba57ae97b55c..e49ce68b607a7ffc2329e3235362f3bc if (type == DRM_PLANE_TYPE_PRIMARY) { vc4_plane->fbinfo = -From db0a0b4de860ec95379ed850ff075fd0bf0eff9c Mon Sep 17 00:00:00 2001 +From 200f3e4c32e944e6a230aa10e70353b0d45c7f46 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:10:09 -0800 -Subject: [PATCH 168/269] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of +Subject: [PATCH 168/305] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of fkms. Trying to debug weston on fkms involved figuring out what calls I was @@ -134007,10 +134007,10 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -From ef91655787d87e1bd96bb59a032e9f5576b5e4ab Mon Sep 17 00:00:00 2001 +From d8855017f57d293c647a1ad869a5e9062154d2f8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Feb 2017 09:42:18 -0800 -Subject: [PATCH 169/269] drm/vc4: Fix sending of page flip completion events +Subject: [PATCH 169/305] drm/vc4: Fix sending of page flip completion events in FKMS mode. In the rewrite of vc4_crtc.c for fkms, I dropped the part of the @@ -134052,10 +134052,10 @@ index dbf065677202fbebf8e3a0cffbe880aa42daef3f..da818a207bfa639b8cea48d94bcf4566 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) -From ef5e5782a94171e684b0507967336e80070c0b96 Mon Sep 17 00:00:00 2001 +From 84a08534bd8014fc24f1cab10010d93c94fc99e2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 8 Feb 2017 15:00:54 -0800 -Subject: [PATCH 170/269] drm/vc4: Fulfill user BO creation requests from the +Subject: [PATCH 170/305] drm/vc4: Fulfill user BO creation requests from the kernel BO cache. The from_cache flag was actually "the BO is invisible to userspace", @@ -134075,7 +134075,7 @@ Signed-off-by: Eric Anholt 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c -index 3f6704cf6608d7be47637c6aa585de087b7f74ee..5ec14f25625dde6fd61e10415092fa25527cc151 100644 +index ec9023bd935b6755b3c2b6a7e171cb269562234c..fd83a28076564b9ea5cf0f2ba29b884ee3c5af43 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -208,21 +208,22 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) @@ -134108,47 +134108,10 @@ index 3f6704cf6608d7be47637c6aa585de087b7f74ee..5ec14f25625dde6fd61e10415092fa25 cma_obj = drm_gem_cma_create(dev, size); -From de9cd3e6a506fbbb3c5e4d29ade8c257cd9e7e5b Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 9 Feb 2017 09:23:34 -0800 -Subject: [PATCH 171/269] drm/vc4: Fix OOPSes from trying to cache a partially - constructed BO. - -If a CMA allocation failed, the partially constructed BO would be -unreferenced through the normal path, and we might choose to put it in -the BO cache. If we then reused it before it expired from the cache, -the kernel would OOPS. - -Signed-off-by: Eric Anholt -Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.") ---- - drivers/gpu/drm/vc4/vc4_bo.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c -index 5ec14f25625dde6fd61e10415092fa25527cc151..fd83a28076564b9ea5cf0f2ba29b884ee3c5af43 100644 ---- a/drivers/gpu/drm/vc4/vc4_bo.c -+++ b/drivers/gpu/drm/vc4/vc4_bo.c -@@ -314,6 +314,14 @@ void vc4_free_object(struct drm_gem_object *gem_bo) - goto out; - } - -+ /* If this object was partially constructed but CMA allocation -+ * had failed, just free it. -+ */ -+ if (!bo->base.vaddr) { -+ vc4_bo_destroy(bo); -+ goto out; -+ } -+ - cache_list = vc4_get_cache_list_for_size(dev, gem_bo->size); - if (!cache_list) { - vc4_bo_destroy(bo); - -From b6685b56027450e43707136f7098150951bada75 Mon Sep 17 00:00:00 2001 +From 981e80f562020ff55d1e5f7a061781883f14c8d6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Oct 2015 08:58:08 -0700 -Subject: [PATCH 172/269] drm/vc4: Verify at boot that CMA doesn't cross a +Subject: [PATCH 171/305] drm/vc4: Verify at boot that CMA doesn't cross a 256MB boundary. I've seen lots of users cranking CMA up higher, so throw an error if @@ -134231,10 +134194,10 @@ index c960459eda7e640ea55be1d4ed80c6a9125a8877..b50245282a18bc790da0f901944c2e67 static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, int align_order) -From 80374437351a33f7d64c01fef4e4bfb1c4c042a3 Mon Sep 17 00:00:00 2001 +From 2faa8f450c99a5a50bb632434ef7eb97e69d882a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 09:47:11 +0000 -Subject: [PATCH 173/269] BCM270X_DT: Add SMSC ethernet controller to DT +Subject: [PATCH 172/305] BCM270X_DT: Add SMSC ethernet controller to DT With an ethernet node in the DT, a suitable firmware can populate the local-mac-address property, removing the need for a downstream patch @@ -134297,10 +134260,10 @@ index d29ba72de727fe26b5a586e0bd0a41181c68ae04..78101849441679baf3624cf67a0ff7a2 / { model = "Raspberry Pi 3 Model B"; -From b0cb31fe043a29bab491cf2dffd206ccf0e0ad9b Mon Sep 17 00:00:00 2001 +From cb30027317dc433201d0e8253e2d43e81ca20fc4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 15:26:13 +0000 -Subject: [PATCH 174/269] brcmfmac: Mute expected startup 'errors' +Subject: [PATCH 173/305] brcmfmac: Mute expected startup 'errors' The brcmfmac WiFi driver always complains about the '00' country code and the firmware version is reported as an error. Modify the driver to @@ -134313,10 +134276,10 @@ Signed-off-by: Phil Elwell 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -index 3fcb1887b2d312e050c02e9fe66ea20f48f0abcb..e2a459f7a2003cb316f29b6dace3ca975f4d7a95 100644 +index 121a697455caba5a9e15145c96c7fb7055dd5ad7..9d63be7b1c9a929880183c453c0444c0213d191a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6804,6 +6804,8 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, +@@ -6806,6 +6806,8 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, /* ignore non-ISO3166 country codes */ for (i = 0; i < sizeof(req->alpha2); i++) if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { @@ -134339,10 +134302,10 @@ index 4051780f64f44a5ce522babe6c371a1beb79a824..b081673abcb4aa72d70d8e0834b608f6 /* locate firmware version number for ethtool */ ptr = strrchr(buf, ' ') + 1; -From 513c64a4d56f1264613dfede5291d4ef3d85c9fe Mon Sep 17 00:00:00 2001 +From 3df6cf5b38fbfe7ba38ea8fc9cd98449c1bbf93f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 175/269] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 174/305] clk-bcm2835: Mark used PLLs and dividers CRITICAL The VPU configures and relies on several PLLs and dividers. Mark all enabled dividers and their PLLs as CRITICAL to prevent the kernel from @@ -134370,10 +134333,10 @@ index 136e5d28f9eaeaa10d45382a0f31da9f4adb91ef..4192863778c8009aacfc9a49ee38ad1c divider->data = data; -From c0f136cc0137125ac2d61bdb82b25fa14cfb414a Mon Sep 17 00:00:00 2001 +From 83b359afff27e394c1026fd97165b005ea946495 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 176/269] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 175/305] clk-bcm2835: Add claim-clocks property The claim-clocks property can be used to prevent PLLs and dividers from being marked as critical. It contains a vector of clock IDs, @@ -134508,52 +134471,10 @@ index 4192863778c8009aacfc9a49ee38ad1ca62a01e4..6b245357e4e93c19a839eee92a82f95a sizeof(cprman_parent_names)); of_clk_parent_fill(dev->of_node, cprman->real_parent_names, -From 2ec24e41fc219ca78b2f308966339b2a6d1f0d68 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Mon, 20 Feb 2017 20:01:16 +0100 -Subject: [PATCH 177/269] dmaengine: bcm2835: Fix cyclic DMA period splitting - -The code responsible for splitting periods into chunks that -can be handled by the DMA controller missed to update total_len, -the number of bytes processed in the current period, when there -are more chunks to follow. - -Therefore total_len was stuck at 0 and the code didn't work at all. -This resulted in a wrong control block layout and audio issues because -the cyclic DMA callback wasn't executing on period boundaries. - -Fix this by adding the missing total_len update. - -Signed-off-by: Matthias Reichl -Signed-off-by: Martin Sperl -Tested-by: Clive Messer -Reviewed-by: Eric Anholt ---- - drivers/dma/bcm2835-dma.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c -index 80d35f760b4a4a51e60c355a84d538bac3892a4d..599c218dc8a73172dd4bd4a058fc8f95a73f982f 100644 ---- a/drivers/dma/bcm2835-dma.c -+++ b/drivers/dma/bcm2835-dma.c -@@ -253,8 +253,11 @@ static void bcm2835_dma_create_cb_set_length( - */ - - /* have we filled in period_length yet? */ -- if (*total_len + control_block->length < period_len) -+ if (*total_len + control_block->length < period_len) { -+ /* update number of bytes in this period so far */ -+ *total_len += control_block->length; - return; -+ } - - /* calculate the length that remains to reach period_length */ - control_block->length = period_len - *total_len; - -From 28467850c080bc39eb4c2b312000d7d837615b3b Mon Sep 17 00:00:00 2001 +From 643b14e60af0678eddc6897e4b54ef7a34edd837 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Thu, 23 Feb 2017 11:56:20 -0500 -Subject: [PATCH 178/269] Add ads1015 driver to config +Subject: [PATCH 176/305] Add ads1015 driver to config --- arch/arm/configs/bcm2709_defconfig | 3 ++- @@ -134607,10 +134528,10 @@ index 9a9cd1cdcb2f76d4408568681ec80885293bae48..554fed3a4fbfd1940422b808046c6d2b CONFIG_FB=y CONFIG_FB_BCM2708=y -From 6c66d4fba197c6d4fb21b07b08e151a34a0a5981 Mon Sep 17 00:00:00 2001 +From c821b53a38c43cbb2f073a65d2f7c73cebbb53a6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jan 2017 18:49:30 +0000 -Subject: [PATCH 179/269] config: add slcan kernel module +Subject: [PATCH 177/305] config: add slcan kernel module See: https://github.com/raspberrypi/linux/issues/1819 --- @@ -134643,10 +134564,10 @@ index 554fed3a4fbfd1940422b808046c6d2b1f508394..99888182259b280790a7506b248a8130 CONFIG_IRDA=m CONFIG_IRLAN=m -From 47708a39cde7788759726c36b8f70405725577dd Mon Sep 17 00:00:00 2001 +From 2dcddefd1a9f4e0ea3950a321ad6dea3ed10e55a Mon Sep 17 00:00:00 2001 From: Miquel Date: Fri, 24 Feb 2017 20:51:06 +0100 -Subject: [PATCH 180/269] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT +Subject: [PATCH 178/305] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT Signed-off-by: Miquel Blauw --- @@ -134910,10 +134831,10 @@ index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b035 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO-V2"); +MODULE_LICENSE("GPL v2"); -From 569f6ff5c211030fc48f0333ecedf72b4451ff43 Mon Sep 17 00:00:00 2001 +From 584217082ef31c58659ec34278d701d13a9ba863 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 26 Feb 2017 01:13:02 +0000 -Subject: [PATCH 181/269] SQUASH: Add LOCO-V2 overlay from last commit +Subject: [PATCH 179/305] SQUASH: Add LOCO-V2 overlay from last commit --- .../dts/overlays/dionaudio-loco-v2-overlay.dts | 49 ++++++++++++++++++++++ @@ -134976,10 +134897,10 @@ index 0000000000000000000000000000000000000000..a1af93de30119734e8d14cbd454589d3 + }; +}; -From a761535375a9a35f93e747d37faf323ae6801aa9 Mon Sep 17 00:00:00 2001 +From 6805c3cf171d54f9f8b4eca7c3db663f18bb965b Mon Sep 17 00:00:00 2001 From: Fe-Pi Date: Wed, 1 Mar 2017 04:42:43 -0700 -Subject: [PATCH 182/269] Add support for Fe-Pi audio sound card. (#1867) +Subject: [PATCH 180/305] Add support for Fe-Pi audio sound card. (#1867) Fe-Pi Audio Sound Card is based on NXP SGTL5000 codec. Mechanical specification of the board is the same the Raspberry Pi Zero. @@ -135328,10 +135249,10 @@ index 0000000000000000000000000000000000000000..015b56fd73cc36be5b5eecd17548fd03 +MODULE_DESCRIPTION("ASoC Driver for Fe-Pi Audio"); +MODULE_LICENSE("GPL v2"); -From 27f214e9a240c68ebc591e9301aa21a41f63d84f Mon Sep 17 00:00:00 2001 +From aef7d8a7fc676e73d83459fc1ff1c7fc76402655 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Wed, 1 Mar 2017 07:22:24 -0500 -Subject: [PATCH 183/269] Add overlay for ads1115 ADCs (#1864) +Subject: [PATCH 181/305] Add overlay for ads1115 ADCs (#1864) --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -135495,10 +135416,10 @@ index 0000000000000000000000000000000000000000..7c16a1af3172d14e1a976b1776b9f167 + }; +}; -From 04733c82affa7a309018d1eaac371d3c38326f5d Mon Sep 17 00:00:00 2001 +From df072585f8473d9b0742e144b127bf6a1e85e6e0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:06:53 +0000 -Subject: [PATCH 184/269] clk-bcm2835: Correct the prediv logic +Subject: [PATCH 182/305] clk-bcm2835: Correct the prediv logic If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency. @@ -135525,10 +135446,10 @@ index 6b245357e4e93c19a839eee92a82f95aec996e4e..8ea29fbc8dc451b9cff502bc1a918ae6 return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv); } -From 9dd418e3b4eb50ce763bcbcf4953cb8b75c2d14e Mon Sep 17 00:00:00 2001 +From cb0e4cd040fe00a770d3e4cbadf306ec8d3fac8a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 185/269] amba_pl011: Round input clock up +Subject: [PATCH 183/305] amba_pl011: Round input clock up The UART clock is initialised to be as close to the requested frequency as possible without exceeding it. Now that there is a @@ -135614,10 +135535,10 @@ index 5a11ff833e1fd112ba04df3a427cd94bf6793ec5..003a5b0c30295dbbcb94a28d0c64d124 /* unregisters the driver also if no more ports are left */ static void pl011_unregister_port(struct uart_amba_port *uap) -From a4391cb7bb1e9b9ab427ab0d3683a970eee19280 Mon Sep 17 00:00:00 2001 +From f217a9ea1e963946a7775f04225df66c77159a92 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 11:10:50 +0000 -Subject: [PATCH 186/269] BCM2835-V4L2: Ensure H264 header bytes get a sensible +Subject: [PATCH 184/305] BCM2835-V4L2: Ensure H264 header bytes get a sensible timestamp H264 header come off VC with 0 timestamps, which means they get a @@ -135706,10 +135627,10 @@ index e6aeb7e7e381de65d6c6586205069a4c5cd33274..7f8a68916a67001bc9241bce2928519a struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ -From 5334a85c956c34c35462d0dd20704b2e57283342 Mon Sep 17 00:00:00 2001 +From 416b34df498f1234ee53ef9e0d406b1a488bd7ba Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 13:11:41 +0000 -Subject: [PATCH 187/269] BCM2835-V4L2: Correctly denote key frames in encoded +Subject: [PATCH 185/305] BCM2835-V4L2: Correctly denote key frames in encoded data Forward MMAL key frame flags to the V4L2 buffers. @@ -135734,10 +135655,10 @@ index e69731320f4e59249933bc21843913deab4a1209..6bdec0806126044cf7146d53326e4da5 "Buffer has ts %llu", dev->capture.last_timestamp); -From 8f780a7c3e2b50d36405cb523b14cc9433f5dc67 Mon Sep 17 00:00:00 2001 +From e2c61551e762b889a2fa7b7f6bbb00f4b7010774 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Feb 2017 17:01:21 +0000 -Subject: [PATCH 188/269] bcm2835-gpio-exp: Driver for GPIO expander via +Subject: [PATCH 186/305] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Pi3 and Compute Module 3 have a GPIO expander that the @@ -136155,10 +136076,10 @@ index 2859db09e25bb945251e85edb39bc43430857168..56b3f0fe1ea3d22fcf207e6df90b640e /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From 97c97764b0c9f476503170f31d13d710e770b809 Mon Sep 17 00:00:00 2001 +From 5cb2c96847c04bd91b5f00fc181a01bb113a69b3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 May 2016 16:30:05 +0100 -Subject: [PATCH 189/269] BCM270X_DT: Add bcm2708-rpi-0-w.dts +Subject: [PATCH 187/305] BCM270X_DT: Add bcm2708-rpi-0-w.dts Add DT support for the Pi Zero W. N.B. It will not be loaded automatically without a corresponding change to the firmware. @@ -136386,10 +136307,10 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + }; +}; -From 4a49a02337cf20f4e58e331dd280cc11ffca3137 Mon Sep 17 00:00:00 2001 +From 7fe980e2d58314379f52eed2a94b26798a56c069 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Mar 2017 09:06:18 +0000 -Subject: [PATCH 190/269] clk-bcm2835: Read max core clock from firmware +Subject: [PATCH 188/305] clk-bcm2835: Read max core clock from firmware The VPU is responsible for managing the core clock, usually under direction from the bcm2835-cpufreq driver but not via the clk-bcm2835 @@ -136517,10 +136438,10 @@ index 8ea29fbc8dc451b9cff502bc1a918ae65fb1b306..fe3298b54cdfb96bd90fb4f39e13921d for (i = 0; !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks", -From 9212faa329aed60c9bfc0130923a808934400b41 Mon Sep 17 00:00:00 2001 +From e05ae88148273a0877056f1044370b76beb6bbf0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 7 Mar 2017 19:48:23 +0000 -Subject: [PATCH 191/269] config: Add CONFIG_CRYPTO_LZ4 +Subject: [PATCH 189/305] config: Add CONFIG_CRYPTO_LZ4 Enabling this options allows LZ4 memory compression. @@ -136557,10 +136478,10 @@ index 2c124bbfa343bf2c160250d055e1509678a80850..1748fcb84bdc3853ffccba93a41cd2dc # CONFIG_CRYPTO_HW is not set CONFIG_ARM_CRYPTO=y -From 3463f2cc120c004b83ff1aa772cf0c45b21c0afe Mon Sep 17 00:00:00 2001 +From 7616b54824ad6218c1877f31170265b413d49e18 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 23 Feb 2017 17:54:31 -0800 -Subject: [PATCH 192/269] drm/vc4: Don't wait for vblank when updating the +Subject: [PATCH 190/305] drm/vc4: Don't wait for vblank when updating the cursor Commonly used desktop environments such as xfce4 and gnome @@ -136617,10 +136538,10 @@ index 881bf489478b01b34e9e4df6013fe608c42215ee..14d69bb4967dedcd3bbc475639a8c27e * expected change from the drm_mode_cursor_universal() * helper. -From 5afef1347eea10e84cced76f1d0a2b26c6266502 Mon Sep 17 00:00:00 2001 +From 68d1a69d9153d6eb40b799d727846e985f1befab Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 6 Mar 2017 12:17:16 -0800 -Subject: [PATCH 193/269] panel-raspberrypi-touchscreen: Round up clk rate to +Subject: [PATCH 191/305] panel-raspberrypi-touchscreen: Round up clk rate to fix DSI panel. Commit 488f9bc8e3def93e0baef53cee2026c2cb0d8956 slightly increased the @@ -136655,10 +136576,10 @@ index 1a536fe4d040f5fafe324baee110a6225dd0be08..7f315f04b109621ca7f3861fdd8acf95 .hsync_start = HACT + HFP, .hsync_end = HACT + HFP + HSW, -From 573328094f77dd6c6b79ad91e1723ec360b5b673 Mon Sep 17 00:00:00 2001 +From af113d1f3fdd77d4c9a566c3c7cb0309ae84d55b Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 20:04:13 +1100 -Subject: [PATCH 194/269] Add support for the AudioInjector.net Octo sound card +Subject: [PATCH 192/305] Add support for the AudioInjector.net Octo sound card --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -137129,10 +137050,10 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:audioinjector-octo-soundcard"); -From 624cbd152a9dfb1705adf73d59f0a0eada4e9888 Mon Sep 17 00:00:00 2001 +From e73df72f27268ea31feb651e29658918bec48d6e Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 21:13:24 +1100 -Subject: [PATCH 195/269] ASoC: bcm2835_i2s.c: relax the ch2 register setting +Subject: [PATCH 193/305] ASoC: bcm2835_i2s.c: relax the ch2 register setting for 8 channels This patch allows ch2 registers to be set for 8 channels of audio. @@ -137161,10 +137082,10 @@ index 6ba20498202ed36906b52096893a88867a79269f..c8dd065aea8414b47aa2ea4fc04168b5 format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); -From 5f8dbf43641bbdbf6b98838e50035f912ddc6066 Mon Sep 17 00:00:00 2001 +From 3d7b9862a0801953a7415bf5e9e0d5f8c4c93e34 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 10 Mar 2017 14:43:15 +0000 -Subject: [PATCH 196/269] bcm2835-v4l2: Fix buffer overflow problem +Subject: [PATCH 194/305] bcm2835-v4l2: Fix buffer overflow problem https://github.com/raspberrypi/linux/issues/1447 port_parameter_get() failed to account for the header @@ -137200,10 +137121,10 @@ index 781322542d5a8295f3d7d5a3eaaf0cac29930c30..e4b243b33f58913f3d2952c97d2a2e3f * but report true size of parameter */ -From fa4d8eb488f238a4176a01283151c657254ae0af Mon Sep 17 00:00:00 2001 +From 426c15ce256ad778da9f3a36d2be290a9a0a5695 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 10 Feb 2017 17:57:08 -0800 -Subject: [PATCH 197/269] build/arm64: Add rules for .dtbo files for dts +Subject: [PATCH 195/305] build/arm64: Add rules for .dtbo files for dts overlays We now create overlays as .dtbo files. @@ -137228,10 +137149,10 @@ index 3635b8662724569d3338ebb620d603c644fe38b7..822fefeb1cd0aa2dc8398f885cf28e9b dtbs: prepare scripts -From 898f4c920f2b1051fce8884a886bc44e49ced7e3 Mon Sep 17 00:00:00 2001 +From 4a4c86b50de77f7b28f18e6444909f96d088665b Mon Sep 17 00:00:00 2001 From: John Greb Date: Wed, 8 Mar 2017 15:12:29 +0000 -Subject: [PATCH 198/269] Match dwc2 device-tree fifo sizes to the hardware +Subject: [PATCH 196/305] Match dwc2 device-tree fifo sizes to the hardware values. Since commit aa381a7259c3f53727bcaa8c5f9359e940a0e3fd was reverted with 3fa9538539ac737096c81f3315a14670b1609092 the g-tx-fifo-size array in the device-tree needs to match the preset values in the bcm2835. @@ -137262,10 +137183,10 @@ index 527abc9f0ddf71f4dc7d58336d87684c931cc2f3..265a16bab008453edba198cf2366c423 }; }; -From a431769232a1185b995d57027f9d2a6b5731690e Mon Sep 17 00:00:00 2001 +From ba5c638de5b564e20839d4b7123f1c3f2540c514 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 5 Mar 2017 11:46:41 +0000 -Subject: [PATCH 199/269] config: Add RTL8XXXU wifi module +Subject: [PATCH 197/305] config: Add RTL8XXXU wifi module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -137297,10 +137218,45 @@ index bf52db66afb2aa18d6f6f9fb9b64dcbd97e24521..4bc0f8b52b7f39f99d650cb9c4cdfdba CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From 1129ad96ef886cbbb908887f4e08fe68926c3b64 Mon Sep 17 00:00:00 2001 +From 0d2c22a40c0f1aad1e9e4e9b0ac2d6bd38cdddde Mon Sep 17 00:00:00 2001 +From: "K. Y. Srinivasan" +Date: Thu, 22 Dec 2016 16:54:00 -0800 +Subject: [PATCH 198/305] Drivers: hv: vmbus: Fix a rescind handling bug + +commit ccb61f8a99e6c29df4fb96a65dad4fad740d5be9 upstream. + +The host can rescind a channel that has been offered to the +guest and once the channel is rescinded, the host does not +respond to any requests on that channel. Deal with the case where +the guest may be blocked waiting for a response from the host. + +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hv/channel.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c +index 1606e7f08f4b36750be747feb5d0e9f36b3e6dd0..9aff4f6f5423a3b03fa834d4f69d4bb5cbc07a07 100644 +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -506,6 +506,11 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) + + wait_for_completion(&info->waitevent); + ++ if (channel->rescind) { ++ ret = -ENODEV; ++ goto post_msg_err; ++ } ++ + post_msg_err: + /* + * If the channel has been rescinded; + +From 737b88e528fe661f4dfe3d00601b43f2dfd6529c Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Mar 2017 12:18:20 +0000 -Subject: [PATCH 200/269] BCM270X_DT: Invert Pi3 power LED to match fw change +Subject: [PATCH 199/305] BCM270X_DT: Invert Pi3 power LED to match fw change Firmware expgpio driver reworked due to complaint over hotplug detect. @@ -137326,10 +137282,10 @@ index 173103aaca503833b5e29530ed94e14c7cab0444..b21d2866d204adc533b46d581028f290 }; -From 327873c238d5f0f023e56597026339ba1ac32c18 Mon Sep 17 00:00:00 2001 +From 0abf8fa2a75023c07aabcbcfbbd4344c713f72ad Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Mar 2017 09:10:05 +0000 -Subject: [PATCH 201/269] BCM270X_DT: Add lm75 to i2c-sensor overlay +Subject: [PATCH 200/305] BCM270X_DT: Add lm75 to i2c-sensor overlay See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=177236 @@ -137392,10 +137348,10 @@ index 31bda8da4cb6a56bfe493a81b918900995fb0589..606b2d5012abf2e85712be631c42ea40 }; }; -From 8f06ec5e33e3464eabfca97c08dcaa838ae0d6de Mon Sep 17 00:00:00 2001 +From cb52d99f26a108454d8a27e1676ab136903bbc96 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Mar 2017 14:23:06 +0000 -Subject: [PATCH 202/269] bcm2835-gpio-exp: Copy/paste error adding base twice +Subject: [PATCH 201/305] bcm2835-gpio-exp: Copy/paste error adding base twice brcmexp_gpio_set was adding gpio->gc.base to the offset twice, so passing an invalid number to the mailbox service. @@ -137421,10 +137377,10 @@ index 681a91492d4c33bdfd42416e069218e8611cc4d9..d68adafaee4ad406f45f4ff0d6b7c1ad set.state = val; /* Output state */ -From fc57975bd64ad13252abdaa2741dba5387f67cb9 Mon Sep 17 00:00:00 2001 +From 5ef66bea064dda3dd226d0f193adbf64b9aadb06 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Mar 2017 11:12:40 +0000 -Subject: [PATCH 203/269] bcm2835-camera: Correct port_parameter_get return +Subject: [PATCH 202/305] bcm2835-camera: Correct port_parameter_get return value The API for port_parameter_get() requires that the @@ -137482,10 +137438,10 @@ index e4b243b33f58913f3d2952c97d2a2e3fbbbd0ae8..ec2853ba9d4b1b0cd6e07a495a424e15 pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, ret, port->component->handle, port->handle, parameter_id); -From 4bed6cdea45f3ae764c67ad7660e7ca54675c45d Mon Sep 17 00:00:00 2001 +From 5139a8a841f16e731bc22509d3d791dda532c919 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Mar 2017 12:24:41 +0000 -Subject: [PATCH 204/269] config: Make spidev a loadable module +Subject: [PATCH 203/305] config: Make spidev a loadable module spidev isn't required early in the boot process, and not all users need it (spi_bcm2835 is a module), so make it a loadable module. @@ -137541,10 +137497,10 @@ index 4bc0f8b52b7f39f99d650cb9c4cdfdba6fac59dd..8d64ce4465f6f276b2d58ed1e2e45fb0 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From 29ab3cd7b0f4c536cdee960a22fa7eacde342412 Mon Sep 17 00:00:00 2001 +From 03494fc360604e1f3f5ca7476352130e41aa9544 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 10:06:56 +0000 -Subject: [PATCH 205/269] ASoC: Add prompt for ICS43432 codec +Subject: [PATCH 204/305] ASoC: Add prompt for ICS43432 codec Without a prompt string, a config setting can't be included in a defconfig. Give CONFIG_SND_SOC_ICS43432 a prompt so that Pi soundcards @@ -137569,10 +137525,10 @@ index 9824cdd04b0c11c45b8cedd0187a0eba8f1dc2d4..c0b88d43df0de283c58ed6158680bc7e config SND_SOC_INNO_RK3036 tristate "Inno codec driver for RK3036 SoC" -From e453f0cd398e6efe9d34b885ec58ce1ca413af3a Mon Sep 17 00:00:00 2001 +From e1a615810770a4302c1d6822513e105d1990e3a4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 16:34:46 +0000 -Subject: [PATCH 206/269] bcm2835-aux: Add aux interrupt controller +Subject: [PATCH 205/305] bcm2835-aux: Add aux interrupt controller The AUX block has a shared interrupt line with a register indicating which devices have active IRQs. Expose this as a nested interrupt @@ -137736,10 +137692,10 @@ index bd750cf2238d61489811e7d7bd3b5f9950ed53c8..41e0702fae4692221980b0d02aed1ba6 BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); if (!onecell) -From 4b0a5af47900cc059c0685a4269e3f17d35a6d17 Mon Sep 17 00:00:00 2001 +From 35bf986c59fa5a714229b3e10b21fd3df0af3fce Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 17:08:44 +0000 -Subject: [PATCH 207/269] BCM270X_DT: Enable AUX interrupt controller in DT +Subject: [PATCH 206/305] BCM270X_DT: Enable AUX interrupt controller in DT See: https://github.com/raspberrypi/linux/issues/1484 https://github.com/raspberrypi/linux/issues/1573 @@ -137792,10 +137748,10 @@ index d3cc586661f903e67a840189c0446aa80e16a44e..348c71bbc913644c04bab43fcb95abe9 #address-cells = <1>; #size-cells = <0>; -From 5f68e7371778455f08e928b4d56971ca7f13f1b9 Mon Sep 17 00:00:00 2001 +From 1be561d6ed7d683395d1a7b8562412ccecc607d6 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 27 Mar 2017 22:26:49 +1100 -Subject: [PATCH 208/269] Audioinjector addons dts : add reset and regulators +Subject: [PATCH 207/305] Audioinjector addons dts : add reset and regulators for the Octo product. This patch adds a reset GPIO for the AudioInjector.net octo sound card. @@ -137862,10 +137818,10 @@ index dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c..a36fa85a61f7eaab35ca481ed1dac621 codec = <&cs42448>; status = "okay"; -From d81f6a1d789f57d1c36b91258c08a69f4eeb0815 Mon Sep 17 00:00:00 2001 +From eb5841fb52cdcecf0279a77286b87cb085248950 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 27 Mar 2017 22:27:26 +1100 -Subject: [PATCH 209/269] AudioInjector Octo : Consolidate sample rates and add +Subject: [PATCH 208/305] AudioInjector Octo : Consolidate sample rates and add a codec reset. This patch consolidates the sample rates which the audioinjector.net octo @@ -138005,10 +137961,10 @@ index 9effea725798640887755dfa688da45338718afc..1198c36c4563b8673e5d386d1dfa92d4 dai->cpu_dai_name = NULL; dai->cpu_of_node = i2s_node; -From b447153a8938ff4f13c114075abbbcc788ecb5bd Mon Sep 17 00:00:00 2001 +From f43535f3ff57ef1215a83b4fd2a229eeb78a7ef7 Mon Sep 17 00:00:00 2001 From: Peter Malkin Date: Mon, 27 Mar 2017 16:38:21 -0700 -Subject: [PATCH 210/269] Driver support for Google voiceHAT soundcard. +Subject: [PATCH 209/305] Driver support for Google voiceHAT soundcard. --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -138513,10 +138469,10 @@ index 0000000000000000000000000000000000000000..225854b8e5298b3c3018f59a49404354 +MODULE_DESCRIPTION("ASoC Driver for Google voiceHAT SoundCard"); +MODULE_LICENSE("GPL v2"); -From 4c8836c546f27ecdc18e88a8d833dc371041d1ed Mon Sep 17 00:00:00 2001 +From 6a70ae83c1f7155eafa39a6a43ccdeba395cb279 Mon Sep 17 00:00:00 2001 From: Raashid Muhammed Date: Mon, 27 Mar 2017 12:35:00 +0530 -Subject: [PATCH 211/269] Add support for Allo Piano DAC 2.1 plus add-on board +Subject: [PATCH 210/305] Add support for Allo Piano DAC 2.1 plus add-on board for Raspberry Pi. The Piano DAC 2.1 has support for 4 channels with subwoofer. @@ -139144,10 +139100,10 @@ index 0000000000000000000000000000000000000000..f66f42abadbd5f9d3fe000676e8297ed +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC Plus"); +MODULE_LICENSE("GPL v2"); -From d16f9d078175353c6da66595257a53021eb29969 Mon Sep 17 00:00:00 2001 +From 6ae7ba918062a63b4bff76642ce92bb0a61ed05f Mon Sep 17 00:00:00 2001 From: BabuSubashChandar Date: Tue, 28 Mar 2017 20:04:42 +0530 -Subject: [PATCH 212/269] Add support for Allo Boss DAC add-on board for +Subject: [PATCH 211/305] Add support for Allo Boss DAC add-on board for Raspberry Pi. (#1924) Signed-off-by: Baswaraj K @@ -139877,10 +139833,10 @@ index 0000000000000000000000000000000000000000..c080e31065d99ab309ab3bdf41a44adf +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Boss DAC"); +MODULE_LICENSE("GPL v2"); -From 5ef08bf183f85e2dbcaa7ca98f5ce752fd0c89fe Mon Sep 17 00:00:00 2001 +From 6f2d186685ef919d85c96cf60dc7113c6775dfaf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 28 Mar 2017 14:22:20 +0100 -Subject: [PATCH 213/269] BCM270X_DT: Allow multiple instances of w1-gpio +Subject: [PATCH 212/305] BCM270X_DT: Allow multiple instances of w1-gpio overlays Upcoming firmware will modify the address portion of node names when @@ -139945,10 +139901,10 @@ index 66a98f6c9601f51483f27803995bec772bb3350e..ef8bfbcabdb31231075d5c281df3b38b <&w1_pins>,"brcm,pins:4"; pullup = <&w1>,"rpi,parasitic-power:0"; -From 6cdb836ec8164ce463556fe15cad56d7b34f348f Mon Sep 17 00:00:00 2001 +From fc53af74e1b532b18015f7bf9c433087071deef3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 28 Mar 2017 17:41:30 +0100 -Subject: [PATCH 214/269] leds-gpio: Remove stray assignment to brightness_set +Subject: [PATCH 213/305] leds-gpio: Remove stray assignment to brightness_set The brightness_set method is intended for use cases that must not block, and can only be used if the GPIO provider can never sleep. @@ -139974,10 +139930,10 @@ index 6a27a693034825de2897bb7b338b60cc10c9e59f..a6b352cb003ff5e6c87cf6d37d6502b6 if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP) { state = gpiod_get_value_cansleep(led_dat->gpiod); -From 60158a9060ede8284904061f1954eee844d18792 Mon Sep 17 00:00:00 2001 +From 0645d60391fabe63a2576f257c39bdbd0e53201b Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Thu, 30 Mar 2017 11:43:57 +1100 -Subject: [PATCH 215/269] Audioinjector Octo : add extra sample rates, fix rst +Subject: [PATCH 214/305] Audioinjector Octo : add extra sample rates, fix rst and use bcm270x regs This patch adds new sample rates to the Audioinjector Octo sound card. The @@ -140139,10 +140095,10 @@ index 1198c36c4563b8673e5d386d1dfa92d43689e297..dcf403ab37639ba79e38278d7e4b1ade if (i2s_node && codec_node) { dai->cpu_dai_name = NULL; -From cd3fd500ae9e4e4a84d8a7228c7b13e1fb8eb0dc Mon Sep 17 00:00:00 2001 +From 7b2d01b2bd1a33617451cf291ef5b44fbfdf41b8 Mon Sep 17 00:00:00 2001 From: BabuSubashChandar C Date: Thu, 30 Mar 2017 20:17:27 +0530 -Subject: [PATCH 216/269] Add support for new clock rate and mute gpios. +Subject: [PATCH 215/305] Add support for new clock rate and mute gpios. Signed-off-by: Baswaraj K Reviewed-by: Deepak @@ -140795,10 +140751,10 @@ index c080e31065d99ab309ab3bdf41a44adfdd8f8039..203ab76c7045b081578e23bda1099dd1 } -From 05f49e701939bcdc7e6c94926c564e319499fa14 Mon Sep 17 00:00:00 2001 +From cfa12863b7ea4d5ad82a0a551f42a9e8aa14a96c Mon Sep 17 00:00:00 2001 From: BabuSubashChandar Date: Sat, 1 Apr 2017 00:46:52 +0530 -Subject: [PATCH 217/269] Add clock changes and mute gpios (#1938) +Subject: [PATCH 216/305] Add clock changes and mute gpios (#1938) Also improve code style and adhere to ALSA coding conventions. @@ -141491,10 +141447,10 @@ index f66f42abadbd5f9d3fe000676e8297ed91630e47..56e43f98846b41e487b3089813f7edc3 } -From 683456e9671d1b32c57b5169e47999f380471a1c Mon Sep 17 00:00:00 2001 +From eb23d4530014d2c301397098d09b614ad90d81d9 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Tue, 4 Apr 2017 19:20:59 +1000 -Subject: [PATCH 218/269] Audioinjector : make the octo and pi sound cards have +Subject: [PATCH 217/305] Audioinjector : make the octo and pi sound cards have different driver names This patch gives the audioinjector octo and pi soundcards different driver @@ -141531,10 +141487,10 @@ index ef54e0f07ea03f59e9957b5d98f3e7fdc998e469..491906bbf446826e55dd843f28e4860f .of_match_table = audioinjector_pi_soundcard_of_match, }, -From bcecdbafb8a1e3129c0a3b839d44e77dc8a103ab Mon Sep 17 00:00:00 2001 +From 3ebed4e5ae9d4e4e01df37c4b4757ad7ec556782 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Tue, 4 Apr 2017 19:23:04 +1000 -Subject: [PATCH 219/269] Audioinjector octo : Make the playback and capture +Subject: [PATCH 218/305] Audioinjector octo : Make the playback and capture symmetric This patch ensures that the sample rate and channel count of the audioinjector @@ -141557,1382 +141513,10 @@ index 49115c8e20ce1a2ba5a99feb8983a1cafb052ca2..5e79f4eff93a21ed3495c77a90f73525 }; -From d03c6c96e186c92359d791d33515af4bdf39dc11 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 7 Mar 2017 14:51:03 -0800 -Subject: [PATCH 220/269] drm/vc4: Allow using more than 256MB of CMA memory. - -Until now, we've had to limit Raspberry Pi to 256MB of CMA memory to -keep from triggering the hardware addressing bug between of the tile -binner of the tile alloc memory (where the top 4 bits come from the -tile state data array's address). - -To work around that and allow more memory to be reserved for graphics, -allocate a single BO to store tile state data arrays and tile -alloc/overflow memory while the GPU is active, and make sure that that -one BO doesn't happen to cross a 256MB boundary. With that in place, -we can allocate textures and shaders anywhere in system memory (still -contiguous, of course). - -Signed-off-by: Eric Anholt ---- - drivers/gpu/drm/vc4/vc4_drv.h | 28 +++++-- - drivers/gpu/drm/vc4/vc4_gem.c | 12 ++- - drivers/gpu/drm/vc4/vc4_irq.c | 61 +++++++-------- - drivers/gpu/drm/vc4/vc4_render_cl.c | 3 +- - drivers/gpu/drm/vc4/vc4_v3d.c | 150 ++++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/vc4/vc4_validate.c | 54 ++++++------- - 6 files changed, 234 insertions(+), 74 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 44a8e6fda2b576fed63d93ef34e076cebf90d64c..9e50bc25b2be71079d52a861c25f3fe7c4db0830 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -97,12 +97,23 @@ struct vc4_dev { - */ - struct list_head seqno_cb_list; - -- /* The binner overflow memory that's currently set up in -- * BPOA/BPOS registers. When overflow occurs and a new one is -- * allocated, the previous one will be moved to -- * vc4->current_exec's free list. -+ /* The memory used for storing binner tile alloc, tile state, -+ * and overflow memory allocations. This is freed when V3D -+ * powers down. - */ -- struct vc4_bo *overflow_mem; -+ struct vc4_bo *bin_bo; -+ -+ /* Size of blocks allocated within bin_bo. */ -+ uint32_t bin_alloc_size; -+ -+ /* Bitmask of the bin_alloc_size chunks in bin_bo that are -+ * used. -+ */ -+ uint32_t bin_alloc_used; -+ -+ /* Bitmask of the current bin_alloc used for overflow memory. */ -+ uint32_t bin_alloc_overflow; -+ - struct work_struct overflow_mem_work; - - int power_refcount; -@@ -295,8 +306,12 @@ struct vc4_exec_info { - bool found_increment_semaphore_packet; - bool found_flush; - uint8_t bin_tiles_x, bin_tiles_y; -- struct drm_gem_cma_object *tile_bo; -+ /* Physical address of the start of the tile alloc array -+ * (where each tile's binned CL will start) -+ */ - uint32_t tile_alloc_offset; -+ /* Bitmask of which binner slots are freed when this job completes. */ -+ uint32_t bin_slots; - - /** - * Computed addresses pointing into exec_bo where we start the -@@ -531,6 +546,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, - extern struct platform_driver vc4_v3d_driver; - int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused); - int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused); -+int vc4_v3d_get_bin_slot(struct vc4_dev *vc4); - - /* vc4_validate.c */ - int -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index ab3016982466c3ca35ba479050ee107d26eb50ac..a5029ab49068bdbd69411cccbdb6f5111f387e38 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -695,6 +695,7 @@ static void - vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) - { - struct vc4_dev *vc4 = to_vc4_dev(dev); -+ unsigned long irqflags; - unsigned i; - - if (exec->bo) { -@@ -710,6 +711,11 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) - drm_gem_object_unreference_unlocked(&bo->base.base); - } - -+ /* Free up the allocation of any bin slots we used. */ -+ spin_lock_irqsave(&vc4->job_lock, irqflags); -+ vc4->bin_alloc_used &= ~exec->bin_slots; -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); -+ - mutex_lock(&vc4->power_lock); - if (--vc4->power_refcount == 0) { - pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -@@ -951,9 +957,9 @@ vc4_gem_destroy(struct drm_device *dev) - /* V3D should already have disabled its interrupt and cleared - * the overflow allocation registers. Now free the object. - */ -- if (vc4->overflow_mem) { -- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); -- vc4->overflow_mem = NULL; -+ if (vc4->bin_bo) { -+ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); -+ vc4->bin_bo = NULL; - } - - if (vc4->hang_state) -diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c -index 094bc6a475c1773923dfe8225cba9886fc9e5026..c43ee1e646f6dd68fe19dacdbcf9322da13c4280 100644 ---- a/drivers/gpu/drm/vc4/vc4_irq.c -+++ b/drivers/gpu/drm/vc4/vc4_irq.c -@@ -58,50 +58,45 @@ vc4_overflow_mem_work(struct work_struct *work) - { - struct vc4_dev *vc4 = - container_of(work, struct vc4_dev, overflow_mem_work); -- struct drm_device *dev = vc4->dev; -- struct vc4_bo *bo; -+ struct vc4_bo *bo = vc4->bin_bo; -+ int bin_bo_slot; -+ struct vc4_exec_info *exec; -+ unsigned long irqflags; - -- bo = vc4_bo_create(dev, 256 * 1024, true); -- if (IS_ERR(bo)) { -+ bin_bo_slot = vc4_v3d_get_bin_slot(vc4); -+ if (bin_bo_slot < 0) { - DRM_ERROR("Couldn't allocate binner overflow mem\n"); - return; - } - -- /* If there's a job executing currently, then our previous -- * overflow allocation is getting used in that job and we need -- * to queue it to be released when the job is done. But if no -- * job is executing at all, then we can free the old overflow -- * object direcctly. -- * -- * No lock necessary for this pointer since we're the only -- * ones that update the pointer, and our workqueue won't -- * reenter. -- */ -- if (vc4->overflow_mem) { -- struct vc4_exec_info *current_exec; -- unsigned long irqflags; -- -- spin_lock_irqsave(&vc4->job_lock, irqflags); -- current_exec = vc4_first_bin_job(vc4); -- if (!current_exec) -- current_exec = vc4_last_render_job(vc4); -- if (current_exec) { -- vc4->overflow_mem->seqno = current_exec->seqno; -- list_add_tail(&vc4->overflow_mem->unref_head, -- ¤t_exec->unref_list); -- vc4->overflow_mem = NULL; -+ spin_lock_irqsave(&vc4->job_lock, irqflags); -+ -+ if (vc4->bin_alloc_overflow) { -+ /* If we had overflow memory allocated previously, -+ * then that chunk will free when the current bin job -+ * is done. If we don't have a bin job running, then -+ * the chunk will be done whenever the list of render -+ * jobs has drained. -+ */ -+ exec = vc4_first_bin_job(vc4); -+ if (!exec) -+ exec = vc4_last_render_job(vc4); -+ if (exec) { -+ exec->bin_slots |= vc4->bin_alloc_overflow; -+ } else { -+ /* There's nothing queued in the hardware, so -+ * the old slot is free immediately. -+ */ -+ vc4->bin_alloc_used &= ~vc4->bin_alloc_overflow; - } -- spin_unlock_irqrestore(&vc4->job_lock, irqflags); - } -+ vc4->bin_alloc_overflow = BIT(bin_bo_slot); - -- if (vc4->overflow_mem) -- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); -- vc4->overflow_mem = bo; -- -- V3D_WRITE(V3D_BPOA, bo->base.paddr); -+ V3D_WRITE(V3D_BPOA, bo->base.paddr + bin_bo_slot * vc4->bin_alloc_size); - V3D_WRITE(V3D_BPOS, bo->base.base.size); - V3D_WRITE(V3D_INTCTL, V3D_INT_OUTOMEM); - V3D_WRITE(V3D_INTENA, V3D_INT_OUTOMEM); -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); - } - - static void -diff --git a/drivers/gpu/drm/vc4/vc4_render_cl.c b/drivers/gpu/drm/vc4/vc4_render_cl.c -index 5cdd003605f57c99faf31832e3f3dd38a75b7402..6face6aa0890b59bc91d3740fa063a5c46f7cc21 100644 ---- a/drivers/gpu/drm/vc4/vc4_render_cl.c -+++ b/drivers/gpu/drm/vc4/vc4_render_cl.c -@@ -178,8 +178,7 @@ static void emit_tile(struct vc4_exec_info *exec, - - if (has_bin) { - rcl_u8(setup, VC4_PACKET_BRANCH_TO_SUB_LIST); -- rcl_u32(setup, (exec->tile_bo->paddr + -- exec->tile_alloc_offset + -+ rcl_u32(setup, (exec->tile_alloc_offset + - (y * exec->bin_tiles_x + x) * 32)); - } - -diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c -index 1d9e5a6edd22c29ce8b2990c9c35627aa1af2bd8..da79d8511dfb4f631fd3ad4c3680b312f44bd454 100644 ---- a/drivers/gpu/drm/vc4/vc4_v3d.c -+++ b/drivers/gpu/drm/vc4/vc4_v3d.c -@@ -159,6 +159,144 @@ static void vc4_v3d_init_hw(struct drm_device *dev) - V3D_WRITE(V3D_VPMBASE, 0); - } - -+int vc4_v3d_get_bin_slot(struct vc4_dev *vc4) -+{ -+ struct drm_device *dev = vc4->dev; -+ unsigned long irqflags; -+ int slot; -+ uint64_t seqno = 0; -+ struct vc4_exec_info *exec; -+ -+try_again: -+ spin_lock_irqsave(&vc4->job_lock, irqflags); -+ slot = ffs(~vc4->bin_alloc_used); -+ if (slot != 0) { -+ /* Switch from ffs() bit index to a 0-based index. */ -+ slot--; -+ vc4->bin_alloc_used |= BIT(slot); -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); -+ return slot; -+ } -+ -+ /* Couldn't find an open slot. Wait for render to complete -+ * and try again. -+ */ -+ exec = vc4_last_render_job(vc4); -+ if (exec) -+ seqno = exec->seqno; -+ spin_unlock_irqrestore(&vc4->job_lock, irqflags); -+ -+ if (seqno) { -+ int ret = vc4_wait_for_seqno(dev, seqno, ~0ull, true); -+ -+ if (ret == 0) -+ goto try_again; -+ -+ return ret; -+ } -+ -+ return -ENOMEM; -+} -+ -+/** -+ * vc4_allocate_bin_bo() - allocates the memory that will be used for -+ * tile binning. -+ * -+ * The binner has a limitation that the addresses in the tile state -+ * buffer that point into the tile alloc buffer or binner overflow -+ * memory only have 28 bits (256MB), and the top 4 on the bus for -+ * tile alloc references end up coming from the tile state buffer's -+ * address. -+ * -+ * To work around this, we allocate a single large buffer while V3D is -+ * in use, make sure that it has the top 4 bits constant across its -+ * entire extent, and then put the tile state, tile alloc, and binner -+ * overflow memory inside that buffer. -+ * -+ * This creates a limitation where we may not be able to execute a job -+ * if it doesn't fit within the buffer that we allocated up front. -+ * However, it turns out that 16MB is "enough for anybody", and -+ * real-world applications run into allocation failures from the -+ * overall CMA pool before they make scenes complicated enough to run -+ * out of bin space. -+ */ -+int -+vc4_allocate_bin_bo(struct drm_device *drm) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ struct vc4_v3d *v3d = vc4->v3d; -+ uint32_t size = 16 * 1024 * 1024; -+ int ret = 0; -+ struct list_head list; -+ -+ /* We may need to try allocating more than once to get a BO -+ * that doesn't cross 256MB. Track the ones we've allocated -+ * that failed so far, so that we can free them when we've got -+ * one that succeeded (if we freed them right away, our next -+ * allocation would probably be the same chunk of memory). -+ */ -+ INIT_LIST_HEAD(&list); -+ -+ while (true) { -+ struct vc4_bo *bo = vc4_bo_create(drm, size, true); -+ -+ if (IS_ERR(bo)) { -+ ret = PTR_ERR(bo); -+ -+ dev_err(&v3d->pdev->dev, -+ "Failed to allocate memory for tile binning: " -+ "%d. You may need to enable CMA or give it " -+ "more memory.", -+ ret); -+ break; -+ } -+ -+ /* Check if this BO won't trigger the addressing bug. */ -+ if ((bo->base.paddr & 0xf0000000) == -+ ((bo->base.paddr + bo->base.base.size - 1) & 0xf0000000)) { -+ vc4->bin_bo = bo; -+ -+ /* Set up for allocating 512KB chunks of -+ * binner memory. The biggest allocation we -+ * need to do is for the initial tile alloc + -+ * tile state buffer. We can render to a -+ * maximum of ((2048*2048) / (32*32) = 4096 -+ * tiles in a frame (until we do floating -+ * point rendering, at which point it would be -+ * 8192). Tile state is 48b/tile (rounded to -+ * a page), and tile alloc is 32b/tile -+ * (rounded to a page), plus a page of extra, -+ * for a total of 320kb for our worst-case. -+ * We choose 512kb so that it divides evenly -+ * into our 16MB, and the rest of the 512kb -+ * will be used as storage for the overflow -+ * from the initial 32b CL per bin. -+ */ -+ vc4->bin_alloc_size = 512 * 1024; -+ vc4->bin_alloc_used = 0; -+ vc4->bin_alloc_overflow = 0; -+ WARN_ON_ONCE(sizeof(vc4->bin_alloc_used) * 8 != -+ bo->base.base.size / vc4->bin_alloc_size); -+ -+ break; -+ } -+ -+ /* Put it on the list to free later, and try again. */ -+ list_add(&bo->unref_head, &list); -+ } -+ -+ /* Free all the BOs we allocated but didn't choose. */ -+ while (!list_empty(&list)) { -+ struct vc4_bo *bo = list_last_entry(&list, -+ struct vc4_bo, unref_head); -+ -+ list_del(&bo->unref_head); -+ drm_gem_object_unreference_unlocked(&bo->base.base); -+ } -+ -+ return ret; -+} -+ - #ifdef CONFIG_PM - static int vc4_v3d_runtime_suspend(struct device *dev) - { -@@ -167,6 +305,9 @@ static int vc4_v3d_runtime_suspend(struct device *dev) - - vc4_irq_uninstall(vc4->dev); - -+ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); -+ vc4->bin_bo = NULL; -+ - return 0; - } - -@@ -174,6 +315,11 @@ static int vc4_v3d_runtime_resume(struct device *dev) - { - struct vc4_v3d *v3d = dev_get_drvdata(dev); - struct vc4_dev *vc4 = v3d->vc4; -+ int ret; -+ -+ ret = vc4_allocate_bin_bo(vc4->dev); -+ if (ret) -+ return ret; - - vc4_v3d_init_hw(vc4->dev); - vc4_irq_postinstall(vc4->dev); -@@ -226,6 +372,10 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) - return -EINVAL; - } - -+ ret = vc4_allocate_bin_bo(drm); -+ if (ret) -+ return ret; -+ - /* Reset the binner overflow address/size at setup, to be sure - * we don't reuse an old one. - */ -diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c -index 9fd171c361c23b52a4d507919ec7e26fd1e87aac..59d808e2a6cc6f3173b1309cc4f491098886cf36 100644 ---- a/drivers/gpu/drm/vc4/vc4_validate.c -+++ b/drivers/gpu/drm/vc4/vc4_validate.c -@@ -340,10 +340,11 @@ static int - validate_tile_binning_config(VALIDATE_ARGS) - { - struct drm_device *dev = exec->exec_bo->base.dev; -- struct vc4_bo *tile_bo; -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - uint8_t flags; -- uint32_t tile_state_size, tile_alloc_size; -- uint32_t tile_count; -+ uint32_t tile_state_size; -+ uint32_t tile_count, bin_addr; -+ int bin_slot; - - if (exec->found_tile_binning_mode_config_packet) { - DRM_ERROR("Duplicate VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); -@@ -369,13 +370,28 @@ validate_tile_binning_config(VALIDATE_ARGS) - return -EINVAL; - } - -+ bin_slot = vc4_v3d_get_bin_slot(vc4); -+ if (bin_slot < 0) { -+ if (bin_slot != -EINTR && bin_slot != -ERESTARTSYS) { -+ DRM_ERROR("Failed to allocate binner memory: %d\n", -+ bin_slot); -+ } -+ return bin_slot; -+ } -+ -+ /* The slot we allocated will only be used by this job, and is -+ * free when the job completes rendering. -+ */ -+ exec->bin_slots |= BIT(bin_slot); -+ bin_addr = vc4->bin_bo->base.paddr + bin_slot * vc4->bin_alloc_size; -+ - /* The tile state data array is 48 bytes per tile, and we put it at - * the start of a BO containing both it and the tile alloc. - */ - tile_state_size = 48 * tile_count; - - /* Since the tile alloc array will follow us, align. */ -- exec->tile_alloc_offset = roundup(tile_state_size, 4096); -+ exec->tile_alloc_offset = bin_addr + roundup(tile_state_size, 4096); - - *(uint8_t *)(validated + 14) = - ((flags & ~(VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_MASK | -@@ -386,35 +402,13 @@ validate_tile_binning_config(VALIDATE_ARGS) - VC4_SET_FIELD(VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_128, - VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE)); - -- /* Initial block size. */ -- tile_alloc_size = 32 * tile_count; -- -- /* -- * The initial allocation gets rounded to the next 256 bytes before -- * the hardware starts fulfilling further allocations. -- */ -- tile_alloc_size = roundup(tile_alloc_size, 256); -- -- /* Add space for the extra allocations. This is what gets used first, -- * before overflow memory. It must have at least 4096 bytes, but we -- * want to avoid overflow memory usage if possible. -- */ -- tile_alloc_size += 1024 * 1024; -- -- tile_bo = vc4_bo_create(dev, exec->tile_alloc_offset + tile_alloc_size, -- true); -- exec->tile_bo = &tile_bo->base; -- if (IS_ERR(exec->tile_bo)) -- return PTR_ERR(exec->tile_bo); -- list_add_tail(&tile_bo->unref_head, &exec->unref_list); -- - /* tile alloc address. */ -- *(uint32_t *)(validated + 0) = (exec->tile_bo->paddr + -- exec->tile_alloc_offset); -+ *(uint32_t *)(validated + 0) = exec->tile_alloc_offset; - /* tile alloc size. */ -- *(uint32_t *)(validated + 4) = tile_alloc_size; -+ *(uint32_t *)(validated + 4) = (bin_addr + vc4->bin_alloc_size - -+ exec->tile_alloc_offset); - /* tile state address. */ -- *(uint32_t *)(validated + 8) = exec->tile_bo->paddr; -+ *(uint32_t *)(validated + 8) = bin_addr; - - return 0; - } - -From 6bab44ea5a558bac94b3fb1579d3e7badb113df2 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 30 Mar 2017 10:23:27 -0700 -Subject: [PATCH 221/269] Revert "drm/vc4: Verify at boot that CMA doesn't - cross a 256MB boundary." - -This reverts commit 016c804fa69381bd23a1a13cba08a3c4557fcdff. The -restriction was lifted by the previous commit. ---- - drivers/base/dma-contiguous.c | 1 - - drivers/gpu/drm/vc4/vc4_v3d.c | 18 ------------------ - mm/cma.c | 2 -- - 3 files changed, 21 deletions(-) - -diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c -index 60f5c2591ccdb0202461458eab4035cfba731b8b..e167a1e1bccb062efef2595fcd5299301a97df80 100644 ---- a/drivers/base/dma-contiguous.c -+++ b/drivers/base/dma-contiguous.c -@@ -35,7 +35,6 @@ - #endif - - struct cma *dma_contiguous_default_area; --EXPORT_SYMBOL(dma_contiguous_default_area); - - /* - * Default global CMA area size can be defined in kernel's .config. -diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c -index da79d8511dfb4f631fd3ad4c3680b312f44bd454..882ec06225f1d5caca71bdb5c69664188192c2e2 100644 ---- a/drivers/gpu/drm/vc4/vc4_v3d.c -+++ b/drivers/gpu/drm/vc4/vc4_v3d.c -@@ -16,10 +16,7 @@ - * this program. If not, see . - */ - --#include "linux/init.h" --#include "linux/cma.h" - #include "linux/component.h" --#include "linux/dma-contiguous.h" - #include "linux/pm_runtime.h" - #include "vc4_drv.h" - #include "vc4_regs.h" -@@ -334,23 +331,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) - struct drm_device *drm = dev_get_drvdata(master); - struct vc4_dev *vc4 = to_vc4_dev(drm); - struct vc4_v3d *v3d = NULL; -- struct cma *cma; - int ret; - -- cma = dev_get_cma_area(dev); -- if (!cma) -- return -EINVAL; -- -- if ((cma_get_base(cma) & 0xf0000000) != -- ((cma_get_base(cma) + cma_get_size(cma) - 1) & 0xf0000000)) { -- DRM_ERROR("V3D requires that the CMA area (0x%08lx - 0x%08lx) " -- "not span a 256MB boundary, or memory corruption " -- "would happen.\n", -- (long)cma_get_base(cma), -- cma_get_base(cma) + cma_get_size(cma)); -- return -EINVAL; -- } -- - v3d = devm_kzalloc(&pdev->dev, sizeof(*v3d), GFP_KERNEL); - if (!v3d) - return -ENOMEM; -diff --git a/mm/cma.c b/mm/cma.c -index b50245282a18bc790da0f901944c2e670ffac2d2..c960459eda7e640ea55be1d4ed80c6a9125a8877 100644 ---- a/mm/cma.c -+++ b/mm/cma.c -@@ -47,13 +47,11 @@ phys_addr_t cma_get_base(const struct cma *cma) - { - return PFN_PHYS(cma->base_pfn); - } --EXPORT_SYMBOL(cma_get_base); - - unsigned long cma_get_size(const struct cma *cma) - { - return cma->count << PAGE_SHIFT; - } --EXPORT_SYMBOL(cma_get_size); - - static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, - int align_order) - -From 0d4a532da7dab2d62ee4bfd0f5949f7a1febaff9 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Mon, 27 Feb 2017 12:28:02 -0800 -Subject: [PATCH 222/269] drm/vc4: Add HDMI audio support - -The HDMI encoder IP embeds all needed blocks to output audio, with a -custom DAI called MAI moving audio between the two parts of the HDMI -core. This driver now exposes a sound card to let users stream audio -to their display. - -Using the hdmi-codec driver has been considered here, but MAI meant -having to significantly rework hdmi-codec, and it would have left -little shared code with the I2S mode anyway. - -The encoder requires that the audio be SPDIF-formatted frames only, -which alsalib will format-convert for us. - -This patch is the combined work of Eric Anholt (initial register setup -with a separate dmaengine driver and using simple-audio-card) and -Boris Brezillon (moving it all into HDMI, massive debug to get it -actually working), and which Eric has the permission to release. - -v2: Drop "-audio" from sound card name, since that's already implied - (suggestion by Boris) - -Signed-off-by: Eric Anholt -Acked-by: Boris Brezillon -Link: http://patchwork.freedesktop.org/patch/msgid/20170227202803.12855-2-eric@anholt.net ---- - drivers/gpu/drm/vc4/Kconfig | 4 + - drivers/gpu/drm/vc4/vc4_hdmi.c | 494 ++++++++++++++++++++++++++++++++++++++++- - drivers/gpu/drm/vc4/vc4_regs.h | 107 ++++++++- - 3 files changed, 603 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig -index e1517d07cb7d22776ca164a5d2d9b87e55a5563a..973b4203c0b264115b7cd9d4a433b449bd0ec3b3 100644 ---- a/drivers/gpu/drm/vc4/Kconfig -+++ b/drivers/gpu/drm/vc4/Kconfig -@@ -2,11 +2,15 @@ config DRM_VC4 - tristate "Broadcom VC4 Graphics" - depends on ARCH_BCM2835 || COMPILE_TEST - depends on DRM -+ depends on SND && SND_SOC - depends on COMMON_CLK - select DRM_KMS_HELPER - select DRM_KMS_CMA_HELPER - select DRM_GEM_CMA_HELPER - select DRM_PANEL -+ select SND_PCM -+ select SND_PCM_ELD -+ select SND_SOC_GENERIC_DMAENGINE_PCM - select DRM_MIPI_DSI - help - Choose this option if you have a system that has a Broadcom -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index c4cb2e26de32f06db0abf3fd94b3117c3292eed5..8db1016cad929438f30ea44c6974dcb340b74596 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -31,11 +31,27 @@ - #include "linux/clk.h" - #include "linux/component.h" - #include "linux/i2c.h" -+#include "linux/of_address.h" - #include "linux/of_gpio.h" - #include "linux/of_platform.h" -+#include "linux/rational.h" -+#include "sound/dmaengine_pcm.h" -+#include "sound/pcm_drm_eld.h" -+#include "sound/pcm_params.h" -+#include "sound/soc.h" - #include "vc4_drv.h" - #include "vc4_regs.h" - -+/* HDMI audio information */ -+struct vc4_hdmi_audio { -+ struct snd_soc_card card; -+ struct snd_soc_dai_link link; -+ int samplerate; -+ int channels; -+ struct snd_dmaengine_dai_dma_data dma_data; -+ struct snd_pcm_substream *substream; -+}; -+ - /* General HDMI hardware state. */ - struct vc4_hdmi { - struct platform_device *pdev; -@@ -43,6 +59,8 @@ struct vc4_hdmi { - struct drm_encoder *encoder; - struct drm_connector *connector; - -+ struct vc4_hdmi_audio audio; -+ - struct i2c_adapter *ddc; - void __iomem *hdmicore_regs; - void __iomem *hd_regs; -@@ -98,6 +116,10 @@ static const struct { - HDMI_REG(VC4_HDMI_SW_RESET_CONTROL), - HDMI_REG(VC4_HDMI_HOTPLUG_INT), - HDMI_REG(VC4_HDMI_HOTPLUG), -+ HDMI_REG(VC4_HDMI_MAI_CHANNEL_MAP), -+ HDMI_REG(VC4_HDMI_MAI_CONFIG), -+ HDMI_REG(VC4_HDMI_MAI_FORMAT), -+ HDMI_REG(VC4_HDMI_AUDIO_PACKET_CONFIG), - HDMI_REG(VC4_HDMI_RAM_PACKET_CONFIG), - HDMI_REG(VC4_HDMI_HORZA), - HDMI_REG(VC4_HDMI_HORZB), -@@ -108,6 +130,7 @@ static const struct { - HDMI_REG(VC4_HDMI_VERTB0), - HDMI_REG(VC4_HDMI_VERTB1), - HDMI_REG(VC4_HDMI_TX_PHY_RESET_CTL), -+ HDMI_REG(VC4_HDMI_TX_PHY_CTL0), - }; - - static const struct { -@@ -116,6 +139,9 @@ static const struct { - } hd_regs[] = { - HDMI_REG(VC4_HD_M_CTL), - HDMI_REG(VC4_HD_MAI_CTL), -+ HDMI_REG(VC4_HD_MAI_THR), -+ HDMI_REG(VC4_HD_MAI_FMT), -+ HDMI_REG(VC4_HD_MAI_SMP), - HDMI_REG(VC4_HD_VID_CTL), - HDMI_REG(VC4_HD_CSC_CTL), - HDMI_REG(VC4_HD_FRAME_COUNT), -@@ -215,6 +241,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) - - drm_mode_connector_update_edid_property(connector, edid); - ret = drm_add_edid_modes(connector, edid); -+ drm_edid_to_eld(connector, edid); - - return ret; - } -@@ -300,7 +327,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, - 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; -+ u32 packet_reg = VC4_HDMI_RAM_PACKET(packet_id); - uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; - ssize_t len, i; - int ret; -@@ -385,6 +412,24 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder) - vc4_hdmi_write_infoframe(encoder, &frame); - } - -+static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder) -+{ -+ struct drm_device *drm = encoder->dev; -+ struct vc4_dev *vc4 = drm->dev_private; -+ struct vc4_hdmi *hdmi = vc4->hdmi; -+ union hdmi_infoframe frame; -+ int ret; -+ -+ ret = hdmi_audio_infoframe_init(&frame.audio); -+ -+ frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM; -+ frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM; -+ frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM; -+ frame.audio.channels = hdmi->audio.channels; -+ -+ vc4_hdmi_write_infoframe(encoder, &frame); -+} -+ - static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) - { - vc4_hdmi_set_avi_infoframe(encoder); -@@ -591,6 +636,447 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { - .enable = vc4_hdmi_encoder_enable, - }; - -+/* HDMI audio codec callbacks */ -+static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *hdmi) -+{ -+ struct drm_device *drm = hdmi->encoder->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ u32 hsm_clock = clk_get_rate(hdmi->hsm_clock); -+ unsigned long n, m; -+ -+ rational_best_approximation(hsm_clock, hdmi->audio.samplerate, -+ VC4_HD_MAI_SMP_N_MASK >> -+ VC4_HD_MAI_SMP_N_SHIFT, -+ (VC4_HD_MAI_SMP_M_MASK >> -+ VC4_HD_MAI_SMP_M_SHIFT) + 1, -+ &n, &m); -+ -+ HD_WRITE(VC4_HD_MAI_SMP, -+ VC4_SET_FIELD(n, VC4_HD_MAI_SMP_N) | -+ VC4_SET_FIELD(m - 1, VC4_HD_MAI_SMP_M)); -+} -+ -+static void vc4_hdmi_set_n_cts(struct vc4_hdmi *hdmi) -+{ -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_crtc *crtc = encoder->crtc; -+ struct drm_device *drm = encoder->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ const struct drm_display_mode *mode = &crtc->state->adjusted_mode; -+ u32 samplerate = hdmi->audio.samplerate; -+ u32 n, cts; -+ u64 tmp; -+ -+ n = 128 * samplerate / 1000; -+ tmp = (u64)(mode->clock * 1000) * n; -+ do_div(tmp, 128 * samplerate); -+ cts = tmp; -+ -+ HDMI_WRITE(VC4_HDMI_CRP_CFG, -+ VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN | -+ VC4_SET_FIELD(n, VC4_HDMI_CRP_CFG_N)); -+ -+ /* -+ * We could get slightly more accurate clocks in some cases by -+ * providing a CTS_1 value. The two CTS values are alternated -+ * between based on the period fields -+ */ -+ HDMI_WRITE(VC4_HDMI_CTS_0, cts); -+ HDMI_WRITE(VC4_HDMI_CTS_1, cts); -+} -+ -+static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) -+{ -+ struct snd_soc_card *card = snd_soc_dai_get_drvdata(dai); -+ -+ return snd_soc_card_get_drvdata(card); -+} -+ -+static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct vc4_dev *vc4 = to_vc4_dev(encoder->dev); -+ int ret; -+ -+ if (hdmi->audio.substream && hdmi->audio.substream != substream) -+ return -EINVAL; -+ -+ hdmi->audio.substream = substream; -+ -+ /* -+ * If the HDMI encoder hasn't probed, or the encoder is -+ * currently in DVI mode, treat the codec dai as missing. -+ */ -+ if (!encoder->crtc || !(HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & -+ VC4_HDMI_RAM_PACKET_ENABLE)) -+ return -ENODEV; -+ -+ ret = snd_pcm_hw_constraint_eld(substream->runtime, -+ hdmi->connector->eld); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+ -+static int vc4_hdmi_audio_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) -+{ -+ return 0; -+} -+ -+static void vc4_hdmi_audio_reset(struct vc4_hdmi *hdmi) -+{ -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_device *drm = encoder->dev; -+ struct device *dev = &hdmi->pdev->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ int ret; -+ -+ ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO); -+ if (ret) -+ dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); -+ -+ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_RESET); -+ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_ERRORF); -+ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_FLUSH); -+} -+ -+static void vc4_hdmi_audio_shutdown(struct snd_pcm_substream *substream, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ -+ if (substream != hdmi->audio.substream) -+ return; -+ -+ vc4_hdmi_audio_reset(hdmi); -+ -+ hdmi->audio.substream = NULL; -+} -+ -+/* HDMI audio codec callbacks */ -+static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_device *drm = encoder->dev; -+ struct device *dev = &hdmi->pdev->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ u32 audio_packet_config, channel_mask; -+ u32 channel_map, i; -+ -+ if (substream != hdmi->audio.substream) -+ return -EINVAL; -+ -+ dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, -+ params_rate(params), params_width(params), -+ params_channels(params)); -+ -+ hdmi->audio.channels = params_channels(params); -+ hdmi->audio.samplerate = params_rate(params); -+ -+ HD_WRITE(VC4_HD_MAI_CTL, -+ VC4_HD_MAI_CTL_RESET | -+ VC4_HD_MAI_CTL_FLUSH | -+ VC4_HD_MAI_CTL_DLATE | -+ VC4_HD_MAI_CTL_ERRORE | -+ VC4_HD_MAI_CTL_ERRORF); -+ -+ vc4_hdmi_audio_set_mai_clock(hdmi); -+ -+ audio_packet_config = -+ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT | -+ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS | -+ VC4_SET_FIELD(0xf, VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER); -+ -+ channel_mask = GENMASK(hdmi->audio.channels - 1, 0); -+ audio_packet_config |= VC4_SET_FIELD(channel_mask, -+ VC4_HDMI_AUDIO_PACKET_CEA_MASK); -+ -+ /* Set the MAI threshold. This logic mimics the firmware's. */ -+ if (hdmi->audio.samplerate > 96000) { -+ HD_WRITE(VC4_HD_MAI_THR, -+ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); -+ } else if (hdmi->audio.samplerate > 48000) { -+ HD_WRITE(VC4_HD_MAI_THR, -+ VC4_SET_FIELD(0x14, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); -+ } else { -+ HD_WRITE(VC4_HD_MAI_THR, -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | -+ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); -+ } -+ -+ HDMI_WRITE(VC4_HDMI_MAI_CONFIG, -+ VC4_HDMI_MAI_CONFIG_BIT_REVERSE | -+ VC4_SET_FIELD(channel_mask, VC4_HDMI_MAI_CHANNEL_MASK)); -+ -+ channel_map = 0; -+ for (i = 0; i < 8; i++) { -+ if (channel_mask & BIT(i)) -+ channel_map |= i << (3 * i); -+ } -+ -+ HDMI_WRITE(VC4_HDMI_MAI_CHANNEL_MAP, channel_map); -+ HDMI_WRITE(VC4_HDMI_AUDIO_PACKET_CONFIG, audio_packet_config); -+ vc4_hdmi_set_n_cts(hdmi); -+ -+ return 0; -+} -+ -+static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, -+ struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ struct drm_encoder *encoder = hdmi->encoder; -+ struct drm_device *drm = encoder->dev; -+ struct vc4_dev *vc4 = to_vc4_dev(drm); -+ -+ switch (cmd) { -+ case SNDRV_PCM_TRIGGER_START: -+ vc4_hdmi_set_audio_infoframe(encoder); -+ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, -+ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) & -+ ~VC4_HDMI_TX_PHY_RNG_PWRDN); -+ HD_WRITE(VC4_HD_MAI_CTL, -+ VC4_SET_FIELD(hdmi->audio.channels, -+ VC4_HD_MAI_CTL_CHNUM) | -+ VC4_HD_MAI_CTL_ENABLE); -+ break; -+ case SNDRV_PCM_TRIGGER_STOP: -+ HD_WRITE(VC4_HD_MAI_CTL, -+ VC4_HD_MAI_CTL_DLATE | -+ VC4_HD_MAI_CTL_ERRORE | -+ VC4_HD_MAI_CTL_ERRORF); -+ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, -+ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) | -+ VC4_HDMI_TX_PHY_RNG_PWRDN); -+ break; -+ default: -+ break; -+ } -+ -+ return 0; -+} -+ -+static inline struct vc4_hdmi * -+snd_component_to_hdmi(struct snd_soc_component *component) -+{ -+ struct snd_soc_card *card = snd_soc_component_get_drvdata(component); -+ -+ return snd_soc_card_get_drvdata(card); -+} -+ -+static int vc4_hdmi_audio_eld_ctl_info(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_info *uinfo) -+{ -+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); -+ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); -+ -+ uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; -+ uinfo->count = sizeof(hdmi->connector->eld); -+ -+ return 0; -+} -+ -+static int vc4_hdmi_audio_eld_ctl_get(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); -+ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); -+ -+ memcpy(ucontrol->value.bytes.data, hdmi->connector->eld, -+ sizeof(hdmi->connector->eld)); -+ -+ return 0; -+} -+ -+static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { -+ { -+ .access = SNDRV_CTL_ELEM_ACCESS_READ | -+ SNDRV_CTL_ELEM_ACCESS_VOLATILE, -+ .iface = SNDRV_CTL_ELEM_IFACE_PCM, -+ .name = "ELD", -+ .info = vc4_hdmi_audio_eld_ctl_info, -+ .get = vc4_hdmi_audio_eld_ctl_get, -+ }, -+}; -+ -+static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { -+ SND_SOC_DAPM_OUTPUT("TX"), -+}; -+ -+static const struct snd_soc_dapm_route vc4_hdmi_audio_routes[] = { -+ { "TX", NULL, "Playback" }, -+}; -+ -+static const struct snd_soc_codec_driver vc4_hdmi_audio_codec_drv = { -+ .component_driver = { -+ .controls = vc4_hdmi_audio_controls, -+ .num_controls = ARRAY_SIZE(vc4_hdmi_audio_controls), -+ .dapm_widgets = vc4_hdmi_audio_widgets, -+ .num_dapm_widgets = ARRAY_SIZE(vc4_hdmi_audio_widgets), -+ .dapm_routes = vc4_hdmi_audio_routes, -+ .num_dapm_routes = ARRAY_SIZE(vc4_hdmi_audio_routes), -+ }, -+}; -+ -+static const struct snd_soc_dai_ops vc4_hdmi_audio_dai_ops = { -+ .startup = vc4_hdmi_audio_startup, -+ .shutdown = vc4_hdmi_audio_shutdown, -+ .hw_params = vc4_hdmi_audio_hw_params, -+ .set_fmt = vc4_hdmi_audio_set_fmt, -+ .trigger = vc4_hdmi_audio_trigger, -+}; -+ -+static struct snd_soc_dai_driver vc4_hdmi_audio_codec_dai_drv = { -+ .name = "vc4-hdmi-hifi", -+ .playback = { -+ .stream_name = "Playback", -+ .channels_min = 2, -+ .channels_max = 8, -+ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | -+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | -+ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | -+ SNDRV_PCM_RATE_192000, -+ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, -+ }, -+}; -+ -+static const struct snd_soc_component_driver vc4_hdmi_audio_cpu_dai_comp = { -+ .name = "vc4-hdmi-cpu-dai-component", -+}; -+ -+static int vc4_hdmi_audio_cpu_dai_probe(struct snd_soc_dai *dai) -+{ -+ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); -+ -+ snd_soc_dai_init_dma_data(dai, &hdmi->audio.dma_data, NULL); -+ -+ return 0; -+} -+ -+static struct snd_soc_dai_driver vc4_hdmi_audio_cpu_dai_drv = { -+ .name = "vc4-hdmi-cpu-dai", -+ .probe = vc4_hdmi_audio_cpu_dai_probe, -+ .playback = { -+ .stream_name = "Playback", -+ .channels_min = 1, -+ .channels_max = 8, -+ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | -+ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | -+ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | -+ SNDRV_PCM_RATE_192000, -+ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, -+ }, -+ .ops = &vc4_hdmi_audio_dai_ops, -+}; -+ -+static const struct snd_dmaengine_pcm_config pcm_conf = { -+ .chan_names[SNDRV_PCM_STREAM_PLAYBACK] = "audio-rx", -+ .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, -+}; -+ -+static int vc4_hdmi_audio_init(struct vc4_hdmi *hdmi) -+{ -+ struct snd_soc_dai_link *dai_link = &hdmi->audio.link; -+ struct snd_soc_card *card = &hdmi->audio.card; -+ struct device *dev = &hdmi->pdev->dev; -+ const __be32 *addr; -+ int ret; -+ -+ if (!of_find_property(dev->of_node, "dmas", NULL)) { -+ dev_warn(dev, -+ "'dmas' DT property is missing, no HDMI audio\n"); -+ return 0; -+ } -+ -+ /* -+ * Get the physical address of VC4_HD_MAI_DATA. We need to retrieve -+ * the bus address specified in the DT, because the physical address -+ * (the one returned by platform_get_resource()) is not appropriate -+ * for DMA transfers. -+ * This VC/MMU should probably be exposed to avoid this kind of hacks. -+ */ -+ addr = of_get_address(dev->of_node, 1, NULL, NULL); -+ hdmi->audio.dma_data.addr = be32_to_cpup(addr) + VC4_HD_MAI_DATA; -+ hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; -+ hdmi->audio.dma_data.maxburst = 2; -+ -+ ret = devm_snd_dmaengine_pcm_register(dev, &pcm_conf, 0); -+ if (ret) { -+ dev_err(dev, "Could not register PCM component: %d\n", ret); -+ return ret; -+ } -+ -+ ret = devm_snd_soc_register_component(dev, &vc4_hdmi_audio_cpu_dai_comp, -+ &vc4_hdmi_audio_cpu_dai_drv, 1); -+ if (ret) { -+ dev_err(dev, "Could not register CPU DAI: %d\n", ret); -+ return ret; -+ } -+ -+ /* register codec and codec dai */ -+ ret = snd_soc_register_codec(dev, &vc4_hdmi_audio_codec_drv, -+ &vc4_hdmi_audio_codec_dai_drv, 1); -+ if (ret) { -+ dev_err(dev, "Could not register codec: %d\n", ret); -+ return ret; -+ } -+ -+ dai_link->name = "MAI"; -+ dai_link->stream_name = "MAI PCM"; -+ dai_link->codec_dai_name = vc4_hdmi_audio_codec_dai_drv.name; -+ dai_link->cpu_dai_name = dev_name(dev); -+ dai_link->codec_name = dev_name(dev); -+ dai_link->platform_name = dev_name(dev); -+ -+ card->dai_link = dai_link; -+ card->num_links = 1; -+ card->name = "vc4-hdmi"; -+ card->dev = dev; -+ -+ /* -+ * Be careful, snd_soc_register_card() calls dev_set_drvdata() and -+ * stores a pointer to the snd card object in dev->driver_data. This -+ * means we cannot use it for something else. The hdmi back-pointer is -+ * now stored in card->drvdata and should be retrieved with -+ * snd_soc_card_get_drvdata() if needed. -+ */ -+ snd_soc_card_set_drvdata(card, hdmi); -+ ret = devm_snd_soc_register_card(dev, card); -+ if (ret) { -+ dev_err(dev, "Could not register sound card: %d\n", ret); -+ goto unregister_codec; -+ } -+ -+ return 0; -+ -+unregister_codec: -+ snd_soc_unregister_codec(dev); -+ -+ return ret; -+} -+ -+static void vc4_hdmi_audio_cleanup(struct vc4_hdmi *hdmi) -+{ -+ struct device *dev = &hdmi->pdev->dev; -+ -+ /* -+ * If drvdata is not set this means the audio card was not -+ * registered, just skip codec unregistration in this case. -+ */ -+ if (dev_get_drvdata(dev)) -+ snd_soc_unregister_codec(dev); -+} -+ - static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) - { - struct platform_device *pdev = to_platform_device(dev); -@@ -722,6 +1208,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) - goto err_destroy_encoder; - } - -+ ret = vc4_hdmi_audio_init(hdmi); -+ if (ret) -+ goto err_destroy_encoder; -+ - return 0; - - err_destroy_encoder: -@@ -743,6 +1233,8 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, - struct vc4_dev *vc4 = drm->dev_private; - struct vc4_hdmi *hdmi = vc4->hdmi; - -+ vc4_hdmi_audio_cleanup(hdmi); -+ - vc4_hdmi_connector_destroy(hdmi->connector); - vc4_hdmi_encoder_destroy(hdmi->encoder); - -diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index 385405a2df05eb3dd86d4f687aa8205331bec3cc..932093936178674173a84002b33e07e9a37fdfe9 100644 ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -446,11 +446,62 @@ - #define VC4_HDMI_HOTPLUG 0x00c - # define VC4_HDMI_HOTPLUG_CONNECTED BIT(0) - -+/* 3 bits per field, where each field maps from that corresponding MAI -+ * bus channel to the given HDMI channel. -+ */ -+#define VC4_HDMI_MAI_CHANNEL_MAP 0x090 -+ -+#define VC4_HDMI_MAI_CONFIG 0x094 -+# define VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE BIT(27) -+# define VC4_HDMI_MAI_CONFIG_BIT_REVERSE BIT(26) -+# define VC4_HDMI_MAI_CHANNEL_MASK_MASK VC4_MASK(15, 0) -+# define VC4_HDMI_MAI_CHANNEL_MASK_SHIFT 0 -+ -+/* Last received format word on the MAI bus. */ -+#define VC4_HDMI_MAI_FORMAT 0x098 -+ -+#define VC4_HDMI_AUDIO_PACKET_CONFIG 0x09c -+# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT BIT(29) -+# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS BIT(24) -+# define VC4_HDMI_AUDIO_PACKET_FORCE_SAMPLE_PRESENT BIT(19) -+# define VC4_HDMI_AUDIO_PACKET_FORCE_B_FRAME BIT(18) -+# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_MASK VC4_MASK(13, 10) -+# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_SHIFT 10 -+/* If set, then multichannel, otherwise 2 channel. */ -+# define VC4_HDMI_AUDIO_PACKET_AUDIO_LAYOUT BIT(9) -+/* If set, then AUDIO_LAYOUT overrides audio_cea_mask */ -+# define VC4_HDMI_AUDIO_PACKET_FORCE_AUDIO_LAYOUT BIT(8) -+# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_MASK VC4_MASK(7, 0) -+# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_SHIFT 0 -+ - #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_CRP_CFG 0x0a8 -+/* When set, the CTS_PERIOD counts based on MAI bus sync pulse instead -+ * of pixel clock. -+ */ -+# define VC4_HDMI_CRP_USE_MAI_BUS_SYNC_FOR_CTS BIT(26) -+/* When set, no CRP packets will be sent. */ -+# define VC4_HDMI_CRP_CFG_DISABLE BIT(25) -+/* If set, generates CTS values based on N, audio clock, and video -+ * clock. N must be divisible by 128. -+ */ -+# define VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN BIT(24) -+# define VC4_HDMI_CRP_CFG_N_MASK VC4_MASK(19, 0) -+# define VC4_HDMI_CRP_CFG_N_SHIFT 0 -+ -+/* 20-bit fields containing CTS values to be transmitted if !EXTERNAL_CTS_EN */ -+#define VC4_HDMI_CTS_0 0x0ac -+#define VC4_HDMI_CTS_1 0x0b0 -+/* 20-bit fields containing number of clocks to send CTS0/1 before -+ * switching to the other one. -+ */ -+#define VC4_HDMI_CTS_PERIOD_0 0x0b4 -+#define VC4_HDMI_CTS_PERIOD_1 0x0b8 -+ - #define VC4_HDMI_HORZA 0x0c4 - # define VC4_HDMI_HORZA_VPOS BIT(14) - # define VC4_HDMI_HORZA_HPOS BIT(13) -@@ -512,7 +563,11 @@ - - #define VC4_HDMI_TX_PHY_RESET_CTL 0x2c0 - --#define VC4_HDMI_GCP_0 0x400 -+#define VC4_HDMI_TX_PHY_CTL0 0x2c4 -+# define VC4_HDMI_TX_PHY_RNG_PWRDN BIT(25) -+ -+#define VC4_HDMI_GCP(x) (0x400 + ((x) * 0x4)) -+#define VC4_HDMI_RAM_PACKET(x) (0x400 + ((x) * 0x24)) - #define VC4_HDMI_PACKET_STRIDE 0x24 - - #define VC4_HD_M_CTL 0x00c -@@ -522,6 +577,56 @@ - # define VC4_HD_M_ENABLE BIT(0) - - #define VC4_HD_MAI_CTL 0x014 -+/* Set when audio stream is received at a slower rate than the -+ * sampling period, so MAI fifo goes empty. Write 1 to clear. -+ */ -+# define VC4_HD_MAI_CTL_DLATE BIT(15) -+# define VC4_HD_MAI_CTL_BUSY BIT(14) -+# define VC4_HD_MAI_CTL_CHALIGN BIT(13) -+# define VC4_HD_MAI_CTL_WHOLSMP BIT(12) -+# define VC4_HD_MAI_CTL_FULL BIT(11) -+# define VC4_HD_MAI_CTL_EMPTY BIT(10) -+# define VC4_HD_MAI_CTL_FLUSH BIT(9) -+/* If set, MAI bus generates SPDIF (bit 31) parity instead of passing -+ * through. -+ */ -+# define VC4_HD_MAI_CTL_PAREN BIT(8) -+# define VC4_HD_MAI_CTL_CHNUM_MASK VC4_MASK(7, 4) -+# define VC4_HD_MAI_CTL_CHNUM_SHIFT 4 -+# define VC4_HD_MAI_CTL_ENABLE BIT(3) -+/* Underflow error status bit, write 1 to clear. */ -+# define VC4_HD_MAI_CTL_ERRORE BIT(2) -+/* Overflow error status bit, write 1 to clear. */ -+# define VC4_HD_MAI_CTL_ERRORF BIT(1) -+/* Single-shot reset bit. Read value is undefined. */ -+# define VC4_HD_MAI_CTL_RESET BIT(0) -+ -+#define VC4_HD_MAI_THR 0x018 -+# define VC4_HD_MAI_THR_PANICHIGH_MASK VC4_MASK(29, 24) -+# define VC4_HD_MAI_THR_PANICHIGH_SHIFT 24 -+# define VC4_HD_MAI_THR_PANICLOW_MASK VC4_MASK(21, 16) -+# define VC4_HD_MAI_THR_PANICLOW_SHIFT 16 -+# define VC4_HD_MAI_THR_DREQHIGH_MASK VC4_MASK(13, 8) -+# define VC4_HD_MAI_THR_DREQHIGH_SHIFT 8 -+# define VC4_HD_MAI_THR_DREQLOW_MASK VC4_MASK(5, 0) -+# define VC4_HD_MAI_THR_DREQLOW_SHIFT 0 -+ -+/* Format header to be placed on the MAI data. Unused. */ -+#define VC4_HD_MAI_FMT 0x01c -+ -+/* Register for DMAing in audio data to be transported over the MAI -+ * bus to the Falcon core. -+ */ -+#define VC4_HD_MAI_DATA 0x020 -+ -+/* Divider from HDMI HSM clock to MAI serial clock. Sampling period -+ * converges to N / (M + 1) cycles. -+ */ -+#define VC4_HD_MAI_SMP 0x02c -+# define VC4_HD_MAI_SMP_N_MASK VC4_MASK(31, 8) -+# define VC4_HD_MAI_SMP_N_SHIFT 8 -+# define VC4_HD_MAI_SMP_M_MASK VC4_MASK(7, 0) -+# define VC4_HD_MAI_SMP_M_SHIFT 0 - - #define VC4_HD_VID_CTL 0x038 - # define VC4_HD_VID_CTL_ENABLE BIT(31) - -From af76c5218bd78ffb38a2b3646233a01730e2dbb0 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Thu, 2 Feb 2017 11:37:36 +0100 -Subject: [PATCH 223/269] ARM: dts: bcm283x: Add HDMI audio related properties - -Add the dmas and dma-names properties to support HDMI audio. - -Signed-off-by: Boris Brezillon -Signed-off-by: Eric Anholt -(cherry picked from commit d46d2c6380c10e80e99f6af9067356128bffac6b) ---- - arch/arm/boot/dts/bcm283x.dtsi | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi -index 348c71bbc913644c04bab43fcb95abe9b6c9c640..7d58cd79ac6bd99f0b47a909ac827c61aac642d9 100644 ---- a/arch/arm/boot/dts/bcm283x.dtsi -+++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -339,6 +339,8 @@ - clocks = <&clocks BCM2835_PLLH_PIX>, - <&clocks BCM2835_CLOCK_HSM>; - clock-names = "pixel", "hdmi"; -+ dmas = <&dma 17>; -+ dma-names = "audio-rx"; - status = "disabled"; - }; - - -From f46d33a24b5389dcab17fe7c485c804d527675ab Mon Sep 17 00:00:00 2001 +From 482e38ce75d024c03f6f9cda4b07b2704d19962b Mon Sep 17 00:00:00 2001 From: Yasunari Takiguchi Date: Fri, 14 Apr 2017 10:43:57 +0100 -Subject: [PATCH 224/269] This is the driver for Sony CXD2880 DVB-T2/T tuner + +Subject: [PATCH 219/305] This is the driver for Sony CXD2880 DVB-T2/T tuner + demodulator. It includes the CXD2880 driver and the CXD2880 SPI adapter. The current CXD2880 driver version is 1.4.1 - 1.0.1 released on April 13, 2017. @@ -159064,10 +157648,10 @@ index 0000000000000000000000000000000000000000..82e122349055be817eb74ed5bbcd7560 +MODULE_AUTHOR("Sony Semiconductor Solutions Corporation"); +MODULE_LICENSE("GPL v2"); -From 7f8d91d7608e454ef727917e4ef8482e235f6b73 Mon Sep 17 00:00:00 2001 +From f6736cbc445f2d60c9dca0c061715906cce4d329 Mon Sep 17 00:00:00 2001 From: Yasunari Takiguchi Date: Thu, 22 Dec 2016 15:34:12 +0900 -Subject: [PATCH 225/269] BCM2708: Add Raspberry Pi TV HAT Device Tree Support +Subject: [PATCH 220/305] BCM2708: Add Raspberry Pi TV HAT Device Tree Support This is an EXAMPLE CODE of Raspberry Pi TV HAT device tree overlay. Although this is not a part of our release code, it has been used to verify @@ -159163,10 +157747,1382 @@ index 0000000000000000000000000000000000000000..a68f6f793d8efd8b2e2adf9f2fb6426f + +}; -From 3ecd305ad5f28f9ad9ab5962f6b53daae3f2bad0 Mon Sep 17 00:00:00 2001 +From c101af35720cf2a697c17ba245c5b22b7a4679f8 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 7 Mar 2017 14:51:03 -0800 +Subject: [PATCH 221/305] drm/vc4: Allow using more than 256MB of CMA memory. + +Until now, we've had to limit Raspberry Pi to 256MB of CMA memory to +keep from triggering the hardware addressing bug between of the tile +binner of the tile alloc memory (where the top 4 bits come from the +tile state data array's address). + +To work around that and allow more memory to be reserved for graphics, +allocate a single BO to store tile state data arrays and tile +alloc/overflow memory while the GPU is active, and make sure that that +one BO doesn't happen to cross a 256MB boundary. With that in place, +we can allocate textures and shaders anywhere in system memory (still +contiguous, of course). + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_drv.h | 28 +++++-- + drivers/gpu/drm/vc4/vc4_gem.c | 12 ++- + drivers/gpu/drm/vc4/vc4_irq.c | 61 +++++++-------- + drivers/gpu/drm/vc4/vc4_render_cl.c | 3 +- + drivers/gpu/drm/vc4/vc4_v3d.c | 150 ++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_validate.c | 54 ++++++------- + 6 files changed, 234 insertions(+), 74 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 44a8e6fda2b576fed63d93ef34e076cebf90d64c..9e50bc25b2be71079d52a861c25f3fe7c4db0830 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -97,12 +97,23 @@ struct vc4_dev { + */ + struct list_head seqno_cb_list; + +- /* The binner overflow memory that's currently set up in +- * BPOA/BPOS registers. When overflow occurs and a new one is +- * allocated, the previous one will be moved to +- * vc4->current_exec's free list. ++ /* The memory used for storing binner tile alloc, tile state, ++ * and overflow memory allocations. This is freed when V3D ++ * powers down. + */ +- struct vc4_bo *overflow_mem; ++ struct vc4_bo *bin_bo; ++ ++ /* Size of blocks allocated within bin_bo. */ ++ uint32_t bin_alloc_size; ++ ++ /* Bitmask of the bin_alloc_size chunks in bin_bo that are ++ * used. ++ */ ++ uint32_t bin_alloc_used; ++ ++ /* Bitmask of the current bin_alloc used for overflow memory. */ ++ uint32_t bin_alloc_overflow; ++ + struct work_struct overflow_mem_work; + + int power_refcount; +@@ -295,8 +306,12 @@ struct vc4_exec_info { + bool found_increment_semaphore_packet; + bool found_flush; + uint8_t bin_tiles_x, bin_tiles_y; +- struct drm_gem_cma_object *tile_bo; ++ /* Physical address of the start of the tile alloc array ++ * (where each tile's binned CL will start) ++ */ + uint32_t tile_alloc_offset; ++ /* Bitmask of which binner slots are freed when this job completes. */ ++ uint32_t bin_slots; + + /** + * Computed addresses pointing into exec_bo where we start the +@@ -531,6 +546,7 @@ void vc4_plane_async_set_fb(struct drm_plane *plane, + extern struct platform_driver vc4_v3d_driver; + int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused); + int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused); ++int vc4_v3d_get_bin_slot(struct vc4_dev *vc4); + + /* vc4_validate.c */ + int +diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c +index ab3016982466c3ca35ba479050ee107d26eb50ac..a5029ab49068bdbd69411cccbdb6f5111f387e38 100644 +--- a/drivers/gpu/drm/vc4/vc4_gem.c ++++ b/drivers/gpu/drm/vc4/vc4_gem.c +@@ -695,6 +695,7 @@ static void + vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); ++ unsigned long irqflags; + unsigned i; + + if (exec->bo) { +@@ -710,6 +711,11 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) + drm_gem_object_unreference_unlocked(&bo->base.base); + } + ++ /* Free up the allocation of any bin slots we used. */ ++ spin_lock_irqsave(&vc4->job_lock, irqflags); ++ vc4->bin_alloc_used &= ~exec->bin_slots; ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); ++ + mutex_lock(&vc4->power_lock); + if (--vc4->power_refcount == 0) { + pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); +@@ -951,9 +957,9 @@ vc4_gem_destroy(struct drm_device *dev) + /* V3D should already have disabled its interrupt and cleared + * the overflow allocation registers. Now free the object. + */ +- if (vc4->overflow_mem) { +- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); +- vc4->overflow_mem = NULL; ++ if (vc4->bin_bo) { ++ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); ++ vc4->bin_bo = NULL; + } + + if (vc4->hang_state) +diff --git a/drivers/gpu/drm/vc4/vc4_irq.c b/drivers/gpu/drm/vc4/vc4_irq.c +index 094bc6a475c1773923dfe8225cba9886fc9e5026..c43ee1e646f6dd68fe19dacdbcf9322da13c4280 100644 +--- a/drivers/gpu/drm/vc4/vc4_irq.c ++++ b/drivers/gpu/drm/vc4/vc4_irq.c +@@ -58,50 +58,45 @@ vc4_overflow_mem_work(struct work_struct *work) + { + struct vc4_dev *vc4 = + container_of(work, struct vc4_dev, overflow_mem_work); +- struct drm_device *dev = vc4->dev; +- struct vc4_bo *bo; ++ struct vc4_bo *bo = vc4->bin_bo; ++ int bin_bo_slot; ++ struct vc4_exec_info *exec; ++ unsigned long irqflags; + +- bo = vc4_bo_create(dev, 256 * 1024, true); +- if (IS_ERR(bo)) { ++ bin_bo_slot = vc4_v3d_get_bin_slot(vc4); ++ if (bin_bo_slot < 0) { + DRM_ERROR("Couldn't allocate binner overflow mem\n"); + return; + } + +- /* If there's a job executing currently, then our previous +- * overflow allocation is getting used in that job and we need +- * to queue it to be released when the job is done. But if no +- * job is executing at all, then we can free the old overflow +- * object direcctly. +- * +- * No lock necessary for this pointer since we're the only +- * ones that update the pointer, and our workqueue won't +- * reenter. +- */ +- if (vc4->overflow_mem) { +- struct vc4_exec_info *current_exec; +- unsigned long irqflags; +- +- spin_lock_irqsave(&vc4->job_lock, irqflags); +- current_exec = vc4_first_bin_job(vc4); +- if (!current_exec) +- current_exec = vc4_last_render_job(vc4); +- if (current_exec) { +- vc4->overflow_mem->seqno = current_exec->seqno; +- list_add_tail(&vc4->overflow_mem->unref_head, +- ¤t_exec->unref_list); +- vc4->overflow_mem = NULL; ++ spin_lock_irqsave(&vc4->job_lock, irqflags); ++ ++ if (vc4->bin_alloc_overflow) { ++ /* If we had overflow memory allocated previously, ++ * then that chunk will free when the current bin job ++ * is done. If we don't have a bin job running, then ++ * the chunk will be done whenever the list of render ++ * jobs has drained. ++ */ ++ exec = vc4_first_bin_job(vc4); ++ if (!exec) ++ exec = vc4_last_render_job(vc4); ++ if (exec) { ++ exec->bin_slots |= vc4->bin_alloc_overflow; ++ } else { ++ /* There's nothing queued in the hardware, so ++ * the old slot is free immediately. ++ */ ++ vc4->bin_alloc_used &= ~vc4->bin_alloc_overflow; + } +- spin_unlock_irqrestore(&vc4->job_lock, irqflags); + } ++ vc4->bin_alloc_overflow = BIT(bin_bo_slot); + +- if (vc4->overflow_mem) +- drm_gem_object_unreference_unlocked(&vc4->overflow_mem->base.base); +- vc4->overflow_mem = bo; +- +- V3D_WRITE(V3D_BPOA, bo->base.paddr); ++ V3D_WRITE(V3D_BPOA, bo->base.paddr + bin_bo_slot * vc4->bin_alloc_size); + V3D_WRITE(V3D_BPOS, bo->base.base.size); + V3D_WRITE(V3D_INTCTL, V3D_INT_OUTOMEM); + V3D_WRITE(V3D_INTENA, V3D_INT_OUTOMEM); ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); + } + + static void +diff --git a/drivers/gpu/drm/vc4/vc4_render_cl.c b/drivers/gpu/drm/vc4/vc4_render_cl.c +index 5cdd003605f57c99faf31832e3f3dd38a75b7402..6face6aa0890b59bc91d3740fa063a5c46f7cc21 100644 +--- a/drivers/gpu/drm/vc4/vc4_render_cl.c ++++ b/drivers/gpu/drm/vc4/vc4_render_cl.c +@@ -178,8 +178,7 @@ static void emit_tile(struct vc4_exec_info *exec, + + if (has_bin) { + rcl_u8(setup, VC4_PACKET_BRANCH_TO_SUB_LIST); +- rcl_u32(setup, (exec->tile_bo->paddr + +- exec->tile_alloc_offset + ++ rcl_u32(setup, (exec->tile_alloc_offset + + (y * exec->bin_tiles_x + x) * 32)); + } + +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index 1d9e5a6edd22c29ce8b2990c9c35627aa1af2bd8..da79d8511dfb4f631fd3ad4c3680b312f44bd454 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -159,6 +159,144 @@ static void vc4_v3d_init_hw(struct drm_device *dev) + V3D_WRITE(V3D_VPMBASE, 0); + } + ++int vc4_v3d_get_bin_slot(struct vc4_dev *vc4) ++{ ++ struct drm_device *dev = vc4->dev; ++ unsigned long irqflags; ++ int slot; ++ uint64_t seqno = 0; ++ struct vc4_exec_info *exec; ++ ++try_again: ++ spin_lock_irqsave(&vc4->job_lock, irqflags); ++ slot = ffs(~vc4->bin_alloc_used); ++ if (slot != 0) { ++ /* Switch from ffs() bit index to a 0-based index. */ ++ slot--; ++ vc4->bin_alloc_used |= BIT(slot); ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); ++ return slot; ++ } ++ ++ /* Couldn't find an open slot. Wait for render to complete ++ * and try again. ++ */ ++ exec = vc4_last_render_job(vc4); ++ if (exec) ++ seqno = exec->seqno; ++ spin_unlock_irqrestore(&vc4->job_lock, irqflags); ++ ++ if (seqno) { ++ int ret = vc4_wait_for_seqno(dev, seqno, ~0ull, true); ++ ++ if (ret == 0) ++ goto try_again; ++ ++ return ret; ++ } ++ ++ return -ENOMEM; ++} ++ ++/** ++ * vc4_allocate_bin_bo() - allocates the memory that will be used for ++ * tile binning. ++ * ++ * The binner has a limitation that the addresses in the tile state ++ * buffer that point into the tile alloc buffer or binner overflow ++ * memory only have 28 bits (256MB), and the top 4 on the bus for ++ * tile alloc references end up coming from the tile state buffer's ++ * address. ++ * ++ * To work around this, we allocate a single large buffer while V3D is ++ * in use, make sure that it has the top 4 bits constant across its ++ * entire extent, and then put the tile state, tile alloc, and binner ++ * overflow memory inside that buffer. ++ * ++ * This creates a limitation where we may not be able to execute a job ++ * if it doesn't fit within the buffer that we allocated up front. ++ * However, it turns out that 16MB is "enough for anybody", and ++ * real-world applications run into allocation failures from the ++ * overall CMA pool before they make scenes complicated enough to run ++ * out of bin space. ++ */ ++int ++vc4_allocate_bin_bo(struct drm_device *drm) ++{ ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ struct vc4_v3d *v3d = vc4->v3d; ++ uint32_t size = 16 * 1024 * 1024; ++ int ret = 0; ++ struct list_head list; ++ ++ /* We may need to try allocating more than once to get a BO ++ * that doesn't cross 256MB. Track the ones we've allocated ++ * that failed so far, so that we can free them when we've got ++ * one that succeeded (if we freed them right away, our next ++ * allocation would probably be the same chunk of memory). ++ */ ++ INIT_LIST_HEAD(&list); ++ ++ while (true) { ++ struct vc4_bo *bo = vc4_bo_create(drm, size, true); ++ ++ if (IS_ERR(bo)) { ++ ret = PTR_ERR(bo); ++ ++ dev_err(&v3d->pdev->dev, ++ "Failed to allocate memory for tile binning: " ++ "%d. You may need to enable CMA or give it " ++ "more memory.", ++ ret); ++ break; ++ } ++ ++ /* Check if this BO won't trigger the addressing bug. */ ++ if ((bo->base.paddr & 0xf0000000) == ++ ((bo->base.paddr + bo->base.base.size - 1) & 0xf0000000)) { ++ vc4->bin_bo = bo; ++ ++ /* Set up for allocating 512KB chunks of ++ * binner memory. The biggest allocation we ++ * need to do is for the initial tile alloc + ++ * tile state buffer. We can render to a ++ * maximum of ((2048*2048) / (32*32) = 4096 ++ * tiles in a frame (until we do floating ++ * point rendering, at which point it would be ++ * 8192). Tile state is 48b/tile (rounded to ++ * a page), and tile alloc is 32b/tile ++ * (rounded to a page), plus a page of extra, ++ * for a total of 320kb for our worst-case. ++ * We choose 512kb so that it divides evenly ++ * into our 16MB, and the rest of the 512kb ++ * will be used as storage for the overflow ++ * from the initial 32b CL per bin. ++ */ ++ vc4->bin_alloc_size = 512 * 1024; ++ vc4->bin_alloc_used = 0; ++ vc4->bin_alloc_overflow = 0; ++ WARN_ON_ONCE(sizeof(vc4->bin_alloc_used) * 8 != ++ bo->base.base.size / vc4->bin_alloc_size); ++ ++ break; ++ } ++ ++ /* Put it on the list to free later, and try again. */ ++ list_add(&bo->unref_head, &list); ++ } ++ ++ /* Free all the BOs we allocated but didn't choose. */ ++ while (!list_empty(&list)) { ++ struct vc4_bo *bo = list_last_entry(&list, ++ struct vc4_bo, unref_head); ++ ++ list_del(&bo->unref_head); ++ drm_gem_object_unreference_unlocked(&bo->base.base); ++ } ++ ++ return ret; ++} ++ + #ifdef CONFIG_PM + static int vc4_v3d_runtime_suspend(struct device *dev) + { +@@ -167,6 +305,9 @@ static int vc4_v3d_runtime_suspend(struct device *dev) + + vc4_irq_uninstall(vc4->dev); + ++ drm_gem_object_unreference_unlocked(&vc4->bin_bo->base.base); ++ vc4->bin_bo = NULL; ++ + return 0; + } + +@@ -174,6 +315,11 @@ static int vc4_v3d_runtime_resume(struct device *dev) + { + struct vc4_v3d *v3d = dev_get_drvdata(dev); + struct vc4_dev *vc4 = v3d->vc4; ++ int ret; ++ ++ ret = vc4_allocate_bin_bo(vc4->dev); ++ if (ret) ++ return ret; + + vc4_v3d_init_hw(vc4->dev); + vc4_irq_postinstall(vc4->dev); +@@ -226,6 +372,10 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + return -EINVAL; + } + ++ ret = vc4_allocate_bin_bo(drm); ++ if (ret) ++ return ret; ++ + /* Reset the binner overflow address/size at setup, to be sure + * we don't reuse an old one. + */ +diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c +index 9fd171c361c23b52a4d507919ec7e26fd1e87aac..59d808e2a6cc6f3173b1309cc4f491098886cf36 100644 +--- a/drivers/gpu/drm/vc4/vc4_validate.c ++++ b/drivers/gpu/drm/vc4/vc4_validate.c +@@ -340,10 +340,11 @@ static int + validate_tile_binning_config(VALIDATE_ARGS) + { + struct drm_device *dev = exec->exec_bo->base.dev; +- struct vc4_bo *tile_bo; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); + uint8_t flags; +- uint32_t tile_state_size, tile_alloc_size; +- uint32_t tile_count; ++ uint32_t tile_state_size; ++ uint32_t tile_count, bin_addr; ++ int bin_slot; + + if (exec->found_tile_binning_mode_config_packet) { + DRM_ERROR("Duplicate VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); +@@ -369,13 +370,28 @@ validate_tile_binning_config(VALIDATE_ARGS) + return -EINVAL; + } + ++ bin_slot = vc4_v3d_get_bin_slot(vc4); ++ if (bin_slot < 0) { ++ if (bin_slot != -EINTR && bin_slot != -ERESTARTSYS) { ++ DRM_ERROR("Failed to allocate binner memory: %d\n", ++ bin_slot); ++ } ++ return bin_slot; ++ } ++ ++ /* The slot we allocated will only be used by this job, and is ++ * free when the job completes rendering. ++ */ ++ exec->bin_slots |= BIT(bin_slot); ++ bin_addr = vc4->bin_bo->base.paddr + bin_slot * vc4->bin_alloc_size; ++ + /* The tile state data array is 48 bytes per tile, and we put it at + * the start of a BO containing both it and the tile alloc. + */ + tile_state_size = 48 * tile_count; + + /* Since the tile alloc array will follow us, align. */ +- exec->tile_alloc_offset = roundup(tile_state_size, 4096); ++ exec->tile_alloc_offset = bin_addr + roundup(tile_state_size, 4096); + + *(uint8_t *)(validated + 14) = + ((flags & ~(VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_MASK | +@@ -386,35 +402,13 @@ validate_tile_binning_config(VALIDATE_ARGS) + VC4_SET_FIELD(VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_128, + VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE)); + +- /* Initial block size. */ +- tile_alloc_size = 32 * tile_count; +- +- /* +- * The initial allocation gets rounded to the next 256 bytes before +- * the hardware starts fulfilling further allocations. +- */ +- tile_alloc_size = roundup(tile_alloc_size, 256); +- +- /* Add space for the extra allocations. This is what gets used first, +- * before overflow memory. It must have at least 4096 bytes, but we +- * want to avoid overflow memory usage if possible. +- */ +- tile_alloc_size += 1024 * 1024; +- +- tile_bo = vc4_bo_create(dev, exec->tile_alloc_offset + tile_alloc_size, +- true); +- exec->tile_bo = &tile_bo->base; +- if (IS_ERR(exec->tile_bo)) +- return PTR_ERR(exec->tile_bo); +- list_add_tail(&tile_bo->unref_head, &exec->unref_list); +- + /* tile alloc address. */ +- *(uint32_t *)(validated + 0) = (exec->tile_bo->paddr + +- exec->tile_alloc_offset); ++ *(uint32_t *)(validated + 0) = exec->tile_alloc_offset; + /* tile alloc size. */ +- *(uint32_t *)(validated + 4) = tile_alloc_size; ++ *(uint32_t *)(validated + 4) = (bin_addr + vc4->bin_alloc_size - ++ exec->tile_alloc_offset); + /* tile state address. */ +- *(uint32_t *)(validated + 8) = exec->tile_bo->paddr; ++ *(uint32_t *)(validated + 8) = bin_addr; + + return 0; + } + +From 06e527d86a6359405901fd7fb682d478ca5ce451 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 30 Mar 2017 10:23:27 -0700 +Subject: [PATCH 222/305] Revert "drm/vc4: Verify at boot that CMA doesn't + cross a 256MB boundary." + +This reverts commit 016c804fa69381bd23a1a13cba08a3c4557fcdff. The +restriction was lifted by the previous commit. +--- + drivers/base/dma-contiguous.c | 1 - + drivers/gpu/drm/vc4/vc4_v3d.c | 18 ------------------ + mm/cma.c | 2 -- + 3 files changed, 21 deletions(-) + +diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c +index 60f5c2591ccdb0202461458eab4035cfba731b8b..e167a1e1bccb062efef2595fcd5299301a97df80 100644 +--- a/drivers/base/dma-contiguous.c ++++ b/drivers/base/dma-contiguous.c +@@ -35,7 +35,6 @@ + #endif + + struct cma *dma_contiguous_default_area; +-EXPORT_SYMBOL(dma_contiguous_default_area); + + /* + * Default global CMA area size can be defined in kernel's .config. +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index da79d8511dfb4f631fd3ad4c3680b312f44bd454..882ec06225f1d5caca71bdb5c69664188192c2e2 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -16,10 +16,7 @@ + * this program. If not, see . + */ + +-#include "linux/init.h" +-#include "linux/cma.h" + #include "linux/component.h" +-#include "linux/dma-contiguous.h" + #include "linux/pm_runtime.h" + #include "vc4_drv.h" + #include "vc4_regs.h" +@@ -334,23 +331,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + struct drm_device *drm = dev_get_drvdata(master); + struct vc4_dev *vc4 = to_vc4_dev(drm); + struct vc4_v3d *v3d = NULL; +- struct cma *cma; + int ret; + +- cma = dev_get_cma_area(dev); +- if (!cma) +- return -EINVAL; +- +- if ((cma_get_base(cma) & 0xf0000000) != +- ((cma_get_base(cma) + cma_get_size(cma) - 1) & 0xf0000000)) { +- DRM_ERROR("V3D requires that the CMA area (0x%08lx - 0x%08lx) " +- "not span a 256MB boundary, or memory corruption " +- "would happen.\n", +- (long)cma_get_base(cma), +- cma_get_base(cma) + cma_get_size(cma)); +- return -EINVAL; +- } +- + v3d = devm_kzalloc(&pdev->dev, sizeof(*v3d), GFP_KERNEL); + if (!v3d) + return -ENOMEM; +diff --git a/mm/cma.c b/mm/cma.c +index b50245282a18bc790da0f901944c2e670ffac2d2..c960459eda7e640ea55be1d4ed80c6a9125a8877 100644 +--- a/mm/cma.c ++++ b/mm/cma.c +@@ -47,13 +47,11 @@ phys_addr_t cma_get_base(const struct cma *cma) + { + return PFN_PHYS(cma->base_pfn); + } +-EXPORT_SYMBOL(cma_get_base); + + unsigned long cma_get_size(const struct cma *cma) + { + return cma->count << PAGE_SHIFT; + } +-EXPORT_SYMBOL(cma_get_size); + + static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, + int align_order) + +From 88921924d479d4cae78c3a6e5dc6d4ca238715a6 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 27 Feb 2017 12:28:02 -0800 +Subject: [PATCH 223/305] drm/vc4: Add HDMI audio support + +The HDMI encoder IP embeds all needed blocks to output audio, with a +custom DAI called MAI moving audio between the two parts of the HDMI +core. This driver now exposes a sound card to let users stream audio +to their display. + +Using the hdmi-codec driver has been considered here, but MAI meant +having to significantly rework hdmi-codec, and it would have left +little shared code with the I2S mode anyway. + +The encoder requires that the audio be SPDIF-formatted frames only, +which alsalib will format-convert for us. + +This patch is the combined work of Eric Anholt (initial register setup +with a separate dmaengine driver and using simple-audio-card) and +Boris Brezillon (moving it all into HDMI, massive debug to get it +actually working), and which Eric has the permission to release. + +v2: Drop "-audio" from sound card name, since that's already implied + (suggestion by Boris) + +Signed-off-by: Eric Anholt +Acked-by: Boris Brezillon +Link: http://patchwork.freedesktop.org/patch/msgid/20170227202803.12855-2-eric@anholt.net +--- + drivers/gpu/drm/vc4/Kconfig | 4 + + drivers/gpu/drm/vc4/vc4_hdmi.c | 494 ++++++++++++++++++++++++++++++++++++++++- + drivers/gpu/drm/vc4/vc4_regs.h | 107 ++++++++- + 3 files changed, 603 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig +index e1517d07cb7d22776ca164a5d2d9b87e55a5563a..973b4203c0b264115b7cd9d4a433b449bd0ec3b3 100644 +--- a/drivers/gpu/drm/vc4/Kconfig ++++ b/drivers/gpu/drm/vc4/Kconfig +@@ -2,11 +2,15 @@ config DRM_VC4 + tristate "Broadcom VC4 Graphics" + depends on ARCH_BCM2835 || COMPILE_TEST + depends on DRM ++ depends on SND && SND_SOC + depends on COMMON_CLK + select DRM_KMS_HELPER + select DRM_KMS_CMA_HELPER + select DRM_GEM_CMA_HELPER + select DRM_PANEL ++ select SND_PCM ++ select SND_PCM_ELD ++ select SND_SOC_GENERIC_DMAENGINE_PCM + select DRM_MIPI_DSI + help + Choose this option if you have a system that has a Broadcom +diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c +index c4cb2e26de32f06db0abf3fd94b3117c3292eed5..8db1016cad929438f30ea44c6974dcb340b74596 100644 +--- a/drivers/gpu/drm/vc4/vc4_hdmi.c ++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c +@@ -31,11 +31,27 @@ + #include "linux/clk.h" + #include "linux/component.h" + #include "linux/i2c.h" ++#include "linux/of_address.h" + #include "linux/of_gpio.h" + #include "linux/of_platform.h" ++#include "linux/rational.h" ++#include "sound/dmaengine_pcm.h" ++#include "sound/pcm_drm_eld.h" ++#include "sound/pcm_params.h" ++#include "sound/soc.h" + #include "vc4_drv.h" + #include "vc4_regs.h" + ++/* HDMI audio information */ ++struct vc4_hdmi_audio { ++ struct snd_soc_card card; ++ struct snd_soc_dai_link link; ++ int samplerate; ++ int channels; ++ struct snd_dmaengine_dai_dma_data dma_data; ++ struct snd_pcm_substream *substream; ++}; ++ + /* General HDMI hardware state. */ + struct vc4_hdmi { + struct platform_device *pdev; +@@ -43,6 +59,8 @@ struct vc4_hdmi { + struct drm_encoder *encoder; + struct drm_connector *connector; + ++ struct vc4_hdmi_audio audio; ++ + struct i2c_adapter *ddc; + void __iomem *hdmicore_regs; + void __iomem *hd_regs; +@@ -98,6 +116,10 @@ static const struct { + HDMI_REG(VC4_HDMI_SW_RESET_CONTROL), + HDMI_REG(VC4_HDMI_HOTPLUG_INT), + HDMI_REG(VC4_HDMI_HOTPLUG), ++ HDMI_REG(VC4_HDMI_MAI_CHANNEL_MAP), ++ HDMI_REG(VC4_HDMI_MAI_CONFIG), ++ HDMI_REG(VC4_HDMI_MAI_FORMAT), ++ HDMI_REG(VC4_HDMI_AUDIO_PACKET_CONFIG), + HDMI_REG(VC4_HDMI_RAM_PACKET_CONFIG), + HDMI_REG(VC4_HDMI_HORZA), + HDMI_REG(VC4_HDMI_HORZB), +@@ -108,6 +130,7 @@ static const struct { + HDMI_REG(VC4_HDMI_VERTB0), + HDMI_REG(VC4_HDMI_VERTB1), + HDMI_REG(VC4_HDMI_TX_PHY_RESET_CTL), ++ HDMI_REG(VC4_HDMI_TX_PHY_CTL0), + }; + + static const struct { +@@ -116,6 +139,9 @@ static const struct { + } hd_regs[] = { + HDMI_REG(VC4_HD_M_CTL), + HDMI_REG(VC4_HD_MAI_CTL), ++ HDMI_REG(VC4_HD_MAI_THR), ++ HDMI_REG(VC4_HD_MAI_FMT), ++ HDMI_REG(VC4_HD_MAI_SMP), + HDMI_REG(VC4_HD_VID_CTL), + HDMI_REG(VC4_HD_CSC_CTL), + HDMI_REG(VC4_HD_FRAME_COUNT), +@@ -215,6 +241,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) + + drm_mode_connector_update_edid_property(connector, edid); + ret = drm_add_edid_modes(connector, edid); ++ drm_edid_to_eld(connector, edid); + + return ret; + } +@@ -300,7 +327,7 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, + 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; ++ u32 packet_reg = VC4_HDMI_RAM_PACKET(packet_id); + uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; + ssize_t len, i; + int ret; +@@ -385,6 +412,24 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder) + vc4_hdmi_write_infoframe(encoder, &frame); + } + ++static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder) ++{ ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dev *vc4 = drm->dev_private; ++ struct vc4_hdmi *hdmi = vc4->hdmi; ++ union hdmi_infoframe frame; ++ int ret; ++ ++ ret = hdmi_audio_infoframe_init(&frame.audio); ++ ++ frame.audio.coding_type = HDMI_AUDIO_CODING_TYPE_STREAM; ++ frame.audio.sample_frequency = HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM; ++ frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM; ++ frame.audio.channels = hdmi->audio.channels; ++ ++ vc4_hdmi_write_infoframe(encoder, &frame); ++} ++ + static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) + { + vc4_hdmi_set_avi_infoframe(encoder); +@@ -591,6 +636,447 @@ static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = { + .enable = vc4_hdmi_encoder_enable, + }; + ++/* HDMI audio codec callbacks */ ++static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *hdmi) ++{ ++ struct drm_device *drm = hdmi->encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ u32 hsm_clock = clk_get_rate(hdmi->hsm_clock); ++ unsigned long n, m; ++ ++ rational_best_approximation(hsm_clock, hdmi->audio.samplerate, ++ VC4_HD_MAI_SMP_N_MASK >> ++ VC4_HD_MAI_SMP_N_SHIFT, ++ (VC4_HD_MAI_SMP_M_MASK >> ++ VC4_HD_MAI_SMP_M_SHIFT) + 1, ++ &n, &m); ++ ++ HD_WRITE(VC4_HD_MAI_SMP, ++ VC4_SET_FIELD(n, VC4_HD_MAI_SMP_N) | ++ VC4_SET_FIELD(m - 1, VC4_HD_MAI_SMP_M)); ++} ++ ++static void vc4_hdmi_set_n_cts(struct vc4_hdmi *hdmi) ++{ ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_crtc *crtc = encoder->crtc; ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ const struct drm_display_mode *mode = &crtc->state->adjusted_mode; ++ u32 samplerate = hdmi->audio.samplerate; ++ u32 n, cts; ++ u64 tmp; ++ ++ n = 128 * samplerate / 1000; ++ tmp = (u64)(mode->clock * 1000) * n; ++ do_div(tmp, 128 * samplerate); ++ cts = tmp; ++ ++ HDMI_WRITE(VC4_HDMI_CRP_CFG, ++ VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN | ++ VC4_SET_FIELD(n, VC4_HDMI_CRP_CFG_N)); ++ ++ /* ++ * We could get slightly more accurate clocks in some cases by ++ * providing a CTS_1 value. The two CTS values are alternated ++ * between based on the period fields ++ */ ++ HDMI_WRITE(VC4_HDMI_CTS_0, cts); ++ HDMI_WRITE(VC4_HDMI_CTS_1, cts); ++} ++ ++static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) ++{ ++ struct snd_soc_card *card = snd_soc_dai_get_drvdata(dai); ++ ++ return snd_soc_card_get_drvdata(card); ++} ++ ++static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct vc4_dev *vc4 = to_vc4_dev(encoder->dev); ++ int ret; ++ ++ if (hdmi->audio.substream && hdmi->audio.substream != substream) ++ return -EINVAL; ++ ++ hdmi->audio.substream = substream; ++ ++ /* ++ * If the HDMI encoder hasn't probed, or the encoder is ++ * currently in DVI mode, treat the codec dai as missing. ++ */ ++ if (!encoder->crtc || !(HDMI_READ(VC4_HDMI_RAM_PACKET_CONFIG) & ++ VC4_HDMI_RAM_PACKET_ENABLE)) ++ return -ENODEV; ++ ++ ret = snd_pcm_hw_constraint_eld(substream->runtime, ++ hdmi->connector->eld); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++static int vc4_hdmi_audio_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ++{ ++ return 0; ++} ++ ++static void vc4_hdmi_audio_reset(struct vc4_hdmi *hdmi) ++{ ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_device *drm = encoder->dev; ++ struct device *dev = &hdmi->pdev->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ int ret; ++ ++ ret = vc4_hdmi_stop_packet(encoder, HDMI_INFOFRAME_TYPE_AUDIO); ++ if (ret) ++ dev_err(dev, "Failed to stop audio infoframe: %d\n", ret); ++ ++ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_RESET); ++ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_ERRORF); ++ HD_WRITE(VC4_HD_MAI_CTL, VC4_HD_MAI_CTL_FLUSH); ++} ++ ++static void vc4_hdmi_audio_shutdown(struct snd_pcm_substream *substream, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ ++ if (substream != hdmi->audio.substream) ++ return; ++ ++ vc4_hdmi_audio_reset(hdmi); ++ ++ hdmi->audio.substream = NULL; ++} ++ ++/* HDMI audio codec callbacks */ ++static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_device *drm = encoder->dev; ++ struct device *dev = &hdmi->pdev->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ u32 audio_packet_config, channel_mask; ++ u32 channel_map, i; ++ ++ if (substream != hdmi->audio.substream) ++ return -EINVAL; ++ ++ dev_dbg(dev, "%s: %u Hz, %d bit, %d channels\n", __func__, ++ params_rate(params), params_width(params), ++ params_channels(params)); ++ ++ hdmi->audio.channels = params_channels(params); ++ hdmi->audio.samplerate = params_rate(params); ++ ++ HD_WRITE(VC4_HD_MAI_CTL, ++ VC4_HD_MAI_CTL_RESET | ++ VC4_HD_MAI_CTL_FLUSH | ++ VC4_HD_MAI_CTL_DLATE | ++ VC4_HD_MAI_CTL_ERRORE | ++ VC4_HD_MAI_CTL_ERRORF); ++ ++ vc4_hdmi_audio_set_mai_clock(hdmi); ++ ++ audio_packet_config = ++ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT | ++ VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS | ++ VC4_SET_FIELD(0xf, VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER); ++ ++ channel_mask = GENMASK(hdmi->audio.channels - 1, 0); ++ audio_packet_config |= VC4_SET_FIELD(channel_mask, ++ VC4_HDMI_AUDIO_PACKET_CEA_MASK); ++ ++ /* Set the MAI threshold. This logic mimics the firmware's. */ ++ if (hdmi->audio.samplerate > 96000) { ++ HD_WRITE(VC4_HD_MAI_THR, ++ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQHIGH) | ++ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); ++ } else if (hdmi->audio.samplerate > 48000) { ++ HD_WRITE(VC4_HD_MAI_THR, ++ VC4_SET_FIELD(0x14, VC4_HD_MAI_THR_DREQHIGH) | ++ VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); ++ } else { ++ HD_WRITE(VC4_HD_MAI_THR, ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | ++ VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); ++ } ++ ++ HDMI_WRITE(VC4_HDMI_MAI_CONFIG, ++ VC4_HDMI_MAI_CONFIG_BIT_REVERSE | ++ VC4_SET_FIELD(channel_mask, VC4_HDMI_MAI_CHANNEL_MASK)); ++ ++ channel_map = 0; ++ for (i = 0; i < 8; i++) { ++ if (channel_mask & BIT(i)) ++ channel_map |= i << (3 * i); ++ } ++ ++ HDMI_WRITE(VC4_HDMI_MAI_CHANNEL_MAP, channel_map); ++ HDMI_WRITE(VC4_HDMI_AUDIO_PACKET_CONFIG, audio_packet_config); ++ vc4_hdmi_set_n_cts(hdmi); ++ ++ return 0; ++} ++ ++static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, ++ struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ struct drm_encoder *encoder = hdmi->encoder; ++ struct drm_device *drm = encoder->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(drm); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ vc4_hdmi_set_audio_infoframe(encoder); ++ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, ++ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) & ++ ~VC4_HDMI_TX_PHY_RNG_PWRDN); ++ HD_WRITE(VC4_HD_MAI_CTL, ++ VC4_SET_FIELD(hdmi->audio.channels, ++ VC4_HD_MAI_CTL_CHNUM) | ++ VC4_HD_MAI_CTL_ENABLE); ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ HD_WRITE(VC4_HD_MAI_CTL, ++ VC4_HD_MAI_CTL_DLATE | ++ VC4_HD_MAI_CTL_ERRORE | ++ VC4_HD_MAI_CTL_ERRORF); ++ HDMI_WRITE(VC4_HDMI_TX_PHY_CTL0, ++ HDMI_READ(VC4_HDMI_TX_PHY_CTL0) | ++ VC4_HDMI_TX_PHY_RNG_PWRDN); ++ break; ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static inline struct vc4_hdmi * ++snd_component_to_hdmi(struct snd_soc_component *component) ++{ ++ struct snd_soc_card *card = snd_soc_component_get_drvdata(component); ++ ++ return snd_soc_card_get_drvdata(card); ++} ++ ++static int vc4_hdmi_audio_eld_ctl_info(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_info *uinfo) ++{ ++ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); ++ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); ++ ++ uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; ++ uinfo->count = sizeof(hdmi->connector->eld); ++ ++ return 0; ++} ++ ++static int vc4_hdmi_audio_eld_ctl_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); ++ struct vc4_hdmi *hdmi = snd_component_to_hdmi(component); ++ ++ memcpy(ucontrol->value.bytes.data, hdmi->connector->eld, ++ sizeof(hdmi->connector->eld)); ++ ++ return 0; ++} ++ ++static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = { ++ { ++ .access = SNDRV_CTL_ELEM_ACCESS_READ | ++ SNDRV_CTL_ELEM_ACCESS_VOLATILE, ++ .iface = SNDRV_CTL_ELEM_IFACE_PCM, ++ .name = "ELD", ++ .info = vc4_hdmi_audio_eld_ctl_info, ++ .get = vc4_hdmi_audio_eld_ctl_get, ++ }, ++}; ++ ++static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { ++ SND_SOC_DAPM_OUTPUT("TX"), ++}; ++ ++static const struct snd_soc_dapm_route vc4_hdmi_audio_routes[] = { ++ { "TX", NULL, "Playback" }, ++}; ++ ++static const struct snd_soc_codec_driver vc4_hdmi_audio_codec_drv = { ++ .component_driver = { ++ .controls = vc4_hdmi_audio_controls, ++ .num_controls = ARRAY_SIZE(vc4_hdmi_audio_controls), ++ .dapm_widgets = vc4_hdmi_audio_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(vc4_hdmi_audio_widgets), ++ .dapm_routes = vc4_hdmi_audio_routes, ++ .num_dapm_routes = ARRAY_SIZE(vc4_hdmi_audio_routes), ++ }, ++}; ++ ++static const struct snd_soc_dai_ops vc4_hdmi_audio_dai_ops = { ++ .startup = vc4_hdmi_audio_startup, ++ .shutdown = vc4_hdmi_audio_shutdown, ++ .hw_params = vc4_hdmi_audio_hw_params, ++ .set_fmt = vc4_hdmi_audio_set_fmt, ++ .trigger = vc4_hdmi_audio_trigger, ++}; ++ ++static struct snd_soc_dai_driver vc4_hdmi_audio_codec_dai_drv = { ++ .name = "vc4-hdmi-hifi", ++ .playback = { ++ .stream_name = "Playback", ++ .channels_min = 2, ++ .channels_max = 8, ++ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | ++ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | ++ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | ++ SNDRV_PCM_RATE_192000, ++ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, ++ }, ++}; ++ ++static const struct snd_soc_component_driver vc4_hdmi_audio_cpu_dai_comp = { ++ .name = "vc4-hdmi-cpu-dai-component", ++}; ++ ++static int vc4_hdmi_audio_cpu_dai_probe(struct snd_soc_dai *dai) ++{ ++ struct vc4_hdmi *hdmi = dai_to_hdmi(dai); ++ ++ snd_soc_dai_init_dma_data(dai, &hdmi->audio.dma_data, NULL); ++ ++ return 0; ++} ++ ++static struct snd_soc_dai_driver vc4_hdmi_audio_cpu_dai_drv = { ++ .name = "vc4-hdmi-cpu-dai", ++ .probe = vc4_hdmi_audio_cpu_dai_probe, ++ .playback = { ++ .stream_name = "Playback", ++ .channels_min = 1, ++ .channels_max = 8, ++ .rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | ++ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | ++ SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | ++ SNDRV_PCM_RATE_192000, ++ .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, ++ }, ++ .ops = &vc4_hdmi_audio_dai_ops, ++}; ++ ++static const struct snd_dmaengine_pcm_config pcm_conf = { ++ .chan_names[SNDRV_PCM_STREAM_PLAYBACK] = "audio-rx", ++ .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, ++}; ++ ++static int vc4_hdmi_audio_init(struct vc4_hdmi *hdmi) ++{ ++ struct snd_soc_dai_link *dai_link = &hdmi->audio.link; ++ struct snd_soc_card *card = &hdmi->audio.card; ++ struct device *dev = &hdmi->pdev->dev; ++ const __be32 *addr; ++ int ret; ++ ++ if (!of_find_property(dev->of_node, "dmas", NULL)) { ++ dev_warn(dev, ++ "'dmas' DT property is missing, no HDMI audio\n"); ++ return 0; ++ } ++ ++ /* ++ * Get the physical address of VC4_HD_MAI_DATA. We need to retrieve ++ * the bus address specified in the DT, because the physical address ++ * (the one returned by platform_get_resource()) is not appropriate ++ * for DMA transfers. ++ * This VC/MMU should probably be exposed to avoid this kind of hacks. ++ */ ++ addr = of_get_address(dev->of_node, 1, NULL, NULL); ++ hdmi->audio.dma_data.addr = be32_to_cpup(addr) + VC4_HD_MAI_DATA; ++ hdmi->audio.dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; ++ hdmi->audio.dma_data.maxburst = 2; ++ ++ ret = devm_snd_dmaengine_pcm_register(dev, &pcm_conf, 0); ++ if (ret) { ++ dev_err(dev, "Could not register PCM component: %d\n", ret); ++ return ret; ++ } ++ ++ ret = devm_snd_soc_register_component(dev, &vc4_hdmi_audio_cpu_dai_comp, ++ &vc4_hdmi_audio_cpu_dai_drv, 1); ++ if (ret) { ++ dev_err(dev, "Could not register CPU DAI: %d\n", ret); ++ return ret; ++ } ++ ++ /* register codec and codec dai */ ++ ret = snd_soc_register_codec(dev, &vc4_hdmi_audio_codec_drv, ++ &vc4_hdmi_audio_codec_dai_drv, 1); ++ if (ret) { ++ dev_err(dev, "Could not register codec: %d\n", ret); ++ return ret; ++ } ++ ++ dai_link->name = "MAI"; ++ dai_link->stream_name = "MAI PCM"; ++ dai_link->codec_dai_name = vc4_hdmi_audio_codec_dai_drv.name; ++ dai_link->cpu_dai_name = dev_name(dev); ++ dai_link->codec_name = dev_name(dev); ++ dai_link->platform_name = dev_name(dev); ++ ++ card->dai_link = dai_link; ++ card->num_links = 1; ++ card->name = "vc4-hdmi"; ++ card->dev = dev; ++ ++ /* ++ * Be careful, snd_soc_register_card() calls dev_set_drvdata() and ++ * stores a pointer to the snd card object in dev->driver_data. This ++ * means we cannot use it for something else. The hdmi back-pointer is ++ * now stored in card->drvdata and should be retrieved with ++ * snd_soc_card_get_drvdata() if needed. ++ */ ++ snd_soc_card_set_drvdata(card, hdmi); ++ ret = devm_snd_soc_register_card(dev, card); ++ if (ret) { ++ dev_err(dev, "Could not register sound card: %d\n", ret); ++ goto unregister_codec; ++ } ++ ++ return 0; ++ ++unregister_codec: ++ snd_soc_unregister_codec(dev); ++ ++ return ret; ++} ++ ++static void vc4_hdmi_audio_cleanup(struct vc4_hdmi *hdmi) ++{ ++ struct device *dev = &hdmi->pdev->dev; ++ ++ /* ++ * If drvdata is not set this means the audio card was not ++ * registered, just skip codec unregistration in this case. ++ */ ++ if (dev_get_drvdata(dev)) ++ snd_soc_unregister_codec(dev); ++} ++ + static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + { + struct platform_device *pdev = to_platform_device(dev); +@@ -722,6 +1208,10 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) + goto err_destroy_encoder; + } + ++ ret = vc4_hdmi_audio_init(hdmi); ++ if (ret) ++ goto err_destroy_encoder; ++ + return 0; + + err_destroy_encoder: +@@ -743,6 +1233,8 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, + struct vc4_dev *vc4 = drm->dev_private; + struct vc4_hdmi *hdmi = vc4->hdmi; + ++ vc4_hdmi_audio_cleanup(hdmi); ++ + vc4_hdmi_connector_destroy(hdmi->connector); + vc4_hdmi_encoder_destroy(hdmi->encoder); + +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 385405a2df05eb3dd86d4f687aa8205331bec3cc..932093936178674173a84002b33e07e9a37fdfe9 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -446,11 +446,62 @@ + #define VC4_HDMI_HOTPLUG 0x00c + # define VC4_HDMI_HOTPLUG_CONNECTED BIT(0) + ++/* 3 bits per field, where each field maps from that corresponding MAI ++ * bus channel to the given HDMI channel. ++ */ ++#define VC4_HDMI_MAI_CHANNEL_MAP 0x090 ++ ++#define VC4_HDMI_MAI_CONFIG 0x094 ++# define VC4_HDMI_MAI_CONFIG_FORMAT_REVERSE BIT(27) ++# define VC4_HDMI_MAI_CONFIG_BIT_REVERSE BIT(26) ++# define VC4_HDMI_MAI_CHANNEL_MASK_MASK VC4_MASK(15, 0) ++# define VC4_HDMI_MAI_CHANNEL_MASK_SHIFT 0 ++ ++/* Last received format word on the MAI bus. */ ++#define VC4_HDMI_MAI_FORMAT 0x098 ++ ++#define VC4_HDMI_AUDIO_PACKET_CONFIG 0x09c ++# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_SAMPLE_FLAT BIT(29) ++# define VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS BIT(24) ++# define VC4_HDMI_AUDIO_PACKET_FORCE_SAMPLE_PRESENT BIT(19) ++# define VC4_HDMI_AUDIO_PACKET_FORCE_B_FRAME BIT(18) ++# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_MASK VC4_MASK(13, 10) ++# define VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER_SHIFT 10 ++/* If set, then multichannel, otherwise 2 channel. */ ++# define VC4_HDMI_AUDIO_PACKET_AUDIO_LAYOUT BIT(9) ++/* If set, then AUDIO_LAYOUT overrides audio_cea_mask */ ++# define VC4_HDMI_AUDIO_PACKET_FORCE_AUDIO_LAYOUT BIT(8) ++# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_MASK VC4_MASK(7, 0) ++# define VC4_HDMI_AUDIO_PACKET_CEA_MASK_SHIFT 0 ++ + #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_CRP_CFG 0x0a8 ++/* When set, the CTS_PERIOD counts based on MAI bus sync pulse instead ++ * of pixel clock. ++ */ ++# define VC4_HDMI_CRP_USE_MAI_BUS_SYNC_FOR_CTS BIT(26) ++/* When set, no CRP packets will be sent. */ ++# define VC4_HDMI_CRP_CFG_DISABLE BIT(25) ++/* If set, generates CTS values based on N, audio clock, and video ++ * clock. N must be divisible by 128. ++ */ ++# define VC4_HDMI_CRP_CFG_EXTERNAL_CTS_EN BIT(24) ++# define VC4_HDMI_CRP_CFG_N_MASK VC4_MASK(19, 0) ++# define VC4_HDMI_CRP_CFG_N_SHIFT 0 ++ ++/* 20-bit fields containing CTS values to be transmitted if !EXTERNAL_CTS_EN */ ++#define VC4_HDMI_CTS_0 0x0ac ++#define VC4_HDMI_CTS_1 0x0b0 ++/* 20-bit fields containing number of clocks to send CTS0/1 before ++ * switching to the other one. ++ */ ++#define VC4_HDMI_CTS_PERIOD_0 0x0b4 ++#define VC4_HDMI_CTS_PERIOD_1 0x0b8 ++ + #define VC4_HDMI_HORZA 0x0c4 + # define VC4_HDMI_HORZA_VPOS BIT(14) + # define VC4_HDMI_HORZA_HPOS BIT(13) +@@ -512,7 +563,11 @@ + + #define VC4_HDMI_TX_PHY_RESET_CTL 0x2c0 + +-#define VC4_HDMI_GCP_0 0x400 ++#define VC4_HDMI_TX_PHY_CTL0 0x2c4 ++# define VC4_HDMI_TX_PHY_RNG_PWRDN BIT(25) ++ ++#define VC4_HDMI_GCP(x) (0x400 + ((x) * 0x4)) ++#define VC4_HDMI_RAM_PACKET(x) (0x400 + ((x) * 0x24)) + #define VC4_HDMI_PACKET_STRIDE 0x24 + + #define VC4_HD_M_CTL 0x00c +@@ -522,6 +577,56 @@ + # define VC4_HD_M_ENABLE BIT(0) + + #define VC4_HD_MAI_CTL 0x014 ++/* Set when audio stream is received at a slower rate than the ++ * sampling period, so MAI fifo goes empty. Write 1 to clear. ++ */ ++# define VC4_HD_MAI_CTL_DLATE BIT(15) ++# define VC4_HD_MAI_CTL_BUSY BIT(14) ++# define VC4_HD_MAI_CTL_CHALIGN BIT(13) ++# define VC4_HD_MAI_CTL_WHOLSMP BIT(12) ++# define VC4_HD_MAI_CTL_FULL BIT(11) ++# define VC4_HD_MAI_CTL_EMPTY BIT(10) ++# define VC4_HD_MAI_CTL_FLUSH BIT(9) ++/* If set, MAI bus generates SPDIF (bit 31) parity instead of passing ++ * through. ++ */ ++# define VC4_HD_MAI_CTL_PAREN BIT(8) ++# define VC4_HD_MAI_CTL_CHNUM_MASK VC4_MASK(7, 4) ++# define VC4_HD_MAI_CTL_CHNUM_SHIFT 4 ++# define VC4_HD_MAI_CTL_ENABLE BIT(3) ++/* Underflow error status bit, write 1 to clear. */ ++# define VC4_HD_MAI_CTL_ERRORE BIT(2) ++/* Overflow error status bit, write 1 to clear. */ ++# define VC4_HD_MAI_CTL_ERRORF BIT(1) ++/* Single-shot reset bit. Read value is undefined. */ ++# define VC4_HD_MAI_CTL_RESET BIT(0) ++ ++#define VC4_HD_MAI_THR 0x018 ++# define VC4_HD_MAI_THR_PANICHIGH_MASK VC4_MASK(29, 24) ++# define VC4_HD_MAI_THR_PANICHIGH_SHIFT 24 ++# define VC4_HD_MAI_THR_PANICLOW_MASK VC4_MASK(21, 16) ++# define VC4_HD_MAI_THR_PANICLOW_SHIFT 16 ++# define VC4_HD_MAI_THR_DREQHIGH_MASK VC4_MASK(13, 8) ++# define VC4_HD_MAI_THR_DREQHIGH_SHIFT 8 ++# define VC4_HD_MAI_THR_DREQLOW_MASK VC4_MASK(5, 0) ++# define VC4_HD_MAI_THR_DREQLOW_SHIFT 0 ++ ++/* Format header to be placed on the MAI data. Unused. */ ++#define VC4_HD_MAI_FMT 0x01c ++ ++/* Register for DMAing in audio data to be transported over the MAI ++ * bus to the Falcon core. ++ */ ++#define VC4_HD_MAI_DATA 0x020 ++ ++/* Divider from HDMI HSM clock to MAI serial clock. Sampling period ++ * converges to N / (M + 1) cycles. ++ */ ++#define VC4_HD_MAI_SMP 0x02c ++# define VC4_HD_MAI_SMP_N_MASK VC4_MASK(31, 8) ++# define VC4_HD_MAI_SMP_N_SHIFT 8 ++# define VC4_HD_MAI_SMP_M_MASK VC4_MASK(7, 0) ++# define VC4_HD_MAI_SMP_M_SHIFT 0 + + #define VC4_HD_VID_CTL 0x038 + # define VC4_HD_VID_CTL_ENABLE BIT(31) + +From 4e8ca7d531bcb9c18c3a684f5aebbefb76242af6 Mon Sep 17 00:00:00 2001 +From: Boris Brezillon +Date: Thu, 2 Feb 2017 11:37:36 +0100 +Subject: [PATCH 224/305] ARM: dts: bcm283x: Add HDMI audio related properties + +Add the dmas and dma-names properties to support HDMI audio. + +Signed-off-by: Boris Brezillon +Signed-off-by: Eric Anholt +(cherry picked from commit d46d2c6380c10e80e99f6af9067356128bffac6b) +--- + arch/arm/boot/dts/bcm283x.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index 348c71bbc913644c04bab43fcb95abe9b6c9c640..7d58cd79ac6bd99f0b47a909ac827c61aac642d9 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -339,6 +339,8 @@ + clocks = <&clocks BCM2835_PLLH_PIX>, + <&clocks BCM2835_CLOCK_HSM>; + clock-names = "pixel", "hdmi"; ++ dmas = <&dma 17>; ++ dma-names = "audio-rx"; + status = "disabled"; + }; + + +From be7726f5eb345ff0fe1dd229a9177551f934c36d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Apr 2017 17:52:56 -0700 -Subject: [PATCH 226/269] panel-raspberrypi-touchscreen: Fix NULL deref if +Subject: [PATCH 225/305] panel-raspberrypi-touchscreen: Fix NULL deref if probe order goes wrong. If the i2c driver hadn't pobed before the panel driver probes, then @@ -159193,10 +159149,10 @@ index 7f315f04b109621ca7f3861fdd8acf956e752629..b57b7ad9aa4c5048186e98553af59ec9 } -From 9bcf9e12ae13d1e928af0d769182a3c663c059f2 Mon Sep 17 00:00:00 2001 +From ec8fcfa9cfe40b5ccefdd2946c09f2e1628d838e Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Wed, 19 Apr 2017 09:59:21 -0700 -Subject: [PATCH 227/269] smsc75xx: use skb_cow_head() to deal with cloned skbs +Subject: [PATCH 226/305] smsc75xx: use skb_cow_head() to deal with cloned skbs We need to ensure there is enough headroom to push extra header, but we also need to check if we are allowed to change headers. @@ -159232,10 +159188,10 @@ index 9af9799935dbbd4baed06eb03402803e0ce8d9c8..4cb9b11a545a9572ab6d248742ec5abe tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS; -From 416209e2665c0d88ecf205fe77c86aeeaa392a29 Mon Sep 17 00:00:00 2001 +From 5dc8bc82994dfdd5946d43c5654c6a66590096fe Mon Sep 17 00:00:00 2001 From: James Hughes Date: Wed, 19 Apr 2017 11:13:40 +0100 -Subject: [PATCH 228/269] smsc95xx: Use skb_cow_head to deal with cloned skbs +Subject: [PATCH 227/305] smsc95xx: Use skb_cow_head to deal with cloned skbs The driver was failing to check that the SKB wasn't cloned before adding checksum data. @@ -159275,35 +159231,10 @@ index df60c989fc229bf0aab3c27e95ccd45323367840..f6661e388f6e801c1b88e48a3b71407b if (csum) { -From b913417a2368cb15a90a2dbfb34bea855bf55347 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 24 Apr 2017 18:26:52 +0100 -Subject: [PATCH 229/269] i2c-bcm2835: Ignore unexpected interrupt - ---- - drivers/i2c/busses/i2c-bcm2835.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c -index 8642f580ce41803bd22c76a0fa80d083d0747be1..47167f403cc8329bd811b47c7011c299b8ecafee 100644 ---- a/drivers/i2c/busses/i2c-bcm2835.c -+++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -279,7 +279,9 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) - } - - if (val & BCM2835_I2C_S_DONE) { -- if (i2c_dev->curr_msg->flags & I2C_M_RD) { -+ if (!i2c_dev->curr_msg) { -+ dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n"); -+ } else if (i2c_dev->curr_msg->flags & I2C_M_RD) { - bcm2835_drain_rxfifo(i2c_dev); - val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); - } - -From ff6c45239866c15264dab3f6af013a0a76793ced Mon Sep 17 00:00:00 2001 +From 339ba44d0abb66b6290fca8bae42fdcb73b319b7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 23 Apr 2017 19:36:53 +0100 -Subject: [PATCH 230/269] BCM270X_DT: Add bme280 and bmp180 to i2c-sensor +Subject: [PATCH 228/305] BCM270X_DT: Add bme280 and bmp180 to i2c-sensor overlay Signed-off-by: Phil Elwell @@ -159377,10 +159308,10 @@ index 606b2d5012abf2e85712be631c42ea40a0b512c5..e23e34b32a0a8927c14203d7384e8008 lm75 = <&lm75>,"status"; lm75addr = <&lm75>,"reg:0"; -From 984a27388b849bbf306a576d410049fdace4d571 Mon Sep 17 00:00:00 2001 +From 6399697afb20d138662a2c4f45f52df77a969160 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 23 Apr 2017 19:38:06 +0100 -Subject: [PATCH 231/269] config: Add CONFIG_BMP280 (and CONFIG_BMP280_I2C) +Subject: [PATCH 229/305] config: Add CONFIG_BMP280 (and CONFIG_BMP280_I2C) Signed-off-by: Phil Elwell --- @@ -159465,10 +159396,10 @@ index fd535ff21e7dab6717eb61f1b966b7d92791ec8d..7948b445f1232064dea01273393f3e3b CONFIG_PWM_PCA9685=m CONFIG_RASPBERRYPI_FIRMWARE=y -From 8bb03fb7ba375e21ca3c9d05bc90fd5659e94f90 Mon Sep 17 00:00:00 2001 +From cebc7ddfe5e162584f93677dc7edc0ba266714f0 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Tue, 25 Apr 2017 10:46:09 -0400 -Subject: [PATCH 232/269] config: Enable TI TMP102 temp sensor module +Subject: [PATCH 230/305] config: Enable TI TMP102 temp sensor module Signed-off-by: Scott Ellis --- @@ -159501,10 +159432,10 @@ index 7948b445f1232064dea01273393f3e3b135b4576..a338c313de9e9db3a338d066b5fad989 CONFIG_THERMAL_BCM2835=y CONFIG_WATCHDOG=y -From 1c39224fab012cffdb7f94aed1d05ad00229c10d Mon Sep 17 00:00:00 2001 +From f94d7347e407f7f513887eba3167414e21f3fcdb Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Tue, 25 Apr 2017 13:05:42 -0400 -Subject: [PATCH 233/269] BCM270X_DT: Add tmp102 to i2c sensor overlay +Subject: [PATCH 231/305] BCM270X_DT: Add tmp102 to i2c sensor overlay Signed-off-by: Scott Ellis --- @@ -159584,10 +159515,10 @@ index e23e34b32a0a8927c14203d7384e800878627347..e86a13f92c3f75c14fa4425cdfb081d6 }; }; -From cd695ae66d57e78fba7d191b2ea3711d1ba56343 Mon Sep 17 00:00:00 2001 +From 0f03a9eadfec0fc66365e8cb53a9d169f570f392 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 26 Apr 2017 16:51:48 +0100 -Subject: [PATCH 234/269] dwc_otg: Add the dependency on FIQ +Subject: [PATCH 232/305] dwc_otg: Add the dependency on FIQ Signed-off-by: popcornmix --- @@ -159608,10 +159539,10 @@ index f17b939c149562527937f49d90e23c7ab8b72328..5a5f6c925f43147082dcfaab15f9e05e The Synopsis DWC controller is a dual-role host/peripheral/OTG ("On The Go") USB controllers. -From 1dabdb616b40654daa67f9608c0b1fb21e2cdc3a Mon Sep 17 00:00:00 2001 +From 8d6000ef2b4d05c200209be892e5c7ef0ffc7e96 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 26 Apr 2017 17:28:47 +0100 -Subject: [PATCH 235/269] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER +Subject: [PATCH 233/305] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER It is unwise to use sources other than the oscillator and PLLD_PER for the PCM peripheral (and perhaps others - TBD) because their rate can @@ -159656,10 +159587,10 @@ index fe3298b54cdfb96bd90fb4f39e13921d2e1d4356..c24b4defb2b046e4ecdc109befc2b224 [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( .name = "pwm", -From 643d427136232f669268e0fb8b226d1e51025f4a Mon Sep 17 00:00:00 2001 +From 2c40231160da1f20d2f3a4ea03a4e3a1f973d6eb Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 27 Apr 2017 16:24:34 +0100 -Subject: [PATCH 236/269] dwc_otg: make nak_holdoff work as intended with empty +Subject: [PATCH 234/305] dwc_otg: make nak_holdoff work as intended with empty queues If URBs reading from non-periodic split endpoints were dequeued and @@ -159743,10 +159674,10 @@ index c2dff94e8e6edd22e4427aaa1eac7aad972cb6bd..85a6d431ca54b47dc10573aa72d1ad69 } else { uint16_t frame_number = dwc_otg_hcd_get_frame_number(hcd); -From 291636002ab8241f052b0ac81f3051e63a8f2431 Mon Sep 17 00:00:00 2001 +From b0610522d07c08d3ab1852beb7b4ef17b3119531 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 18 Apr 2017 21:43:46 +0100 -Subject: [PATCH 237/269] vc4_fkms: Apply firmware overscan offset to hardware +Subject: [PATCH 235/305] vc4_fkms: Apply firmware overscan offset to hardware cursor --- @@ -159803,10 +159734,10 @@ index da818a207bfa639b8cea48d94bcf4566f97db816..943cbb38f1f2e6fc7c06870be7904677 return 0; -From d7af8f271c9f2f94bfe8ddbf8deedc3a921a338e Mon Sep 17 00:00:00 2001 +From 9e33ea0d490b3a2ede6fa9227465b34a18617312 Mon Sep 17 00:00:00 2001 From: P33M Date: Tue, 2 May 2017 16:31:15 +0100 -Subject: [PATCH 238/269] dwc_otg: fix split transaction data toggle handling +Subject: [PATCH 236/305] dwc_otg: fix split transaction data toggle handling around dequeues See https://github.com/raspberrypi/linux/issues/1709 @@ -159894,10 +159825,10 @@ index 608e036be2c9484465ab836de70129335d3d2d96..718a1accc0c219a1764ce53d291de6a2 } qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); -From 6f0c7340045599e48f44fc3a9e2af40dcc73eba9 Mon Sep 17 00:00:00 2001 +From 5a52a93c6e26d04f672ec91d7b58e3f917c3066d Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 4 May 2017 14:56:08 +0100 -Subject: [PATCH 239/269] fiq_fsm: Use correct states when starting isoc OUT +Subject: [PATCH 237/305] fiq_fsm: Use correct states when starting isoc OUT transfers (#1991) * fiq_fsm: Use correct states when starting isoc OUT transfers @@ -159936,10 +159867,10 @@ index 9304279592cb5b388086ef91cb52f1e9f94868ce..208252645c09d1d17bf07673989f91b7 break; } -From 7427ad0c899ca7540629c334ac7ff152f33d3923 Mon Sep 17 00:00:00 2001 +From 6733150f9d6ec93c636a65c258a84d855764885c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 May 2017 16:36:05 +0100 -Subject: [PATCH 240/269] vcsm: Treat EBUSY as success rather than SIGBUS +Subject: [PATCH 238/305] vcsm: Treat EBUSY as success rather than SIGBUS Currently if two cores access the same page concurrently one will return VM_FAULT_NOPAGE and the other VM_FAULT_SIGBUS crashing the user code. @@ -159977,10 +159908,10 @@ index 1db6716c2c0c8b2013203391501f92d09db258af..ee4e05948c439a9045e0b65566d57587 } } -From 5e1fb5bbead087e173a638c7d27daa60cadd8a41 Mon Sep 17 00:00:00 2001 +From 7cdea4f7af4b010f73a9ca37871cb05820776845 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 4 May 2017 17:38:22 +0100 -Subject: [PATCH 241/269] bcm2708_fb: Avoid firmware mbox call in vc_mem_copy +Subject: [PATCH 239/305] bcm2708_fb: Avoid firmware mbox call in vc_mem_copy If firmware has locked up it is useful to get vcdbg log out without a firmware mbox response. Issue the mbox call at probe time instead. @@ -160044,326 +159975,34 @@ index 53c5a0bdadb4be9251affdabed66305842a08e72..612293cf9f1bd93ad2f2aefdd7ca0f5e if (ret == 0) { platform_set_drvdata(dev, fb); -From 6432aba0e1eff51f3c1c54fe78f9c6683cd4cd59 Mon Sep 17 00:00:00 2001 +From 3957edf63b084c54c5bdedfbbe299f0a1677757d Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Mon, 22 May 2017 15:28:27 +0100 -Subject: [PATCH 242/269] config: Add CONFIG_IPV6_ROUTE_INFO +Date: Fri, 5 May 2017 13:23:10 +0100 +Subject: [PATCH 240/305] Revert "serial: 8250: Don't crash when nr_uarts is 0" +This reverts commit 9c297d9ebd0d8c6d5e6e8675d527d6a221613abc. --- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) + drivers/tty/serial/8250/8250_core.c | 2 -- + 1 file changed, 2 deletions(-) -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index d5624bbf15a669dccdde489e14c1d5c56a8cfa5c..a763d05190d83feaa8a05920056605b6ddd921a8 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -103,6 +103,7 @@ CONFIG_TCP_CONG_ADVANCED=y - CONFIG_TCP_CONG_BBR=m - CONFIG_IPV6=m - CONFIG_IPV6_ROUTER_PREF=y -+CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index a338c313de9e9db3a338d066b5fad989f6ece1ad..1d528ab1129223c580a4b30dc4058efbba7b00aa 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -99,6 +99,7 @@ CONFIG_TCP_CONG_ADVANCED=y - CONFIG_TCP_CONG_BBR=m - CONFIG_IPV6=m - CONFIG_IPV6_ROUTER_PREF=y -+CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m +diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c +index cf9c7d2e3f95e1a19410247a89c2e49c1a2747a8..e8819aa20415603c80547e382838a8fa3ce54792 100644 +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -509,8 +509,6 @@ static void __init serial8250_isa_init_ports(void) + + if (nr_uarts > UART_NR) + nr_uarts = UART_NR; +- if (!nr_uarts) +- return; + + for (i = 0; i < nr_uarts; i++) { + struct uart_8250_port *up = &serial8250_ports[i]; -From e44f9961ef5536f75176909c7f2ec15c5ac49707 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 22 May 2017 13:35:28 +0100 -Subject: [PATCH 243/269] config: Add CONFIG_IPV6_SIT_6RD - ---- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index a763d05190d83feaa8a05920056605b6ddd921a8..bd4750b30f3b30955506bac80a8ae7bc0dae0da6 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -107,6 +107,7 @@ CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -+CONFIG_IPV6_SIT_6RD=y - CONFIG_IPV6_TUNNEL=m - CONFIG_IPV6_MULTIPLE_TABLES=y - CONFIG_IPV6_SUBTREES=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 1d528ab1129223c580a4b30dc4058efbba7b00aa..390171b4a7a377f9523001e2928c47b5ab0801ab 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -103,6 +103,7 @@ CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -+CONFIG_IPV6_SIT_6RD=y - CONFIG_IPV6_TUNNEL=m - CONFIG_IPV6_MULTIPLE_TABLES=y - CONFIG_IPV6_SUBTREES=y - -From d2c492c6079988ff647931dc9a2178a20d8987a9 Mon Sep 17 00:00:00 2001 -From: Anton Onishchenko -Date: Tue, 23 May 2017 18:55:46 +0300 -Subject: [PATCH 244/269] mpu6050 device tree overlay (#2031) - -Add overlay and config options for InvenSense MPU6050 6-axis motion -detector. ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 ++++++ - arch/arm/boot/dts/overlays/mpu6050-overlay.dts | 28 ++++++++++++++++++++++++++ - arch/arm/configs/bcm2709_defconfig | 3 +-- - arch/arm/configs/bcmrpi_defconfig | 3 +-- - 5 files changed, 37 insertions(+), 4 deletions(-) - create mode 100644 arch/arm/boot/dts/overlays/mpu6050-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index e2f66a55dc5afe13d690c2c17827054ac94b7168..0eb0e87c5746a8449162549384eb4a63895ba3c6 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -57,6 +57,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - mcp3008.dtbo \ - midi-uart0.dtbo \ - mmc.dtbo \ -+ mpu6050.dtbo \ - mz61581.dtbo \ - pi3-act-led.dtbo \ - pi3-disable-bt.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 32e5fc4a9968c368e1063aef5fea95caedfba36f..843734740c2cd7438ecd9c956c87371f5803ba06 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -883,6 +883,12 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework - requests 50MHz - - -+Name: mpu6050 -+Info: Overlay for i2c connected mpu6050 imu -+Load: dtoverlay=mpu6050,= -+Params: interrupt GPIO pin for interrupt (default 4) -+ -+ - Name: mz61581 - Info: MZ61581 display by Tontec - Load: dtoverlay=mz61581,= -diff --git a/arch/arm/boot/dts/overlays/mpu6050-overlay.dts b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..06037969c3abba270b3cad45875342f3c730506e ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -@@ -0,0 +1,28 @@ -+// Definitions for MPU6050 -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ clock-frequency = <400000>; -+ -+ mpu6050: mpu6050@68 { -+ compatible = "invensense,mpu6050"; -+ reg = <0x68>; -+ interrupt-parent = <&gpio>; -+ interrupts = <4 1>; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ interrupt = <&mpu6050>,"interrupts:0"; -+ }; -+}; -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index bd4750b30f3b30955506bac80a8ae7bc0dae0da6..6e67f6744780cb6c3a92c5cdea9270e629cef946 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -1170,13 +1170,12 @@ CONFIG_RASPBERRYPI_POWER=y - CONFIG_EXTCON=m - CONFIG_EXTCON_ARIZONA=m - CONFIG_IIO=m --CONFIG_IIO_BUFFER=y - CONFIG_IIO_BUFFER_CB=m --CONFIG_IIO_KFIFO_BUF=m - CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_INV_MPU6050_I2C=m - CONFIG_BMP280=m - CONFIG_PWM_BCM2835=m - CONFIG_PWM_PCA9685=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 390171b4a7a377f9523001e2928c47b5ab0801ab..8dd491e75834ede8221919a97099037b69d43f2c 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1178,13 +1178,12 @@ CONFIG_RASPBERRYPI_POWER=y - CONFIG_EXTCON=m - CONFIG_EXTCON_ARIZONA=m - CONFIG_IIO=m --CONFIG_IIO_BUFFER=y - CONFIG_IIO_BUFFER_CB=m --CONFIG_IIO_KFIFO_BUF=m - CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_INV_MPU6050_I2C=m - CONFIG_BMP280=m - CONFIG_PWM_BCM2835=m - CONFIG_PWM_PCA9685=m - -From 1db1cea7b2bf5291fdd701602789d7fc52ebb622 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 22 May 2017 13:56:41 +0100 -Subject: [PATCH 245/269] clk: bcm2835: Minimise clock jitter for PCM clock - -Fractional clock dividers generate accurate average frequencies but -with jitter, particularly when the integer divisor is small. - -Introduce a new metric of clock accuracy to penalise clocks with a good -average but worse jitter compared to clocks with an average which is no -better but with lower jitter. The metric is the ideal rate minus the -worse deviation from that ideal using the nearest integer divisors. - -Use this metric for parent selection for clocks requiring low jitter -(currently just PCM). - -Signed-off-by: Phil Elwell ---- - drivers/clk/bcm/clk-bcm2835.c | 39 ++++++++++++++++++++++++++++++++++----- - 1 file changed, 34 insertions(+), 5 deletions(-) - -diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index c24b4defb2b046e4ecdc109befc2b22497060647..db3ba74acf78f4dfec0d2206b58bc7c3a09f72fe 100644 ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -534,6 +534,7 @@ struct bcm2835_clock_data { - - bool is_vpu_clock; - bool is_mash_clock; -+ bool low_jitter; - - u32 tcnt_mux; - }; -@@ -1154,7 +1155,8 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - int parent_idx, - unsigned long rate, - u32 *div, -- unsigned long *prate) -+ unsigned long *prate, -+ unsigned long *avgrate) - { - struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); - struct bcm2835_cprman *cprman = clock->cprman; -@@ -1166,11 +1168,33 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - parent = clk_hw_get_parent_by_index(hw, parent_idx); - - if (!(BIT(parent_idx) & data->set_rate_parent)) { -+ unsigned long tmp_rate; -+ - *prate = clk_hw_get_rate(parent); - *div = bcm2835_clock_choose_div(hw, rate, *prate, true); - -- return bcm2835_clock_rate_from_divisor(clock, *prate, -- *div); -+ tmp_rate = bcm2835_clock_rate_from_divisor(clock, *prate, *div); -+ *avgrate = tmp_rate; -+ -+ if (data->low_jitter && (*div & CM_DIV_FRAC_MASK)) { -+ unsigned long high, low; -+ u32 idiv = *div & ~CM_DIV_FRAC_MASK; -+ -+ high = bcm2835_clock_rate_from_divisor(clock, *prate, -+ idiv); -+ idiv += CM_DIV_FRAC_MASK + 1; -+ low = bcm2835_clock_rate_from_divisor(clock, *prate, -+ idiv); -+ -+ /* Return a value which is the maximum deviation -+ * below the ideal rate, for use as a metric. -+ */ -+ if ((tmp_rate - low) < (high - tmp_rate)) -+ tmp_rate = low; -+ else -+ tmp_rate -= high - tmp_rate; -+ } -+ return tmp_rate; - } - - if (data->frac_bits) -@@ -1197,6 +1221,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - - *div = curdiv << CM_DIV_FRAC_BITS; - *prate = curdiv * best_rate; -+ *avgrate = best_rate; - - return best_rate; - } -@@ -1208,6 +1233,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - bool current_parent_is_pllc; - unsigned long rate, best_rate = 0; - unsigned long prate, best_prate = 0; -+ unsigned long avgrate, best_avgrate = 0; - size_t i; - u32 div; - -@@ -1232,11 +1258,13 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - continue; - - rate = bcm2835_clock_choose_div_and_prate(hw, i, req->rate, -- &div, &prate); -+ &div, &prate, -+ &avgrate); - if (rate > best_rate && rate <= req->rate) { - best_parent = parent; - best_prate = prate; - best_rate = rate; -+ best_avgrate = avgrate; - } - } - -@@ -1246,7 +1274,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - req->best_parent_hw = best_parent; - req->best_parent_rate = best_prate; - -- req->rate = best_rate; -+ req->rate = best_avgrate; - - return 0; - } -@@ -2061,6 +2089,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { - .int_bits = 12, - .frac_bits = 12, - .is_mash_clock = true, -+ .low_jitter = true, - .parents = bcm2835_pcm_per_parents, - .tcnt_mux = 23), - [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( - -From 9ca0b52c448cb05df5fe0cabe04ae2a8babb0700 Mon Sep 17 00:00:00 2001 +From 2543c750c26e61704d5c5d6269ac59944388d770 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 8 May 2017 16:30:18 +0100 -Subject: [PATCH 246/269] ARM: dts: bcm283x: Reserve first page for firmware +Subject: [PATCH 241/305] ARM: dts: bcm283x: Reserve first page for firmware The Raspberry Pi startup stub files for multi-core BCM27XX processors make the secondary CPUs spin until the corresponding mailbox is @@ -160410,10 +160049,257 @@ index 7d58cd79ac6bd99f0b47a909ac827c61aac642d9..0bc1932cde435bd151ffc2364bca5cd9 * bcm2835 and bcm2836 implementations, leaving the CPU configuration to * bcm2835.dtsi and bcm2836.dtsi. -From a721f7ae4739afe5ccfba390baac901171fe397b Mon Sep 17 00:00:00 2001 +From 7eff299716f5658789ba463a2dc3c0a9ebf0b527 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 8 May 2017 16:43:40 +0100 +Subject: [PATCH 242/305] irq_bcm2836: Send event when onlining sleeping cores + +In order to reduce power consumption and bus traffic, it is sensible +for secondary cores to enter a low-power idle state when waiting to +be started. The wfe instruction causes a core to wait until an event +or interrupt arrives before continuing to the next instruction. +The sev instruction sends a wakeup event to the other cores, so call +it from bcm2836_smp_boot_secondary, the function that wakes up the +waiting cores during booting. + +It is harmless to use this patch without the corresponding change +adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated +and this patch is not applied then the other cores will sleep forever. + +See: https://github.com/raspberrypi/linux/issues/1989 + +Signed-off-by: Phil Elwell +--- + drivers/irqchip/irq-bcm2836.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c +index e10597c1a1e51e5e27aa574b6a26d87181f26221..6dccdf94f6f3b4c6a3f6cb1cae5a6ab2879a38cc 100644 +--- a/drivers/irqchip/irq-bcm2836.c ++++ b/drivers/irqchip/irq-bcm2836.c +@@ -248,6 +248,9 @@ static int __init bcm2836_smp_boot_secondary(unsigned int cpu, + writel(secondary_startup_phys, + intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu); + ++ dsb(sy); /* Ensure write has completed before waking the other CPUs */ ++ sev(); ++ + return 0; + } + + +From a0d47f428b18b51172bf3db46c4813653f8c5edc Mon Sep 17 00:00:00 2001 +From: Nisar Sayed +Date: Tue, 9 May 2017 18:51:42 +0100 +Subject: [PATCH 243/305] According to RFC 2460, IPv6 UDP calculated checksum + yields a result of zero must be changed to 0xffff, however this feature is + not supported by smsc95xx family hence enable csum offload only for IPv4 + TCP/UDP packets. + +Signed-off-by: Nisar Sayed + +Reported-by: popcorn mix +--- + drivers/net/usb/smsc95xx.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index f6661e388f6e801c1b88e48a3b71407bd70cf56e..b84e98508b5d97165b68dfc30240950e78bb14c3 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -694,7 +694,7 @@ static int smsc95xx_set_features(struct net_device *netdev, + if (ret < 0) + return ret; + +- if (features & NETIF_F_HW_CSUM) ++ if (features & NETIF_F_IP_CSUM) + read_buf |= Tx_COE_EN_; + else + read_buf &= ~Tx_COE_EN_; +@@ -1342,12 +1342,16 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + + spin_lock_init(&pdata->mac_cr_lock); + ++ /* RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be ++ * changed to 0xffff, this feature is not supported by smsc95xx family, ++ * hence enable csum offload only for IPv4 TCP/UDP packets. ++ */ + if (DEFAULT_TX_CSUM_ENABLE) +- dev->net->features |= NETIF_F_HW_CSUM; ++ dev->net->features |= NETIF_F_IP_CSUM; + if (DEFAULT_RX_CSUM_ENABLE) + dev->net->features |= NETIF_F_RXCSUM; + +- dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM; ++ dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM; + + smsc95xx_init_mac_address(dev); + + +From 23df46b4bf493b334c0b5be1480e3b34c5dc3ad9 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 10 May 2017 12:47:46 +0100 +Subject: [PATCH 244/305] dwcotg: Allow to build without FIQ on ARM64 + +Signed-off-by: popcornmix +--- + drivers/usb/host/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig +index 5a5f6c925f43147082dcfaab15f9e05ed966838c..c50476b3d72471faf94c280aab756599fe55ac90 100644 +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -764,7 +764,7 @@ config USB_HWA_HCD + + config USB_DWCOTG + tristate "Synopsis DWC host support" +- depends on USB && FIQ ++ depends on USB && (FIQ || ARM64) + help + The Synopsis DWC controller is a dual-role + host/peripheral/OTG ("On The Go") USB controllers. + +From 5c268166a7521080658e9609aa0e55a9d9ffb4b5 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 11 May 2017 16:58:16 +0100 +Subject: [PATCH 245/305] BCM270X_DT: Tidy up mmc, sdhost, sdio overlays + +The mmc, sdhost, sdio and sdio-1bit overlays had a few +anachronisms and oddities which were overdue for fixing. +The new versions should be functionally equivalent. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/mmc-overlay.dts | 1 + + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 1 - + arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts | 11 ++++++----- + arch/arm/boot/dts/overlays/sdio-overlay.dts | 11 ++++++----- + 4 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts +index d32b02ca01ced5ab3de00d66d5412c8fda4bc510..64f1ff6684b19e76cfd00e6950919ac55227b44b 100644 +--- a/arch/arm/boot/dts/overlays/mmc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts +@@ -21,6 +21,7 @@ + mmc_pins: mmc_pins { + brcm,pins = <48 49 50 51 52 53>; + brcm,function = <7>; /* alt3 */ ++ brcm.pull = <0 2 2 2 2 2>; + }; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index a431177a1c9d320d5432ea448ad4d0f696c34525..de3d1b0a5e403057a8e94f85695de4076d77e31f 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -11,7 +11,6 @@ + frag0: __overlay__ { + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; +- brcm,debug-flags = <0>; + status = "okay"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts +index 46d453859b31f5c700a8a2e39a2c209330bc108f..0b7f2c6f2603b631e1985df7fbf66749149566d6 100644 +--- a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts +@@ -1,11 +1,12 @@ +-/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ ++/dts-v1/; ++/plugin/; + +-/include/ "sdhost-overlay.dts" ++/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ + + /{ + compatible = "brcm,bcm2708"; + +- fragment@3 { ++ fragment@0 { + target = <&mmc>; + sdio_mmc: __overlay__ { + compatible = "brcm,bcm2835-mmc"; +@@ -18,12 +19,12 @@ + }; + }; + +- fragment@4 { ++ fragment@1 { + target = <&gpio>; + __overlay__ { + sdio_pins: sdio_pins { + brcm,pins = <22 23 24 25>; +- brcm,function = <7 7 7 7>; /* ALT3 = SD1 */ ++ brcm,function = <7>; /* ALT3 = SD1 */ + brcm,pull = <0 2 2 2>; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/sdio-overlay.dts b/arch/arm/boot/dts/overlays/sdio-overlay.dts +index 398bd812c716c9e472fbac5aba4fe882114c65d1..215d5e3e8a8ca4363457fed1f7425427bb5086d7 100644 +--- a/arch/arm/boot/dts/overlays/sdio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts +@@ -1,11 +1,12 @@ +-/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ ++/dts-v1/; ++/plugin/; + +-/include/ "sdhost-overlay.dts" ++/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ + + /{ + compatible = "brcm,bcm2708"; + +- fragment@3 { ++ fragment@0 { + target = <&mmc>; + sdio_mmc: __overlay__ { + pinctrl-names = "default"; +@@ -17,12 +18,12 @@ + }; + }; + +- fragment@4 { ++ fragment@1 { + target = <&gpio>; + __overlay__ { + sdio_pins: sdio_pins { + brcm,pins = <22 23 24 25 26 27>; +- brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */ ++ brcm,function = <7>; /* ALT3 = SD1 */ + brcm,pull = <0 2 2 2 2 2>; + }; + }; + +From 490a73cd7c31efbf1f79f342e1ac178e74f55246 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 11 May 2017 22:00:20 +0100 +Subject: [PATCH 246/305] SQUASH: BCM270X_DT: Fix typo in mmc overlay + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/mmc-overlay.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts +index 64f1ff6684b19e76cfd00e6950919ac55227b44b..88251ad653917674f80c2975de2e425fca00b71f 100644 +--- a/arch/arm/boot/dts/overlays/mmc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts +@@ -21,7 +21,7 @@ + mmc_pins: mmc_pins { + brcm,pins = <48 49 50 51 52 53>; + brcm,function = <7>; /* alt3 */ +- brcm.pull = <0 2 2 2 2 2>; ++ brcm,pull = <0 2 2 2 2 2>; + }; + }; + }; + +From ffefd34181cc1591c862298179df965083f1b455 Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 12 May 2017 12:24:00 +0100 -Subject: [PATCH 247/269] dwc_otg: fix several potential crash sources +Subject: [PATCH 247/305] dwc_otg: fix several potential crash sources On root port disconnect events, the host driver state is cleared and in-progress host channels are forcibly stopped. This doesn't play @@ -160609,10 +160495,10 @@ index 718a1accc0c219a1764ce53d291de6a2b6f93608..cf23baaa388562b5843be4cfa6c206cb release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); break; -From 3bad002726b9272b1e3f4f2024ac292def30a1b9 Mon Sep 17 00:00:00 2001 +From 463a15bd951aeee9e3065756a89b2fb3482560a0 Mon Sep 17 00:00:00 2001 From: P33M Date: Mon, 15 May 2017 14:27:48 +0100 -Subject: [PATCH 248/269] dwc_otg: delete hcd->channel_lock +Subject: [PATCH 248/305] dwc_otg: delete hcd->channel_lock The lock serves no purpose as it is only held while the HCD spinlock is already being held. @@ -160764,10 +160650,10 @@ index cf23baaa388562b5843be4cfa6c206cbdc4e780d..a4355afc77b68718fdaba6c5d4be257d /* Try to queue more transfers now that there's a free channel. */ -From 0c2cccd2448ffde803fb8b9f600d3c4f89e61b76 Mon Sep 17 00:00:00 2001 +From 112235c8ca7fe2d477c6da058705a4f0532c7266 Mon Sep 17 00:00:00 2001 From: P33M Date: Mon, 15 May 2017 14:51:42 +0100 -Subject: [PATCH 249/269] dwc_otg: remove unnecessary dma-mode channel halts on +Subject: [PATCH 249/305] dwc_otg: remove unnecessary dma-mode channel halts on disconnect interrupt Host channels are already halted in kill_urbs_in_qh_list() with the @@ -160835,10 +160721,10 @@ index 5ec991624c7865901b22ea01b9f2c58c8535ecfd..a2dc6337836b2719f4c954edeeb2a713 if(fiq_enable) { -From 4adcb9be792ebf709234627923b525e602b73c14 Mon Sep 17 00:00:00 2001 +From 31ab4f56811854594c6f204fcb4d95952f48422f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 15 May 2017 09:28:36 -0700 -Subject: [PATCH 250/269] drm/vc4: Mark the device as active when enabling +Subject: [PATCH 250/305] drm/vc4: Mark the device as active when enabling runtime PM. Failing to do so meant that we got a resume() callback on first use of @@ -160864,10 +160750,10 @@ index 882ec06225f1d5caca71bdb5c69664188192c2e2..77ed4ef3b8c8685a3cd8c871bbd249de pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ pm_runtime_enable(dev); -From 888ae724a02d0b7e81afb0c0a8fde554154e5a76 Mon Sep 17 00:00:00 2001 +From daac5920226d6c880ae13cf13b0bfa583076c36d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 15 May 2017 11:35:13 -0700 -Subject: [PATCH 251/269] BCM270X: Drop position requirement for CMA in VC4 +Subject: [PATCH 251/305] BCM270X: Drop position requirement for CMA in VC4 overlay. No longer necessary since 2aefcd576195a739a7a256099571c9c4a401005f, @@ -160925,10 +160811,10 @@ index c57e795824e9261e0f60bcb40d6a57241019fd91..bf9395041face775d335177583e0b222 }; -From c45ad09ce5906f17631ec87d440a5442a3fec75a Mon Sep 17 00:00:00 2001 +From c907ae9c1dfc0cdf9cb40cfc76517834b7ea1d70 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Mon, 15 May 2017 16:55:56 +0200 -Subject: [PATCH 252/269] config: Add Goodix touch controller module +Subject: [PATCH 252/305] config: Add Goodix touch controller module Signed-off-by: Ahmet Inan --- @@ -160937,10 +160823,10 @@ Signed-off-by: Ahmet Inan 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 6e67f6744780cb6c3a92c5cdea9270e629cef946..b8937da67d842393ee293f4ad83de10595e32da5 100644 +index d5624bbf15a669dccdde489e14c1d5c56a8cfa5c..c4c5b42016e54d87b9f8f99354b164a0548980f7 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -571,6 +571,7 @@ CONFIG_JOYSTICK_RPISENSE=m +@@ -569,6 +569,7 @@ CONFIG_JOYSTICK_RPISENSE=m CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_ADS7846=m CONFIG_TOUCHSCREEN_EGALAX=m @@ -160949,10 +160835,10 @@ index 6e67f6744780cb6c3a92c5cdea9270e629cef946..b8937da67d842393ee293f4ad83de105 CONFIG_TOUCHSCREEN_RPI_FT5406=m CONFIG_TOUCHSCREEN_USB_COMPOSITE=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 8dd491e75834ede8221919a97099037b69d43f2c..20740aaa943d6875f24a2dcfa18078967d2bd829 100644 +index a338c313de9e9db3a338d066b5fad989f6ece1ad..c274e53142ce231819e6421df1257e8a3544fd94 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -567,6 +567,7 @@ CONFIG_JOYSTICK_RPISENSE=m +@@ -565,6 +565,7 @@ CONFIG_JOYSTICK_RPISENSE=m CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_ADS7846=m CONFIG_TOUCHSCREEN_EGALAX=m @@ -160961,10 +160847,10 @@ index 8dd491e75834ede8221919a97099037b69d43f2c..20740aaa943d6875f24a2dcfa1807896 CONFIG_TOUCHSCREEN_USB_COMPOSITE=m CONFIG_TOUCHSCREEN_STMPE=m -From c01f2d9d1a69c3508c1aeb07eda39504b8c395dc Mon Sep 17 00:00:00 2001 +From 1b676078a6e12f70317421b65203a45a9860fe44 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Mon, 15 May 2017 17:10:53 +0200 -Subject: [PATCH 253/269] overlays: Add Goodix overlay +Subject: [PATCH 253/305] overlays: Add Goodix overlay Add support for I2C connected Goodix gt9271 multiple touch controller using GPIOs 4 and 17 (pins 7 and 11 on GPIO header) for interrupt and reset. @@ -160978,7 +160864,7 @@ Signed-off-by: Ahmet Inan create mode 100644 arch/arm/boot/dts/overlays/goodix-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 0eb0e87c5746a8449162549384eb4a63895ba3c6..315ee19036ab85431f2a077101054ba21b2db888 100644 +index e2f66a55dc5afe13d690c2c17827054ac94b7168..b62edf6ce17ed8db18c73ce02b18ca43481691ab 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -25,6 +25,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ @@ -160990,7 +160876,7 @@ index 0eb0e87c5746a8449162549384eb4a63895ba3c6..315ee19036ab85431f2a077101054ba2 gpio-ir.dtbo \ gpio-poweroff.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 843734740c2cd7438ecd9c956c87371f5803ba06..2dade3155e11387de52e5e6150c9a1e9fc4c36cf 100644 +index 32e5fc4a9968c368e1063aef5fea95caedfba36f..b3aadaa6cfafae0e01908a3a2f1f646d06d69b32 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -459,6 +459,14 @@ Load: dtoverlay=fe-pi-audio @@ -161061,10 +160947,102 @@ index 0000000000000000000000000000000000000000..084f74042ed6379ebd9281374d5391a7 + }; +}; -From 8b0da256d949f4721185fd2990932ac397359ed7 Mon Sep 17 00:00:00 2001 +From be5d9a800381ee60c446f628cd4c004066f031fc Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 16 May 2017 16:55:36 +0100 +Subject: [PATCH 254/305] config: Drop CONFIG_TOUCHSCREEN_EKTF2127 + +--- + arch/arm/configs/bcm2709_defconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index c4c5b42016e54d87b9f8f99354b164a0548980f7..fdd17f5625e889257e69c90a0679dc9bb716bb69 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -570,7 +570,6 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_GOODIX=m +-CONFIG_TOUCHSCREEN_EKTF2127=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + +From b85241e64affe0446bcdcc4ba6bed0a2a734becf Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 16 May 2017 15:58:00 +0100 +Subject: [PATCH 255/305] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index fdd17f5625e889257e69c90a0679dc9bb716bb69..6ba9d39f47daf34672806858afa1c2a1a692beb5 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -570,6 +570,7 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_GOODIX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index c274e53142ce231819e6421df1257e8a3544fd94..d50e88455b4ba5a891a47c2416a09f9402435b90 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -566,6 +566,7 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_GOODIX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + +From 48012ce823f271c6e805ce578f32aa9ec2d4997a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 16 May 2017 19:34:52 +0100 +Subject: [PATCH 256/305] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 6ba9d39f47daf34672806858afa1c2a1a692beb5..e5e83af21db0c628838b18f85b37ec569840fba7 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -619,6 +619,7 @@ CONFIG_I2C_MUX_PCA954x=m + CONFIG_I2C_BCM2708=m + CONFIG_I2C_BCM2835=m + CONFIG_I2C_GPIO=m ++CONFIG_I2C_ROBOTFUZZ_OSIF=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index d50e88455b4ba5a891a47c2416a09f9402435b90..9699c93fbb6934b3fded4704316f1ad4c4a639d6 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -615,6 +615,7 @@ CONFIG_I2C_MUX_PCA954x=m + CONFIG_I2C_BCM2708=m + CONFIG_I2C_BCM2835=m + CONFIG_I2C_GPIO=m ++CONFIG_I2C_ROBOTFUZZ_OSIF=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m + +From 19d58ad1708adb37981d8d8c4985037661306bb4 Mon Sep 17 00:00:00 2001 From: chenzhiwo Date: Wed, 17 May 2017 16:34:57 +0800 -Subject: [PATCH 254/269] Add device tree overlay for GPIO connected rotary +Subject: [PATCH 257/305] Add device tree overlay for GPIO connected rotary encoder. See Documentation/input/rotary-encoder.txt for more information. --- @@ -161075,10 +161053,10 @@ Subject: [PATCH 254/269] Add device tree overlay for GPIO connected rotary create mode 100644 arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 315ee19036ab85431f2a077101054ba21b2db888..a2670d3ab9479f34886e0ea5431de39c8bcc21e4 100644 +index b62edf6ce17ed8db18c73ce02b18ca43481691ab..9368f6281dd80f01900b477d97c83047e33ceb36 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile -@@ -76,6 +76,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ +@@ -75,6 +75,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ pwm-2chan.dtbo \ qca7000.dtbo \ raspidac3.dtbo \ @@ -161087,10 +161065,10 @@ index 315ee19036ab85431f2a077101054ba21b2db888..a2670d3ab9479f34886e0ea5431de39c rpi-cirrus-wm5102.dtbo \ rpi-dac.dtbo \ diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 2dade3155e11387de52e5e6150c9a1e9fc4c36cf..c0b37e2db6ded6e0f209ab6c7831bd514c4e2bcd 100644 +index b3aadaa6cfafae0e01908a3a2f1f646d06d69b32..95600381448b0b485dbbbeb592ae1e82a8acec08 100644 --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README -@@ -1121,6 +1121,15 @@ Load: dtoverlay=raspidac3 +@@ -1115,6 +1115,15 @@ Load: dtoverlay=raspidac3 Params: @@ -161156,10 +161134,10 @@ index 0000000000000000000000000000000000000000..c0c6bccff60cc15d9a9bf59d2c7cba41 + }; +}; -From d18c0f6cab6149a21be496f581611923a37618cb Mon Sep 17 00:00:00 2001 +From 8ec8edc1fd98ddb21846c8dd5235ccb3ad68928a Mon Sep 17 00:00:00 2001 From: Ed Blake Date: Thu, 10 Nov 2016 18:07:54 +0000 -Subject: [PATCH 255/269] serial: 8250: Add IrDA to UART capabilities +Subject: [PATCH 258/305] serial: 8250: Add IrDA to UART capabilities commit 98838d95075a5295f3478ceba18bcccf472e30f4 upstream. @@ -161202,7 +161180,7 @@ index a697a8585ddc346a72de6e30cdb77785a5688e71..0c23b0079a51977275a16a3c3849dc70 #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index cf9c7d2e3f95e1a19410247a89c2e49c1a2747a8..2d45863da0e3fecaf339f3e9cdf3c385081f1a9b 100644 +index e8819aa20415603c80547e382838a8fa3ce54792..9bfdb0e549e626082be8fd6f350e9f801e1a1eed 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -425,10 +425,10 @@ struct uart_8250_port *serial8250_get_port(int line) @@ -161240,10 +161218,10 @@ index 48ec7651989b093fc015e44b59657c7000e11012..04185e03d7bec56197cb765377320044 #endif -From 6017b95d474d641bc430a1e98e774607bf5a205c Mon Sep 17 00:00:00 2001 +From f11b6a3d4dea9a821bad6e0fc2ee7f5c083384ed Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 May 2017 15:07:27 +0100 -Subject: [PATCH 256/269] serial: 8250: Add CAP_MINI, set for bcm2835aux +Subject: [PATCH 259/305] serial: 8250: Add CAP_MINI, set for bcm2835aux The AUX/mini-UART in the BCM2835 family of procesors is a cut-down 8250 clone. In particular it is lacking support for the following @@ -161295,7 +161273,7 @@ index e10f1244409b344b850ffbbd4af5757a66c875f1..a23c7da42ea81342efc26fb35a92a69d data->uart.port.regshift = 2; data->uart.port.type = PORT_16550; diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 080d5a59d0a7f41ee0578d1f6e2fbecf00409bce..6d0d42d06670eba7cd56204083efd6f60a1f1ee1 100644 +index f24d3030b98c8d7543ac52e3ebadc65ecfe745ee..2d7a63f69b90415d6e1b6eb1c10612f4aa9fbed2 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2558,6 +2558,12 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, @@ -161312,10 +161290,10 @@ index 080d5a59d0a7f41ee0578d1f6e2fbecf00409bce..6d0d42d06670eba7cd56204083efd6f6 baud = serial8250_get_baud_rate(port, termios, old); -From 610ddaec2bdfbbb5a181d0b994e9a8abf0ac45ea Mon Sep 17 00:00:00 2001 +From a3d7fd03b3e8e2aad38b2a16546c168972bcf25f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 May 2017 11:40:43 +0100 -Subject: [PATCH 257/269] config: Add FB_TFT_ST7789V module +Subject: [PATCH 260/305] config: Add FB_TFT_ST7789V module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -161323,10 +161301,10 @@ Subject: [PATCH 257/269] config: Add FB_TFT_ST7789V module 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index b8937da67d842393ee293f4ad83de10595e32da5..d6f3db7620639f1cf377a935dd93710db4ec9c82 100644 +index e5e83af21db0c628838b18f85b37ec569840fba7..7f46612d43773bd1ab88fef2bcd10f20e34f16e8 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -1157,6 +1157,7 @@ CONFIG_FB_TFT_SSD1306=m +@@ -1156,6 +1156,7 @@ CONFIG_FB_TFT_SSD1306=m CONFIG_FB_TFT_SSD1331=m CONFIG_FB_TFT_SSD1351=m CONFIG_FB_TFT_ST7735R=m @@ -161335,7 +161313,7 @@ index b8937da67d842393ee293f4ad83de10595e32da5..d6f3db7620639f1cf377a935dd93710d CONFIG_FB_TFT_TLS8204=m CONFIG_FB_TFT_UC1701=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 20740aaa943d6875f24a2dcfa18078967d2bd829..e3878cdcbc8d17ee7cb1af10592477b56308669b 100644 +index 9699c93fbb6934b3fded4704316f1ad4c4a639d6..b4554044aad7faabd4db57a87c11dba8e088d7d4 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -1165,6 +1165,7 @@ CONFIG_FB_TFT_SSD1306=m @@ -161347,290 +161325,10 @@ index 20740aaa943d6875f24a2dcfa18078967d2bd829..e3878cdcbc8d17ee7cb1af10592477b5 CONFIG_FB_TFT_TLS8204=m CONFIG_FB_TFT_UC1701=m -From 71c3f3b39cabeada04087460b92d382ee31abc57 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 8 May 2017 16:43:40 +0100 -Subject: [PATCH 258/269] irq_bcm2836: Send event when onlining sleeping cores - -In order to reduce power consumption and bus traffic, it is sensible -for secondary cores to enter a low-power idle state when waiting to -be started. The wfe instruction causes a core to wait until an event -or interrupt arrives before continuing to the next instruction. -The sev instruction sends a wakeup event to the other cores, so call -it from bcm2836_smp_boot_secondary, the function that wakes up the -waiting cores during booting. - -It is harmless to use this patch without the corresponding change -adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated -and this patch is not applied then the other cores will sleep forever. - -See: https://github.com/raspberrypi/linux/issues/1989 - -Signed-off-by: Phil Elwell ---- - drivers/irqchip/irq-bcm2836.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c -index e10597c1a1e51e5e27aa574b6a26d87181f26221..6dccdf94f6f3b4c6a3f6cb1cae5a6ab2879a38cc 100644 ---- a/drivers/irqchip/irq-bcm2836.c -+++ b/drivers/irqchip/irq-bcm2836.c -@@ -248,6 +248,9 @@ static int __init bcm2836_smp_boot_secondary(unsigned int cpu, - writel(secondary_startup_phys, - intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu); - -+ dsb(sy); /* Ensure write has completed before waking the other CPUs */ -+ sev(); -+ - return 0; - } - - -From 94b13af3bf364587f3ebfaad846dc040412b0ebe Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Sat, 20 May 2017 22:10:14 +0100 -Subject: [PATCH 259/269] overlays: README: remove vestigial SDIO parameters - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 24 ++---------------------- - 1 file changed, 2 insertions(+), 22 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index c0b37e2db6ded6e0f209ab6c7831bd514c4e2bcd..2f762bcf23859ccb0e922935ad158227514b34c5 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1231,19 +1231,9 @@ Name: sdio - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, - and enables SDIO via GPIOs 22-27. - Load: dtoverlay=sdio,= --Params: overclock_50 SD Clock (in MHz) to use when the MMC framework -- requests 50MHz -- -- sdio_overclock SDIO Clock (in MHz) to use when the MMC -+Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC - framework requests 50MHz - -- force_pio Disable DMA support (default off) -- -- pio_limit Number of blocks above which to use DMA -- (default 1) -- -- debug Enable debug output (default off) -- - poll_once Disable SDIO-device polling every second - (default on: polling once at boot-time) - -@@ -1254,19 +1244,9 @@ Name: sdio-1bit - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, - and enables 1-bit SDIO via GPIOs 22-25. - Load: dtoverlay=sdio-1bit,= --Params: overclock_50 SD Clock (in MHz) to use when the MMC framework -- requests 50MHz -- -- sdio_overclock SDIO Clock (in MHz) to use when the MMC -+Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC - framework requests 50MHz - -- force_pio Disable DMA support (default off) -- -- pio_limit Number of blocks above which to use DMA -- (default 1) -- -- debug Enable debug output (default off) -- - poll_once Disable SDIO-device polling every second - (default on: polling once at boot-time) - - -From 955b9301c6a4cf750817d3a2a60173433213fb38 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 11 May 2017 16:58:16 +0100 -Subject: [PATCH 260/269] BCM270X_DT: Tidy up mmc, sdhost, sdio overlays - -The mmc, sdhost, sdio and sdio-1bit overlays had a few -anachronisms and oddities which were overdue for fixing. -The new versions should be functionally equivalent. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/mmc-overlay.dts | 1 + - arch/arm/boot/dts/overlays/sdhost-overlay.dts | 1 - - arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts | 11 ++++++----- - arch/arm/boot/dts/overlays/sdio-overlay.dts | 11 ++++++----- - 4 files changed, 13 insertions(+), 11 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts -index d32b02ca01ced5ab3de00d66d5412c8fda4bc510..64f1ff6684b19e76cfd00e6950919ac55227b44b 100644 ---- a/arch/arm/boot/dts/overlays/mmc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts -@@ -21,6 +21,7 @@ - mmc_pins: mmc_pins { - brcm,pins = <48 49 50 51 52 53>; - brcm,function = <7>; /* alt3 */ -+ brcm.pull = <0 2 2 2 2 2>; - }; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts -index a431177a1c9d320d5432ea448ad4d0f696c34525..de3d1b0a5e403057a8e94f85695de4076d77e31f 100644 ---- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts -@@ -11,7 +11,6 @@ - frag0: __overlay__ { - brcm,overclock-50 = <0>; - brcm,pio-limit = <1>; -- brcm,debug-flags = <0>; - status = "okay"; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -index 46d453859b31f5c700a8a2e39a2c209330bc108f..0b7f2c6f2603b631e1985df7fbf66749149566d6 100644 ---- a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -@@ -1,11 +1,12 @@ --/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ -+/dts-v1/; -+/plugin/; - --/include/ "sdhost-overlay.dts" -+/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ - - /{ - compatible = "brcm,bcm2708"; - -- fragment@3 { -+ fragment@0 { - target = <&mmc>; - sdio_mmc: __overlay__ { - compatible = "brcm,bcm2835-mmc"; -@@ -18,12 +19,12 @@ - }; - }; - -- fragment@4 { -+ fragment@1 { - target = <&gpio>; - __overlay__ { - sdio_pins: sdio_pins { - brcm,pins = <22 23 24 25>; -- brcm,function = <7 7 7 7>; /* ALT3 = SD1 */ -+ brcm,function = <7>; /* ALT3 = SD1 */ - brcm,pull = <0 2 2 2>; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdio-overlay.dts b/arch/arm/boot/dts/overlays/sdio-overlay.dts -index 398bd812c716c9e472fbac5aba4fe882114c65d1..215d5e3e8a8ca4363457fed1f7425427bb5086d7 100644 ---- a/arch/arm/boot/dts/overlays/sdio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts -@@ -1,11 +1,12 @@ --/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ -+/dts-v1/; -+/plugin/; - --/include/ "sdhost-overlay.dts" -+/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ - - /{ - compatible = "brcm,bcm2708"; - -- fragment@3 { -+ fragment@0 { - target = <&mmc>; - sdio_mmc: __overlay__ { - pinctrl-names = "default"; -@@ -17,12 +18,12 @@ - }; - }; - -- fragment@4 { -+ fragment@1 { - target = <&gpio>; - __overlay__ { - sdio_pins: sdio_pins { - brcm,pins = <22 23 24 25 26 27>; -- brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */ -+ brcm,function = <7>; /* ALT3 = SD1 */ - brcm,pull = <0 2 2 2 2 2>; - }; - }; - -From 8163070dc6a469b9c64512f82f7a160d2ad0509c Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 11 May 2017 22:00:20 +0100 -Subject: [PATCH 261/269] SQUASH: BCM270X_DT: Fix typo in mmc overlay - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/mmc-overlay.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts -index 64f1ff6684b19e76cfd00e6950919ac55227b44b..88251ad653917674f80c2975de2e425fca00b71f 100644 ---- a/arch/arm/boot/dts/overlays/mmc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts -@@ -21,7 +21,7 @@ - mmc_pins: mmc_pins { - brcm,pins = <48 49 50 51 52 53>; - brcm,function = <7>; /* alt3 */ -- brcm.pull = <0 2 2 2 2 2>; -+ brcm,pull = <0 2 2 2 2 2>; - }; - }; - }; - -From 32e01de8efab7210d864eb2daff3d3eccbc12ffc Mon Sep 17 00:00:00 2001 -From: Nisar Sayed -Date: Tue, 9 May 2017 18:51:42 +0100 -Subject: [PATCH 262/269] According to RFC 2460, IPv6 UDP calculated checksum - yields a result of zero must be changed to 0xffff, however this feature is - not supported by smsc95xx family hence enable csum offload only for IPv4 - TCP/UDP packets. - -Signed-off-by: Nisar Sayed - -Reported-by: popcorn mix ---- - drivers/net/usb/smsc95xx.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index f6661e388f6e801c1b88e48a3b71407bd70cf56e..b84e98508b5d97165b68dfc30240950e78bb14c3 100644 ---- a/drivers/net/usb/smsc95xx.c -+++ b/drivers/net/usb/smsc95xx.c -@@ -694,7 +694,7 @@ static int smsc95xx_set_features(struct net_device *netdev, - if (ret < 0) - return ret; - -- if (features & NETIF_F_HW_CSUM) -+ if (features & NETIF_F_IP_CSUM) - read_buf |= Tx_COE_EN_; - else - read_buf &= ~Tx_COE_EN_; -@@ -1342,12 +1342,16 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) - - spin_lock_init(&pdata->mac_cr_lock); - -+ /* RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be -+ * changed to 0xffff, this feature is not supported by smsc95xx family, -+ * hence enable csum offload only for IPv4 TCP/UDP packets. -+ */ - if (DEFAULT_TX_CSUM_ENABLE) -- dev->net->features |= NETIF_F_HW_CSUM; -+ dev->net->features |= NETIF_F_IP_CSUM; - if (DEFAULT_RX_CSUM_ENABLE) - dev->net->features |= NETIF_F_RXCSUM; - -- dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM; -+ dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM; - - smsc95xx_init_mac_address(dev); - - -From 2af672ce3d6de0430b4e1578561347fa5c28175c Mon Sep 17 00:00:00 2001 +From 0347406f27599b9d64ab3751f3fbb9aecd3b1016 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 18 Mar 2014 23:33:27 +0000 -Subject: [PATCH 263/269] usb/serial/ch341: Add parity support +Subject: [PATCH 261/305] usb/serial/ch341: Add parity support Based on wireshark packet traces from a windows machine. @@ -161695,58 +161393,67 @@ index e98590aab633cd6491f2886842179d314ded5fe6..4f25aba5bdfcabe7304b18860be85275 if (C_BAUD(tty) == B0) priv->line_control &= ~(CH341_BIT_DTR | CH341_BIT_RTS); -From 6f7b4c2fd93af047338593994594b651f863f3e9 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 5 May 2017 13:23:10 +0100 -Subject: [PATCH 264/269] Revert "serial: 8250: Don't crash when nr_uarts is 0" +From 10eeb1be0aee5ae942462976cb7959c7280aba93 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sat, 20 May 2017 22:10:14 +0100 +Subject: [PATCH 262/305] overlays: README: remove vestigial SDIO parameters -This reverts commit 9c297d9ebd0d8c6d5e6e8675d527d6a221613abc. +Signed-off-by: Phil Elwell --- - drivers/tty/serial/8250/8250_core.c | 2 -- - 1 file changed, 2 deletions(-) + arch/arm/boot/dts/overlays/README | 24 ++---------------------- + 1 file changed, 2 insertions(+), 22 deletions(-) -diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index 2d45863da0e3fecaf339f3e9cdf3c385081f1a9b..9bfdb0e549e626082be8fd6f350e9f801e1a1eed 100644 ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -509,8 +509,6 @@ static void __init serial8250_isa_init_ports(void) +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 95600381448b0b485dbbbeb592ae1e82a8acec08..d5aebbe2d514c07c0fae72f80173c086cd19a83b 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1225,19 +1225,9 @@ Name: sdio + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, + and enables SDIO via GPIOs 22-27. + Load: dtoverlay=sdio,= +-Params: overclock_50 SD Clock (in MHz) to use when the MMC framework +- requests 50MHz +- +- sdio_overclock SDIO Clock (in MHz) to use when the MMC ++Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC + framework requests 50MHz - if (nr_uarts > UART_NR) - nr_uarts = UART_NR; -- if (!nr_uarts) -- return; +- force_pio Disable DMA support (default off) +- +- pio_limit Number of blocks above which to use DMA +- (default 1) +- +- debug Enable debug output (default off) +- + poll_once Disable SDIO-device polling every second + (default on: polling once at boot-time) - for (i = 0; i < nr_uarts; i++) { - struct uart_8250_port *up = &serial8250_ports[i]; - -From 8fe8bab6cdfd41751ec0c74e95857b98dbc5c193 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 May 2017 12:47:46 +0100 -Subject: [PATCH 265/269] dwcotg: Allow to build without FIQ on ARM64 - -Signed-off-by: popcornmix ---- - drivers/usb/host/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index 5a5f6c925f43147082dcfaab15f9e05ed966838c..c50476b3d72471faf94c280aab756599fe55ac90 100644 ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -764,7 +764,7 @@ config USB_HWA_HCD +@@ -1248,19 +1238,9 @@ Name: sdio-1bit + Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, + and enables 1-bit SDIO via GPIOs 22-25. + Load: dtoverlay=sdio-1bit,= +-Params: overclock_50 SD Clock (in MHz) to use when the MMC framework +- requests 50MHz +- +- sdio_overclock SDIO Clock (in MHz) to use when the MMC ++Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC + framework requests 50MHz + +- force_pio Disable DMA support (default off) +- +- pio_limit Number of blocks above which to use DMA +- (default 1) +- +- debug Enable debug output (default off) +- + poll_once Disable SDIO-device polling every second + (default on: polling once at boot-time) - config USB_DWCOTG - tristate "Synopsis DWC host support" -- depends on USB && FIQ -+ depends on USB && (FIQ || ARM64) - help - The Synopsis DWC controller is a dual-role - host/peripheral/OTG ("On The Go") USB controllers. -From a017d2c8d33ea20e73ae94b931d361d60b76c664 Mon Sep 17 00:00:00 2001 +From b04d8e1044a9bc05fcd14fd0c1ec2a7c5f59a904 Mon Sep 17 00:00:00 2001 From: Liviu Dudau Date: Wed, 1 Mar 2017 12:26:28 +0000 -Subject: [PATCH 266/269] ASoC: TLV320AIC23: Unquote NULL from control name +Subject: [PATCH 263/305] ASoC: TLV320AIC23: Unquote NULL from control name commit a03faba972cb0f9b3a46d8054e674d5492e06c38 upstream. @@ -161787,32 +161494,10 @@ index 410cae0f2060474313872d6b9110bf05d3368e43..628a8eeaab689eb85b6d3dba54ec5a98 /* input mux */ {"Capture Source", "Line", "Line Input"}, -From 553e258c1407e42f4b4eba21806fd2b2cf855280 Mon Sep 17 00:00:00 2001 +From 37e50f264a8297bc649337a871d4d101b4e73951 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 16 May 2017 16:55:36 +0100 -Subject: [PATCH 267/269] config: Drop CONFIG_TOUCHSCREEN_EKTF2127 - ---- - arch/arm/configs/bcm2709_defconfig | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index d6f3db7620639f1cf377a935dd93710db4ec9c82..dc3523343c39cacdf6f913fe8fbcaa38c5f5374a 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -572,7 +572,6 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m --CONFIG_TOUCHSCREEN_EKTF2127=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m - -From 6132c29f1f8aeef3b19cc7a9ed53e82e447908af Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 16 May 2017 15:58:00 +0100 -Subject: [PATCH 268/269] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 +Date: Mon, 22 May 2017 15:28:27 +0100 +Subject: [PATCH 264/305] config: Add CONFIG_IPV6_ROUTE_INFO --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -161820,34 +161505,34 @@ Subject: [PATCH 268/269] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index dc3523343c39cacdf6f913fe8fbcaa38c5f5374a..b4eb06e990b2d6b11e4645d9c79ae6a75fc2655b 100644 +index 7f46612d43773bd1ab88fef2bcd10f20e34f16e8..c6ad0d3259c06e85071327086553a1c5c2ab7e99 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -572,6 +572,7 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m -+CONFIG_TOUCHSCREEN_EDT_FT5X06=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m +@@ -103,6 +103,7 @@ CONFIG_TCP_CONG_ADVANCED=y + CONFIG_TCP_CONG_BBR=m + CONFIG_IPV6=m + CONFIG_IPV6_ROUTER_PREF=y ++CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index e3878cdcbc8d17ee7cb1af10592477b56308669b..693ac252ce29f3aae94424e892c6206d48be3265 100644 +index b4554044aad7faabd4db57a87c11dba8e088d7d4..d92392cbdfa6b76184bf22da7c69ecb09ffdc842 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -568,6 +568,7 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m -+CONFIG_TOUCHSCREEN_EDT_FT5X06=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m +@@ -99,6 +99,7 @@ CONFIG_TCP_CONG_ADVANCED=y + CONFIG_TCP_CONG_BBR=m + CONFIG_IPV6=m + CONFIG_IPV6_ROUTER_PREF=y ++CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m -From 435c831bb5f68a59f4c9b4e6eb5d74d714a74766 Mon Sep 17 00:00:00 2001 +From e40dd8c0c847874d396f72753709365de9f459f6 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Tue, 16 May 2017 19:34:52 +0100 -Subject: [PATCH 269/269] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF +Date: Mon, 22 May 2017 13:35:28 +0100 +Subject: [PATCH 265/305] config: Add CONFIG_IPV6_SIT_6RD --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -161855,26 +161540,5326 @@ Subject: [PATCH 269/269] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index b4eb06e990b2d6b11e4645d9c79ae6a75fc2655b..17fac298f4e5a07fb5292f5e42d43a09208b21c5 100644 +index c6ad0d3259c06e85071327086553a1c5c2ab7e99..df6c738ee38bc26a3895f9fdc4a1bfbb4a7e0347 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -621,6 +621,7 @@ CONFIG_I2C_MUX_PCA954x=m - CONFIG_I2C_BCM2708=m - CONFIG_I2C_BCM2835=m - CONFIG_I2C_GPIO=m -+CONFIG_I2C_ROBOTFUZZ_OSIF=m - CONFIG_SPI=y - CONFIG_SPI_BCM2835=m - CONFIG_SPI_BCM2835AUX=m +@@ -107,6 +107,7 @@ CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m ++CONFIG_IPV6_SIT_6RD=y + CONFIG_IPV6_TUNNEL=m + CONFIG_IPV6_MULTIPLE_TABLES=y + CONFIG_IPV6_SUBTREES=y diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 693ac252ce29f3aae94424e892c6206d48be3265..442eb48d4cb418d596e0dbad4bf0742d9e8e80b0 100644 +index d92392cbdfa6b76184bf22da7c69ecb09ffdc842..65f16f4f64dd7ad9e9d4a337ec64d769bbff2bee 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -617,6 +617,7 @@ CONFIG_I2C_MUX_PCA954x=m - CONFIG_I2C_BCM2708=m - CONFIG_I2C_BCM2835=m - CONFIG_I2C_GPIO=m -+CONFIG_I2C_ROBOTFUZZ_OSIF=m - CONFIG_SPI=y - CONFIG_SPI_BCM2835=m - CONFIG_SPI_BCM2835AUX=m +@@ -103,6 +103,7 @@ CONFIG_IPV6_ROUTE_INFO=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m ++CONFIG_IPV6_SIT_6RD=y + CONFIG_IPV6_TUNNEL=m + CONFIG_IPV6_MULTIPLE_TABLES=y + CONFIG_IPV6_SUBTREES=y + +From 359bf250157840153dbafffb543bc5bd24ece1bf Mon Sep 17 00:00:00 2001 +From: Anton Onishchenko +Date: Tue, 23 May 2017 18:55:46 +0300 +Subject: [PATCH 266/305] mpu6050 device tree overlay (#2031) + +Add overlay and config options for InvenSense MPU6050 6-axis motion +detector. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 ++++++ + arch/arm/boot/dts/overlays/mpu6050-overlay.dts | 28 ++++++++++++++++++++++++++ + arch/arm/configs/bcm2709_defconfig | 3 +-- + arch/arm/configs/bcmrpi_defconfig | 3 +-- + 5 files changed, 37 insertions(+), 4 deletions(-) + create mode 100644 arch/arm/boot/dts/overlays/mpu6050-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 9368f6281dd80f01900b477d97c83047e33ceb36..a2670d3ab9479f34886e0ea5431de39c8bcc21e4 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -58,6 +58,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mcp3008.dtbo \ + midi-uart0.dtbo \ + mmc.dtbo \ ++ mpu6050.dtbo \ + mz61581.dtbo \ + pi3-act-led.dtbo \ + pi3-disable-bt.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index d5aebbe2d514c07c0fae72f80173c086cd19a83b..2f762bcf23859ccb0e922935ad158227514b34c5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -891,6 +891,12 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework + requests 50MHz + + ++Name: mpu6050 ++Info: Overlay for i2c connected mpu6050 imu ++Load: dtoverlay=mpu6050,= ++Params: interrupt GPIO pin for interrupt (default 4) ++ ++ + Name: mz61581 + Info: MZ61581 display by Tontec + Load: dtoverlay=mz61581,= +diff --git a/arch/arm/boot/dts/overlays/mpu6050-overlay.dts b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..06037969c3abba270b3cad45875342f3c730506e +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts +@@ -0,0 +1,28 @@ ++// Definitions for MPU6050 ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ mpu6050: mpu6050@68 { ++ compatible = "invensense,mpu6050"; ++ reg = <0x68>; ++ interrupt-parent = <&gpio>; ++ interrupts = <4 1>; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ interrupt = <&mpu6050>,"interrupts:0"; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index df6c738ee38bc26a3895f9fdc4a1bfbb4a7e0347..17fac298f4e5a07fb5292f5e42d43a09208b21c5 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1173,13 +1173,12 @@ CONFIG_RASPBERRYPI_POWER=y + CONFIG_EXTCON=m + CONFIG_EXTCON_ARIZONA=m + CONFIG_IIO=m +-CONFIG_IIO_BUFFER=y + CONFIG_IIO_BUFFER_CB=m +-CONFIG_IIO_KFIFO_BUF=m + CONFIG_MCP320X=m + CONFIG_MCP3422=m + CONFIG_DHT11=m + CONFIG_HTU21=m ++CONFIG_INV_MPU6050_I2C=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 65f16f4f64dd7ad9e9d4a337ec64d769bbff2bee..442eb48d4cb418d596e0dbad4bf0742d9e8e80b0 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1182,13 +1182,12 @@ CONFIG_RASPBERRYPI_POWER=y + CONFIG_EXTCON=m + CONFIG_EXTCON_ARIZONA=m + CONFIG_IIO=m +-CONFIG_IIO_BUFFER=y + CONFIG_IIO_BUFFER_CB=m +-CONFIG_IIO_KFIFO_BUF=m + CONFIG_MCP320X=m + CONFIG_MCP3422=m + CONFIG_DHT11=m + CONFIG_HTU21=m ++CONFIG_INV_MPU6050_I2C=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m + +From 11605abeb458d621455e30d59262b4275d13e648 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 22 May 2017 13:56:41 +0100 +Subject: [PATCH 267/305] clk: bcm2835: Minimise clock jitter for PCM clock + +Fractional clock dividers generate accurate average frequencies but +with jitter, particularly when the integer divisor is small. + +Introduce a new metric of clock accuracy to penalise clocks with a good +average but worse jitter compared to clocks with an average which is no +better but with lower jitter. The metric is the ideal rate minus the +worse deviation from that ideal using the nearest integer divisors. + +Use this metric for parent selection for clocks requiring low jitter +(currently just PCM). + +Signed-off-by: Phil Elwell +--- + drivers/clk/bcm/clk-bcm2835.c | 39 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 34 insertions(+), 5 deletions(-) + +diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c +index c24b4defb2b046e4ecdc109befc2b22497060647..db3ba74acf78f4dfec0d2206b58bc7c3a09f72fe 100644 +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -534,6 +534,7 @@ struct bcm2835_clock_data { + + bool is_vpu_clock; + bool is_mash_clock; ++ bool low_jitter; + + u32 tcnt_mux; + }; +@@ -1154,7 +1155,8 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, + int parent_idx, + unsigned long rate, + u32 *div, +- unsigned long *prate) ++ unsigned long *prate, ++ unsigned long *avgrate) + { + struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); + struct bcm2835_cprman *cprman = clock->cprman; +@@ -1166,11 +1168,33 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, + parent = clk_hw_get_parent_by_index(hw, parent_idx); + + if (!(BIT(parent_idx) & data->set_rate_parent)) { ++ unsigned long tmp_rate; ++ + *prate = clk_hw_get_rate(parent); + *div = bcm2835_clock_choose_div(hw, rate, *prate, true); + +- return bcm2835_clock_rate_from_divisor(clock, *prate, +- *div); ++ tmp_rate = bcm2835_clock_rate_from_divisor(clock, *prate, *div); ++ *avgrate = tmp_rate; ++ ++ if (data->low_jitter && (*div & CM_DIV_FRAC_MASK)) { ++ unsigned long high, low; ++ u32 idiv = *div & ~CM_DIV_FRAC_MASK; ++ ++ high = bcm2835_clock_rate_from_divisor(clock, *prate, ++ idiv); ++ idiv += CM_DIV_FRAC_MASK + 1; ++ low = bcm2835_clock_rate_from_divisor(clock, *prate, ++ idiv); ++ ++ /* Return a value which is the maximum deviation ++ * below the ideal rate, for use as a metric. ++ */ ++ if ((tmp_rate - low) < (high - tmp_rate)) ++ tmp_rate = low; ++ else ++ tmp_rate -= high - tmp_rate; ++ } ++ return tmp_rate; + } + + if (data->frac_bits) +@@ -1197,6 +1221,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, + + *div = curdiv << CM_DIV_FRAC_BITS; + *prate = curdiv * best_rate; ++ *avgrate = best_rate; + + return best_rate; + } +@@ -1208,6 +1233,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, + bool current_parent_is_pllc; + unsigned long rate, best_rate = 0; + unsigned long prate, best_prate = 0; ++ unsigned long avgrate, best_avgrate = 0; + size_t i; + u32 div; + +@@ -1232,11 +1258,13 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, + continue; + + rate = bcm2835_clock_choose_div_and_prate(hw, i, req->rate, +- &div, &prate); ++ &div, &prate, ++ &avgrate); + if (rate > best_rate && rate <= req->rate) { + best_parent = parent; + best_prate = prate; + best_rate = rate; ++ best_avgrate = avgrate; + } + } + +@@ -1246,7 +1274,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, + req->best_parent_hw = best_parent; + req->best_parent_rate = best_prate; + +- req->rate = best_rate; ++ req->rate = best_avgrate; + + return 0; + } +@@ -2061,6 +2089,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { + .int_bits = 12, + .frac_bits = 12, + .is_mash_clock = true, ++ .low_jitter = true, + .parents = bcm2835_pcm_per_parents, + .tcnt_mux = 23), + [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( + +From bc7652be6fbd93e460c8de2f7411d70dca9f2287 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 24 May 2017 18:06:02 +0100 +Subject: [PATCH 268/305] Revert "hid: Reduce default mouse polling interval to + 60Hz" + +This reverts commit b45c0448b60d691508251cdccf242ea43bbabb14. +--- + drivers/hid/usbhid/hid-core.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index 4a7af9d0b910f59d17421ce14138400dfd5834f3..ae83af649a607f67239f1a64bf45dd4b5770cc7d 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -49,7 +49,7 @@ + * Module parameters. + */ + +-static unsigned int hid_mousepoll_interval = ~0; ++static unsigned int hid_mousepoll_interval; + module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); + MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); + +@@ -1083,12 +1083,8 @@ static int usbhid_start(struct hid_device *hid) + } + + /* Change the polling interval of mice. */ +- if (hid->collection->usage == HID_GD_MOUSE) { +- if (hid_mousepoll_interval == ~0 && interval < 16) +- interval = 16; +- else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0) +- interval = hid_mousepoll_interval; +- } ++ if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) ++ interval = hid_mousepoll_interval; + + ret = -ENOMEM; + if (usb_endpoint_dir_in(endpoint)) { + +From 50be44a48e60fb53d94746c9f6153683f868a1a5 Mon Sep 17 00:00:00 2001 +From: Tobias Jakobi +Date: Sat, 25 Feb 2017 20:27:27 +0100 +Subject: [PATCH 269/305] HID: usbhid: extend polling interval configuration to + joysticks + +For mouse devices we can currently change the polling interval +via usbhid.mousepoll. Implement the same thing for joysticks, so +users can reduce input latency this way. + +This has been tested with a Logitech RumblePad 2 with jspoll=2, +resulting in a polling rate of 500Hz (verified with evhz). + +Signed-off-by: Tobias Jakobi +Acked-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +--- + Documentation/kernel-parameters.txt | 3 +++ + drivers/hid/usbhid/hid-core.c | 18 +++++++++++++++--- + 2 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt +index 86a6746f683393982cc93a6c3b99b989adbb1df8..d2e1858cf7e1d8ddfb0b81bc1e32e11a3b5f930c 100644 +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -4281,6 +4281,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. + usbhid.mousepoll= + [USBHID] The interval which mice are to be polled at. + ++ usbhid.jspoll= ++ [USBHID] The interval which joysticks are to be polled at. ++ + usb-storage.delay_use= + [UMS] The delay in seconds before a new device is + scanned for Logical Units (default 1). +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index ae83af649a607f67239f1a64bf45dd4b5770cc7d..f7a692f9e50cdc80ebebab1ea260cde29b32d147 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -53,6 +53,10 @@ static unsigned int hid_mousepoll_interval; + module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); + MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); + ++static unsigned int hid_jspoll_interval; ++module_param_named(jspoll, hid_jspoll_interval, uint, 0644); ++MODULE_PARM_DESC(jspoll, "Polling interval of joysticks"); ++ + static unsigned int ignoreled; + module_param_named(ignoreled, ignoreled, uint, 0644); + MODULE_PARM_DESC(ignoreled, "Autosuspend with active leds"); +@@ -1082,9 +1086,17 @@ static int usbhid_start(struct hid_device *hid) + hid->name, endpoint->bInterval, interval); + } + +- /* Change the polling interval of mice. */ +- if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) +- interval = hid_mousepoll_interval; ++ /* Change the polling interval of mice and joysticks. */ ++ switch (hid->collection->usage) { ++ case HID_GD_MOUSE: ++ if (hid_mousepoll_interval > 0) ++ interval = hid_mousepoll_interval; ++ break; ++ case HID_GD_JOYSTICK: ++ if (hid_jspoll_interval > 0) ++ interval = hid_jspoll_interval; ++ break; ++ } + + ret = -ENOMEM; + if (usb_endpoint_dir_in(endpoint)) { + +From 600845fe2736cede780074bc674046b88d24bcec Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 14 Jul 2014 22:02:09 +0100 +Subject: [PATCH 270/305] hid: Reduce default mouse polling interval to 60Hz + +Reduces overhead when using X +--- + drivers/hid/usbhid/hid-core.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index f7a692f9e50cdc80ebebab1ea260cde29b32d147..dbe506d3ceecb6d47e21f060d0bbac2b3c0165fe 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -49,7 +49,7 @@ + * Module parameters. + */ + +-static unsigned int hid_mousepoll_interval; ++static unsigned int hid_mousepoll_interval = ~0; + module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); + MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); + +@@ -1089,7 +1089,9 @@ static int usbhid_start(struct hid_device *hid) + /* Change the polling interval of mice and joysticks. */ + switch (hid->collection->usage) { + case HID_GD_MOUSE: +- if (hid_mousepoll_interval > 0) ++ if (hid_mousepoll_interval == ~0 && interval < 16) ++ interval = 16; ++ else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0) + interval = hid_mousepoll_interval; + break; + case HID_GD_JOYSTICK: + +From cb08472f4ee59309cad227a3c8df76a473c65670 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Thu, 25 May 2017 16:04:53 +0100 +Subject: [PATCH 271/305] dwc_otg: make periodic scheduling behave properly for + FS buses + +If the root port is in full-speed mode, transfer times at 12mbit/s +would be calculated but matched against high-speed quotas. + +Reinitialise hcd->frame_usecs[i] on each port enable event so that +full-speed bandwidth can be tracked sensibly. + +Also, don't bother using the FIQ for transfers when in full-speed +mode - at the slower bus speed, interrupt frequency is reduced by +an order of magnitude. + +Related issue: https://github.com/raspberrypi/linux/issues/2020 +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 15 ++++++++++----- + drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 7 +++++-- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 4 ++++ + drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 19 ++++++++++++------- + 4 files changed, 31 insertions(+), 14 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index a2dc6337836b2719f4c954edeeb2a71301931b04..38bf5fc792d32352f9e208e0e90f968599b9bc31 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -926,8 +926,6 @@ static void dwc_otg_hcd_free(dwc_otg_hcd_t * dwc_otg_hcd) + DWC_FREE(dwc_otg_hcd); + } + +-int init_hcd_usecs(dwc_otg_hcd_t *_hcd); +- + int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) + { + struct device *dev = dwc_otg_hcd_to_dev(hcd); +@@ -1429,6 +1427,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + + /** + * fiq_fsm_transaction_suitable() - Test a QH for compatibility with the FIQ ++ * @hcd: Pointer to the dwc_otg_hcd struct + * @qh: pointer to the endpoint's queue head + * + * Transaction start/end control flow is grafted onto the existing dwc_otg +@@ -1438,8 +1437,14 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + * Returns: 0 for unsuitable, 1 implies the FIQ can be enabled for this transaction. + */ + +-int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh) ++int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + { ++ /* There is little benefit in using the FIQ to perform transfers if ++ * the root port is not in high-speed mode. ++ */ ++ if (hcd->flags.b.port_speed != DWC_HPRT0_PRTSPD_HIGH_SPEED) ++ return 0; ++ + if (qh->do_split) { + switch (qh->ep_type) { + case UE_CONTROL: +@@ -2218,7 +2223,7 @@ static void process_periodic_channels(dwc_otg_hcd_t * hcd) + continue; + } + +- if (fiq_fsm_enable && fiq_fsm_transaction_suitable(qh)) { ++ if (fiq_fsm_enable && fiq_fsm_transaction_suitable(hcd, qh)) { + if (qh->do_split) + fiq_fsm_queue_split_transaction(hcd, qh); + else +@@ -2355,7 +2360,7 @@ static void process_non_periodic_channels(dwc_otg_hcd_t * hcd) + qh = DWC_LIST_ENTRY(hcd->non_periodic_qh_ptr, dwc_otg_qh_t, + qh_list_entry); + +- if(fiq_fsm_enable && fiq_fsm_transaction_suitable(qh)) { ++ if(fiq_fsm_enable && fiq_fsm_transaction_suitable(hcd, qh)) { + fiq_fsm_queue_split_transaction(hcd, qh); + } else { + status = queue_transaction(hcd, qh->channel, +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +index 7f7e9eaffd6a3c3d898855562fbec11289f77f53..5ed8dccf03959a610849aa6c8946ca745dbae207 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +@@ -410,7 +410,8 @@ struct dwc_otg_hcd { + unsigned port_suspend_change:1; + unsigned port_over_current_change:1; + unsigned port_l1_change:1; +- unsigned reserved:26; ++ unsigned port_speed:2; ++ unsigned reserved:24; + } b; + } flags; + +@@ -629,7 +630,7 @@ int dwc_otg_hcd_allocate_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh); + void dwc_otg_hcd_release_port(dwc_otg_hcd_t * dwc_otg_hcd, dwc_otg_qh_t *qh); + + extern int fiq_fsm_queue_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh); +-extern int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh); ++extern int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh); + extern void dwc_otg_cleanup_fiq_channel(dwc_otg_hcd_t *hcd, uint32_t num); + + /** @} */ +@@ -823,6 +824,8 @@ static inline uint16_t dwc_micro_frame_num(uint16_t frame) + return frame & 0x7; + } + ++extern void init_hcd_usecs(dwc_otg_hcd_t *_hcd); ++ + void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc, + dwc_otg_hc_regs_t * hc_regs, + dwc_otg_qtd_t * qtd); +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +index a4355afc77b68718fdaba6c5d4be257dadc75036..c8f52709a7d24974c0a38dcf1708f91073e96b0e 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -515,6 +515,10 @@ int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd) + dwc_otg_host_if_t *host_if = + dwc_otg_hcd->core_if->host_if; + ++ dwc_otg_hcd->flags.b.port_speed = hprt0.b.prtspd; ++ if (microframe_schedule) ++ init_hcd_usecs(dwc_otg_hcd); ++ + /* Every time when port enables calculate + * HFIR.FrInterval + */ +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +index 85a6d431ca54b47dc10573aa72d1ad69d06f2e36..4b1dd9de99e9e08b2e006fb5f8a7ef92f20c2553 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +@@ -408,13 +408,17 @@ const unsigned short max_uframe_usecs[]={ 100, 100, 100, 100, 100, 100, 30, 0 }; + /* + * called from dwc_otg_hcd.c:dwc_otg_hcd_init + */ +-int init_hcd_usecs(dwc_otg_hcd_t *_hcd) ++void init_hcd_usecs(dwc_otg_hcd_t *_hcd) + { + int i; +- for (i=0; i<8; i++) { +- _hcd->frame_usecs[i] = max_uframe_usecs[i]; ++ if (_hcd->flags.b.port_speed == DWC_HPRT0_PRTSPD_FULL_SPEED) { ++ _hcd->frame_usecs[0] = 900; ++ for (i = 1; i < 8; i++) ++ _hcd->frame_usecs[i] = 0; ++ } else { ++ for (i = 0; i < 8; i++) ++ _hcd->frame_usecs[i] = max_uframe_usecs[i]; + } +- return 0; + } + + static int find_single_uframe(dwc_otg_hcd_t * _hcd, dwc_otg_qh_t * _qh) +@@ -541,8 +545,9 @@ static int find_uframe(dwc_otg_hcd_t * _hcd, dwc_otg_qh_t * _qh) + int ret; + ret = -1; + +- if (_qh->speed == USB_SPEED_HIGH) { +- /* if this is a hs transaction we need a full frame */ ++ if (_qh->speed == USB_SPEED_HIGH || ++ _hcd->flags.b.port_speed == DWC_HPRT0_PRTSPD_FULL_SPEED) { ++ /* if this is a hs transaction we need a full frame - or account for FS usecs */ + ret = find_single_uframe(_hcd, _qh); + } else { + /* if this is a fs transaction we may need a sequence of frames */ +@@ -627,7 +632,7 @@ static int schedule_periodic(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + if (status) { + DWC_INFO("%s: Insufficient periodic bandwidth for " + "periodic transfer.\n", __func__); +- return status; ++ return -DWC_E_NO_SPACE; + } + status = check_max_xfer_size(hcd, qh); + if (status) { + +From bad5a9beb71519961754efc15579463a04752c70 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 31 May 2017 09:33:55 +0100 +Subject: [PATCH 272/305] config: Adding SENSOR_JC42 + +The jc42 module supports a number of I2C-based temperature +sensor modules. + +[ DM_RAID0 config lost because now selected by DM_RAID ] + +See: https://github.com/raspberrypi/linux/issues/2046 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 2 +- + arch/arm/configs/bcmrpi_defconfig | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 17fac298f4e5a07fb5292f5e42d43a09208b21c5..40d7ffe33cbd3e1f068ef540cb6297842b7d8130 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -440,7 +440,6 @@ CONFIG_ISCSI_TCP=m + CONFIG_ISCSI_BOOT_SYSFS=m + CONFIG_MD=y + CONFIG_MD_LINEAR=m +-CONFIG_MD_RAID0=m + CONFIG_BLK_DEV_DM=m + CONFIG_DM_CRYPT=m + CONFIG_DM_SNAPSHOT=m +@@ -657,6 +656,7 @@ CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m + CONFIG_HWMON=m ++CONFIG_SENSORS_JC42=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 442eb48d4cb418d596e0dbad4bf0742d9e8e80b0..9dc64f7985cc1f91952ea382fac7920e46b3f8c4 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -436,7 +436,6 @@ CONFIG_ISCSI_TCP=m + CONFIG_ISCSI_BOOT_SYSFS=m + CONFIG_MD=y + CONFIG_MD_LINEAR=m +-CONFIG_MD_RAID0=m + CONFIG_BLK_DEV_DM=m + CONFIG_DM_CRYPT=m + CONFIG_DM_SNAPSHOT=m +@@ -651,6 +650,7 @@ CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m + CONFIG_HWMON=m ++CONFIG_SENSORS_JC42=m + CONFIG_SENSORS_LM75=m + CONFIG_SENSORS_SHT21=m + CONFIG_SENSORS_SHTC1=m + +From d40d6afc796dbe38fe266d6cbd6e80fe5cf495d8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 31 May 2017 15:27:39 +0100 +Subject: [PATCH 273/305] BCM270X_DT: Improve i2c-sensor and i2c-rtc overlay + +Use the "__dormant__" feature to permit multiple instances of each +overlay, which is more useful now that changing the "reg" property +also changes the node address. Although the overlay grows slightly, +when applied only the requested node is included. + +Usage does not change, except that the "lm75addr" parameter of the +i2c-sensor overlay has been deprecated in favour of the generic +"addr" parameter. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 8 +- + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 119 ++++++++++++++++++---- + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 87 +++++++++++++--- + 3 files changed, 175 insertions(+), 39 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 2f762bcf23859ccb0e922935ad158227514b34c5..bd7563be019c5a8086d6369c8fc24af7303f8610 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -660,8 +660,8 @@ Name: i2c-sensor + Info: Adds support for a number of I2C barometric pressure and temperature + sensors on i2c_arm + Load: dtoverlay=i2c-sensor,= +-Params: addr Set the address for the BME280, BMP280 or +- TMP102 ++Params: addr Set the address for the BME280, BMP280, TMP102 ++ or LM75 + + bme280 Select the Bosch Sensortronic BME280 + Valid addresses 0x76-0x77, default 0x76 +@@ -674,9 +674,9 @@ Params: addr Set the address for the BME280, BMP280 or + Valid addresses 0x76-0x77, default 0x76 + + lm75 Select the Maxim LM75 temperature sensor ++ Valid addresses 0x48-0x4f, default 0x4f + +- lm75addr Choose the address for the LM75 (0x48-0x4f - +- default 0x4f) ++ lm75addr Deprecated - use addr parameter instead + + si7020 Select the Silicon Labs Si7013/20/21 humidity/ + temperature sensor +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index 1efcf0b712c9c5c19210545002ac1f0931db58f5..b73f902289c8e52705665d8da6d0e904eeaaaf18 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -7,7 +7,7 @@ + + fragment@0 { + target = <&i2c_arm>; +- __overlay__ { ++ __dormant__ { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; +@@ -17,61 +17,142 @@ + reg = <0x69>; + abracon,tc-diode = "standard"; + abracon,tc-resistor = <0>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + ds1307: ds1307@68 { + compatible = "maxim,ds1307"; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + ds1339: ds1339@68 { + compatible = "dallas,ds1339"; + trickle-resistor-ohms = <0>; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + mcp7940x: mcp7940x@6f { + compatible = "microchip,mcp7940x"; + reg = <0x6f>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + mcp7941x: mcp7941x@6f { + compatible = "microchip,mcp7941x"; + reg = <0x6f>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + ds3231: ds3231@68 { + compatible = "maxim,ds3231"; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + pcf2127: pcf2127@51 { + compatible = "nxp,pcf2127"; + reg = <0x51>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@7 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + pcf8523: pcf8523@68 { + compatible = "nxp,pcf8523"; + reg = <0x68>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@8 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + pcf8563: pcf8563@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; +- status = "disable"; ++ status = "okay"; + }; + }; + }; ++ + __overrides__ { +- abx80x = <&abx80x>,"status"; +- ds1307 = <&ds1307>,"status"; +- ds1339 = <&ds1339>,"status"; +- ds3231 = <&ds3231>,"status"; +- mcp7940x = <&mcp7940x>,"status"; +- mcp7941x = <&mcp7941x>,"status"; +- pcf2127 = <&pcf2127>,"status"; +- pcf8523 = <&pcf8523>,"status"; +- pcf8563 = <&pcf8563>,"status"; ++ abx80x = <0>,"+0"; ++ ds1307 = <0>,"+1"; ++ ds1339 = <0>,"+2"; ++ ds3231 = <0>,"+3"; ++ mcp7940x = <0>,"+4"; ++ mcp7941x = <0>,"+5"; ++ pcf2127 = <0>,"+6"; ++ pcf8523 = <0>,"+7"; ++ pcf8563 = <0>,"+8"; + trickle-diode-type = <&abx80x>,"abracon,tc-diode"; + trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0", + <&abx80x>,"abracon,tc-resistor"; +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index e86a13f92c3f75c14fa4425cdfb081d6795ff76a..d2f0008addfadac8f6ed774a6e4f3f97871c0d61 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -7,7 +7,7 @@ + + fragment@0 { + target = <&i2c_arm>; +- __overlay__ { ++ __dormant__ { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; +@@ -15,57 +15,112 @@ + bme280: bme280@76 { + compatible = "bosch,bme280"; + reg = <0x76>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + bmp085: bmp085@77 { + compatible = "bosch,bmp085"; + reg = <0x77>; + default-oversampling = <3>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + bmp180: bmp180@77 { + compatible = "bosch,bmp180"; + reg = <0x77>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + bmp280: bmp280@76 { + compatible = "bosch,bmp280"; + reg = <0x76>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + lm75: lm75@4f { + compatible = "lm75"; + reg = <0x4f>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + si7020: si7020@40 { + compatible = "si7020"; + reg = <0x40>; +- status = "disable"; ++ status = "okay"; + }; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; + + tmp102: tmp102@48 { + compatible = "ti,tmp102"; + reg = <0x48>; +- status = "disable"; ++ status = "okay"; + }; + }; + }; + + __overrides__ { +- addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0"; +- bme280 = <&bme280>,"status"; +- bmp085 = <&bmp085>,"status"; +- bmp180 = <&bmp180>,"status"; +- bmp280 = <&bmp280>,"status"; +- lm75 = <&lm75>,"status"; ++ addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0", ++ <&lm75>,"reg:0"; ++ bme280 = <0>,"+0"; ++ bmp085 = <0>,"+1"; ++ bmp180 = <0>,"+2"; ++ bmp280 = <0>,"+3"; ++ lm75 = <0>,"+4"; + lm75addr = <&lm75>,"reg:0"; +- si7020 = <&si7020>,"status"; +- tmp102 = <&tmp102>,"status"; ++ si7020 = <0>,"+5"; ++ tmp102 = <0>,"+6"; + }; + }; + +From 24ae795e0ab2f8147423da4c14988ef01ba81743 Mon Sep 17 00:00:00 2001 +From: Stefan Tatschner +Date: Mon, 29 May 2017 21:46:16 +0200 +Subject: [PATCH 274/305] Add device tree config for htu21 + +See: https://github.com/raspberrypi/linux/pull/2041 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 2 ++ + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 26 ++++++++++++++++++----- + 2 files changed, 23 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index bd7563be019c5a8086d6369c8fc24af7303f8610..1a905dba7fe1fa03c7ab842c64345988774c88e0 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -673,6 +673,8 @@ Params: addr Set the address for the BME280, BMP280, TMP102 + bmp280 Select the Bosch Sensortronic BMP280 + Valid addresses 0x76-0x77, default 0x76 + ++ htu21 Select the HTU21 temperature and humidity sensor ++ + lm75 Select the Maxim LM75 temperature sensor + Valid addresses 0x48-0x4f, default 0x4f + +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index d2f0008addfadac8f6ed774a6e4f3f97871c0d61..17c27e3b666a7a83619471b50c63bb93836653c5 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -73,6 +73,21 @@ + #size-cells = <0>; + status = "okay"; + ++ htu21: htu21@40 { ++ compatible = "htu21"; ++ reg = <0x40>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ + lm75: lm75@4f { + compatible = "lm75"; + reg = <0x4f>; +@@ -81,7 +96,7 @@ + }; + }; + +- fragment@5 { ++ fragment@6 { + target = <&i2c_arm>; + __dormant__ { + #address-cells = <1>; +@@ -96,7 +111,7 @@ + }; + }; + +- fragment@6 { ++ fragment@7 { + target = <&i2c_arm>; + __dormant__ { + #address-cells = <1>; +@@ -118,9 +133,10 @@ + bmp085 = <0>,"+1"; + bmp180 = <0>,"+2"; + bmp280 = <0>,"+3"; +- lm75 = <0>,"+4"; ++ htu21 = <0>,"+4"; ++ lm75 = <0>,"+5"; + lm75addr = <&lm75>,"reg:0"; +- si7020 = <0>,"+5"; +- tmp102 = <0>,"+6"; ++ si7020 = <0>,"+6"; ++ tmp102 = <0>,"+7"; + }; + }; + +From 99a71a6c154986e69b25817d8eebd7688d0f1de6 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Fri, 26 May 2017 12:50:31 +0100 +Subject: [PATCH 275/305] dwc_otg: fiq_fsm: Make isochronous compatibility + checks work properly + +Get rid of the spammy printk and local pointer mangling. +Also, there is a nominal benefit for using fiq_fsm for isochronous +transfers in FS mode (~1.1k IRQs per second vs 2.1k IRQs per second) +so remove the root port speed check. +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 24 ++++++------------------ + 1 file changed, 6 insertions(+), 18 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index 38bf5fc792d32352f9e208e0e90f968599b9bc31..71834cf365e67d7ad995bba7869216c4091c3a74 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -1439,12 +1439,6 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) + + int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + { +- /* There is little benefit in using the FIQ to perform transfers if +- * the root port is not in high-speed mode. +- */ +- if (hcd->flags.b.port_speed != DWC_HPRT0_PRTSPD_HIGH_SPEED) +- return 0; +- + if (qh->do_split) { + switch (qh->ep_type) { + case UE_CONTROL: +@@ -1462,28 +1456,22 @@ int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + } + } else if (qh->ep_type == UE_ISOCHRONOUS) { + if (fiq_fsm_mask & (1 << 2)) { +- /* HS ISOCH support. We test for compatibility: ++ /* ISOCH support. We test for compatibility: + * - DWORD aligned buffers + * - Must be at least 2 transfers (otherwise pointless to use the FIQ) + * If yes, then the fsm enqueue function will handle the state machine setup. + */ + dwc_otg_qtd_t *qtd = DWC_CIRCLEQ_FIRST(&qh->qtd_list); + dwc_otg_hcd_urb_t *urb = qtd->urb; +- struct dwc_otg_hcd_iso_packet_desc (*iso_descs)[0] = &urb->iso_descs; +- int nr_iso_frames = urb->packet_count; ++ dwc_dma_t ptr; + int i; +- uint32_t ptr; + +- if (nr_iso_frames < 2) ++ if (urb->packet_count < 2) + return 0; +- for (i = 0; i < nr_iso_frames; i++) { +- ptr = urb->dma + iso_descs[i]->offset; +- if (ptr & 0x3) { +- printk_ratelimited("%s: Non-Dword aligned isochronous frame offset." +- " Cannot queue FIQ-accelerated transfer to device %d endpoint %d\n", +- __FUNCTION__, qh->channel->dev_addr, qh->channel->ep_num); ++ for (i = 0; i < urb->packet_count; i++) { ++ ptr = urb->dma + urb->iso_descs[i].offset; ++ if (ptr & 0x3) + return 0; +- } + } + return 1; + } + +From 4e7b343c8e589baf28430d197538821650983bad Mon Sep 17 00:00:00 2001 +From: sandeepal +Date: Fri, 2 Jun 2017 18:59:46 +0530 +Subject: [PATCH 276/305] Allo Digione Driver (#2048) + +Driver for the Allo Digione soundcard +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../arm/boot/dts/overlays/allo-digione-overlay.dts | 44 ++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 6 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-digione.c | 268 +++++++++++++++++++++ + 8 files changed, 329 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/allo-digione-overlay.dts + create mode 100644 sound/soc/bcm/allo-digione.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index a2670d3ab9479f34886e0ea5431de39c8bcc21e4..f19e06055dec6760205ebccde31f65b4d5793fca 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -8,6 +8,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ads7846.dtbo \ + akkordion-iqdacplus.dtbo \ + allo-boss-dac-pcm512x-audio.dtbo \ ++ allo-digione.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ + allo-piano-dac-plus-pcm512x-audio.dtbo \ + at86rf233.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 1a905dba7fe1fa03c7ab842c64345988774c88e0..984a0f1c4240cc30806a9a596e038ab2ae4fa4ab 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -287,6 +287,12 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + slave" + + ++Name: allo-digione ++Info: Configures the Allo Digione audio card ++Load: dtoverlay=allo-digione ++Params: ++ ++ + Name: allo-piano-dac-pcm512x-audio + Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. + (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. +diff --git a/arch/arm/boot/dts/overlays/allo-digione-overlay.dts b/arch/arm/boot/dts/overlays/allo-digione-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..101277a11a24e9b3eb441c44c3f19c61836fe77c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-digione-overlay.dts +@@ -0,0 +1,44 @@ ++// Definitions for Allo DigiOne ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ wm8804@3b { ++ #sound-dai-cells = <0>; ++ compatible = "wlf,wm8804"; ++ reg = <0x3b>; ++ PVDD-supply = <&vdd_3v3_reg>; ++ DVDD-supply = <&vdd_3v3_reg>; ++ status = "okay"; ++ wlf,reset-gpio = <&gpio 17 0>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "allo,allo-digione"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ clock44-gpio = <&gpio 5 0>; ++ clock48-gpio = <&gpio 6 0>; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 40d7ffe33cbd3e1f068ef540cb6297842b7d8130..8962d1b9c10140bb1af43e01f7eae629adbdeece 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -903,6 +903,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 9dc64f7985cc1f91952ea382fac7920e46b3f8c4..372bfe1ca1fb638d78b1ece096ca1a8e5f5a13a8 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -897,6 +897,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index ede81ecbfa2ac6e0430768ddf31cb957201eb3fd..bf754c0b9fc1c5cb99196ef4c94120c81d7f6cf2 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -182,6 +182,12 @@ config SND_BCM2708_SOC_ALLO_BOSS_DAC + help + Say Y or M if you want to add support for Allo Boss DAC. + ++config SND_BCM2708_SOC_ALLO_DIGIONE ++ tristate "Support for Allo DigiOne" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for Allo DigiOne. + + config SND_PISOUND + tristate "Support for Blokas Labs pisound" +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 72e1620fa4038035804cf3b2a09c6b12e7ae0fe1..53ea8229d7ac2065176983385dd7ba85ee3915ea 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -34,6 +34,7 @@ snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o + snd-soc-allo-boss-dac-objs := allo-boss-dac.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o ++snd-soc-allo-digione-objs := allo-digione.o + snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + +@@ -60,5 +61,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE) += snd-soc-allo-digione.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o + obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o +diff --git a/sound/soc/bcm/allo-digione.c b/sound/soc/bcm/allo-digione.c +new file mode 100644 +index 0000000000000000000000000000000000000000..e3664e44c699d0102120ecf99e8b780a4505ebad +--- /dev/null ++++ b/sound/soc/bcm/allo-digione.c +@@ -0,0 +1,268 @@ ++/* ++ * ASoC Driver for Allo DigiOne ++ * ++ * Author: Baswaraj ++ * Copyright 2017 ++ * based on code by Daniel Matuschek ++ * based on code by Florian Meier ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "../codecs/wm8804.h" ++ ++static short int auto_shutdown_output = 0; ++module_param(auto_shutdown_output, short, ++ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); ++MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped"); ++ ++#define CLK_44EN_RATE 22579200UL ++#define CLK_48EN_RATE 24576000UL ++ ++static struct gpio_desc *snd_allo_clk44gpio; ++static struct gpio_desc *snd_allo_clk48gpio; ++ ++static int samplerate = 44100; ++ ++static uint32_t snd_allo_digione_enable_clock(int sample_rate) ++{ ++ switch (sample_rate) { ++ case 11025: ++ case 22050: ++ case 44100: ++ case 88200: ++ case 176400: ++ gpiod_set_value_cansleep(snd_allo_clk44gpio, 1); ++ gpiod_set_value_cansleep(snd_allo_clk48gpio, 0); ++ return CLK_44EN_RATE; ++ default: ++ gpiod_set_value_cansleep(snd_allo_clk48gpio, 1); ++ gpiod_set_value_cansleep(snd_allo_clk44gpio, 0); ++ return CLK_48EN_RATE; ++ } ++} ++ ++ ++static int snd_allo_digione_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ /* enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ return 0; ++} ++ ++static int snd_allo_digione_startup(struct snd_pcm_substream *substream) ++{ ++ /* turn on digital output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); ++ return 0; ++} ++ ++static void snd_allo_digione_shutdown(struct snd_pcm_substream *substream) ++{ ++ /* turn off output */ ++ if (auto_shutdown_output) { ++ /* turn off output */ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); ++ } ++} ++ ++static int snd_allo_digione_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ int sysclk = 27000000; /* This is fixed on this board */ ++ ++ long mclk_freq = 0; ++ int mclk_div = 1; ++ int sampling_freq = 1; ++ ++ int ret; ++ ++ samplerate = params_rate(params); ++ ++ if (samplerate <= 96000) { ++ mclk_freq = samplerate * 256; ++ mclk_div = WM8804_MCLKDIV_256FS; ++ } else { ++ mclk_freq = samplerate * 128; ++ mclk_div = WM8804_MCLKDIV_128FS; ++ } ++ ++ sysclk = snd_allo_digione_enable_clock(samplerate); ++ ++ switch (samplerate) { ++ case 32000: ++ sampling_freq=0x03; ++ break; ++ case 44100: ++ sampling_freq=0x00; ++ break; ++ case 48000: ++ sampling_freq=0x02; ++ break; ++ case 88200: ++ sampling_freq=0x08; ++ break; ++ case 96000: ++ sampling_freq=0x0a; ++ break; ++ case 176400: ++ sampling_freq=0x0c; ++ break; ++ case 192000: ++ sampling_freq=0x0e; ++ break; ++ default: ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", ++ samplerate); ++ } ++ ++ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); ++ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); ++ ++ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, ++ sysclk, SND_SOC_CLOCK_OUT); ++ ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK: %d\n", ret); ++ return ret; ++ } ++ ++ /* Enable TX output */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); ++ ++ /* Power on */ ++ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); ++ ++ /* set sampling frequency status bits */ ++ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_digione_ops = { ++ .hw_params = snd_allo_digione_hw_params, ++ .startup = snd_allo_digione_startup, ++ .shutdown = snd_allo_digione_shutdown, ++}; ++ ++static struct snd_soc_dai_link snd_allo_digione_dai[] = { ++{ ++ .name = "Allo DigiOne", ++ .stream_name = "Allo DigiOne HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "wm8804-spdif", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "wm8804.1-003b", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBM_CFM, ++ .ops = &snd_allo_digione_ops, ++ .init = snd_allo_digione_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_digione = { ++ .name = "snd_allo_digione", ++ .driver_name = "AlloDigiOne", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_digione_dai, ++ .num_links = ARRAY_SIZE(snd_allo_digione_dai), ++}; ++ ++static int snd_allo_digione_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_allo_digione.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_allo_digione_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ snd_allo_clk44gpio = ++ devm_gpiod_get(&pdev->dev, "clock44", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_allo_clk44gpio)) ++ dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); ++ ++ snd_allo_clk48gpio = ++ devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_allo_clk48gpio)) ++ dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); ++ } ++ ++ ret = snd_soc_register_card(&snd_allo_digione); ++ if (ret && ret != -EPROBE_DEFER) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int snd_allo_digione_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_allo_digione); ++} ++ ++static const struct of_device_id snd_allo_digione_of_match[] = { ++ { .compatible = "allo,allo-digione", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_allo_digione_of_match); ++ ++static struct platform_driver snd_allo_digione_driver = { ++ .driver = { ++ .name = "snd-allo-digione", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_digione_of_match, ++ }, ++ .probe = snd_allo_digione_probe, ++ .remove = snd_allo_digione_remove, ++}; ++ ++module_platform_driver(snd_allo_digione_driver); ++ ++MODULE_AUTHOR("Baswaraj "); ++MODULE_DESCRIPTION("ASoC Driver for Allo DigiOne"); ++MODULE_LICENSE("GPL v2"); + +From 27ca0234d2bcf6bebb336f6e4ff2f6117e3e25fa Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Fri, 28 Apr 2017 15:14:55 -0400 +Subject: [PATCH 277/305] cgroup_get() expected to be called only on live + cgroups and triggers warning on a dead cgroup; however, cgroup_sk_alloc() may + be called while cloning a socket which is left in an empty and removed cgroup + and thus may legitimately duplicate its reference on a dead cgroup. This + currently triggers the following warning spuriously. + + WARNING: CPU: 14 PID: 0 at kernel/cgroup.c:490 cgroup_get+0x55/0x60 + ... + [] __warn+0xd3/0xf0 + [] warn_slowpath_null+0x1e/0x20 + [] cgroup_get+0x55/0x60 + [] cgroup_sk_alloc+0x51/0xe0 + [] sk_clone_lock+0x2db/0x390 + [] inet_csk_clone_lock+0x16/0xc0 + [] tcp_create_openreq_child+0x23/0x4b0 + [] tcp_v6_syn_recv_sock+0x91/0x670 + [] tcp_check_req+0x3a6/0x4e0 + [] tcp_v6_rcv+0x693/0xa00 + [] ip6_input_finish+0x59/0x3e0 + [] ip6_input+0x32/0xb0 + [] ip6_rcv_finish+0x57/0xa0 + [] ipv6_rcv+0x318/0x4d0 + [] __netif_receive_skb_core+0x2d7/0x9a0 + [] __netif_receive_skb+0x16/0x70 + [] netif_receive_skb_internal+0x23/0x80 + [] napi_gro_frags+0x208/0x270 + [] mlx4_en_process_rx_cq+0x74c/0xf40 + [] mlx4_en_poll_rx_cq+0x30/0x90 + [] net_rx_action+0x210/0x350 + [] __do_softirq+0x106/0x2c7 + [] irq_exit+0x9d/0xa0 [] do_IRQ+0x54/0xd0 + [] common_interrupt+0x7f/0x7f + [] cpuidle_enter+0x17/0x20 + [] cpu_startup_entry+0x2a9/0x2f0 + [] start_secondary+0xf1/0x100 + +This patch renames the existing cgroup_get() with the dead cgroup +warning to cgroup_get_live() after cgroup_kn_lock_live() and +introduces the new cgroup_get() which doesn't check whether the cgroup +is live or dead. + +All existing cgroup_get() users except for cgroup_sk_alloc() are +converted to use cgroup_get_live(). + +Fixes: d979a39d7242 ("cgroup: duplicate cgroup reference when cloning sockets") +Cc: stable@vger.kernel.org # v4.5+ +Cc: Johannes Weiner +Reported-by: Chris Mason +Signed-off-by: Tejun Heo +--- + kernel/cgroup.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/kernel/cgroup.c b/kernel/cgroup.c +index e22af4287b4ba084a7cfe7b6fcbf28956796b113..84f45a33d69fc7f187cab1ee7374afe971915f05 100644 +--- a/kernel/cgroup.c ++++ b/kernel/cgroup.c +@@ -489,6 +489,11 @@ static inline bool cgroup_is_dead(const struct cgroup *cgrp) + + static void cgroup_get(struct cgroup *cgrp) + { ++ css_get(&cgrp->self); ++} ++ ++static void cgroup_get_live(struct cgroup *cgrp) ++{ + WARN_ON_ONCE(cgroup_is_dead(cgrp)); + css_get(&cgrp->self); + } +@@ -1049,7 +1054,7 @@ static void link_css_set(struct list_head *tmp_links, struct css_set *cset, + list_add_tail(&link->cgrp_link, &cset->cgrp_links); + + if (cgroup_parent(cgrp)) +- cgroup_get(cgrp); ++ cgroup_get_live(cgrp); + } + + /** +@@ -2118,7 +2123,7 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, + } + cgrp_dfl_visible = true; + root = &cgrp_dfl_root; +- cgroup_get(&root->cgrp); ++ cgroup_get_live(&root->cgrp); + goto out_mount; + } + +@@ -3151,7 +3156,7 @@ static void cgroup_lock_and_drain_offline(struct cgroup *cgrp) + if (!css || !percpu_ref_is_dying(&css->refcnt)) + continue; + +- cgroup_get(dsct); ++ cgroup_get_live(dsct); + prepare_to_wait(&dsct->offline_waitq, &wait, + TASK_UNINTERRUPTIBLE); + +@@ -5096,7 +5101,7 @@ static void init_and_link_css(struct cgroup_subsys_state *css, + { + lockdep_assert_held(&cgroup_mutex); + +- cgroup_get(cgrp); ++ cgroup_get_live(cgrp); + + memset(css, 0, sizeof(*css)); + css->cgroup = cgrp; +@@ -5272,7 +5277,7 @@ static struct cgroup *cgroup_create(struct cgroup *parent) + /* allocation complete, commit to creation */ + list_add_tail_rcu(&cgrp->self.sibling, &cgroup_parent(cgrp)->self.children); + atomic_inc(&root->nr_cgrps); +- cgroup_get(parent); ++ cgroup_get_live(parent); + + /* + * @cgrp is now fully operational. If something fails after this +@@ -6265,7 +6270,7 @@ struct cgroup *cgroup_get_from_path(const char *path) + if (kn) { + if (kernfs_type(kn) == KERNFS_DIR) { + cgrp = kn->priv; +- cgroup_get(cgrp); ++ cgroup_get_live(cgrp); + } else { + cgrp = ERR_PTR(-ENOTDIR); + } +@@ -6345,6 +6350,11 @@ void cgroup_sk_alloc(struct sock_cgroup_data *skcd) + + /* Socket clone path */ + if (skcd->val) { ++ /* ++ * We might be cloning a socket which is left in an empty ++ * cgroup and the cgroup might have already been rmdir'd. ++ * Don't use cgroup_get_live(). ++ */ + cgroup_get(sock_cgroup_ptr(skcd)); + return; + } + +From a156fa530007d19880994f47d185148b495b87bc Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 May 2017 13:03:41 +0100 +Subject: [PATCH 278/305] BCM270X_DT: Add midi-uart1 overlay + +Add a scaler to the ttyS0 clock so that requesting 38400 baud results +in an approximately 31250 baud signal. This is analagous to +midi-uart0, except for ttyS0, which may be useful on Pi3 and also +may avoid an issue with ttyAMA0 failing to synchronise to an active +data stream. + +See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=183860 + +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-uart1-overlay.dts | 43 +++++++++++++++++++++++ + 3 files changed, 51 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/midi-uart1-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index f19e06055dec6760205ebccde31f65b4d5793fca..eca81982c0f19988abd05165fc62a80d26f539cb 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -58,6 +58,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mcp2515-can1.dtbo \ + mcp3008.dtbo \ + midi-uart0.dtbo \ ++ midi-uart1.dtbo \ + mmc.dtbo \ + mpu6050.dtbo \ + mz61581.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 984a0f1c4240cc30806a9a596e038ab2ae4fa4ab..19df6883be4277240283d5f63f27e34a22a2eec5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -892,6 +892,13 @@ Load: dtoverlay=midi-uart0 + Params: + + ++Name: midi-uart1 ++Info: Configures UART1 (ttyS0) so that a requested 38.4kbaud actually gets ++ 31.25kbaud, the frequency required for MIDI ++Load: dtoverlay=midi-uart1 ++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-uart1-overlay.dts b/arch/arm/boot/dts/overlays/midi-uart1-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..e0bc410acbff3a7a175dd5d53b3ab0d0802e8239 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/midi-uart1-overlay.dts +@@ -0,0 +1,43 @@ ++/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: clock@5 { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clocks = <&aux BCM2835_AUX_CLOCK_UART>; ++ clock-mult = <38400>; ++ clock-div = <31250>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart1>; ++ __overlay__ { ++ clocks = <&midi_clk>; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&aux>; ++ __overlay__ { ++ clock-output-names = "aux_uart", "aux_spi1", "aux_spi2"; ++ }; ++ }; ++}; + +From 0a0b11755a929dc43aa16385d482e5c412f787e9 Mon Sep 17 00:00:00 2001 +From: Andrei Gherzan +Date: Mon, 5 Jun 2017 16:40:38 +0100 +Subject: [PATCH 279/305] dma-bcm2708: Fix module compilation of + CONFIG_DMA_BCM2708 + +bcm2708-dmaengine.c defines functions like bcm_dma_start which are +defined as well in dma-bcm2708.h as inline versions when +CONFIG_DMA_BCM2708 is not defined. This works fine when +CONFIG_DMA_BCM2708 is built in, but when it is selected as module build +fails with redefinition errors because in the build system when +CONFIG_DMA_BCM2708 is selected as module, the macro becomes +CONFIG_DMA_BCM2708_MODULE. + +This patch makes the header use CONFIG_DMA_BCM2708_MODULE too when +available. + +Fixes https://github.com/raspberrypi/linux/issues/2056 + +Signed-off-by: Andrei Gherzan +--- + include/linux/platform_data/dma-bcm2708.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/linux/platform_data/dma-bcm2708.h b/include/linux/platform_data/dma-bcm2708.h +index c5bfff2765be4606077e6c8af73040ec13ee8974..6ca874d332a8bc666b1c9576ac51f479b98de14d 100644 +--- a/include/linux/platform_data/dma-bcm2708.h ++++ b/include/linux/platform_data/dma-bcm2708.h +@@ -75,7 +75,7 @@ struct bcm2708_dma_cb { + struct scatterlist; + struct platform_device; + +-#ifdef CONFIG_DMA_BCM2708 ++#if defined(CONFIG_DMA_BCM2708) || defined(CONFIG_DMA_BCM2708_MODULE) + + int bcm_sg_suitable_for_dma(struct scatterlist *sg_ptr, int sg_len); + void bcm_dma_start(void __iomem *dma_chan_base, dma_addr_t control_block); +@@ -138,6 +138,6 @@ static inline int bcm_dmaman_remove(struct platform_device *pdev) + return 0; + } + +-#endif /* CONFIG_DMA_BCM2708 */ ++#endif /* CONFIG_DMA_BCM2708 || CONFIG_DMA_BCM2708_MODULE */ + + #endif /* _PLAT_BCM2708_DMA_H */ + +From 6ae8c6dc14d3662deadde5f5370f3fcd26eb6b73 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 7 Jun 2017 08:53:36 +0100 +Subject: [PATCH 280/305] overlays: Fix i2c-rtc order and fragment numbering + +See: https://github.com/raspberrypi/linux/issues/2059 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index b73f902289c8e52705665d8da6d0e904eeaaaf18..6140f172a86b8731782f938f76cb5dac9f28b662 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -60,9 +60,9 @@ + #size-cells = <0>; + status = "okay"; + +- mcp7940x: mcp7940x@6f { +- compatible = "microchip,mcp7940x"; +- reg = <0x6f>; ++ ds3231: ds3231@68 { ++ compatible = "maxim,ds3231"; ++ reg = <0x68>; + status = "okay"; + }; + }; +@@ -75,8 +75,8 @@ + #size-cells = <0>; + status = "okay"; + +- mcp7941x: mcp7941x@6f { +- compatible = "microchip,mcp7941x"; ++ mcp7940x: mcp7940x@6f { ++ compatible = "microchip,mcp7940x"; + reg = <0x6f>; + status = "okay"; + }; +@@ -90,9 +90,9 @@ + #size-cells = <0>; + status = "okay"; + +- ds3231: ds3231@68 { +- compatible = "maxim,ds3231"; +- reg = <0x68>; ++ mcp7941x: mcp7941x@6f { ++ compatible = "microchip,mcp7941x"; ++ reg = <0x6f>; + status = "okay"; + }; + }; + +From 532e3156aa6ea5754f90474249b440fc3c4dc0bd Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 12:16:10 -0700 +Subject: [PATCH 281/305] drm/vc4: Add T-format scanout support. + +The T tiling format is what V3D uses for textures, with no raster +support at all until later revisions of the hardware (and always at a +large 3D performance penalty). If we can't scan out V3D's format, +then we often need to do a relayout at some stage of the pipeline, +either right before texturing from the scanout buffer (common in X11 +without a compositor) or between a tiled screen buffer right before +scanout (an option I've considered in trying to resolve this +inconsistency, but which means needing to use the dirty fb ioctl and +having some update policy). + +T-format scanout lets us avoid either of those shadow copies, for a +massive, obvious performance improvement to X11 window dragging +without a compositor. Unfortunately, enabling a compositor to work +around the discrepancy has turned out to be too costly in memory +consumption for the Raspbian distribution. + +Because the HVS operates a scanline at a time, compositing from T does +increase the memory bandwidth cost of scanout. On my 1920x1080@32bpp +display on a RPi3, we go from about 15% of system memory bandwidth +with linear to about 20% with tiled. However, for X11 this still ends +up being a huge performance win in active usage. + +This patch doesn't yet handle src_x/src_y offsetting within the tiled +buffer. However, we fail to do so for untiled buffers already. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 32 ++++++++++++++++++++++++++++---- + drivers/gpu/drm/vc4/vc4_regs.h | 19 +++++++++++++++++++ + include/uapi/drm/drm_fourcc.h | 22 ++++++++++++++++++++++ + 3 files changed, 69 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 14d69bb4967dedcd3bbc475639a8c27e38662fb3..62c5f7df0f1a0034bf0b5630eba1344a0f85897b 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -22,6 +22,7 @@ + #include "vc4_regs.h" + #include "drm_atomic.h" + #include "drm_atomic_helper.h" ++#include "drm_fourcc.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" + +@@ -499,8 +500,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + u32 ctl0_offset = vc4_state->dlist_count; + const struct hvs_format *format = vc4_get_hvs_format(fb->pixel_format); + int num_planes = drm_format_num_planes(format->drm); +- u32 scl0, scl1; +- u32 lbm_size; ++ u32 scl0, scl1, pitch0; ++ u32 lbm_size, tiling = SCALER_CTL0_TILING_LINEAR; + unsigned long irqflags; + int ret, i; + +@@ -541,11 +542,31 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + scl1 = vc4_get_scl_field(state, 0); + } + ++ switch (fb->modifier[0]) { ++ case DRM_FORMAT_MOD_NONE: ++ tiling = SCALER_CTL0_TILING_LINEAR; ++ pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ tiling = SCALER_CTL0_TILING_256B_OR_T; ++ ++ pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET), ++ VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L), ++ VC4_SET_FIELD((vc4_state->src_w[0] + 31) >> 5, ++ SCALER_PITCH0_TILE_WIDTH_R)); ++ break; ++ default: ++ DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", ++ (long long)fb->modifier[0]); ++ return -EINVAL; ++ } ++ + /* Control word */ + vc4_dlist_write(vc4_state, + SCALER_CTL0_VALID | + (format->pixel_order << SCALER_CTL0_ORDER_SHIFT) | + (format->hvs << SCALER_CTL0_PIXEL_FORMAT_SHIFT) | ++ VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) | + (vc4_state->is_unity ? SCALER_CTL0_UNITY : 0) | + VC4_SET_FIELD(scl0, SCALER_CTL0_SCL0) | + VC4_SET_FIELD(scl1, SCALER_CTL0_SCL1)); +@@ -599,8 +620,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + for (i = 0; i < num_planes; i++) + vc4_dlist_write(vc4_state, 0xc0c0c0c0); + +- /* Pitch word 0/1/2 */ +- for (i = 0; i < num_planes; i++) { ++ /* Pitch word 0 */ ++ vc4_dlist_write(vc4_state, pitch0); ++ ++ /* Pitch word 1/2 */ ++ for (i = 1; i < num_planes; i++) { + vc4_dlist_write(vc4_state, + VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); + } +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 932093936178674173a84002b33e07e9a37fdfe9..d382c34c1b9e0c6d5b949ca09bf1e8401d44f91a 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -709,6 +709,13 @@ enum hvs_pixel_format { + #define SCALER_CTL0_SIZE_MASK VC4_MASK(29, 24) + #define SCALER_CTL0_SIZE_SHIFT 24 + ++#define SCALER_CTL0_TILING_MASK VC4_MASK(21, 20) ++#define SCALER_CTL0_TILING_SHIFT 20 ++#define SCALER_CTL0_TILING_LINEAR 0 ++#define SCALER_CTL0_TILING_64B 1 ++#define SCALER_CTL0_TILING_128B 2 ++#define SCALER_CTL0_TILING_256B_OR_T 3 ++ + #define SCALER_CTL0_HFLIP BIT(16) + #define SCALER_CTL0_VFLIP BIT(15) + +@@ -838,7 +845,19 @@ enum hvs_pixel_format { + #define SCALER_PPF_KERNEL_OFFSET_SHIFT 0 + #define SCALER_PPF_KERNEL_UNCACHED BIT(31) + ++/* PITCH0/1/2 fields for raster. */ + #define SCALER_SRC_PITCH_MASK VC4_MASK(15, 0) + #define SCALER_SRC_PITCH_SHIFT 0 + ++/* PITCH0 fields for T-tiled. */ ++#define SCALER_PITCH0_TILE_WIDTH_L_MASK VC4_MASK(22, 16) ++#define SCALER_PITCH0_TILE_WIDTH_L_SHIFT 16 ++#define SCALER_PITCH0_TILE_LINE_DIR BIT(15) ++#define SCALER_PITCH0_TILE_INITIAL_LINE_DIR BIT(14) ++/* Y offset within a tile. */ ++#define SCALER_PITCH0_TILE_Y_OFFSET_MASK VC4_MASK(13, 7) ++#define SCALER_PITCH0_TILE_Y_OFFSET_SHIFT 7 ++#define SCALER_PITCH0_TILE_WIDTH_R_MASK VC4_MASK(6, 0) ++#define SCALER_PITCH0_TILE_WIDTH_R_SHIFT 0 ++ + #endif /* VC4_REGS_H */ +diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h +index a5890bf44c0afa3b78d1cfa66308b097d1c38710..4fccf9b898b1242877362ca0be872478c1f0ec8d 100644 +--- a/include/uapi/drm/drm_fourcc.h ++++ b/include/uapi/drm/drm_fourcc.h +@@ -159,6 +159,7 @@ extern "C" { + #define DRM_FORMAT_MOD_VENDOR_NV 0x03 + #define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 + #define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 ++#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 + /* add more to the end as needed */ + + #define fourcc_mod_code(vendor, val) \ +@@ -233,6 +234,27 @@ extern "C" { + */ + #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) + ++/* ++ * Broadcom VC4 "T" format ++ * ++ * This is the primary layout that the V3D GPU can texture from (it ++ * can't do linear). The T format has: ++ * ++ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 ++ * pixels at 32 bit depth. ++ * ++ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually ++ * 16x16 pixels). ++ * ++ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On ++ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows ++ * they're (TR, BR, BL, TL), where bottom left is start of memory. ++ * ++ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k ++ * tiles) or right-to-left (odd rows of 4k tiles). ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) ++ + #if defined(__cplusplus) + } + #endif + +From a8d844ca3a3085a7cd2d8187b9e2856f50c25b8f Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 14:00:45 -0700 +Subject: [PATCH 282/305] drm/vc4: Add get/set tiling ioctls. + +This allows mesa to set the tiling format for a BO and have that +tiling format be respected by mesa on the other side of an +import/export (and by vc4 scanout in the kernel), without defining a +protocol to pass the tiling through userspace. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_bo.c | 83 +++++++++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_drv.c | 2 ++ + drivers/gpu/drm/vc4/vc4_drv.h | 6 ++++ + drivers/gpu/drm/vc4/vc4_kms.c | 41 ++++++++++++++++++++- + include/uapi/drm/vc4_drm.h | 16 +++++++++ + 5 files changed, 147 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index fd83a28076564b9ea5cf0f2ba29b884ee3c5af43..55bbadc86a1ee45205360fb26e8525a8326db017 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -534,6 +534,89 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + return ret; + } + ++/** ++ * vc4_set_tiling_ioctl() - Sets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * The tiling state of the BO decides the default modifier of an fb if ++ * no specific modifier was set by userspace, and the return value of ++ * vc4_get_tiling_ioctl() (so that a BO shared to another DRM fd can ++ * treat the BO as the same tiling format). ++ */ ++ ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_set_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ bool t_format; ++ ++ if (args->flags != 0) ++ return -EINVAL; ++ ++ switch (args->modifier) { ++ case DRM_FORMAT_MOD_NONE: ++ t_format = false; ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ t_format = true; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ bo->t_format = t_format; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ ++/** ++ * vc4_get_tiling_ioctl() - Gets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * Returns the tiling modifier for a BO as set by vc4_set_tiling_ioctl(). ++ */ ++ ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_get_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ if (args->flags != 0 || args->modifier != 0) ++ return -EINVAL; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ if (bo->t_format) ++ args->modifier = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ else ++ args->modifier = DRM_FORMAT_MOD_NONE; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ + void vc4_bo_cache_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 457e5e79ec8dc863fc66759662232c7160592f6e..f528edc4b389e2e3843cd8be2faccf62947cbda4 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -124,6 +124,8 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = { + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_SET_TILING, vc4_set_tiling_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_GET_TILING, vc4_get_tiling_ioctl, DRM_RENDER_ALLOW), + }; + + static struct drm_driver vc4_drm_driver = { +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 9e50bc25b2be71079d52a861c25f3fe7c4db0830..fcf1c45783736413c058a33f31e189ebaddb446e 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -148,6 +148,8 @@ struct vc4_bo { + */ + uint64_t write_seqno; + ++ bool t_format; ++ + /* List entry for the BO's position in either + * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list + */ +@@ -450,6 +452,10 @@ int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); + int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap(struct file *filp, struct vm_area_struct *vma); +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 67af2af70af091bf4b13ac03eb1078f867bc6cea..78080c3e966cacf4756d58d34069c3fb0bafdd87 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -201,11 +201,50 @@ static int vc4_atomic_commit(struct drm_device *dev, + return 0; + } + ++static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, ++ struct drm_file *file_priv, ++ const struct drm_mode_fb_cmd2 *mode_cmd) ++{ ++ struct drm_mode_fb_cmd2 mode_cmd_local; ++ ++ /* If the user didn't specify a modifier, use the ++ * vc4_set_tiling_ioctl() state for the BO. ++ */ ++ if (!(mode_cmd->flags & DRM_MODE_FB_MODIFIERS)) { ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", ++ mode_cmd->handles[0]); ++ return ERR_PTR(-ENOENT); ++ ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ mode_cmd_local = *mode_cmd; ++ ++ if (bo->t_format) { ++ mode_cmd_local.modifier[0] = ++ DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ } else { ++ mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; ++ } ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ mode_cmd = &mode_cmd_local; ++ } ++ ++ return drm_fb_cma_create(dev, file_priv, mode_cmd); ++} ++ + static const struct drm_mode_config_funcs vc4_mode_funcs = { + .output_poll_changed = vc4_output_poll_changed, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = vc4_atomic_commit, +- .fb_create = drm_fb_cma_create, ++ .fb_create = vc4_fb_create, + }; + + int vc4_kms_load(struct drm_device *dev) +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index f07a090167261131076438960c1dec175d7d376e..6ac4c5c014cb9b98343f25721f74b727a88f2bb5 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -38,6 +38,8 @@ extern "C" { + #define DRM_VC4_CREATE_SHADER_BO 0x05 + #define DRM_VC4_GET_HANG_STATE 0x06 + #define DRM_VC4_GET_PARAM 0x07 ++#define DRM_VC4_SET_TILING 0x08 ++#define DRM_VC4_GET_TILING 0x09 + + #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) + #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +@@ -47,6 +49,8 @@ extern "C" { + #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) + #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) + #define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) ++#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) ++#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) + + struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ +@@ -295,6 +299,18 @@ struct drm_vc4_get_param { + __u64 value; + }; + ++struct drm_vc4_get_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ ++struct drm_vc4_set_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ + #if defined(__cplusplus) + } + #endif + +From 26d5ae3d4a282490696904a186aa12c98c6ef54c Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 7 Jun 2017 14:39:49 -0700 +Subject: [PATCH 283/305] drm/vc4: Add FB modifier support to firmwarekms. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 943cbb38f1f2e6fc7c06870be7904677e0a9c7a3..40a0cdc179ceabafb387724e1b835895fa3e2ca2 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -18,6 +18,7 @@ + #include "drm_atomic_helper.h" + #include "drm_plane_helper.h" + #include "drm_crtc_helper.h" ++#include "drm_fourcc.h" + #include "linux/clk.h" + #include "linux/debugfs.h" + #include "drm_fb_cma_helper.h" +@@ -136,6 +137,10 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + fbinfo->yoffset = state->crtc_y; + fbinfo->base = bo->paddr + fb->offsets[0]; + fbinfo->pitch = fb->pitches[0]; ++ ++ if (fb->modifier[0] == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED) ++ fbinfo->bpp |= BIT(31); ++ + /* 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 + +From 60be33928c5b79c21defe47cf6de96b348601f10 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 12 Jun 2017 13:05:43 +0100 +Subject: [PATCH 284/305] config: Add CONFIG_CAN_GS_USB + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 8962d1b9c10140bb1af43e01f7eae629adbdeece..0fbabb1c0d56943871c3ad2b700f4c81de1c81ae 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -365,6 +365,7 @@ CONFIG_CAN=m + CONFIG_CAN_VCAN=m + CONFIG_CAN_SLCAN=m + CONFIG_CAN_MCP251X=m ++CONFIG_CAN_GS_USB=m + CONFIG_IRDA=m + CONFIG_IRLAN=m + CONFIG_IRNET=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 372bfe1ca1fb638d78b1ece096ca1a8e5f5a13a8..83cfb1e8738bdb7ef3ee1502b9a64d654de80c1b 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -361,6 +361,7 @@ CONFIG_CAN=m + CONFIG_CAN_VCAN=m + CONFIG_CAN_SLCAN=m + CONFIG_CAN_MCP251X=m ++CONFIG_CAN_GS_USB=m + CONFIG_IRDA=m + CONFIG_IRLAN=m + CONFIG_IRNET=m + +From b0eaba9a38164cead5ad05fc384932ccb5e9573b Mon Sep 17 00:00:00 2001 +From: P33M +Date: Mon, 12 Jun 2017 16:10:03 +0100 +Subject: [PATCH 285/305] dwc_otg: add module parameter int_ep_interval_min + +Add a module parameter (defaulting to ignored) that clamps the polling rate +of high-speed Interrupt endpoints to a minimum microframe interval. + +The parameter is modifiable at runtime as it is used when activating new +endpoints (such as on device connect). +--- + drivers/usb/host/dwc_otg/dwc_otg_driver.c | 6 +++++- + drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 25 ++++++++++++------------- + 2 files changed, 17 insertions(+), 14 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +index cb060a7179a3eec791506ed2779b553cad9841b0..95943e07528276b26b51ea2d57a1f433f280aaef 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +@@ -249,6 +249,7 @@ uint16_t nak_holdoff = 8; + + unsigned short fiq_fsm_mask = 0x0F; + ++unsigned short int_ep_interval_min = 0; + /** + * This function shows the Driver Version. + */ +@@ -1398,7 +1399,10 @@ MODULE_PARM_DESC(fiq_fsm_mask, "Bitmask of transactions to perform in the FIQ.\n + "Bit 1 : Periodic split transactions\n" + "Bit 2 : High-speed multi-transfer isochronous\n" + "All other bits should be set 0."); +- ++module_param(int_ep_interval_min, ushort, 0644); ++MODULE_PARM_DESC(int_ep_interval_min, "Clamp high-speed Interrupt endpoints to a minimum polling interval.\n" ++ "0..1 = Use endpoint default\n" ++ "2..n = Minimum interval n microframes. Use powers of 2.\n"); + + /** @page "Module Parameters" + * +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +index 4b1dd9de99e9e08b2e006fb5f8a7ef92f20c2553..fe8e8f841f03660c2ad49ab8e66193bec62558d3 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +@@ -43,6 +43,7 @@ + #include "dwc_otg_regs.h" + + extern bool microframe_schedule; ++extern unsigned short int_ep_interval_min; + + /** + * Free each QTD in the QH's QTD-list then free the QH. QH should already be +@@ -218,21 +219,19 @@ void qh_init(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, dwc_otg_hcd_urb_t * urb) + SCHEDULE_SLOP); + qh->interval = urb->interval; + +-#if 0 +- /* Increase interrupt polling rate for debugging. */ +- if (qh->ep_type == UE_INTERRUPT) { +- qh->interval = 8; +- } +-#endif + hprt.d32 = DWC_READ_REG32(hcd->core_if->host_if->hprt0); +- if ((hprt.b.prtspd == DWC_HPRT0_PRTSPD_HIGH_SPEED) && +- ((dev_speed == USB_SPEED_LOW) || +- (dev_speed == USB_SPEED_FULL))) { +- qh->interval *= 8; +- qh->sched_frame |= 0x7; +- qh->start_split_frame = qh->sched_frame; ++ if (hprt.b.prtspd == DWC_HPRT0_PRTSPD_HIGH_SPEED) { ++ if (dev_speed == USB_SPEED_LOW || ++ dev_speed == USB_SPEED_FULL) { ++ qh->interval *= 8; ++ qh->sched_frame |= 0x7; ++ qh->start_split_frame = qh->sched_frame; ++ } else if (int_ep_interval_min >= 2 && ++ qh->interval < int_ep_interval_min && ++ qh->ep_type == UE_INTERRUPT) { ++ qh->interval = int_ep_interval_min; ++ } + } +- + } + + DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD QH Initialized\n"); + +From b248733d5e32dafa86c0bf7b9dcc3fb3d91c0ccc Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 13 Jun 2017 15:06:22 +0100 +Subject: [PATCH 286/305] Revert "drm/vc4: Add FB modifier support to + firmwarekms." + +This reverts commit 9183dfdbf2cb3ec8e981204847b345f7ab95662d. +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 40a0cdc179ceabafb387724e1b835895fa3e2ca2..943cbb38f1f2e6fc7c06870be7904677e0a9c7a3 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -18,7 +18,6 @@ + #include "drm_atomic_helper.h" + #include "drm_plane_helper.h" + #include "drm_crtc_helper.h" +-#include "drm_fourcc.h" + #include "linux/clk.h" + #include "linux/debugfs.h" + #include "drm_fb_cma_helper.h" +@@ -137,10 +136,6 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + fbinfo->yoffset = state->crtc_y; + fbinfo->base = bo->paddr + fb->offsets[0]; + fbinfo->pitch = fb->pitches[0]; +- +- if (fb->modifier[0] == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED) +- fbinfo->bpp |= BIT(31); +- + /* 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 + +From 46be68eb92eed7df464b2974ff8ae5bee7c7a05b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 13 Jun 2017 15:06:24 +0100 +Subject: [PATCH 287/305] Revert "drm/vc4: Add get/set tiling ioctls." + +This reverts commit 3ea95503a626b7e4157afa0745d11908546654b1. +--- + drivers/gpu/drm/vc4/vc4_bo.c | 83 ------------------------------------------- + drivers/gpu/drm/vc4/vc4_drv.c | 2 -- + drivers/gpu/drm/vc4/vc4_drv.h | 6 ---- + drivers/gpu/drm/vc4/vc4_kms.c | 41 +-------------------- + include/uapi/drm/vc4_drm.h | 16 --------- + 5 files changed, 1 insertion(+), 147 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index 55bbadc86a1ee45205360fb26e8525a8326db017..fd83a28076564b9ea5cf0f2ba29b884ee3c5af43 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -534,89 +534,6 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + return ret; + } + +-/** +- * vc4_set_tiling_ioctl() - Sets the tiling modifier for a BO. +- * @dev: DRM device +- * @data: ioctl argument +- * @file_priv: DRM file for this fd +- * +- * The tiling state of the BO decides the default modifier of an fb if +- * no specific modifier was set by userspace, and the return value of +- * vc4_get_tiling_ioctl() (so that a BO shared to another DRM fd can +- * treat the BO as the same tiling format). +- */ +- +-int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv) +-{ +- struct drm_vc4_set_tiling *args = data; +- struct drm_gem_object *gem_obj; +- struct vc4_bo *bo; +- bool t_format; +- +- if (args->flags != 0) +- return -EINVAL; +- +- switch (args->modifier) { +- case DRM_FORMAT_MOD_NONE: +- t_format = false; +- break; +- case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: +- t_format = true; +- break; +- default: +- return -EINVAL; +- } +- +- gem_obj = drm_gem_object_lookup(file_priv, args->handle); +- if (!gem_obj) { +- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); +- return -ENOENT; +- } +- bo = to_vc4_bo(gem_obj); +- bo->t_format = t_format; +- +- drm_gem_object_unreference_unlocked(gem_obj); +- +- return 0; +-} +- +-/** +- * vc4_get_tiling_ioctl() - Gets the tiling modifier for a BO. +- * @dev: DRM device +- * @data: ioctl argument +- * @file_priv: DRM file for this fd +- * +- * Returns the tiling modifier for a BO as set by vc4_set_tiling_ioctl(). +- */ +- +-int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv) +-{ +- struct drm_vc4_get_tiling *args = data; +- struct drm_gem_object *gem_obj; +- struct vc4_bo *bo; +- +- if (args->flags != 0 || args->modifier != 0) +- return -EINVAL; +- +- gem_obj = drm_gem_object_lookup(file_priv, args->handle); +- if (!gem_obj) { +- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); +- return -ENOENT; +- } +- bo = to_vc4_bo(gem_obj); +- +- if (bo->t_format) +- args->modifier = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; +- else +- args->modifier = DRM_FORMAT_MOD_NONE; +- +- drm_gem_object_unreference_unlocked(gem_obj); +- +- return 0; +-} +- + void vc4_bo_cache_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index f528edc4b389e2e3843cd8be2faccf62947cbda4..457e5e79ec8dc863fc66759662232c7160592f6e 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -124,8 +124,6 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = { + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), +- DRM_IOCTL_DEF_DRV(VC4_SET_TILING, vc4_set_tiling_ioctl, DRM_RENDER_ALLOW), +- DRM_IOCTL_DEF_DRV(VC4_GET_TILING, vc4_get_tiling_ioctl, DRM_RENDER_ALLOW), + }; + + static struct drm_driver vc4_drm_driver = { +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index fcf1c45783736413c058a33f31e189ebaddb446e..9e50bc25b2be71079d52a861c25f3fe7c4db0830 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -148,8 +148,6 @@ struct vc4_bo { + */ + uint64_t write_seqno; + +- bool t_format; +- + /* List entry for the BO's position in either + * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list + */ +@@ -452,10 +450,6 @@ int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); +-int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv); +-int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, +- struct drm_file *file_priv); + int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap(struct file *filp, struct vm_area_struct *vma); +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 78080c3e966cacf4756d58d34069c3fb0bafdd87..67af2af70af091bf4b13ac03eb1078f867bc6cea 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -201,50 +201,11 @@ static int vc4_atomic_commit(struct drm_device *dev, + return 0; + } + +-static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, +- struct drm_file *file_priv, +- const struct drm_mode_fb_cmd2 *mode_cmd) +-{ +- struct drm_mode_fb_cmd2 mode_cmd_local; +- +- /* If the user didn't specify a modifier, use the +- * vc4_set_tiling_ioctl() state for the BO. +- */ +- if (!(mode_cmd->flags & DRM_MODE_FB_MODIFIERS)) { +- struct drm_gem_object *gem_obj; +- struct vc4_bo *bo; +- +- gem_obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); +- if (!gem_obj) { +- DRM_ERROR("Failed to look up GEM BO %d\n", +- mode_cmd->handles[0]); +- return ERR_PTR(-ENOENT); +- +- } +- bo = to_vc4_bo(gem_obj); +- +- mode_cmd_local = *mode_cmd; +- +- if (bo->t_format) { +- mode_cmd_local.modifier[0] = +- DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; +- } else { +- mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; +- } +- +- drm_gem_object_unreference_unlocked(gem_obj); +- +- mode_cmd = &mode_cmd_local; +- } +- +- return drm_fb_cma_create(dev, file_priv, mode_cmd); +-} +- + static const struct drm_mode_config_funcs vc4_mode_funcs = { + .output_poll_changed = vc4_output_poll_changed, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = vc4_atomic_commit, +- .fb_create = vc4_fb_create, ++ .fb_create = drm_fb_cma_create, + }; + + int vc4_kms_load(struct drm_device *dev) +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index 6ac4c5c014cb9b98343f25721f74b727a88f2bb5..f07a090167261131076438960c1dec175d7d376e 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -38,8 +38,6 @@ extern "C" { + #define DRM_VC4_CREATE_SHADER_BO 0x05 + #define DRM_VC4_GET_HANG_STATE 0x06 + #define DRM_VC4_GET_PARAM 0x07 +-#define DRM_VC4_SET_TILING 0x08 +-#define DRM_VC4_GET_TILING 0x09 + + #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) + #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +@@ -49,8 +47,6 @@ extern "C" { + #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) + #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) + #define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) +-#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) +-#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) + + struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ +@@ -299,18 +295,6 @@ struct drm_vc4_get_param { + __u64 value; + }; + +-struct drm_vc4_get_tiling { +- __u32 handle; +- __u32 flags; +- __u64 modifier; +-}; +- +-struct drm_vc4_set_tiling { +- __u32 handle; +- __u32 flags; +- __u64 modifier; +-}; +- + #if defined(__cplusplus) + } + #endif + +From 5a340c227213a85b63fc7a411d333a1e925b2546 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 13 Jun 2017 15:06:25 +0100 +Subject: [PATCH 288/305] Revert "drm/vc4: Add T-format scanout support." + +This reverts commit 85e9ae254717d2e4a313945a465230a3102cad42. +--- + drivers/gpu/drm/vc4/vc4_plane.c | 32 ++++---------------------------- + drivers/gpu/drm/vc4/vc4_regs.h | 19 ------------------- + include/uapi/drm/drm_fourcc.h | 22 ---------------------- + 3 files changed, 4 insertions(+), 69 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 62c5f7df0f1a0034bf0b5630eba1344a0f85897b..14d69bb4967dedcd3bbc475639a8c27e38662fb3 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -22,7 +22,6 @@ + #include "vc4_regs.h" + #include "drm_atomic.h" + #include "drm_atomic_helper.h" +-#include "drm_fourcc.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" + +@@ -500,8 +499,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + u32 ctl0_offset = vc4_state->dlist_count; + const struct hvs_format *format = vc4_get_hvs_format(fb->pixel_format); + int num_planes = drm_format_num_planes(format->drm); +- u32 scl0, scl1, pitch0; +- u32 lbm_size, tiling = SCALER_CTL0_TILING_LINEAR; ++ u32 scl0, scl1; ++ u32 lbm_size; + unsigned long irqflags; + int ret, i; + +@@ -542,31 +541,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + scl1 = vc4_get_scl_field(state, 0); + } + +- switch (fb->modifier[0]) { +- case DRM_FORMAT_MOD_NONE: +- tiling = SCALER_CTL0_TILING_LINEAR; +- pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); +- break; +- case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: +- tiling = SCALER_CTL0_TILING_256B_OR_T; +- +- pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET), +- VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L), +- VC4_SET_FIELD((vc4_state->src_w[0] + 31) >> 5, +- SCALER_PITCH0_TILE_WIDTH_R)); +- break; +- default: +- DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", +- (long long)fb->modifier[0]); +- return -EINVAL; +- } +- + /* Control word */ + vc4_dlist_write(vc4_state, + SCALER_CTL0_VALID | + (format->pixel_order << SCALER_CTL0_ORDER_SHIFT) | + (format->hvs << SCALER_CTL0_PIXEL_FORMAT_SHIFT) | +- VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) | + (vc4_state->is_unity ? SCALER_CTL0_UNITY : 0) | + VC4_SET_FIELD(scl0, SCALER_CTL0_SCL0) | + VC4_SET_FIELD(scl1, SCALER_CTL0_SCL1)); +@@ -620,11 +599,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + for (i = 0; i < num_planes; i++) + vc4_dlist_write(vc4_state, 0xc0c0c0c0); + +- /* Pitch word 0 */ +- vc4_dlist_write(vc4_state, pitch0); +- +- /* Pitch word 1/2 */ +- for (i = 1; i < num_planes; i++) { ++ /* Pitch word 0/1/2 */ ++ for (i = 0; i < num_planes; i++) { + vc4_dlist_write(vc4_state, + VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); + } +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index d382c34c1b9e0c6d5b949ca09bf1e8401d44f91a..932093936178674173a84002b33e07e9a37fdfe9 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -709,13 +709,6 @@ enum hvs_pixel_format { + #define SCALER_CTL0_SIZE_MASK VC4_MASK(29, 24) + #define SCALER_CTL0_SIZE_SHIFT 24 + +-#define SCALER_CTL0_TILING_MASK VC4_MASK(21, 20) +-#define SCALER_CTL0_TILING_SHIFT 20 +-#define SCALER_CTL0_TILING_LINEAR 0 +-#define SCALER_CTL0_TILING_64B 1 +-#define SCALER_CTL0_TILING_128B 2 +-#define SCALER_CTL0_TILING_256B_OR_T 3 +- + #define SCALER_CTL0_HFLIP BIT(16) + #define SCALER_CTL0_VFLIP BIT(15) + +@@ -845,19 +838,7 @@ enum hvs_pixel_format { + #define SCALER_PPF_KERNEL_OFFSET_SHIFT 0 + #define SCALER_PPF_KERNEL_UNCACHED BIT(31) + +-/* PITCH0/1/2 fields for raster. */ + #define SCALER_SRC_PITCH_MASK VC4_MASK(15, 0) + #define SCALER_SRC_PITCH_SHIFT 0 + +-/* PITCH0 fields for T-tiled. */ +-#define SCALER_PITCH0_TILE_WIDTH_L_MASK VC4_MASK(22, 16) +-#define SCALER_PITCH0_TILE_WIDTH_L_SHIFT 16 +-#define SCALER_PITCH0_TILE_LINE_DIR BIT(15) +-#define SCALER_PITCH0_TILE_INITIAL_LINE_DIR BIT(14) +-/* Y offset within a tile. */ +-#define SCALER_PITCH0_TILE_Y_OFFSET_MASK VC4_MASK(13, 7) +-#define SCALER_PITCH0_TILE_Y_OFFSET_SHIFT 7 +-#define SCALER_PITCH0_TILE_WIDTH_R_MASK VC4_MASK(6, 0) +-#define SCALER_PITCH0_TILE_WIDTH_R_SHIFT 0 +- + #endif /* VC4_REGS_H */ +diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h +index 4fccf9b898b1242877362ca0be872478c1f0ec8d..a5890bf44c0afa3b78d1cfa66308b097d1c38710 100644 +--- a/include/uapi/drm/drm_fourcc.h ++++ b/include/uapi/drm/drm_fourcc.h +@@ -159,7 +159,6 @@ extern "C" { + #define DRM_FORMAT_MOD_VENDOR_NV 0x03 + #define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 + #define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 +-#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 + /* add more to the end as needed */ + + #define fourcc_mod_code(vendor, val) \ +@@ -234,27 +233,6 @@ extern "C" { + */ + #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) + +-/* +- * Broadcom VC4 "T" format +- * +- * This is the primary layout that the V3D GPU can texture from (it +- * can't do linear). The T format has: +- * +- * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 +- * pixels at 32 bit depth. +- * +- * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually +- * 16x16 pixels). +- * +- * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On +- * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows +- * they're (TR, BR, BL, TL), where bottom left is start of memory. +- * +- * - an image made of 4k tiles in rows either left-to-right (even rows of 4k +- * tiles) or right-to-left (odd rows of 4k tiles). +- */ +-#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) +- + #if defined(__cplusplus) + } + #endif + +From 5bf833343957e53f3c74386124def88931fcb15b Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 12:16:10 -0700 +Subject: [PATCH 289/305] drm/vc4: Add T-format scanout support. + +The T tiling format is what V3D uses for textures, with no raster +support at all until later revisions of the hardware (and always at a +large 3D performance penalty). If we can't scan out V3D's format, +then we often need to do a relayout at some stage of the pipeline, +either right before texturing from the scanout buffer (common in X11 +without a compositor) or between a tiled screen buffer right before +scanout (an option I've considered in trying to resolve this +inconsistency, but which means needing to use the dirty fb ioctl and +having some update policy). + +T-format scanout lets us avoid either of those shadow copies, for a +massive, obvious performance improvement to X11 window dragging +without a compositor. Unfortunately, enabling a compositor to work +around the discrepancy has turned out to be too costly in memory +consumption for the Raspbian distribution. + +Because the HVS operates a scanline at a time, compositing from T does +increase the memory bandwidth cost of scanout. On my 1920x1080@32bpp +display on a RPi3, we go from about 15% of system memory bandwidth +with linear to about 20% with tiled. However, for X11 this still ends +up being a huge performance win in active usage. + +This patch doesn't yet handle src_x/src_y offsetting within the tiled +buffer. However, we fail to do so for untiled buffers already. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 32 ++++++++++++++++++++++++++++---- + drivers/gpu/drm/vc4/vc4_regs.h | 19 +++++++++++++++++++ + include/uapi/drm/drm_fourcc.h | 22 ++++++++++++++++++++++ + 3 files changed, 69 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 14d69bb4967dedcd3bbc475639a8c27e38662fb3..62c5f7df0f1a0034bf0b5630eba1344a0f85897b 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -22,6 +22,7 @@ + #include "vc4_regs.h" + #include "drm_atomic.h" + #include "drm_atomic_helper.h" ++#include "drm_fourcc.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" + +@@ -499,8 +500,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + u32 ctl0_offset = vc4_state->dlist_count; + const struct hvs_format *format = vc4_get_hvs_format(fb->pixel_format); + int num_planes = drm_format_num_planes(format->drm); +- u32 scl0, scl1; +- u32 lbm_size; ++ u32 scl0, scl1, pitch0; ++ u32 lbm_size, tiling = SCALER_CTL0_TILING_LINEAR; + unsigned long irqflags; + int ret, i; + +@@ -541,11 +542,31 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + scl1 = vc4_get_scl_field(state, 0); + } + ++ switch (fb->modifier[0]) { ++ case DRM_FORMAT_MOD_NONE: ++ tiling = SCALER_CTL0_TILING_LINEAR; ++ pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ tiling = SCALER_CTL0_TILING_256B_OR_T; ++ ++ pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET), ++ VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L), ++ VC4_SET_FIELD((vc4_state->src_w[0] + 31) >> 5, ++ SCALER_PITCH0_TILE_WIDTH_R)); ++ break; ++ default: ++ DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", ++ (long long)fb->modifier[0]); ++ return -EINVAL; ++ } ++ + /* Control word */ + vc4_dlist_write(vc4_state, + SCALER_CTL0_VALID | + (format->pixel_order << SCALER_CTL0_ORDER_SHIFT) | + (format->hvs << SCALER_CTL0_PIXEL_FORMAT_SHIFT) | ++ VC4_SET_FIELD(tiling, SCALER_CTL0_TILING) | + (vc4_state->is_unity ? SCALER_CTL0_UNITY : 0) | + VC4_SET_FIELD(scl0, SCALER_CTL0_SCL0) | + VC4_SET_FIELD(scl1, SCALER_CTL0_SCL1)); +@@ -599,8 +620,11 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + for (i = 0; i < num_planes; i++) + vc4_dlist_write(vc4_state, 0xc0c0c0c0); + +- /* Pitch word 0/1/2 */ +- for (i = 0; i < num_planes; i++) { ++ /* Pitch word 0 */ ++ vc4_dlist_write(vc4_state, pitch0); ++ ++ /* Pitch word 1/2 */ ++ for (i = 1; i < num_planes; i++) { + vc4_dlist_write(vc4_state, + VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); + } +diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h +index 932093936178674173a84002b33e07e9a37fdfe9..d382c34c1b9e0c6d5b949ca09bf1e8401d44f91a 100644 +--- a/drivers/gpu/drm/vc4/vc4_regs.h ++++ b/drivers/gpu/drm/vc4/vc4_regs.h +@@ -709,6 +709,13 @@ enum hvs_pixel_format { + #define SCALER_CTL0_SIZE_MASK VC4_MASK(29, 24) + #define SCALER_CTL0_SIZE_SHIFT 24 + ++#define SCALER_CTL0_TILING_MASK VC4_MASK(21, 20) ++#define SCALER_CTL0_TILING_SHIFT 20 ++#define SCALER_CTL0_TILING_LINEAR 0 ++#define SCALER_CTL0_TILING_64B 1 ++#define SCALER_CTL0_TILING_128B 2 ++#define SCALER_CTL0_TILING_256B_OR_T 3 ++ + #define SCALER_CTL0_HFLIP BIT(16) + #define SCALER_CTL0_VFLIP BIT(15) + +@@ -838,7 +845,19 @@ enum hvs_pixel_format { + #define SCALER_PPF_KERNEL_OFFSET_SHIFT 0 + #define SCALER_PPF_KERNEL_UNCACHED BIT(31) + ++/* PITCH0/1/2 fields for raster. */ + #define SCALER_SRC_PITCH_MASK VC4_MASK(15, 0) + #define SCALER_SRC_PITCH_SHIFT 0 + ++/* PITCH0 fields for T-tiled. */ ++#define SCALER_PITCH0_TILE_WIDTH_L_MASK VC4_MASK(22, 16) ++#define SCALER_PITCH0_TILE_WIDTH_L_SHIFT 16 ++#define SCALER_PITCH0_TILE_LINE_DIR BIT(15) ++#define SCALER_PITCH0_TILE_INITIAL_LINE_DIR BIT(14) ++/* Y offset within a tile. */ ++#define SCALER_PITCH0_TILE_Y_OFFSET_MASK VC4_MASK(13, 7) ++#define SCALER_PITCH0_TILE_Y_OFFSET_SHIFT 7 ++#define SCALER_PITCH0_TILE_WIDTH_R_MASK VC4_MASK(6, 0) ++#define SCALER_PITCH0_TILE_WIDTH_R_SHIFT 0 ++ + #endif /* VC4_REGS_H */ +diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h +index a5890bf44c0afa3b78d1cfa66308b097d1c38710..4fccf9b898b1242877362ca0be872478c1f0ec8d 100644 +--- a/include/uapi/drm/drm_fourcc.h ++++ b/include/uapi/drm/drm_fourcc.h +@@ -159,6 +159,7 @@ extern "C" { + #define DRM_FORMAT_MOD_VENDOR_NV 0x03 + #define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 + #define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 ++#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 + /* add more to the end as needed */ + + #define fourcc_mod_code(vendor, val) \ +@@ -233,6 +234,27 @@ extern "C" { + */ + #define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) + ++/* ++ * Broadcom VC4 "T" format ++ * ++ * This is the primary layout that the V3D GPU can texture from (it ++ * can't do linear). The T format has: ++ * ++ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 ++ * pixels at 32 bit depth. ++ * ++ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually ++ * 16x16 pixels). ++ * ++ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On ++ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows ++ * they're (TR, BR, BL, TL), where bottom left is start of memory. ++ * ++ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k ++ * tiles) or right-to-left (odd rows of 4k tiles). ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) ++ + #if defined(__cplusplus) + } + #endif + +From 159aa96f948a1f52a4e88cf61ca2c8f053f7e149 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Jun 2017 14:00:45 -0700 +Subject: [PATCH 290/305] drm/vc4: Add get/set tiling ioctls. + +This allows mesa to set the tiling format for a BO and have that +tiling format be respected by mesa on the other side of an +import/export (and by vc4 scanout in the kernel), without defining a +protocol to pass the tiling through userspace. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_bo.c | 83 +++++++++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/vc4/vc4_drv.c | 2 ++ + drivers/gpu/drm/vc4/vc4_drv.h | 6 ++++ + drivers/gpu/drm/vc4/vc4_kms.c | 41 ++++++++++++++++++++- + include/uapi/drm/vc4_drm.h | 16 +++++++++ + 5 files changed, 147 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c +index fd83a28076564b9ea5cf0f2ba29b884ee3c5af43..55bbadc86a1ee45205360fb26e8525a8326db017 100644 +--- a/drivers/gpu/drm/vc4/vc4_bo.c ++++ b/drivers/gpu/drm/vc4/vc4_bo.c +@@ -534,6 +534,89 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + return ret; + } + ++/** ++ * vc4_set_tiling_ioctl() - Sets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * The tiling state of the BO decides the default modifier of an fb if ++ * no specific modifier was set by userspace, and the return value of ++ * vc4_get_tiling_ioctl() (so that a BO shared to another DRM fd can ++ * treat the BO as the same tiling format). ++ */ ++ ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_set_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ bool t_format; ++ ++ if (args->flags != 0) ++ return -EINVAL; ++ ++ switch (args->modifier) { ++ case DRM_FORMAT_MOD_NONE: ++ t_format = false; ++ break; ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ t_format = true; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ bo->t_format = t_format; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ ++/** ++ * vc4_get_tiling_ioctl() - Gets the tiling modifier for a BO. ++ * @dev: DRM device ++ * @data: ioctl argument ++ * @file_priv: DRM file for this fd ++ * ++ * Returns the tiling modifier for a BO as set by vc4_set_tiling_ioctl(). ++ */ ++ ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv) ++{ ++ struct drm_vc4_get_tiling *args = data; ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ if (args->flags != 0 || args->modifier != 0) ++ return -EINVAL; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, args->handle); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); ++ return -ENOENT; ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ if (bo->t_format) ++ args->modifier = DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ else ++ args->modifier = DRM_FORMAT_MOD_NONE; ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ return 0; ++} ++ + void vc4_bo_cache_init(struct drm_device *dev) + { + struct vc4_dev *vc4 = to_vc4_dev(dev); +diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c +index 457e5e79ec8dc863fc66759662232c7160592f6e..f528edc4b389e2e3843cd8be2faccf62947cbda4 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.c ++++ b/drivers/gpu/drm/vc4/vc4_drv.c +@@ -124,6 +124,8 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = { + DRM_IOCTL_DEF_DRV(VC4_GET_HANG_STATE, vc4_get_hang_state_ioctl, + DRM_ROOT_ONLY), + DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_SET_TILING, vc4_set_tiling_ioctl, DRM_RENDER_ALLOW), ++ DRM_IOCTL_DEF_DRV(VC4_GET_TILING, vc4_get_tiling_ioctl, DRM_RENDER_ALLOW), + }; + + static struct drm_driver vc4_drm_driver = { +diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h +index 9e50bc25b2be71079d52a861c25f3fe7c4db0830..fcf1c45783736413c058a33f31e189ebaddb446e 100644 +--- a/drivers/gpu/drm/vc4/vc4_drv.h ++++ b/drivers/gpu/drm/vc4/vc4_drv.h +@@ -148,6 +148,8 @@ struct vc4_bo { + */ + uint64_t write_seqno; + ++ bool t_format; ++ + /* List entry for the BO's position in either + * vc4_exec_info->unref_list or vc4_dev->bo_cache.time_list + */ +@@ -450,6 +452,10 @@ int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); ++int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); ++int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, ++ struct drm_file *file_priv); + int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); + int vc4_mmap(struct file *filp, struct vm_area_struct *vma); +diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c +index 67af2af70af091bf4b13ac03eb1078f867bc6cea..78080c3e966cacf4756d58d34069c3fb0bafdd87 100644 +--- a/drivers/gpu/drm/vc4/vc4_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_kms.c +@@ -201,11 +201,50 @@ static int vc4_atomic_commit(struct drm_device *dev, + return 0; + } + ++static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, ++ struct drm_file *file_priv, ++ const struct drm_mode_fb_cmd2 *mode_cmd) ++{ ++ struct drm_mode_fb_cmd2 mode_cmd_local; ++ ++ /* If the user didn't specify a modifier, use the ++ * vc4_set_tiling_ioctl() state for the BO. ++ */ ++ if (!(mode_cmd->flags & DRM_MODE_FB_MODIFIERS)) { ++ struct drm_gem_object *gem_obj; ++ struct vc4_bo *bo; ++ ++ gem_obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); ++ if (!gem_obj) { ++ DRM_ERROR("Failed to look up GEM BO %d\n", ++ mode_cmd->handles[0]); ++ return ERR_PTR(-ENOENT); ++ ++ } ++ bo = to_vc4_bo(gem_obj); ++ ++ mode_cmd_local = *mode_cmd; ++ ++ if (bo->t_format) { ++ mode_cmd_local.modifier[0] = ++ DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED; ++ } else { ++ mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; ++ } ++ ++ drm_gem_object_unreference_unlocked(gem_obj); ++ ++ mode_cmd = &mode_cmd_local; ++ } ++ ++ return drm_fb_cma_create(dev, file_priv, mode_cmd); ++} ++ + static const struct drm_mode_config_funcs vc4_mode_funcs = { + .output_poll_changed = vc4_output_poll_changed, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = vc4_atomic_commit, +- .fb_create = drm_fb_cma_create, ++ .fb_create = vc4_fb_create, + }; + + int vc4_kms_load(struct drm_device *dev) +diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h +index f07a090167261131076438960c1dec175d7d376e..6ac4c5c014cb9b98343f25721f74b727a88f2bb5 100644 +--- a/include/uapi/drm/vc4_drm.h ++++ b/include/uapi/drm/vc4_drm.h +@@ -38,6 +38,8 @@ extern "C" { + #define DRM_VC4_CREATE_SHADER_BO 0x05 + #define DRM_VC4_GET_HANG_STATE 0x06 + #define DRM_VC4_GET_PARAM 0x07 ++#define DRM_VC4_SET_TILING 0x08 ++#define DRM_VC4_GET_TILING 0x09 + + #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) + #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) +@@ -47,6 +49,8 @@ extern "C" { + #define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo) + #define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state) + #define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) ++#define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) ++#define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) + + struct drm_vc4_submit_rcl_surface { + __u32 hindex; /* Handle index, or ~0 if not present. */ +@@ -295,6 +299,18 @@ struct drm_vc4_get_param { + __u64 value; + }; + ++struct drm_vc4_get_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ ++struct drm_vc4_set_tiling { ++ __u32 handle; ++ __u32 flags; ++ __u64 modifier; ++}; ++ + #if defined(__cplusplus) + } + #endif + +From 567afa31d5e52d04d094a70bee991d78b36334e6 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 7 Jun 2017 14:39:49 -0700 +Subject: [PATCH 291/305] drm/vc4: Add FB modifier support to firmwarekms. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 943cbb38f1f2e6fc7c06870be7904677e0a9c7a3..40a0cdc179ceabafb387724e1b835895fa3e2ca2 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -18,6 +18,7 @@ + #include "drm_atomic_helper.h" + #include "drm_plane_helper.h" + #include "drm_crtc_helper.h" ++#include "drm_fourcc.h" + #include "linux/clk.h" + #include "linux/debugfs.h" + #include "drm_fb_cma_helper.h" +@@ -136,6 +137,10 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + fbinfo->yoffset = state->crtc_y; + fbinfo->base = bo->paddr + fb->offsets[0]; + fbinfo->pitch = fb->pitches[0]; ++ ++ if (fb->modifier[0] == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED) ++ fbinfo->bpp |= BIT(31); ++ + /* 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 + +From 2194d686cc9236aaf8509148e90c955b425f4ee1 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 6 Jan 2017 19:15:23 +0100 +Subject: [PATCH 292/305] USB: serial: ch341: change initial line-control + settings + +commit 7c61b0d5e82bfe29b8dda55745afbf65b6ccc901 upstream. + +Some CH340 devices appear unable to change the initial LCR settings, so +set a sane 8N1 default during probe to enable basic support for such +devices. + +Also drop a redundant LCR read during device initialisation. + +Signed-off-by: Johan Hovold +--- + drivers/usb/serial/ch341.c | 187 +++++++++++++++++++++++++-------------------- + 1 file changed, 103 insertions(+), 84 deletions(-) + +diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c +index 4f25aba5bdfcabe7304b18860be8527587390467..b27593a02734a1def9412e848c91feb553088e3c 100644 +--- a/drivers/usb/serial/ch341.c ++++ b/drivers/usb/serial/ch341.c +@@ -61,13 +61,26 @@ + * the Net/FreeBSD uchcom.c driver by Takanori Watanabe. Domo arigato. + */ + ++#define CH341_REQ_READ_VERSION 0x5F + #define CH341_REQ_WRITE_REG 0x9A + #define CH341_REQ_READ_REG 0x95 +-#define CH341_REG_BREAK1 0x05 +-#define CH341_REG_BREAK2 0x18 +-#define CH341_NBREAK_BITS_REG1 0x01 +-#define CH341_NBREAK_BITS_REG2 0x40 +- ++#define CH341_REQ_SERIAL_INIT 0xA1 ++#define CH341_REQ_MODEM_CTRL 0xA4 ++ ++#define CH341_REG_BREAK 0x05 ++#define CH341_REG_LCR 0x18 ++#define CH341_NBREAK_BITS 0x01 ++ ++#define CH341_LCR_ENABLE_RX 0x80 ++#define CH341_LCR_ENABLE_TX 0x40 ++#define CH341_LCR_MARK_SPACE 0x20 ++#define CH341_LCR_PAR_EVEN 0x10 ++#define CH341_LCR_ENABLE_PAR 0x08 ++#define CH341_LCR_STOP_BITS_2 0x04 ++#define CH341_LCR_CS8 0x03 ++#define CH341_LCR_CS7 0x02 ++#define CH341_LCR_CS6 0x01 ++#define CH341_LCR_CS5 0x00 + + static const struct usb_device_id id_table[] = { + { USB_DEVICE(0x4348, 0x5523) }, +@@ -82,6 +95,7 @@ struct ch341_private { + unsigned baud_rate; /* set baud rate */ + u8 line_control; /* set line control value RTS/DTR */ + u8 line_status; /* active status of modem control inputs */ ++ u8 lcr; + }; + + static void ch341_set_termios(struct tty_struct *tty, +@@ -134,10 +148,10 @@ static int ch341_control_in(struct usb_device *dev, + return 0; + } + +-static int ch341_set_baudrate(struct usb_device *dev, +- struct ch341_private *priv) ++static int ch341_set_baudrate_lcr(struct usb_device *dev, ++ struct ch341_private *priv, u8 lcr) + { +- short a, b; ++ short a; + int r; + unsigned long factor; + short divisor; +@@ -157,18 +171,27 @@ static int ch341_set_baudrate(struct usb_device *dev, + + factor = 0x10000 - factor; + a = (factor & 0xff00) | divisor; +- b = factor & 0xff; + +- r = ch341_control_out(dev, 0x9a, 0x1312, a); +- if (!r) +- r = ch341_control_out(dev, 0x9a, 0x0f2c, b); ++ /* ++ * CH341A buffers data until a full endpoint-size packet (32 bytes) ++ * has been received unless bit 7 is set. ++ */ ++ a |= BIT(7); ++ ++ r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x1312, a); ++ if (r) ++ return r; ++ ++ r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x2518, lcr); ++ if (r) ++ return r; + + return r; + } + + static int ch341_set_handshake(struct usb_device *dev, u8 control) + { +- return ch341_control_out(dev, 0xa4, ~control, 0); ++ return ch341_control_out(dev, CH341_REQ_MODEM_CTRL, ~control, 0); + } + + static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv) +@@ -182,7 +205,7 @@ static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv) + if (!buffer) + return -ENOMEM; + +- r = ch341_control_in(dev, 0x95, 0x0706, 0, buffer, size); ++ r = ch341_control_in(dev, CH341_REQ_READ_REG, 0x0706, 0, buffer, size); + if (r < 0) + goto out; + +@@ -207,46 +230,20 @@ static int ch341_configure(struct usb_device *dev, struct ch341_private *priv) + return -ENOMEM; + + /* expect two bytes 0x27 0x00 */ +- r = ch341_control_in(dev, 0x5f, 0, 0, buffer, size); +- if (r < 0) +- goto out; +- +- r = ch341_control_out(dev, 0xa1, 0, 0); +- if (r < 0) +- goto out; +- +- r = ch341_set_baudrate(dev, priv); ++ r = ch341_control_in(dev, CH341_REQ_READ_VERSION, 0, 0, buffer, size); + if (r < 0) + goto out; ++ dev_dbg(&dev->dev, "Chip version: 0x%02x\n", buffer[0]); + +- /* expect two bytes 0x56 0x00 */ +- r = ch341_control_in(dev, 0x95, 0x2518, 0, buffer, size); ++ r = ch341_control_out(dev, CH341_REQ_SERIAL_INIT, 0, 0); + if (r < 0) + goto out; + +- r = ch341_control_out(dev, 0x9a, 0x2518, 0x0050); +- if (r < 0) +- goto out; +- +- /* expect 0xff 0xee */ +- r = ch341_get_status(dev, priv); +- if (r < 0) +- goto out; +- +- r = ch341_control_out(dev, 0xa1, 0x501f, 0xd90a); +- if (r < 0) +- goto out; +- +- r = ch341_set_baudrate(dev, priv); ++ r = ch341_set_baudrate_lcr(dev, priv, priv->lcr); + if (r < 0) + goto out; + + r = ch341_set_handshake(dev, priv->line_control); +- if (r < 0) +- goto out; +- +- /* expect 0x9f 0xee */ +- r = ch341_get_status(dev, priv); + + out: kfree(buffer); + return r; +@@ -263,6 +260,11 @@ static int ch341_port_probe(struct usb_serial_port *port) + + spin_lock_init(&priv->lock); + priv->baud_rate = DEFAULT_BAUD_RATE; ++ /* ++ * Some CH340 devices appear unable to change the initial LCR ++ * settings, so set a sane 8N1 default. ++ */ ++ priv->lcr = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX | CH341_LCR_CS8; + + r = ch341_configure(port->serial->dev, priv); + if (r < 0) +@@ -318,14 +320,9 @@ static void ch341_close(struct usb_serial_port *port) + /* open this device, set default parameters */ + static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port) + { +- struct usb_serial *serial = port->serial; + struct ch341_private *priv = usb_get_serial_port_data(port); + int r; + +- r = ch341_configure(serial->dev, priv); +- if (r) +- return r; +- + if (tty) + ch341_set_termios(tty, port, NULL); + +@@ -337,6 +334,12 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port) + return r; + } + ++ r = ch341_get_status(port->serial->dev, priv); ++ if (r < 0) { ++ dev_err(&port->dev, "failed to read modem status: %d\n", r); ++ goto err_kill_interrupt_urb; ++ } ++ + r = usb_serial_generic_open(tty, port); + if (r) + goto err_kill_interrupt_urb; +@@ -358,44 +361,54 @@ static void ch341_set_termios(struct tty_struct *tty, + struct ch341_private *priv = usb_get_serial_port_data(port); + unsigned baud_rate; + unsigned long flags; +- unsigned int par_flags; ++ unsigned char ctrl; ++ int r; ++ ++ /* redundant changes may cause the chip to lose bytes */ ++ if (old_termios && !tty_termios_hw_change(&tty->termios, old_termios)) ++ return; + + baud_rate = tty_get_baud_rate(tty); + +- if (baud_rate) { +- priv->baud_rate = baud_rate; +- ch341_set_baudrate(port->serial->dev, priv); +- } ++ ctrl = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX; + +- /* Unimplemented: +- * (cflag & CSIZE) : data bits [5, 8] +- * (cflag & CSTOPB) : stop bits [1, 2] +- */ ++ switch (C_CSIZE(tty)) { ++ case CS5: ++ ctrl |= CH341_LCR_CS5; ++ break; ++ case CS6: ++ ctrl |= CH341_LCR_CS6; ++ break; ++ case CS7: ++ ctrl |= CH341_LCR_CS7; ++ break; ++ case CS8: ++ ctrl |= CH341_LCR_CS8; ++ break; ++ } + +- /* CH340 doesn't appear to support variable stop bits or data bits */ + if (C_PARENB(tty)) { +- if (C_PARODD(tty)) { +- if (tty->termios.c_cflag & CMSPAR) { +- dev_dbg(&port->dev, "parity = mark\n"); +- par_flags = 0xeb; +- } else { +- dev_dbg(&port->dev, "parity = odd\n"); +- par_flags = 0xcb; +- } +- } else { +- if (tty->termios.c_cflag & CMSPAR) { +- dev_dbg(&port->dev, "parity = space\n"); +- par_flags = 0xfb; +- } else { +- dev_dbg(&port->dev, "parity = even\n"); +- par_flags = 0xdb; +- } ++ ctrl |= CH341_LCR_ENABLE_PAR; ++ if (C_PARODD(tty) == 0) ++ ctrl |= CH341_LCR_PAR_EVEN; ++ if (C_CMSPAR(tty)) ++ ctrl |= CH341_LCR_MARK_SPACE; ++ } ++ ++ if (C_CSTOPB(tty)) ++ ctrl |= CH341_LCR_STOP_BITS_2; ++ ++ if (baud_rate) { ++ priv->baud_rate = baud_rate; ++ ++ r = ch341_set_baudrate_lcr(port->serial->dev, priv, ctrl); ++ if (r < 0 && old_termios) { ++ priv->baud_rate = tty_termios_baud_rate(old_termios); ++ tty_termios_copy_hw(&tty->termios, old_termios); ++ } else if (r == 0) { ++ priv->lcr = ctrl; + } +- } else { +- dev_dbg(&port->dev, "parity = none\n"); +- par_flags = 0xc3; + } +- ch341_control_out(port->serial->dev, 0x9a, 0x2518, par_flags); + + spin_lock_irqsave(&priv->lock, flags); + if (C_BAUD(tty) == B0) +@@ -410,7 +423,7 @@ static void ch341_set_termios(struct tty_struct *tty, + static void ch341_break_ctl(struct tty_struct *tty, int break_state) + { + const uint16_t ch341_break_reg = +- ((uint16_t) CH341_REG_BREAK2 << 8) | CH341_REG_BREAK1; ++ ((uint16_t) CH341_REG_LCR << 8) | CH341_REG_BREAK; + struct usb_serial_port *port = tty->driver_data; + int r; + uint16_t reg_contents; +@@ -431,12 +444,12 @@ static void ch341_break_ctl(struct tty_struct *tty, int break_state) + __func__, break_reg[0], break_reg[1]); + if (break_state != 0) { + dev_dbg(&port->dev, "%s - Enter break state requested\n", __func__); +- break_reg[0] &= ~CH341_NBREAK_BITS_REG1; +- break_reg[1] &= ~CH341_NBREAK_BITS_REG2; ++ break_reg[0] &= ~CH341_NBREAK_BITS; ++ break_reg[1] &= ~CH341_LCR_ENABLE_TX; + } else { + dev_dbg(&port->dev, "%s - Leave break state requested\n", __func__); +- break_reg[0] |= CH341_NBREAK_BITS_REG1; +- break_reg[1] |= CH341_NBREAK_BITS_REG2; ++ break_reg[0] |= CH341_NBREAK_BITS; ++ break_reg[1] |= CH341_LCR_ENABLE_TX; + } + dev_dbg(&port->dev, "%s - New ch341 break register contents - reg1: %x, reg2: %x\n", + __func__, break_reg[0], break_reg[1]); +@@ -593,6 +606,12 @@ static int ch341_reset_resume(struct usb_serial *serial) + ret); + return ret; + } ++ ++ ret = ch341_get_status(port->serial->dev, priv); ++ if (ret < 0) { ++ dev_err(&port->dev, "failed to read modem status: %d\n", ++ ret); ++ } + } + + return usb_serial_generic_resume(serial); + +From 9e381fa0502e45e35fed132290b5d9c859c47d38 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Tue, 20 Jun 2017 13:44:01 +0100 +Subject: [PATCH 293/305] dwc_otg: fiq_fsm: Add non-periodic TT exclusivity + constraints + +Certain hub types do not discriminate between pipe direction (IN or OUT) +when considering non-periodic transfers. Therefore these hubs get confused +if multiple transfers are issued in different directions with the same +device address and endpoint number. + +Constrain queuing non-periodic split transactions so they are performed +serially in such cases. + +Related: https://github.com/raspberrypi/linux/issues/2024 +--- + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 32 ++++++++++++++++++ + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h | 2 ++ + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 53 ++++++++++++++++++++++++++++-- + 3 files changed, 85 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +index 208252645c09d1d17bf07673989f91b7f4b3ef7a..0163e9cf620ba58df36a872b82cea92734baada6 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +@@ -191,6 +191,32 @@ static void notrace fiq_fsm_setup_csplit(struct fiq_state *st, int n) + mb(); + } + ++/** ++ * fiq_fsm_restart_np_pending() - Restart a single non-periodic contended transfer ++ * @st: Pointer to the channel's state ++ * @num_channels: Total number of host channels ++ * @orig_channel: Channel index of completed transfer ++ * ++ * In the case where an IN and OUT transfer are simultaneously scheduled to the ++ * same device/EP, inadequate hub implementations will misbehave. Once the first ++ * transfer is complete, a pending non-periodic split can then be issued. ++ */ ++static void notrace fiq_fsm_restart_np_pending(struct fiq_state *st, int num_channels, int orig_channel) ++{ ++ int i; ++ int dev_addr = st->channel[orig_channel].hcchar_copy.b.devaddr; ++ int ep_num = st->channel[orig_channel].hcchar_copy.b.epnum; ++ for (i = 0; i < num_channels; i++) { ++ if (st->channel[i].fsm == FIQ_NP_SSPLIT_PENDING && ++ st->channel[i].hcchar_copy.b.devaddr == dev_addr && ++ st->channel[i].hcchar_copy.b.epnum == ep_num) { ++ st->channel[i].fsm = FIQ_NP_SSPLIT_STARTED; ++ fiq_fsm_restart_channel(st, i, 0); ++ break; ++ } ++ } ++} ++ + static inline int notrace fiq_get_xfer_len(struct fiq_state *st, int n) + { + /* The xfersize register is a bit wonky. For IN transfers, it decrements by the packet size. */ +@@ -870,6 +896,9 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c + st->fsm = FIQ_NP_SPLIT_HS_ABORTED; + } + } ++ if (st->fsm != FIQ_NP_IN_CSPLIT_RETRY) { ++ fiq_fsm_restart_np_pending(state, num_channels, n); ++ } + break; + + case FIQ_NP_OUT_CSPLIT_RETRY: +@@ -919,6 +948,9 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c + st->fsm = FIQ_NP_SPLIT_HS_ABORTED; + } + } ++ if (st->fsm != FIQ_NP_OUT_CSPLIT_RETRY) { ++ fiq_fsm_restart_np_pending(state, num_channels, n); ++ } + break; + + /* Periodic split states (except isoc out) */ +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h +index 0a1ddf3f89f45ca75b8880722fbc22cbdc9f4a2f..ed088f34f210e9a337ab9b80fff0cf9e9b0241ea 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h +@@ -178,6 +178,8 @@ enum fiq_fsm_state { + /* Nonperiodic state groups */ + FIQ_NP_SSPLIT_STARTED = 1, + FIQ_NP_SSPLIT_RETRY = 2, ++ /* TT contention - working around hub bugs */ ++ FIQ_NP_SSPLIT_PENDING = 33, + FIQ_NP_OUT_CSPLIT_RETRY = 3, + FIQ_NP_IN_CSPLIT_RETRY = 4, + FIQ_NP_SPLIT_DONE = 5, +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index 71834cf365e67d7ad995bba7869216c4091c3a74..7710370b30363e3170bf9bf522597c5f41dfb908 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -1572,6 +1572,45 @@ int fiq_fsm_setup_periodic_dma(dwc_otg_hcd_t *hcd, struct fiq_channel_state *st, + } + } + ++/** ++ * fiq_fsm_np_tt_contended() - Avoid performing contended non-periodic transfers ++ * @hcd: Pointer to the dwc_otg_hcd struct ++ * @qh: Pointer to the endpoint's queue head ++ * ++ * Certain hub chips don't differentiate between IN and OUT non-periodic pipes ++ * with the same endpoint number. If transfers get completed out of order ++ * (disregarding the direction token) then the hub can lock up ++ * or return erroneous responses. ++ * ++ * Returns 1 if initiating the transfer would cause contention, 0 otherwise. ++ */ ++int fiq_fsm_np_tt_contended(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) ++{ ++ int i; ++ struct fiq_channel_state *st; ++ int dev_addr = qh->channel->dev_addr; ++ int ep_num = qh->channel->ep_num; ++ for (i = 0; i < hcd->core_if->core_params->host_channels; i++) { ++ if (i == qh->channel->hc_num) ++ continue; ++ st = &hcd->fiq_state->channel[i]; ++ switch (st->fsm) { ++ case FIQ_NP_SSPLIT_STARTED: ++ case FIQ_NP_SSPLIT_RETRY: ++ case FIQ_NP_SSPLIT_PENDING: ++ case FIQ_NP_OUT_CSPLIT_RETRY: ++ case FIQ_NP_IN_CSPLIT_RETRY: ++ if (st->hcchar_copy.b.devaddr == dev_addr && ++ st->hcchar_copy.b.epnum == ep_num) ++ return 1; ++ break; ++ default: ++ break; ++ } ++ } ++ return 0; ++} ++ + /* + * Pushing a periodic request into the queue near the EOF1 point + * in a microframe causes erroneous behaviour (frmovrun) interrupt. +@@ -1894,7 +1933,12 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + switch (hc->ep_type) { + case UE_CONTROL: + case UE_BULK: +- st->fsm = FIQ_NP_SSPLIT_STARTED; ++ if (fiq_fsm_np_tt_contended(hcd, qh)) { ++ st->fsm = FIQ_NP_SSPLIT_PENDING; ++ start_immediate = 0; ++ } else { ++ st->fsm = FIQ_NP_SSPLIT_STARTED; ++ } + break; + case UE_ISOCHRONOUS: + if (hc->ep_is_in) { +@@ -1918,7 +1962,12 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + break; + case UE_INTERRUPT: + if (fiq_fsm_mask & 0x8) { +- st->fsm = FIQ_NP_SSPLIT_STARTED; ++ if (fiq_fsm_np_tt_contended(hcd, qh)) { ++ st->fsm = FIQ_NP_SSPLIT_PENDING; ++ start_immediate = 0; ++ } else { ++ st->fsm = FIQ_NP_SSPLIT_STARTED; ++ } + } else if (start_immediate) { + st->fsm = FIQ_PER_SSPLIT_STARTED; + } else { + +From 2310d30585b5fa865c133a179fafe5f543194103 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 20 Jun 2017 17:51:47 +0100 +Subject: [PATCH 294/305] bcm2835-cpufreq: Change licence to GPLv2 + +Signed-off-by: Eben Upton +Signed-off-by: Dom Cobley +--- + drivers/cpufreq/bcm2835-cpufreq.c | 36 ++++++++++++++---------------------- + 1 file changed, 14 insertions(+), 22 deletions(-) + +diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c +index 414fbdc10dfbfc6e4bb47870a7af3fd5780f9c9a..99345969b0e4d651fd9033d67de2febb13fc0892 100644 +--- a/drivers/cpufreq/bcm2835-cpufreq.c ++++ b/drivers/cpufreq/bcm2835-cpufreq.c +@@ -1,25 +1,17 @@ +-/***************************************************************************** +-* Copyright 2011 Broadcom Corporation. All rights reserved. +-* +-* Unless you and Broadcom execute a separate written software license +-* agreement governing use of this software, this software is licensed to you +-* under the terms of the GNU General Public License version 2, available at +-* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). +-* +-* Notwithstanding the above, under no circumstances may you combine this +-* software in any way with any other Broadcom software provided under a +-* license other than the GPL, without Broadcom's express prior written +-* consent. +-*****************************************************************************/ +- +-/***************************************************************************** +-* FILENAME: bcm2835-cpufreq.h +-* DESCRIPTION: This driver dynamically manages the CPU Frequency of the ARM +-* processor. Messages are sent to Videocore either setting or requesting the +-* frequency of the ARM in order to match an appropiate frequency to the current +-* usage of the processor. The policy which selects the frequency to use is +-* defined in the kernel .config file, but can be changed during runtime. +-*****************************************************************************/ ++/* ++ * Copyright 2011 Broadcom Corporation. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; version 2 ++ * of the License. ++ * ++ * This driver dynamically manages the CPU Frequency of the ARM ++ * processor. Messages are sent to Videocore either setting or requesting the ++ * frequency of the ARM in order to match an appropiate frequency to the current ++ * usage of the processor. The policy which selects the frequency to use is ++ * defined in the kernel .config file, but can be changed during runtime. ++ */ + + /* ---------- INCLUDES ---------- */ + #include + +From 7889c33408eac5140410e993fde3def6e51709d9 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 21 Jun 2017 09:03:51 -0700 +Subject: [PATCH 295/305] bcm2708: Drop CMA alignment from FKMS mode as well. + +I dropped it from KMS mode in d88274d88ed81de1ade8e18e4c0ed91792ec82ea +and should have done both of them at that time. + +Signed-off-by: Eric Anholt +--- + arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +index 95a595a35cb4fbb707bf4b18161f6a46860aa4ae..36fbf6c8c2e612a6dc5aa02d77cc8173098c16ca 100644 +--- a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts ++++ b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts +@@ -11,35 +11,35 @@ + fragment@0 { + target-path = "/chosen"; + __overlay__ { +- bootargs = "cma=256M@256M"; ++ bootargs = "cma=256M"; + }; + }; + + fragment@1 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=192M@256M"; ++ bootargs = "cma=192M"; + }; + }; + + fragment@2 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=128M@128M"; ++ bootargs = "cma=128M"; + }; + }; + + fragment@3 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=96M@128M"; ++ bootargs = "cma=96M"; + }; + }; + + fragment@4 { + target-path = "/chosen"; + __dormant__ { +- bootargs = "cma=64M@64M"; ++ bootargs = "cma=64M"; + }; + }; + + +From a23b416acd38c5323be774e555ca2d117a6d759c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 21 Jun 2017 17:19:04 +0100 +Subject: [PATCH 296/305] serial: 8250: Fix THRE flag usage for CAP_MINI + +The BCM2835 MINI UART has non-standard THRE semantics. Conventionally +the bit means that the FIFO is empty (although there may still be a +byte in the transmit register), but on 2835 it indicates that the FIFO +is not empty. This causes interrupts after every byte is transmitted, +with the FIFO providing some interrupt latency tolerance. + +A consequence of this difference is that the usual strategy of writing +multiple bytes into the TX FIFO after checking THRE once is unsafe. +In the worst case of 7 bytes in the FIFO, writing 8 bytes loses all +but the first since by then the FIFO is full. + +There is an HFIFO ("Hidden FIFO") bit which is almost what is needed, +but it only adds more bytes while both THRE and TEMT are set, i.e. +when the TX side is completely idle. This is unnecessarily pessimistic. + +Add a new special case, predicated on CAP_MINI, that loops until THRE +is no longer set. With this change, the FIFO fills quickly but +subsequent writes are paced by the transmission rate. + +See: https://github.com/raspberrypi/linux/issues/1855 + +Signed-off-by: Phil Elwell +--- + drivers/tty/serial/8250/8250_port.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 2d7a63f69b90415d6e1b6eb1c10612f4aa9fbed2..d2ecdb80e5f2d6bcb7e4edbb28280853bf1fd440 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -1746,6 +1746,10 @@ void serial8250_tx_chars(struct uart_8250_port *up) + if ((up->capabilities & UART_CAP_HFIFO) && + (serial_in(up, UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY) + break; ++ /* The BCM2835 MINI UART THRE bit is really a not-full bit. */ ++ if ((up->capabilities & UART_CAP_MINI) && ++ !(serial_in(up, UART_LSR) & UART_LSR_THRE)) ++ break; + } while (--count > 0); + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + +From fe0e2484ec702fff8d0e2f5b8c3bb1d8045ccd7e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Jun 2016 16:37:46 +0100 +Subject: [PATCH 297/305] mmc: Apply ERASE_BROKEN quirks correctly + +Signed-off-by: Phil Elwell +--- + drivers/mmc/card/block.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c +index 894c105be9ce7f83147a62c433c787b90a5e7c17..f1aeab19e10a465bffe69d24fc3331c80426e6b8 100644 +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -2584,12 +2584,9 @@ static const struct mmc_fixup blk_fixups[] = + * On some Kingston SD cards, multiple erases of less than 64 + * sectors can cause corruption. + */ +- MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), +- MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), +- MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk_mmc, +- MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), + + END_FIXUP + }; + +From 7008aa63f65db75fc7057e6da19527e8004ccd0c Mon Sep 17 00:00:00 2001 +From: Steve Conner +Date: Thu, 29 Jun 2017 15:56:19 +0100 +Subject: [PATCH 298/305] New i2c-rtc-gpio device overlay (#2092) + +Created new i2c-rtc-gpio device overlay by combining i2c-rtc and i2c-gpio. Tested with PCF2127 on CM3. +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 41 +++++ + .../arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts | 183 +++++++++++++++++++++ + 3 files changed, 225 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index eca81982c0f19988abd05165fc62a80d26f539cb..8a3131f5a4bc90d4a597b416416953e8e49d41ec 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -42,6 +42,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + i2c-mux.dtbo \ + i2c-pwm-pca9685a.dtbo \ + i2c-rtc.dtbo \ ++ i2c-rtc-gpio.dtbo \ + i2c-sensor.dtbo \ + i2c0-bcm2708.dtbo \ + i2c1-bcm2708.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 19df6883be4277240283d5f63f27e34a22a2eec5..a69e3a0d8dce1633598dd3cd8e00cad9509eee03 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -662,6 +662,47 @@ Params: abx80x Select one of the ABx80x family: + source + + ++Name: i2c-rtc-gpio ++Info: Adds support for a number of I2C Real Time Clock devices ++ using the software i2c controller ++Load: dtoverlay=i2c-rtc-gpio,= ++Params: abx80x Select one of the ABx80x family: ++ AB0801, AB0803, AB0804, AB0805, ++ AB1801, AB1803, AB1804, AB1805 ++ ++ ds1307 Select the DS1307 device ++ ++ ds1339 Select the DS1339 device ++ ++ ds3231 Select the DS3231 device ++ ++ mcp7940x Select the MCP7940x device ++ ++ mcp7941x Select the MCP7941x device ++ ++ pcf2127 Select the PCF2127 device ++ ++ pcf8523 Select the PCF8523 device ++ ++ pcf8563 Select the PCF8563 device ++ ++ trickle-diode-type Diode type for trickle charge - "standard" or ++ "schottky" (ABx80x only) ++ ++ trickle-resistor-ohms Resistor value for trickle charge (DS1339, ++ ABx80x) ++ ++ wakeup-source Specify that the RTC can be used as a wakeup ++ source ++ ++ i2c_gpio_sda GPIO used for I2C data (default "23") ++ ++ i2c_gpio_scl GPIO used for I2C clock (default "24") ++ ++ i2c_gpio_delay_us Clock delay in microseconds ++ (default "2" = ~100kHz) ++ ++ + Name: i2c-sensor + Info: Adds support for a number of I2C barometric pressure and temperature + sensors on i2c_arm +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..8415e6081428fba9a47682964174fc023cfd2b0c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts +@@ -0,0 +1,183 @@ ++// Definitions for several I2C based Real Time Clocks ++// Available through i2c-gpio ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ i2c_gpio: i2c-gpio-rtc@0 { ++ compatible = "i2c-gpio"; ++ gpios = <&gpio 23 0 /* sda */ ++ &gpio 24 0 /* scl */ ++ >; ++ i2c-gpio,delay-us = <2>; /* ~100 kHz */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ abx80x: abx80x@69 { ++ compatible = "abracon,abx80x"; ++ reg = <0x69>; ++ abracon,tc-diode = "standard"; ++ abracon,tc-resistor = <0>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ds1307: ds1307@68 { ++ compatible = "maxim,ds1307"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ds1339: ds1339@68 { ++ compatible = "dallas,ds1339"; ++ trickle-resistor-ohms = <0>; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ ds3231: ds3231@68 { ++ compatible = "maxim,ds3231"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@5 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ mcp7940x: mcp7940x@6f { ++ compatible = "microchip,mcp7940x"; ++ reg = <0x6f>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@6 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ mcp7941x: mcp7941x@6f { ++ compatible = "microchip,mcp7941x"; ++ reg = <0x6f>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@7 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcf2127: pcf2127@51 { ++ compatible = "nxp,pcf2127"; ++ reg = <0x51>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@8 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcf8523: pcf8523@68 { ++ compatible = "nxp,pcf8523"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@9 { ++ target = <&i2c_gpio>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcf8563: pcf8563@51 { ++ compatible = "nxp,pcf8563"; ++ reg = <0x51>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ abx80x = <0>,"+1"; ++ ds1307 = <0>,"+2"; ++ ds1339 = <0>,"+3"; ++ ds3231 = <0>,"+4"; ++ mcp7940x = <0>,"+5"; ++ mcp7941x = <0>,"+6"; ++ pcf2127 = <0>,"+7"; ++ pcf8523 = <0>,"+8"; ++ pcf8563 = <0>,"+9"; ++ trickle-diode-type = <&abx80x>,"abracon,tc-diode"; ++ trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0", ++ <&abx80x>,"abracon,tc-resistor"; ++ wakeup-source = <&ds1339>,"wakeup-source?", ++ <&ds3231>,"wakeup-source?", ++ <&mcp7940x>,"wakeup-source?", ++ <&mcp7941x>,"wakeup-source?"; ++ i2c_gpio_sda = <&i2c_gpio>,"gpios:4"; ++ i2c_gpio_scl = <&i2c_gpio>,"gpios:16"; ++ i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0"; ++ }; ++}; + +From e1a4ad113967eacc936c19fcc79335b8df174cc3 Mon Sep 17 00:00:00 2001 +From: Allo +Date: Mon, 3 Jul 2017 15:45:20 +0530 +Subject: [PATCH 299/305] PianoPlus: Dual Mono & Dual Stereo features added + (#2069) + +--- + sound/soc/bcm/allo-piano-dac-plus.c | 160 +++++++++++++++++++++++++++++++----- + 1 file changed, 141 insertions(+), 19 deletions(-) + +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +index 56e43f98846b41e487b3089813f7edc3c08517eb..d4e99e3c6a383d92fb0cf9e8c1cd1e7657358d49 100644 +--- a/sound/soc/bcm/allo-piano-dac-plus.c ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -36,6 +36,7 @@ struct dsp_code { + + struct glb_pool { + struct mutex lock; ++ unsigned int dual_mode; + unsigned int set_lowpass; + unsigned int set_mode; + unsigned int set_rate; +@@ -47,8 +48,8 @@ bool glb_mclk; + + static struct gpio_desc *mute_gpio[2]; + +- + static const char * const allo_piano_mode_texts[] = { ++ "None", + "2.0", + "2.1", + "2.2", +@@ -57,6 +58,15 @@ static const char * const allo_piano_mode_texts[] = { + static const SOC_ENUM_SINGLE_DECL(allo_piano_mode_enum, + 0, 0, allo_piano_mode_texts); + ++static const char * const allo_piano_dual_mode_texts[] = { ++ "None", ++ "Dual-Mono", ++ "Dual-Stereo", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_dual_mode_enum, ++ 0, 0, allo_piano_dual_mode_texts); ++ + static const char * const allo_piano_dsp_low_pass_texts[] = { + "60", + "70", +@@ -82,10 +92,10 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + unsigned int mode, unsigned int rate, unsigned int lowpass) + { + const struct firmware *fw; +- char firmware_name[60]; +- int ret = 0, dac = 0; + struct snd_soc_card *card = rtd->card; + struct glb_pool *glb_ptr = card->drvdata; ++ char firmware_name[60]; ++ int ret = 0, dac = 0; + + if (rate <= 46000) + rate = 44100; +@@ -100,26 +110,35 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + else + rate = 192000; + +- if ((lowpass > 14) || (lowpass < 0)) +- lowpass = 3; +- if ((mode > 2) || (mode < 0)) +- mode = 0; ++ if (lowpass > 14) ++ glb_ptr->set_lowpass = lowpass = 3; ++ ++ if (mode > 3) ++ glb_ptr->set_mode = mode = 0; ++ ++ if (mode > 0) ++ glb_ptr->dual_mode = 0; + + /* same configuration loaded */ + if ((rate == glb_ptr->set_rate) && (lowpass == glb_ptr->set_lowpass) + && (mode == glb_ptr->set_mode)) + return 0; + +- if (mode == 0) { /* 2.0 */ +- snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x11); ++ switch (mode) { ++ case 0: /* None */ ++ return 1; ++ ++ case 1: /* 2.0 */ ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x11); + glb_ptr->set_rate = rate; + glb_ptr->set_mode = mode; + glb_ptr->set_lowpass = lowpass; + return 1; +- } else { +- snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x00); ++ ++ default: ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x00); + } + + for (dac = 0; dac < rtd->num_codecs; dac++) { +@@ -128,13 +147,13 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + int i = 1; + + if (dac == 0) { /* high */ +- sprintf(firmware_name, ++ snprintf(firmware_name, sizeof(firmware_name), + "allo/piano/2.2/allo-piano-dsp-%d-%d-%d.bin", + rate, ((lowpass * 10) + 60), dac); + } else { /* low */ +- sprintf(firmware_name, ++ snprintf(firmware_name, sizeof(firmware_name), + "allo/piano/2.%d/allo-piano-dsp-%d-%d-%d.bin", +- mode, rate, ((lowpass * 10) + 60), dac); ++ (mode - 1), rate, ((lowpass * 10) + 60), dac); + } + + dev_info(codec->dev, "Dsp Firmware File Name: %s\n", +@@ -199,6 +218,80 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + return ret; + } + ++static int snd_allo_piano_dual_mode_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->dual_mode; ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dual_mode_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_card *snd_card_ptr = card->snd_card; ++ struct snd_kcontrol *kctl; ++ struct soc_mixer_control *mc; ++ unsigned int left_val = 0; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ++ if (ucontrol->value.integer.value[0] > 0) { ++ glb_ptr->dual_mode = ucontrol->value.integer.value[0]; ++ glb_ptr->set_mode = 0; ++ } else if (ucontrol->value.integer.value[0] <= 0) { ++ if (glb_ptr->set_mode <= 0) { ++ glb_ptr->dual_mode = 1; ++ glb_ptr->set_mode = 0; ++ } ++ } else { ++ glb_ptr->dual_mode = 0; ++ return 0; ++ } ++ ++ if (glb_ptr->dual_mode == 1) { ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x01); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x10); ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_3, 0xff); ++ ++ list_for_each_entry(kctl, &snd_card_ptr->controls, list) { ++ if (!strncmp(kctl->id.name, "Digital Playback Volume", ++ sizeof(kctl->id.name))) { ++ mc = (struct soc_mixer_control *) ++ kctl->private_value; ++ mc->rreg = mc->reg; ++ break; ++ } ++ } ++ } else { ++ left_val = snd_soc_read(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ list_for_each_entry(kctl, &snd_card_ptr->controls, list) { ++ if (!strncmp(kctl->id.name, "Digital Playback Volume", ++ sizeof(kctl->id.name))) { ++ mc = (struct soc_mixer_control *) ++ kctl->private_value; ++ mc->rreg = PCM512x_DIGITAL_VOLUME_3; ++ break; ++ } ++ } ++ ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_3, left_val); ++ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x00); ++ } ++ ++ return 0; ++} ++ + static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +@@ -215,8 +308,30 @@ static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, + struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); + struct snd_soc_pcm_runtime *rtd; + struct glb_pool *glb_ptr = card->drvdata; ++ struct snd_card *snd_card_ptr = card->snd_card; ++ struct snd_kcontrol *kctl; ++ struct soc_mixer_control *mc; ++ unsigned int left_val = 0; + + rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ++ if ((glb_ptr->dual_mode == 1) && ++ (ucontrol->value.integer.value[0] > 0)) { ++ left_val = snd_soc_read(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ list_for_each_entry(kctl, &snd_card_ptr->controls, list) { ++ if (!strncmp(kctl->id.name, "Digital Playback Volume", ++ sizeof(kctl->id.name))) { ++ mc = (struct soc_mixer_control *) ++ kctl->private_value; ++ mc->rreg = PCM512x_DIGITAL_VOLUME_3; ++ break; ++ } ++ } ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_3, left_val); ++ } ++ + return(snd_allo_piano_dsp_program(rtd, + ucontrol->value.integer.value[0], + glb_ptr->set_rate, glb_ptr->set_lowpass)); +@@ -344,6 +459,11 @@ static const struct snd_kcontrol_new allo_piano_controls[] = { + snd_allo_piano_mode_get, + snd_allo_piano_mode_put), + ++ SOC_ENUM_EXT("Dual Mode Route", ++ allo_piano_dual_mode_enum, ++ snd_allo_piano_dual_mode_get, ++ snd_allo_piano_dual_mode_put), ++ + SOC_ENUM_EXT("Lowpass Route", allo_piano_enum, + snd_allo_piano_lowpass_get, + snd_allo_piano_lowpass_put), +@@ -472,7 +592,7 @@ static int snd_allo_piano_dac_hw_params( + PCM512x_RATE_DET_4); + if (val < 0) { + dev_err(rtd->codec_dais[dac]->codec->dev, +- "Failed to read register PCM512x_RATE_DET_4\n"); ++ "Failed to read register PCM512x_RATE_DET_4\n"); + return val; + } + +@@ -482,7 +602,7 @@ static int snd_allo_piano_dac_hw_params( + PCM512x_SREF_BCK); + + dev_info(rtd->codec_dais[dac]->codec->dev, +- "Setting BCLK as input clock & Enable PLL\n"); ++ "Setting BCLK as input clock & Enable PLL\n"); + } else { + snd_soc_write(rtd->codec_dais[dac]->codec, + PCM512x_PLL_EN, +@@ -493,7 +613,7 @@ static int snd_allo_piano_dac_hw_params( + PCM512x_SREF_SCK); + + dev_info(rtd->codec_dais[dac]->codec->dev, +- "Setting SCLK as input clock & disabled PLL\n"); ++ "Setting SCLK as input clock & disabled PLL\n"); + } + } + +@@ -504,6 +624,7 @@ static int snd_allo_piano_dac_hw_params( + dev_warn(card->dev, "Failed to set volume limit: %d\n", + ret); + } ++ + ret = snd_allo_piano_dsp_program(rtd, glb_ptr->set_mode, rate, + glb_ptr->set_lowpass); + if (ret < 0) +@@ -521,6 +642,7 @@ static int snd_allo_piano_dac_prepare( + struct snd_soc_card *card = rtd->card; + + snd_allo_piano_gpio_unmute(card); ++ + return 0; + } + + +From 7c6b5d91f231a1543ac00bfe452d33b73a1f1734 Mon Sep 17 00:00:00 2001 +From: Marta Lofstedt +Date: Mon, 5 Dec 2016 14:04:08 +0200 +Subject: [PATCH 300/305] drm: allow changing DPMS mode + +The drm_atomic_helper_connector_dpms +will set the connector back the old DPMS state +before returning. This makes it impossible to change +DPMS state of the connector. + +Fixes: 0853695c3ba46f97dfc0b5885f7b7e640ca212dd +v2: edit of commit message +Cc: Chris Wilson +Cc: Daniel Vetter +Cc: Eric Engestrom +Cc: Sean Paul +Cc: dri-devel@lists.freedesktop.org +Cc: +Signed-off-by: Marta Lofstedt +Signed-off-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/20161205120408.13056-1-marta.lofstedt@intel.com +(cherry picked from commit 8f5040e421ca4bbd8cd5216dec509da188eb74bc) +--- + drivers/gpu/drm/drm_atomic_helper.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c +index 50acd799babe1824e47e4bba6b9f03875429c17a..06572ffdb4082fe290b51bbd4c54b84cd11f73d3 100644 +--- a/drivers/gpu/drm/drm_atomic_helper.c ++++ b/drivers/gpu/drm/drm_atomic_helper.c +@@ -2932,7 +2932,8 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector, + if (ret == -EDEADLK) + goto backoff; + +- connector->dpms = old_mode; ++ if (ret != 0) ++ connector->dpms = old_mode; + drm_atomic_state_free(state); + + return ret; + +From 1752286157f8017a5a21163c1206df43362052bb Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 6 Jul 2017 11:45:48 -0700 +Subject: [PATCH 301/305] drm/vc4: Add support for setting DPMS in firmwarekms. + +This ensures that the screen goes blank during DPMS (screensaver), +including the cursor. Planes don't necessarily get disabled during +CRTC disable, so we need to be careful to not leave them on or turn +them back on early. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 40 +++++++++++++++++++++++++++++++--- + 1 file changed, 37 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index 40a0cdc179ceabafb387724e1b835895fa3e2ca2..c85cae7d2f5f88cd41d3cf41dafa1449e3416c01 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -38,6 +38,8 @@ struct vc4_crtc { + struct drm_crtc base; + struct drm_encoder *encoder; + struct drm_connector *connector; ++ struct drm_plane *primary; ++ struct drm_plane *cursor; + void __iomem *regs; + + struct drm_pending_vblank_event *event; +@@ -126,8 +128,6 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + 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; +@@ -175,6 +175,12 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + vc4_plane->fbinfo_bus_addr); + WARN_ON_ONCE(fbinfo->pitch != fb->pitches[0]); + WARN_ON_ONCE(fbinfo->base != bo->paddr + fb->offsets[0]); ++ ++ /* If the CRTC is on (or going to be on) and we're enabled, ++ * then unblank. Otherwise, stay blank until CRTC enable. ++ */ ++ if (state->crtc->state->active) ++ vc4_plane_set_primary_blank(plane, false); + } + + static void vc4_primary_plane_atomic_disable(struct drm_plane *plane, +@@ -192,7 +198,12 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, + 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_state[] = { ++ state->crtc->state->active, ++ state->crtc_x, ++ state->crtc_y, ++ 0 ++ }; + u32 packet_info[] = { state->crtc_w, state->crtc_h, + 0, /* unused */ + bo->paddr + fb->offsets[0], +@@ -336,10 +347,30 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + + static void vc4_crtc_disable(struct drm_crtc *crtc) + { ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ ++ /* Always turn the planes off on CRTC disable. In DRM, planes ++ * are enabled/disabled through the update/disable hooks ++ * above, and the CRTC enable/disable independently controls ++ * whether anything scans out at all, but the firmware doesn't ++ * give us a CRTC-level control for that. ++ */ ++ vc4_cursor_plane_atomic_disable(vc4_crtc->cursor, ++ vc4_crtc->cursor->state); ++ vc4_plane_set_primary_blank(vc4_crtc->primary, true); + } + + static void vc4_crtc_enable(struct drm_crtc *crtc) + { ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ ++ /* Unblank the planes (if they're supposed to be displayed). */ ++ if (vc4_crtc->primary->state->fb) ++ vc4_plane_set_primary_blank(vc4_crtc->primary, false); ++ if (vc4_crtc->cursor->state->fb) { ++ vc4_cursor_plane_atomic_update(vc4_crtc->cursor, ++ vc4_crtc->cursor->state); ++ } + } + + static int vc4_crtc_atomic_check(struct drm_crtc *crtc, +@@ -635,6 +666,9 @@ static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) + cursor_plane->crtc = crtc; + vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; + ++ vc4_crtc->primary = primary_plane; ++ vc4_crtc->cursor = cursor_plane; ++ + vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL); + if (!vc4_encoder) + return -ENOMEM; + +From 2f978a18335396172a43ab837f391fed419ef446 Mon Sep 17 00:00:00 2001 +From: Matthijs Kooijman +Date: Sun, 9 Jul 2017 15:15:22 +0200 +Subject: [PATCH 302/305] overlays: Add gpio-shutdown overlay (#2103) + +This overlay facilitates the addition of a powerbutton by converting +GPIO edges into KEY_POWER keypresses, which can be handled by +systemd-logind to shut down the system. + +Signed-off-by: Matthijs Kooijman +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 32 +++++++++ + .../boot/dts/overlays/gpio-shutdown-overlay.dts | 80 ++++++++++++++++++++++ + 3 files changed, 113 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 8a3131f5a4bc90d4a597b416416953e8e49d41ec..c50b1dfa9d7334df47ce087f9d2a7a816afa05ba 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -30,6 +30,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + googlevoicehat-soundcard.dtbo \ + gpio-ir.dtbo \ + gpio-poweroff.dtbo \ ++ gpio-shutdown.dtbo \ + hifiberry-amp.dtbo \ + hifiberry-dac.dtbo \ + hifiberry-dacplus.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index a69e3a0d8dce1633598dd3cd8e00cad9509eee03..e6d777a601c91d192bc5713f9a73e1a2d4d708ef 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -508,6 +508,38 @@ Params: gpiopin GPIO for signalling (default 26) + will also cause the pin to go low. + + ++Name: gpio-shutdown ++Info: Initiates a shutdown when GPIO pin changes. The given GPIO pin ++ is configured as an input key that generates KEY_POWER events. ++ This event is handled by systemd-logind by initiating a ++ shutdown. Systemd versions older than 225 need an udev rule ++ enable listening to the input device: ++ ++ ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \ ++ SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \ ++ ATTRS{keys}=="116", TAG+="power-switch" ++ ++ This overlay only handles shutdown. After shutdown, the system ++ can be powered up again by driving GPIO3 low. The default ++ configuration uses GPIO3 with a pullup, so if you connect a ++ button between GPIO3 and GND (pin 5 and 6 on the 40-pin header), ++ you get a shutdown and power-up button. ++Load: dtoverlay=gpio-shutdown,= ++Params: gpio_pin GPIO pin to trigger on (default 3) ++ ++ active_low When this is 1 (active low), a falling ++ edge generates a key down event and a ++ rising edge generates a key up event. ++ When this is 0 (active high), this is ++ reversed. The default is 1 (active low). ++ ++ gpio_pull Desired pull-up/down state (off, down, up) ++ Default is "up". ++ ++ Note that the default pin (GPIO3) has an ++ external pullup. ++ ++ + Name: hifiberry-amp + Info: Configures the HifiBerry Amp and Amp+ audio cards + Load: dtoverlay=hifiberry-amp +diff --git a/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..863fb395c8539734b658682b900e1fbd96c9443e +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts +@@ -0,0 +1,80 @@ ++// Definitions for gpio-poweroff module ++/dts-v1/; ++/plugin/; ++ ++// This overlay sets up an input device that generates KEY_POWER events ++// when a given GPIO pin changes. It defaults to using GPIO3, which can ++// also be used to wake up (start) the Rpi again after shutdown. Since ++// wakeup is active-low, this defaults to active-low with a pullup ++// enabled, but all of this can be changed using overlay parameters (but ++// note that GPIO3 has an external pullup on at least some boards). ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ // Configure the gpio pin controller ++ target = <&gpio>; ++ __overlay__ { ++ // Define a pinctrl state, that sets up the gpio ++ // as an input with a pullup enabled. This does ++ // not take effect by itself, only when referenced ++ // by a "pinctrl client", as is done below. See: ++ // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt ++ // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt ++ pin_state: shutdown_button_pins { ++ brcm,pins = <3>; // gpio number ++ brcm,function = <0>; // 0 = input, 1 = output ++ brcm,pull = <2>; // 0 = none, 1 = pull down, 2 = pull up ++ }; ++ }; ++ }; ++ fragment@1 { ++ // Add a new device to the /soc devicetree node ++ target-path = "/soc"; ++ __overlay__ { ++ shutdown_button { ++ // Let the gpio-keys driver handle this device. See: ++ // https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt ++ compatible = "gpio-keys"; ++ ++ // Declare a single pinctrl state (referencing the one declared above) and name it ++ // default, so it is activated automatically. ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pin_state>; ++ ++ // Enable this device ++ status = "okay"; ++ ++ // Define a single key, called "shutdown" that monitors the gpio and sends KEY_POWER ++ // (keycode 116, see ++ // https://github.com/torvalds/linux/blob/v4.12/include/uapi/linux/input-event-codes.h#L190) ++ button: shutdown { ++ label = "shutdown"; ++ linux,code = <116>; // KEY_POWER ++ gpios = <&gpio 3 1>; ++ }; ++ }; ++ }; ++ }; ++ ++ // This defines parameters that can be specified when loading ++ // the overlay. Each foo = line specifies one parameter, named ++ // foo. The rest of the specification gives properties where the ++ // parameter value is inserted into (changing the values above ++ // or adding new ones). ++ __overrides__ { ++ // Allow overriding the GPIO number. ++ gpio_pin = <&button>,"gpios:4", ++ <&pin_state>,"brcm,pins:0"; ++ ++ // Allow changing the internal pullup/down state. 0 = none, 1 = pulldown, 2 = pullup ++ // Note that GPIO3 and GPIO2 are the I2c pins and have an external pullup (at least ++ // on some boards). ++ gpio_pull = <&pin_state>,"brcm,pull:0"; ++ ++ // Allow setting the active_low flag. 0 = active high, 1 = active low ++ active_low = <&button>,"gpios:8"; ++ }; ++ ++}; + +From 0cc897e19bb87825805834fbff13fe58392d3e13 Mon Sep 17 00:00:00 2001 +From: Matthias Reichl +Date: Mon, 10 Jul 2017 11:05:17 +0200 +Subject: [PATCH 303/305] config: enable generic S/PDIF codec drivers (#2104) + +These drivers can be used as dummy ADC/DAC drivers for +attaching general codecs that don't need to be configured. + +This option will build 2 additional drivers, spdif_receiver +and spdif_transmitter. + +Since these drivers have DT bindings they are handy for quick +testing of I2S peripherals with simple-audio-card. + +eg: + +fragment@0 { + target-path = "/"; + __overlay__ { + dummy_receiver: spdif-receiver { + #address-cells = <0>; + #size-cells = <0>; + #sound-dai-cells = <0>; + compatible = "linux,spdif-dir"; + status = "okay"; + }; + }; +}; + +Signed-off-by: Matthias Reichl +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 0fbabb1c0d56943871c3ad2b700f4c81de1c81ae..51f83ba0cf0f7fd3a44501ba521d4453e83ce46f 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -909,6 +909,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_SPDIF=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 83cfb1e8738bdb7ef3ee1502b9a64d654de80c1b..646d69bea48befde89bec7c85895d41cd644d226 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -903,6 +903,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_SPDIF=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + +From 86f8b06fb2dffeee207f12048aa801c9f66e3dc5 Mon Sep 17 00:00:00 2001 +From: Krzysztof Opasiak +Date: Tue, 24 Jan 2017 03:27:24 +0100 +Subject: [PATCH 304/305] usb: gadget: f_hid: fix: Move IN request allocation + to set_alt() + +Since commit: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") +we cannot allocate any requests in bind() as we check if we should +align request buffer based on endpoint descriptor which is assigned +in set_alt(). + +Allocating request in bind() function causes a NULL pointer +dereference. + +This commit moves allocation of IN request from bind() to set_alt() +to prevent this issue. + +Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") +Cc: stable@vger.kernel.org +Tested-by: David Lechner +Signed-off-by: Krzysztof Opasiak +Signed-off-by: Felipe Balbi +--- + drivers/usb/gadget/function/f_hid.c | 91 +++++++++++++++++++++++++++---------- + 1 file changed, 68 insertions(+), 23 deletions(-) + +diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c +index b0f71957d00bded60c8f8da92e2cc15b376cce00..5815120c04021695d2453dece631bdbd43c51885 100644 +--- a/drivers/usb/gadget/function/f_hid.c ++++ b/drivers/usb/gadget/function/f_hid.c +@@ -284,6 +284,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + size_t count, loff_t *offp) + { + struct f_hidg *hidg = file->private_data; ++ struct usb_request *req; + unsigned long flags; + ssize_t status = -ENOMEM; + +@@ -293,7 +294,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + spin_lock_irqsave(&hidg->write_spinlock, flags); + + #define WRITE_COND (!hidg->write_pending) +- ++try_again: + /* write queue */ + while (!WRITE_COND) { + spin_unlock_irqrestore(&hidg->write_spinlock, flags); +@@ -308,6 +309,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + } + + hidg->write_pending = 1; ++ req = hidg->req; + count = min_t(unsigned, count, hidg->report_length); + + spin_unlock_irqrestore(&hidg->write_spinlock, flags); +@@ -320,24 +322,38 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer, + goto release_write_pending; + } + +- hidg->req->status = 0; +- hidg->req->zero = 0; +- hidg->req->length = count; +- hidg->req->complete = f_hidg_req_complete; +- hidg->req->context = hidg; ++ spin_lock_irqsave(&hidg->write_spinlock, flags); ++ ++ /* we our function has been disabled by host */ ++ if (!hidg->req) { ++ free_ep_req(hidg->in_ep, hidg->req); ++ /* ++ * TODO ++ * Should we fail with error here? ++ */ ++ goto try_again; ++ } ++ ++ req->status = 0; ++ req->zero = 0; ++ req->length = count; ++ req->complete = f_hidg_req_complete; ++ req->context = hidg; + + status = usb_ep_queue(hidg->in_ep, hidg->req, GFP_ATOMIC); + if (status < 0) { + ERROR(hidg->func.config->cdev, + "usb_ep_queue error on int endpoint %zd\n", status); +- goto release_write_pending; ++ goto release_write_pending_unlocked; + } else { + status = count; + } ++ spin_unlock_irqrestore(&hidg->write_spinlock, flags); + + return status; + release_write_pending: + spin_lock_irqsave(&hidg->write_spinlock, flags); ++release_write_pending_unlocked: + hidg->write_pending = 0; + spin_unlock_irqrestore(&hidg->write_spinlock, flags); + +@@ -541,12 +557,23 @@ static void hidg_disable(struct usb_function *f) + kfree(list); + } + spin_unlock_irqrestore(&hidg->read_spinlock, flags); ++ ++ spin_lock_irqsave(&hidg->write_spinlock, flags); ++ if (!hidg->write_pending) { ++ free_ep_req(hidg->in_ep, hidg->req); ++ hidg->write_pending = 1; ++ } ++ ++ hidg->req = NULL; ++ spin_unlock_irqrestore(&hidg->write_spinlock, flags); + } + + static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + { + struct usb_composite_dev *cdev = f->config->cdev; + struct f_hidg *hidg = func_to_hidg(f); ++ struct usb_request *req_in = NULL; ++ unsigned long flags; + int i, status = 0; + + VDBG(cdev, "hidg_set_alt intf:%d alt:%d\n", intf, alt); +@@ -567,6 +594,12 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + goto fail; + } + hidg->in_ep->driver_data = hidg; ++ ++ req_in = hidg_alloc_ep_req(hidg->in_ep, hidg->report_length); ++ if (!req_in) { ++ status = -ENOMEM; ++ goto disable_ep_in; ++ } + } + + +@@ -578,12 +611,12 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + hidg->out_ep); + if (status) { + ERROR(cdev, "config_ep_by_speed FAILED!\n"); +- goto fail; ++ goto free_req_in; + } + status = usb_ep_enable(hidg->out_ep); + if (status < 0) { +- ERROR(cdev, "Enable IN endpoint FAILED!\n"); +- goto fail; ++ ERROR(cdev, "Enable OUT endpoint FAILED!\n"); ++ goto free_req_in; + } + hidg->out_ep->driver_data = hidg; + +@@ -599,17 +632,37 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) + req->context = hidg; + status = usb_ep_queue(hidg->out_ep, req, + GFP_ATOMIC); +- if (status) ++ if (status) { + ERROR(cdev, "%s queue req --> %d\n", + hidg->out_ep->name, status); ++ free_ep_req(hidg->out_ep, req); ++ } + } else { +- usb_ep_disable(hidg->out_ep); + status = -ENOMEM; +- goto fail; ++ goto disable_out_ep; + } + } + } + ++ if (hidg->in_ep != NULL) { ++ spin_lock_irqsave(&hidg->write_spinlock, flags); ++ hidg->req = req_in; ++ hidg->write_pending = 0; ++ spin_unlock_irqrestore(&hidg->write_spinlock, flags); ++ ++ wake_up(&hidg->write_queue); ++ } ++ return 0; ++disable_out_ep: ++ usb_ep_disable(hidg->out_ep); ++free_req_in: ++ if (req_in) ++ free_ep_req(hidg->in_ep, req_in); ++ ++disable_ep_in: ++ if (hidg->in_ep) ++ usb_ep_disable(hidg->in_ep); ++ + fail: + return status; + } +@@ -658,12 +711,6 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) + goto fail; + hidg->out_ep = ep; + +- /* preallocate request and buffer */ +- status = -ENOMEM; +- hidg->req = alloc_ep_req(hidg->in_ep, hidg->report_length); +- if (!hidg->req) +- goto fail; +- + /* set descriptor dynamic values */ + hidg_interface_desc.bInterfaceSubClass = hidg->bInterfaceSubClass; + hidg_interface_desc.bInterfaceProtocol = hidg->bInterfaceProtocol; +@@ -690,6 +737,8 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f) + goto fail; + + spin_lock_init(&hidg->write_spinlock); ++ hidg->write_pending = 1; ++ hidg->req = NULL; + spin_lock_init(&hidg->read_spinlock); + init_waitqueue_head(&hidg->write_queue); + init_waitqueue_head(&hidg->read_queue); +@@ -954,10 +1003,6 @@ static void hidg_unbind(struct usb_configuration *c, struct usb_function *f) + device_destroy(hidg_class, MKDEV(major, hidg->minor)); + cdev_del(&hidg->cdev); + +- /* disable/free request and end point */ +- usb_ep_disable(hidg->in_ep); +- free_ep_req(hidg->in_ep, hidg->req); +- + usb_free_all_descriptors(f); + } + + +From 5df301bee659e92133e86c68b5a0a89103836c12 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 12 Jul 2017 17:34:59 +0100 +Subject: [PATCH 305/305] fixups from rpi-4.9.y + +--- + drivers/hv/channel.c | 5 ----- + drivers/i2c/busses/i2c-bcm2835.c | 4 +++- + 2 files changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c +index 9aff4f6f5423a3b03fa834d4f69d4bb5cbc07a07..1606e7f08f4b36750be747feb5d0e9f36b3e6dd0 100644 +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -506,11 +506,6 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) + + wait_for_completion(&info->waitevent); + +- if (channel->rescind) { +- ret = -ENODEV; +- goto post_msg_err; +- } +- + post_msg_err: + /* + * If the channel has been rescinded; +diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c +index 8642f580ce41803bd22c76a0fa80d083d0747be1..47167f403cc8329bd811b47c7011c299b8ecafee 100644 +--- a/drivers/i2c/busses/i2c-bcm2835.c ++++ b/drivers/i2c/busses/i2c-bcm2835.c +@@ -279,7 +279,9 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data) + } + + if (val & BCM2835_I2C_S_DONE) { +- if (i2c_dev->curr_msg->flags & I2C_M_RD) { ++ if (!i2c_dev->curr_msg) { ++ dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n"); ++ } else if (i2c_dev->curr_msg->flags & I2C_M_RD) { + bcm2835_drain_rxfifo(i2c_dev); + val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); + }