diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index c87244fc95..d6377736e5 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 57f6047cdbd633f660b9a859b903503709cc821e Mon Sep 17 00:00:00 2001 +From 0e8bd84a8406e37307c00a246c5a0f62aac6b8d3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 001/131] Main bcm2708/bcm2709 linux port +Subject: [PATCH 001/149] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From eef200f75c4a6f6701f1693f8f59ab2c83d1abcd Mon Sep 17 00:00:00 2001 +From 347ffd7de4bb0ccd64731fb76814dd9e626bf1c5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 002/131] Add bcm2708_gpio driver +Subject: [PATCH 002/149] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7635,10 +7635,10 @@ index 0000000..fb69624 + +#endif -From 6f5003498da677a660cbdfaf9be78d3c0aff2e4c Mon Sep 17 00:00:00 2001 +From eb3917f2c39b485511607da826cd9dbba16751b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 19:11:03 +0200 -Subject: [PATCH 003/131] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 003/149] mailbox: bcm2708: Add bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -8269,10 +8269,10 @@ index 0000000..cc284ed + +#endif -From 7c8a47937b598fa8dad4cd50753164b5ee44f8c1 Mon Sep 17 00:00:00 2001 +From dac4f2f5791de43cb28c829c03b74b03187b7535 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 004/131] Add dwc_otg driver +Subject: [PATCH 004/149] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -9180,10 +9180,10 @@ index 358ca8d..abaac7c 100644 return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index 3b71516..8324c14 100644 +index 1e9a8c9..7e9f79f 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -4922,7 +4922,7 @@ static void port_event(struct usb_hub *hub, int port1) +@@ -4906,7 +4906,7 @@ static void port_event(struct usb_hub *hub, int port1) if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; @@ -69546,10 +69546,10 @@ index 0000000..cdc9963 +test_main(); +0; -From 70cf7eac2e13367cb8939741ee140c6bbac32f62 Mon Sep 17 00:00:00 2001 +From cb7293f71c4de308f8d2f1dda81889fa1ccc5f70 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 005/131] bcm2708 watchdog driver +Subject: [PATCH 005/149] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -69986,10 +69986,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 6655b0b613cde9e4eb6aacaf43d04a388d8cd6c6 Mon Sep 17 00:00:00 2001 +From 3f93f22131290ce805bd9fe0a2c23fc23e9d0d02 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 006/131] bcm2708 framebuffer driver +Subject: [PATCH 006/149] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73428,10 +73428,10 @@ index 3c14e43..7626beb6a 100644 +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 0f8c3ed7803f3a871df49398b678c364aa4929c2 Mon Sep 17 00:00:00 2001 +From d7b8efef115448b4899c4d3327cbdfed06144d29 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 007/131] dmaengine: Add support for BCM2708 +Subject: [PATCH 007/149] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75199,10 +75199,10 @@ index 0000000..2310e34 + +#endif /* _PLAT_BCM2708_DMA_H */ -From 0464f674cf3e441b8651c4a5ea0131fa24a3adc4 Mon Sep 17 00:00:00 2001 +From c5a2f57f382bb863ec39be702d5c7dd1abf43a1e Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 008/131] MMC: added alternative MMC driver +Subject: [PATCH 008/149] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -77018,10 +77018,10 @@ index 0000000..b7c4883 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 7bf3e966797438781e11dbc233e17bbe4746bd5b Mon Sep 17 00:00:00 2001 +From 42f6bf501dfd96a293a001811c66f81a599a7c0a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 009/131] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 009/149] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -78791,10 +78791,10 @@ index 0000000..eef8a24 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 2bb9c01de4c90a8b7a9b52be95f504177abeaf45 Mon Sep 17 00:00:00 2001 +From 4e1d2a7a36c3a6a50b8e3e180840f5de3c59dab9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 010/131] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 010/149] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix @@ -80119,10 +80119,10 @@ index 0000000..5325832 + +#endif /* VC_CMA_H */ -From 801a4cbc4ea0f0ffd64b4fa0065be3f791b9d1d0 Mon Sep 17 00:00:00 2001 +From 0e75dc8f6ada5d524b64787a3f6a1f7774c19ad1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 011/131] bcm2708: alsa sound driver +Subject: [PATCH 011/149] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -82964,10 +82964,10 @@ index 0000000..af3e6eb + +#endif // _VC_AUDIO_DEFS_H_ -From 32495b1b4a656f2388b1dc133278a80616e40994 Mon Sep 17 00:00:00 2001 +From f99733b7c93f18f7bb2519462760a71817e2282c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 012/131] bcm2708 vchiq driver +Subject: [PATCH 012/149] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -96221,10 +96221,10 @@ index 0000000..b6bfa21 + return vchiq_build_time; +} -From 8909329c134abdf242dc345a4528e98e86c85c33 Mon Sep 17 00:00:00 2001 +From bb99de1085903aae1acd33f9333636668a2d0940 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 013/131] vc_mem: Add vc_mem driver +Subject: [PATCH 013/149] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -97230,10 +97230,10 @@ index 0000000..20a4753 + +#endif /* _VC_MEM_H */ -From 3dc51b65ed267fd3cc57feeda298e6c02af5cf82 Mon Sep 17 00:00:00 2001 +From 2835e674ab3568be62a2cd50e060f4172c6d7760 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 014/131] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 014/149] vcsm: VideoCore shared memory service for BCM2835 Add experimental support for the VideoCore shared memory service. This allows user processes to allocate memory from VideoCore's @@ -101643,10 +101643,10 @@ index 0000000..0bfb42e +MODULE_DESCRIPTION("VideoCore SharedMemory Driver"); +MODULE_LICENSE("GPL v2"); -From 250314915c749fccd25d98aca0b9a2d29f55ec1c Mon Sep 17 00:00:00 2001 +From d956b1bd6c339852f27e912d2e79ed1ae1f770d3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 015/131] Add hwrng (hardware random number generator) driver +Subject: [PATCH 015/149] Add hwrng (hardware random number generator) driver --- drivers/char/hw_random/Kconfig | 13 +++- @@ -101823,10 +101823,10 @@ index 0000000..340f004 +MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver"); +MODULE_LICENSE("GPL and additional rights"); -From e074d656e4011eae32577e4d20d7ce6dfa15f6e8 Mon Sep 17 00:00:00 2001 +From 0a234b968ca8409fdf24ee38b84144ea6df901c1 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 016/131] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 016/149] 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 @@ -102679,10 +102679,10 @@ index 0000000..24563ec +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Enable debugging messages"); -From ccdc49f30be0caec97b9b7e4352b8c63eb45acdd Mon Sep 17 00:00:00 2001 +From 8aa5df1654dc0d99e6edaee56960a62a759642f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 017/131] Add cpufreq driver +Subject: [PATCH 017/149] Add cpufreq driver Signed-off-by: popcornmix --- @@ -102955,10 +102955,10 @@ index 0000000..6735da9 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From b7e45ce253f9aa6f3f4b33967b124198d3e2b74f Mon Sep 17 00:00:00 2001 +From a78e95402f25318bb6049c253a586bdabf0e3934 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 018/131] Added hwmon/thermal driver for reporting core +Subject: [PATCH 018/149] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -103255,10 +103255,10 @@ index 0000000..3bc80f1 + +module_platform_driver(bcm2835_thermal_driver); -From f65673287078cca868595a556d8613802e9a1743 Mon Sep 17 00:00:00 2001 +From fe524efc70536aa67e3568f97bc373031e4de4ea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 019/131] Add Chris Boot's spi driver. +Subject: [PATCH 019/149] Add Chris Boot's spi driver. spi: bcm2708: add device tree support @@ -104170,10 +104170,10 @@ index 0000000..041b5e2 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 31dade83cc4f448f81d7d460c59d02b9ebc3b05b Mon Sep 17 00:00:00 2001 +From b42f499d093bb6ed2991c6f304338bff3a85b429 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 020/131] Add Chris Boot's i2c driver +Subject: [PATCH 020/149] Add Chris Boot's i2c driver i2c-bcm2708: fixed baudrate @@ -104974,10 +104974,10 @@ index 0000000..8773203 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 170ee05def27ef6ddedf2561d1dd770c992962b1 Mon Sep 17 00:00:00 2001 +From 8e40d3346d2607cee13a9eee8c2357b1c0cdb48a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 021/131] bcm2835: add v4l2 camera device +Subject: [PATCH 021/149] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -112304,10 +112304,10 @@ index 0000000..9d1d11e + +#endif /* MMAL_VCHIQ_H */ -From e864404b1afe2fdb0dbd9b3bc5968ea2173fd3e7 Mon Sep 17 00:00:00 2001 +From 7a4688d4481948917c7d09d4745c21c7f802da18 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 022/131] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 022/149] scripts/dtc: Update to upstream version with overlay patches --- @@ -117520,10 +117520,10 @@ index 54d4e904..d644002 100644 -#define DTC_VERSION "DTC 1.4.0-dirty" +#define DTC_VERSION "DTC 1.4.1-g36c70742" -From 5b2523aae9c5beb443315a7814633fc740992d07 Mon Sep 17 00:00:00 2001 +From e9e0f3cef41db19f29ab37a403feabe9f55f83fc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 023/131] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 023/149] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -118008,10 +118008,10 @@ index 0000000..3dff948 + return (($val eq 'y') || ($val eq '1')); +} -From 2d9c312e5b7a52fc0e311f909bb475ecc68b1199 Mon Sep 17 00:00:00 2001 +From 996a96ca5045f3ea6e39192d242062441c3c797b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 024/131] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 024/149] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- @@ -118066,10 +118066,10 @@ index cde35c5d01..dd7fbfe 100644 pr_debug("Command line is: %s\n", (char*)data); -From 73ffc770b510d914757449f9bd52ff5e0b300a52 Mon Sep 17 00:00:00 2001 +From 25f3e064afc8b7be40bc92af946b59bce9ed6c58 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 025/131] BCM2708: Add core Device Tree support +Subject: [PATCH 025/149] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -121946,10 +121946,10 @@ index 0000000..66a98f6 + }; +}; -From 4559e395eaf5d2a4c9af93066c8edc7d184287e3 Mon Sep 17 00:00:00 2001 +From d4f6c4010632825e49b58d95db228b4ab394f3f0 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 026/131] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 026/149] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -122042,10 +122042,10 @@ index fb795c3..fa72af0 100644 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From 68d4d166abf2d287a3b333bbae60e2c9c027fa71 Mon Sep 17 00:00:00 2001 +From 5539b4d21d0d0485e548a1bd0bc259abc7403767 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 029/131] Speed up console framebuffer imageblit function +Subject: [PATCH 029/149] 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 @@ -122254,10 +122254,10 @@ index a2bb276..436494f 100644 start_index, pitch_index); } else -From 5e3834b22d4c560ac1354cfff30a6713b6d94e64 Mon Sep 17 00:00:00 2001 +From 683a06a250e735c94ec3640d9288528ee50ddf16 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 030/131] Allow mac address to be set in smsc95xx +Subject: [PATCH 030/149] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -122348,10 +122348,10 @@ index 26423ad..e29a323 100644 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -From 9c50f6318fdf116e5abaeb05bffa0b65e48ba259 Mon Sep 17 00:00:00 2001 +From 4f3ab22c324a811dda12f53cd9e77d3a32c3a113 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 031/131] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 031/149] 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 @@ -122749,10 +122749,10 @@ index d58594a..feae942 100644 unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 2722779be49b7b76dea3de564e03d9fd0083f094 Mon Sep 17 00:00:00 2001 +From 853fe067aeff8a0be4027b63f50dd0478103f723 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 033/131] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 033/149] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -122761,10 +122761,10 @@ Subject: [PATCH 033/131] config: Enable CONFIG_MEMCG, but leave it disabled 2 files changed, 24 insertions(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c -index 469dd54..c9684da 100644 +index e8a5491..2428355 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c -@@ -5395,6 +5395,29 @@ static int __init cgroup_disable(char *str) +@@ -5393,6 +5393,29 @@ static int __init cgroup_disable(char *str) } __setup("cgroup_disable=", cgroup_disable); @@ -122807,10 +122807,10 @@ index a04225d..a2ef8af 100644 /** -From 27e4ffc36fc9366bfcefe25321191a78460ba1fd Mon Sep 17 00:00:00 2001 +From 02f4298dead0071add7bb58678d7451bf06d4b7f Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 034/131] ASoC: Add support for BCM2708 +Subject: [PATCH 034/149] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -123953,10 +123953,10 @@ index 0000000..6fdcbc1 + +#endif -From c368e010eacbc50e6a5f527fcc8651ea1cdc5f26 Mon Sep 17 00:00:00 2001 +From 9dca125b0468d40894de4138982400ba5b833e4d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 035/131] ASoC: Add support for PCM5102A codec +Subject: [PATCH 035/149] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -124081,10 +124081,10 @@ index 0000000..126f1e9 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 1ae47f91380b552b3bb3adb28f3283be31786064 Mon Sep 17 00:00:00 2001 +From 45a02391f0fa3d34235ff795c299638fbf3f5773 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 036/131] BCM2708: Add I2S support to board file +Subject: [PATCH 036/149] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -124173,10 +124173,10 @@ index a3b65dc..a515992 100644 for (i = 0; i <= 1; i++) { void __iomem *base; -From 65a3e3f912faa5d0c0cdb937b23e641d45608236 Mon Sep 17 00:00:00 2001 +From 19cea6e827bb706afe8bb57e43ee5f3fa7cd1731 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 037/131] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 037/149] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -124325,10 +124325,10 @@ index 0000000..4b70b45 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 1fee3fa181deb59422ad4f5f08262c8328189370 Mon Sep 17 00:00:00 2001 +From 7528f3f5f51e0f304d5726a82dd9178f87b1ca41 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 038/131] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 038/149] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -124376,10 +124376,10 @@ index 01f2de7..1d9b788 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; -From c5a634c60f6706ba7ffaec669d6ddae793a7b889 Mon Sep 17 00:00:00 2001 +From 48355b1b1b0ae407d17524fb836fa61f2341d579 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 039/131] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 039/149] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -124674,10 +124674,10 @@ index 0000000..b4eaa44 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From c739ac8e078de6188449830672c7dd1e5b57af52 Mon Sep 17 00:00:00 2001 +From ee415b9db413a155e99d81537a776b7becf60227 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 040/131] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 040/149] 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 @@ -124717,10 +124717,10 @@ index 1e403f6..d4efa85 100644 #define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ -From 7cce7a2fdf84a988e7b23caa129dddbcc7613b10 Mon Sep 17 00:00:00 2001 +From 4e0d1e894adb9184eb45a7c343907df881e3a523 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 041/131] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 041/149] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -124985,10 +124985,10 @@ index 0000000..92e9e46 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 6912c1ddd399d69d7704e9f6445014d40ec21c9b Mon Sep 17 00:00:00 2001 +From 5c4656d103da802e6d0412eb55c8dc9164935867 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 042/131] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 042/149] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -125035,10 +125035,10 @@ index 6d53beb..a062d7f 100644 bcm_register_device_dt(&snd_rpi_dac_device); bcm_register_device_dt(&snd_pcm1794a_codec_device); -From c1291a2b3390ab53e3a6ca2325e39d0a01908d87 Mon Sep 17 00:00:00 2001 +From 87f8afdc7be60f059356680542fa556055434a0b Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 043/131] ASoC: wm8804: Set idle_bias_off to false Idle bias +Subject: [PATCH 043/149] ASoC: wm8804: Set idle_bias_off to false Idle bias has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek @@ -125060,10 +125060,10 @@ index d4efa85..f3f26a2 100644 .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From 3cefe8f4539e290215418a54ff815913bb658814 Mon Sep 17 00:00:00 2001 +From 02e362cf47d55e3e6e075d14a6f5eda064e832a9 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 044/131] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 044/149] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -125271,10 +125271,10 @@ index 0000000..aff7377 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 63dc5102ff1e782a18c891169ef614ff83fd16da Mon Sep 17 00:00:00 2001 +From 6ccb62cc7e401082561c12ed6258dc3382264875 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 045/131] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 045/149] vmstat: Workaround for issue where dirty page count goes negative See: @@ -125301,10 +125301,10 @@ index 82e7db7..f87d16d 100644 static inline void __inc_zone_page_state(struct page *page, -From 4b7eb6e29aee506fd82e9eea37b951f0a4101f8a Mon Sep 17 00:00:00 2001 +From 7db38451aa2a58b2f7e9e9cd60842e5167732ba0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 046/131] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 046/149] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125340,10 +125340,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From e35b74b6335b49387b09d114966b89549a13f1d5 Mon Sep 17 00:00:00 2001 +From ede6ae920d5614aeaca3793cab45e68d7a5667f4 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 047/131] Added support for HiFiBerry DAC+ +Subject: [PATCH 047/149] 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. @@ -125554,10 +125554,10 @@ index 0000000..c63387b +MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+"); +MODULE_LICENSE("GPL v2"); -From ee406533a463686db7d11c7ad0f626578c1edcac Mon Sep 17 00:00:00 2001 +From 7f32b28e3ecbddf73a8a2b849fe1950d1d3d6441 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 048/131] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 048/149] 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. @@ -126426,10 +126426,10 @@ index 0000000..8f019e0 + +#endif /* _TAS5713_H */ -From b904f76b1090667c9f4741a60da8e60cebc8a91c Mon Sep 17 00:00:00 2001 +From 5342cc918f42da5b299e861b708d0986f42f4c81 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 049/131] bcm2708: Allow option card devices to be configured +Subject: [PATCH 049/149] bcm2708: Allow option card devices to be configured via DT If the kernel is built with Device Tree support, and if a DT blob @@ -126454,10 +126454,10 @@ index 03fa1cb..c816526 100644 static struct platform_driver bcm2835_i2s_driver = { .probe = bcm2835_i2s_probe, -From 8b4aab9c9a47544e493ba3479ad0e6397e4ea27a Mon Sep 17 00:00:00 2001 +From c2db87de57679d93a7b54ded9f2ad2c29b449c58 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 050/131] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 050/149] Adding Device Tree support for some RPi audio cards --- arch/arm/mach-bcm2709/bcm2709.c | 143 ++++++++++++++++++++++++++++++++++++++ @@ -126820,10 +126820,10 @@ index 126f1e9..7c6598e 100644 }; -From bc32dfd7d696d4e3c381344064aabc38961b7f46 Mon Sep 17 00:00:00 2001 +From decbd54190fce2736e5f8614c974f6d236eebd15 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 051/131] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 051/149] Added support to reserve/enable a GPIO pin to be used from pps-gpio module (LinuxPPS). Enable PPS modules in default config for RPi. @@ -126959,10 +126959,10 @@ index 57e1f3d..721559b 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); -From 5b706049d22fc0593a14a1d94ebf7f9bf54feeea Mon Sep 17 00:00:00 2001 +From 128bbd307de47c1a0748dcf84e5d948c2df3db38 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 052/131] Update ds1307 driver for device-tree support +Subject: [PATCH 052/149] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -126989,10 +126989,10 @@ index 4ffabb3..c6789a7 100644 .driver = { .name = "rtc-ds1307", -From 1578dbee8e10fed1be0f64820fe511dc4b7a720e Mon Sep 17 00:00:00 2001 +From 0fcc1245d4ba1391e0bcc754e2c521cecbb10179 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 053/131] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 053/149] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -127103,10 +127103,10 @@ index 0000000..2ca2b98 +MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); +MODULE_LICENSE("GPL"); -From a926a1d2720eef63b580a4510a9aec4540836d40 Mon Sep 17 00:00:00 2001 +From 2b9a2491e2554f5dc92a62be523ef8932a5eb85e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 054/131] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 054/149] bcm2709: Simplify and strip down IRQ handler --- arch/arm/include/asm/entry-macro-multi.S | 2 + @@ -127325,10 +127325,10 @@ index d08591b..08d184c 100644 +1: get_irqnr_and_base r0, r2, r6, lr + .endm -From 39cf4677b7c38fac3da503b75d5cd7efc64dd19a Mon Sep 17 00:00:00 2001 +From 145d538784f1fb1a938a6f037df9d85898ea1ba4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 055/131] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 055/149] Fix LED "input" trigger implementation for 3.19 --- drivers/leds/leds-gpio.c | 10 +++++++++- @@ -127415,10 +127415,10 @@ index 9a2b000..60accc5 100644 /* Set LED brightness level */ /* Must not sleep, use a workqueue if needed */ -From d6f122c984a90914b054c16def454ee77a002bad Mon Sep 17 00:00:00 2001 +From 20a42859d52cff889adbec5697ba61870b22c423 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 056/131] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 056/149] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -127440,10 +127440,10 @@ index 8d908e3..7a1900d 100644 .can_sleep = false, }; -From 0bb455e4eca847aa74560f58bfd7daa13e9fb496 Mon Sep 17 00:00:00 2001 +From 812a64aaa5d3dec21864e49c612b38ee65273b17 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 057/131] pinctrl-bcm2835: bcm2835_gpio_direction_output must +Subject: [PATCH 057/149] pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value --- @@ -127471,10 +127471,10 @@ index 7a1900d..62f85aa 100644 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) -From 1ee5ccaeae81a9acd296d4d3eaba9fa1807b9e17 Mon Sep 17 00:00:00 2001 +From 09041f7ccbd1cde792edae91c41266886d5d1382 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 058/131] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 058/149] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -127620,10 +127620,10 @@ index 62f85aa..c7cf266 100644 }, }; -From 7e2506a80d3a218bab8db21c947187c92d29812c Mon Sep 17 00:00:00 2001 +From 523ce9c5aa97607b0847833b93a8d34965808132 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 059/131] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 059/149] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -127650,10 +127650,10 @@ index c7cf266..986779a 100644 pc->irq_data[i].irqgroup = i; -From 69c25727685034a06c041fee3938afba0b84e582 Mon Sep 17 00:00:00 2001 +From ee9c77a3cc5d83e87e52f3424f7a29d605d562ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 060/131] enc28j60: Add device tree compatible string and an +Subject: [PATCH 060/149] enc28j60: Add device tree compatible string and an overlay --- @@ -127687,10 +127687,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From 9ea362cfd9b8e0b2a8896a713b8b82c0c5834a68 Mon Sep 17 00:00:00 2001 +From 0c87fa341259d332ce8402d1a3703f2b69af5219 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 061/131] Add driver for rpi-proto +Subject: [PATCH 061/149] 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 @@ -127905,10 +127905,10 @@ index 0000000..c6e45a0 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From db5f1ae7154cf08397ba74b67af282f246a17ddf Mon Sep 17 00:00:00 2001 +From 458dc19741c5295b62ff78882b94a4d6dc8aaac2 Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 062/131] Add Device Tree support for RPi-DAC. +Subject: [PATCH 062/149] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -127983,10 +127983,10 @@ index b4eaa44..afe1b41 100644 }; -From 0fa5223ca68a9c68b92b6ea149fccc42d50c3357 Mon Sep 17 00:00:00 2001 +From 4c33cf46121a5662ebfb84ad34a5a632c2c679f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 063/131] config: Add default configs +Subject: [PATCH 063/149] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1204 ++++++++++++++++++++++++++++++++++++ @@ -130411,10 +130411,10 @@ index 0000000..6a41231 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 4fc03ec1bfe73a125775bb06937a246be639dc55 Mon Sep 17 00:00:00 2001 +From f8b20b1317fd46d23a2a9944a53df547904a238f Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 064/131] smsx95xx: fix crimes against truesize +Subject: [PATCH 064/149] 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. @@ -130449,10 +130449,10 @@ index e29a323..aff63dc usbnet_skb_return(dev, ax_skb); } -From 9131a29e8e039bdc5055dad93d41f11a111a13b9 Mon Sep 17 00:00:00 2001 +From 7b168915af2a8d731046afeed5cdf939cd9c4323 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 065/131] smsc95xx: Disable turbo mode by default +Subject: [PATCH 065/149] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -130472,10 +130472,10 @@ index aff63dc..08a8a8c 100755 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 510eb2621d1b1b74618236a324538c19c9106ece Mon Sep 17 00:00:00 2001 +From aab95f9b10e8c3d32de2bf163b86f220c88214fe Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 066/131] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 066/149] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130486,10 +130486,10 @@ Subject: [PATCH 066/131] Add blk_pos parameter to mmc multi_io_quirk callback 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c -index 60f7141..1f15cb5 100644 +index 31d2627..8484ec9 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c -@@ -1413,6 +1413,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, +@@ -1415,6 +1415,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, brq->data.blocks = card->host->ops->multi_io_quirk(card, (rq_data_dir(req) == READ) ? MMC_DATA_READ : MMC_DATA_WRITE, @@ -130558,10 +130558,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From d2482f75a64fce6da8a4138f88a6c59cb0de4d9b Mon Sep 17 00:00:00 2001 +From 9a092ad62309aecb8c27cde5fb5f863a7447b90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 29 Apr 2015 17:24:02 +0200 -Subject: [PATCH 067/131] bcm2835: bcm2835_defconfig +Subject: [PATCH 067/149] bcm2835: bcm2835_defconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -131891,10 +131891,10 @@ index 31cb073..2e8a95a 100644 # CONFIG_XZ_DEC_ARM is not set # CONFIG_XZ_DEC_ARMTHUMB is not set -From 984698645ff73ed2100b4bfea99ed035139ac721 Mon Sep 17 00:00:00 2001 +From 4ab42e0f9eab22619622ea5f13195280aebc0d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 23:00:15 +0200 -Subject: [PATCH 068/131] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 068/149] BCM270x_DT: Add mailbox bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -131935,10 +131935,10 @@ index 721559b..4a00561 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); -From 156ce0fa550bbcb8e63eb60d11ac05cc28c14775 Mon Sep 17 00:00:00 2001 +From fa2b33b614fead97a2eb8b950fb1c77e73f0eb28 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 069/131] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 069/149] rpi-ft5406: Add touchscreen driver for pi LCD display --- drivers/input/touchscreen/Kconfig | 7 + @@ -132255,10 +132255,10 @@ index cc284ed..d3ea839 100644 VCMSG_SET_CURSOR_STATE = 0x00008011, }; -From e2149721bbb442d9f1622bfd0b4c89a892afd88f Mon Sep 17 00:00:00 2001 +From 5cbcb76ee23807632fcd5db19ebcc2d913011f17 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 070/131] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 070/149] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -133783,10 +133783,10 @@ index 3e58d71..0622891 100644 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 92f76fcdda43617a0f3461741bba9e6d328684da Mon Sep 17 00:00:00 2001 +From b196781e4110a44416cf5926cf1ff350a1533c94 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 071/131] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 071/149] bcm2835-audio: Create the platform device if the DT node is disabled For backwards compatibility, allow the built-in ALSA driver to be enabled @@ -133840,10 +133840,10 @@ index 4a00561..dec8043 100644 bcm_register_device_dt(&bcm2708_spi_device); -From e64ab6c66db34627b7765099e815a8c2d4957296 Mon Sep 17 00:00:00 2001 +From 35fb850719835a0029eb91480b214fbaf2a99dc3 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 072/131] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 072/149] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -133902,10 +133902,10 @@ index 70f2f39..f7fdacd 100644 static const char * const bcm2835_compat[] = { -From 8a609b1977da490cd177740e61169444383fd8c4 Mon Sep 17 00:00:00 2001 +From fb9bb42b9875d61716503c9eb330e73d720f5a64 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 073/131] platform: Add force_core command line setting to boot +Subject: [PATCH 073/149] platform: Add force_core command line setting to boot from a different core number --- @@ -133976,10 +133976,10 @@ index dec8043..fe71c50 100644 module_param(serial, uint, 0644); module_param(uart_clock, uint, 0644); -From 2efab5a48bc519a3901b62da297ee5523c91ee58 Mon Sep 17 00:00:00 2001 +From 63a651b12cbd98ba14d2ac6f038f230a4b3ce336 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 074/131] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 074/149] mach-bcm270x: Enable the building of pinctrl-bcm2835 --- drivers/pinctrl/Makefile | 1 + @@ -133998,10 +133998,10 @@ index 6eadf04..9119513 100644 obj-$(CONFIG_ARCH_BERLIN) += berlin/ obj-y += freescale/ -From 436bd2ba164863768b90c2456a943dcfed3b053c Mon Sep 17 00:00:00 2001 +From 30e79675077f83c35b77f74ae833212cbff42b6f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Jun 2015 16:41:39 +0100 -Subject: [PATCH 075/131] BCM270X_DT: Document the i2s-mmap overlay +Subject: [PATCH 075/149] BCM270X_DT: Document the i2s-mmap overlay --- arch/arm/boot/dts/overlays/README | 6 ++++++ @@ -134025,10 +134025,10 @@ index 3e08f98..7fa6d33 100644 Info: Configures the IQaudio DAC audio card Load: dtoverlay=iqaudio-dac -From 175d8f77d2fe5ed0d43d53ece08978fd50c97a97 Mon Sep 17 00:00:00 2001 +From 1dd7bc29051074b4aedba9ed05bbc920ed67a654 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 11:36:53 +0100 -Subject: [PATCH 076/131] bcm2835-sdhost: Improve error handling and recovery +Subject: [PATCH 076/149] bcm2835-sdhost: Improve error handling and recovery 1) Expose the hw_reset method to the MMC framework, removing many internal calls by the driver. @@ -135120,10 +135120,10 @@ index eef8a24..6277e43 100644 if (host->allow_dma) { -From 48297e4045a1d8a3b2a0edbe6cf371a34c5eb3be Mon Sep 17 00:00:00 2001 +From e6a1ebfa363797e35902c3d466af7c92ef05a62f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:46 -0700 -Subject: [PATCH 077/131] ARM: bcm2835: Add the Raspberry Pi firmware driver +Subject: [PATCH 077/149] ARM: bcm2835: Add the Raspberry Pi firmware driver This gives us a function for making mailbox property channel requests of the firmware, which is most notable in that it will let us get and @@ -135557,10 +135557,10 @@ index 0000000..9d9efb7 + void *data, size_t tag_size); +struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); -From 9762ae8cc9ebb55739cb553f3b2c5bc604aec9e4 Mon Sep 17 00:00:00 2001 +From dce877ba363b979281f5781ec75a197875fd21a9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 22 Mar 2015 13:33:23 +0000 -Subject: [PATCH 078/131] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING +Subject: [PATCH 078/149] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -135612,10 +135612,10 @@ index 6a41231..cacde14 100644 CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_DRBD=m -From dd888666ae9c4f80521f3bbe48edb86b423bb6f6 Mon Sep 17 00:00:00 2001 +From 2f04df7aef19d4e087c80fa7371e3f5139233570 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Mon, 22 Jun 2015 16:27:07 +0100 -Subject: [PATCH 079/131] Add rpi-ft5406 overlay Add rpi-ft5406 driver as +Subject: [PATCH 079/149] Add rpi-ft5406 overlay Add rpi-ft5406 driver as module --- @@ -135702,10 +135702,10 @@ index cacde14..f952ff2 100644 CONFIG_TOUCHSCREEN_STMPE=m CONFIG_INPUT_MISC=y -From afae7dff11e5ee1d5aaf0d00cf26ea3cf24db2d8 Mon Sep 17 00:00:00 2001 +From bf09fbb31f813db47e4b64fddbc1ea1d089133c2 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 23 Jun 2015 09:53:40 +0100 -Subject: [PATCH 080/131] Fix driver detection failure Check that the buffer +Subject: [PATCH 080/149] Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected --- @@ -135726,10 +135726,10 @@ index f55151b..d41851d 100644 dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); } -From 9e053b2e623361aa3a3bbfa298e7b8d33adf7abc Mon Sep 17 00:00:00 2001 +From e8fe55cc59f200121b845a93110d6c41e7daeb01 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 13:24:01 +0100 -Subject: [PATCH 081/131] config: Enable 8250 serial port +Subject: [PATCH 081/149] config: Enable 8250 serial port --- arch/arm/configs/bcm2709_defconfig | 7 +++++++ @@ -135777,10 +135777,10 @@ index f952ff2..0c25d8b 100644 CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_BCM2835=m -From 60300e1082cd46b3ae2732854776ee549e217387 Mon Sep 17 00:00:00 2001 +From 02dfc389b34d52a0c97428a666d0314216c2cb34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 14:10:58 +0100 -Subject: [PATCH 082/131] config: Enable POWER_RESET_GPIO +Subject: [PATCH 082/149] config: Enable POWER_RESET_GPIO --- arch/arm/configs/bcm2709_defconfig | 2 ++ @@ -135814,10 +135814,10 @@ index 0c25d8b..e757db6 100644 CONFIG_THERMAL=y CONFIG_THERMAL_BCM2835=y -From 79796a03fa8311ea9030817db27690f24f72214c Mon Sep 17 00:00:00 2001 +From 83d5bd935a9a83db9e7bf89bb3cd123fc7a6999f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Jun 2015 17:37:38 +0100 -Subject: [PATCH 083/131] bcm2708-vcio: Remove restriction of only a single +Subject: [PATCH 083/149] bcm2708-vcio: Remove restriction of only a single instance being open We need more than one process to be able to use mailbox interface (e.g. HW cursor in fbturbo and hello_fft). @@ -135862,10 +135862,10 @@ index d91672b..06fb2c2f 100644 return 0; -From 6bda1bf0de21592f772c2d65b3e66ddf89d50bdf Mon Sep 17 00:00:00 2001 +From 08ab3b10ef3b9fee5c05f7c1463fefa3206e36eb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:39:19 +0100 -Subject: [PATCH 084/131] BCM270X_DT: Create a "core" clock, use it for SPI and +Subject: [PATCH 084/149] BCM270X_DT: Create a "core" clock, use it for SPI and sdhost --- @@ -136016,10 +136016,10 @@ index b408ab4..897204a 100644 }; }; -From d4a0abb7a644365a9f21204a5e3f530a8112d5e8 Mon Sep 17 00:00:00 2001 +From a3c04e353a23787157f52097715422aed626198d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 09:24:31 +0100 -Subject: [PATCH 085/131] BCM270X_DT: Add MCP7941X to i2c-rtc overlay +Subject: [PATCH 085/149] BCM270X_DT: Add MCP7941X to i2c-rtc overlay --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -136072,10 +136072,10 @@ index 6bccfdc..7052c71 100644 pcf8523 = <&pcf8523>,"status"; pcf8563 = <&pcf8563>,"status"; -From 54695dcb27d8e4c37e8dd9620e85257b8abb89d8 Mon Sep 17 00:00:00 2001 +From 89ce29fd10942fcb3a8a72a88ed399d5bbac6f56 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 24 Jun 2015 11:23:06 +0100 -Subject: [PATCH 086/131] dts/overlays: document DHT11 overlay +Subject: [PATCH 086/149] dts/overlays: document DHT11 overlay --- arch/arm/boot/dts/overlays/README | 8 ++++++++ @@ -136101,10 +136101,10 @@ index 425eb19..9406cf3 100644 -From 842fe412d512dabb76d169395086b6337150015a Mon Sep 17 00:00:00 2001 +From e5230cc9bbb441510c38faf9f0c82a839afbba71 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 087/131] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 087/149] 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 @@ -136219,10 +136219,10 @@ index e5332f1..6e3fec2 100644 "%s: pm_power_off function already registered", __func__); -From 311119b99b34e88df249d706c69bdcffcd8dafb5 Mon Sep 17 00:00:00 2001 +From c7c9f2995da703a41e6c70bce53d9eef408b1b46 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 17:10:40 +0100 -Subject: [PATCH 088/131] BCM270x_DT: Default Compute Module i2c, i2s and spi +Subject: [PATCH 088/149] BCM270x_DT: Default Compute Module i2c, i2s and spi support --- @@ -136312,10 +136312,10 @@ index e82fcb2..af252bd 100755 }; }; -From bd6dabc8c7f6cdaba821ff3246034cd704f6364d Mon Sep 17 00:00:00 2001 +From 44c63dcdaca924590d42106b99b5f4e30dcbfbe3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:21:55 +0100 -Subject: [PATCH 089/131] BCM270X_DT: Sort nodes by bus address, and +Subject: [PATCH 089/149] BCM270X_DT: Sort nodes by bus address, and consolidate aliases --- @@ -136557,10 +136557,10 @@ index 24fa849..ccb9c31 100644 &gpio { -From f40ed032e6f0892778bac7d33d45593c0483628b Mon Sep 17 00:00:00 2001 +From 870b67c8c48467c19fbbccb90aeb8137ce5e9bea Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:23:03 +0100 -Subject: [PATCH 090/131] i2c-bcm2708/BCM270X_DT: Add support for I2C2 +Subject: [PATCH 090/149] i2c-bcm2708/BCM270X_DT: Add support for I2C2 The third I2C bus (I2C2) is normally reserved for HDMI use. Careless use of this bus can break an attached display - use with caution. @@ -136733,10 +136733,10 @@ index 8773203..7a24fbe 100644 goto out_free_bi; } -From 9451939c7a95b4f81886a2bf89f953be1833189d Mon Sep 17 00:00:00 2001 +From 207f6d593f3d6b5e5bbe5b12f8e915d7f6b85dd7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Jun 2015 12:14:02 +0100 -Subject: [PATCH 091/131] BCM270X_DT: Correct the lirc-rpi overlay +Subject: [PATCH 091/149] BCM270X_DT: Correct the lirc-rpi overlay documentation The polarity of the "sense" parameter was inverted with respect to reality. @@ -136762,10 +136762,10 @@ index 0ed7094..ec762d2 100644 (default "-1") -From d645d31525be338b1baa22916217f3ac0c3705f9 Mon Sep 17 00:00:00 2001 +From 919c9342b5a5c83686dc932935276d621b5cccae Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 08:47:09 +0100 -Subject: [PATCH 092/131] bcm2835-sdhost: Further improve overclock back-off +Subject: [PATCH 092/149] bcm2835-sdhost: Further improve overclock back-off --- drivers/mmc/host/bcm2835-sdhost.c | 144 +++++++++++++++++++++----------------- @@ -137057,10 +137057,10 @@ index 6277e43..a03db06 100644 iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); -From 11667799f99dca096d4d92e63b7823db2a8f8779 Mon Sep 17 00:00:00 2001 +From 23382239529f6cb7af467a9247e8e24e70a4aa06 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:28:59 +0100 -Subject: [PATCH 093/131] i2c-bcm2708: Increase timeouts to allow larger +Subject: [PATCH 093/149] i2c-bcm2708: Increase timeouts to allow larger transfers Use the timeout value provided by the I2C_TIMEOUT ioctl when waiting @@ -137098,10 +137098,10 @@ index 7a24fbe..8b8762d 100644 dev_err(&adap->dev, "transfer timed out\n"); goto error_timeout; -From 04f7264e602d7148822f3a162176190fcc41f71a Mon Sep 17 00:00:00 2001 +From f3d59521e6139a0e1cf79eaacffea5a576360185 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:33:52 +0100 -Subject: [PATCH 094/131] spi-bcm2708: Increase timeout from 150ms to 1s +Subject: [PATCH 094/149] spi-bcm2708: Increase timeout from 150ms to 1s See: https://github.com/raspberrypi/linux/issues/260 --- @@ -137125,10 +137125,10 @@ index 041b5e2..5c0214e 100644 struct bcm2708_spi { spinlock_t lock; -From 2e6c5de15687dadf4c24d880d0cdcb6763aacda5 Mon Sep 17 00:00:00 2001 +From ea8bb97ffa4e1f4bd832e7a9bed797551685625b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 09:59:38 +0100 -Subject: [PATCH 095/131] bcm2708-spi: Don't use static pin configuration with +Subject: [PATCH 095/149] bcm2708-spi: Don't use static pin configuration with DT Also remove superfluous error checking - the SPI framework ensures the @@ -137167,10 +137167,10 @@ index 5c0214e..781c747 100644 master = spi_alloc_master(&pdev->dev, sizeof(*bs)); if (!master) { -From 699c056af380b45856086c0b33a65acc3d2ad3d8 Mon Sep 17 00:00:00 2001 +From a141cf018b63c08c9907aa0d7b1b2791ee9250d0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 10:10:59 +0100 -Subject: [PATCH 096/131] bcm2708-i2s: Don't use static pin configuration with +Subject: [PATCH 096/149] bcm2708-i2s: Don't use static pin configuration with DT --- @@ -137193,10 +137193,10 @@ index a515992..5e93cd6 100644 /* * Adjust the data length according to the format. -From 6b8e6f74b78fcc225c873ea1b07890352dd77ee5 Mon Sep 17 00:00:00 2001 +From 9ac08a7ad7b65014eada794cf252828d10b6cb91 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 097/131] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 097/149] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -137216,10 +137216,10 @@ index 4506e40..f03a19a 100644 for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From 5131bc710dd79b98d12c08b2f22477f48fdbd0d3 Mon Sep 17 00:00:00 2001 +From e3ee14936302400a2b6389b4062e4ce45046cb2e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:50:11 +0100 -Subject: [PATCH 098/131] BCM270X_DT: Add overlay to enable uart1 +Subject: [PATCH 098/149] BCM270X_DT: Add overlay to enable uart1 N.B. The UART1 clock is derived from the core clock. The firmware will update clock-frequency if core_freq is set, but be aware @@ -137388,10 +137388,10 @@ index e757db6..363c894 100644 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y -From 72d2ba8d7fa2d47c53ed1425501c2dac2aa909b0 Mon Sep 17 00:00:00 2001 +From 6ee396162a3700157252585fd19ed67e22b8aa34 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 099/131] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 099/149] 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 @@ -137472,10 +137472,10 @@ index 37875cf..55e81c2 100644 /* and set up the "mode" and level */ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", -From 4bf9c275c9733d1fcf41f6ee70b40e321b39eac1 Mon Sep 17 00:00:00 2001 +From 2f890ad4ea68997c62f8d58af8c2800b7eeab056 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 17:37:38 +0100 -Subject: [PATCH 100/131] BCM270X_DT: Change pio_limit of sdhost driver to 1 +Subject: [PATCH 100/149] BCM270X_DT: Change pio_limit of sdhost driver to 1 --- arch/arm/boot/dts/overlays/sdhost-overlay.dts | 2 +- @@ -137495,10 +137495,10 @@ index 897204a..2da14a4 100644 }; }; -From 0ca1e1d7ffdfcf1e716205491a00bf025fb71a77 Mon Sep 17 00:00:00 2001 +From a9ac939580e8cf0c43c4242bb458db7d27a6deea Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Jul 2015 12:51:52 +0100 -Subject: [PATCH 101/131] bcm2835-sdhost: Clear HBLC for PIO mode +Subject: [PATCH 101/149] bcm2835-sdhost: Clear HBLC for PIO mode Also update pio_limit default in overlay README. --- @@ -137534,10 +137534,10 @@ index a03db06..d65870a 100644 BUG_ON(!host->data); } -From f158c5aa486712cfad1c405eb849d65272b2cbc3 Mon Sep 17 00:00:00 2001 +From 7b05003d4f07188e83919e476ac48dc5c219f8ed Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 12:21:01 +0100 -Subject: [PATCH 102/131] BCM270X_DT: I2S needs function Alt2 +Subject: [PATCH 102/149] BCM270X_DT: I2S needs function Alt2 --- arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 2 +- @@ -137599,10 +137599,10 @@ index f25f0a2..62d1c62 100644 }; -From 704b53d89697a2542dfa6d23224f49c0d5350abb Mon Sep 17 00:00:00 2001 +From 7a39e0bdf178dd83ffca4766bfc0a2acc1b6c3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:16:15 +0200 -Subject: [PATCH 103/131] configs: Incorporate v4.1 dependency changes +Subject: [PATCH 103/149] configs: Incorporate v4.1 dependency changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -137765,10 +137765,10 @@ index 363c894..80f84d7 100644 CONFIG_CRC_ITU_T=y CONFIG_LIBCRC32C=y -From d47845877b27576daac3c55bdb742a43209baaed Mon Sep 17 00:00:00 2001 +From 01a50411ad1528451d53f69d5ad1c7370db0dbee Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 15:47:33 +0100 -Subject: [PATCH 104/131] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for +Subject: [PATCH 104/149] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for HifiBerry Digi) 4.1 has split out support for the I2C and SPI variants, so it now @@ -137803,10 +137803,10 @@ index 80f84d7..14b91fdf 100644 CONFIG_SOUND_PRIME=m CONFIG_HIDRAW=y -From a984b5d876c74984fad16d90507b95a50db22fba Mon Sep 17 00:00:00 2001 +From c3934ab548244c7fd691ca2e78f9a950d8eff269 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 4 Jul 2015 19:55:23 +0100 -Subject: [PATCH 105/131] squash: BCM270X_DT: I2S only needs Alt2 on 28-31 +Subject: [PATCH 105/149] squash: BCM270X_DT: I2S only needs Alt2 on 28-31 See: https://github.com/raspberrypi/linux/issues/1046 --- @@ -137855,10 +137855,10 @@ index 62d1c62..f25f0a2 100644 }; -From edb21286ac7e246dfe7c9ee05101880f719e00e8 Mon Sep 17 00:00:00 2001 +From acd32a30be3e6952f7486c9569429fce70fb8d9e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 8 Jul 2015 14:48:57 +0100 -Subject: [PATCH 106/131] vchiq_arm: Two cacheing fixes +Subject: [PATCH 106/149] vchiq_arm: Two cacheing fixes 1) Make fragment size vary with cache line size Without this patch, non-cache-line-aligned transfers may corrupt @@ -138129,10 +138129,10 @@ index c739083..5edba23 100644 kfree(pagelist); } -From 265838d467aedd75abf2949373d889cfec090168 Mon Sep 17 00:00:00 2001 +From d3f1bad2c2095c829d0111a41763ec4cf3fbdeb3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 09:10:36 +0100 -Subject: [PATCH 107/131] BCM270X_DT: Overlay for the Fen Logic VGA666 board +Subject: [PATCH 107/149] BCM270X_DT: Overlay for the Fen Logic VGA666 board The VGA666 board requires GPIOs 2-21 (so no I2C or UART). Using the overlay (instead of a custom dt-blob.bin) has the advantage that it will @@ -138214,10 +138214,10 @@ index 0000000..7fcab96 + }; +}; -From 5c8148df6f5147fcaa9fe81425b58a3e7a64cdba Mon Sep 17 00:00:00 2001 +From f92a566b5dcec58d56cc8e7e629601f449325b0c Mon Sep 17 00:00:00 2001 From: petit-miner Date: Fri, 10 Jul 2015 13:59:18 +0200 -Subject: [PATCH 108/131] Added support for 2 mcp2515 CAN Bus IC +Subject: [PATCH 108/149] Added support for 2 mcp2515 CAN Bus IC See: https://github.com/raspberrypi/linux/issues/1018 https://github.com/raspberrypi/linux/pull/1049 @@ -138347,10 +138347,10 @@ index 0000000..6bef9ae + }; +}; -From a097ef23c580bdcad619cca1deabd71eb6237984 Mon Sep 17 00:00:00 2001 +From 5d7fd1e72db3384293037ca586ed2936b45748d3 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 5 May 2015 13:27:45 -0700 -Subject: [PATCH 109/131] mailbox: Enable BCM2835 mailbox support +Subject: [PATCH 109/149] mailbox: Enable BCM2835 mailbox support This mailbox driver provides a single mailbox channel to write 32-bit values to the VPU and get a 32-bit response. The Raspberry Pi @@ -138629,10 +138629,10 @@ index 0000000..4b13268 +MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); +MODULE_LICENSE("GPL v2"); -From aa1ca835a9a179168f9d8355a458bd0eecda3912 Mon Sep 17 00:00:00 2001 +From 44369d3764961e5cb7a7dfce2fdb31a86ff16b14 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 13 May 2015 13:10:32 -0700 -Subject: [PATCH 110/131] mailbox/bcm2835: Fix mailbox full detection. +Subject: [PATCH 110/149] mailbox/bcm2835: Fix mailbox full detection. With the VC reader blocked and the ARM writing, MAIL0_STA reads empty permanently while MAIL1_STA goes from empty (0x40000000) to non-empty @@ -138671,10 +138671,10 @@ index 4b13268..0b47dd4 100644 return ret; } -From 36301913195582a2398add6d60477be534d4f603 Mon Sep 17 00:00:00 2001 +From 4e08351a07fbe7f6e8625e3e538e94a2bc4c08bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:19:30 +0200 -Subject: [PATCH 111/131] mailbox: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 111/149] mailbox: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -138790,10 +138790,10 @@ index 19b491d..cc07d71 100644 dev_dbg(dev, "%s: mailbox not free\n", __func__); mutex_unlock(&con_mutex); -From e3d1e45b4cf84fead585758e48adad894858670c Mon Sep 17 00:00:00 2001 +From 3389224055b1ee2a518308c13583361f88ff5f82 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:47 -0700 -Subject: [PATCH 112/131] ARM: bcm2835: Add the firmware driver information to +Subject: [PATCH 112/149] ARM: bcm2835: Add the firmware driver information to the RPi DT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -138827,10 +138827,10 @@ index 466f02b..5cdfd5a 100644 audio: audio { compatible = "brcm,bcm2835-audio"; -From 4b72dfbcb5e820f4bfdb2ccb423538b2e4821329 Mon Sep 17 00:00:00 2001 +From cc901351e0dd5e50ee5e11b8697a6f5b1f35ee0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:21:20 +0200 -Subject: [PATCH 113/131] firmware: bcm2835: Add missing property tags +Subject: [PATCH 113/149] firmware: bcm2835: Add missing property tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -138892,10 +138892,10 @@ index 9d9efb7..d3933af 100644 RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From d72c334f7fe3305ae13034ac0562123c26820ade Mon Sep 17 00:00:00 2001 +From 31139cf5452a835f8e160b7093b05dca12c6dd29 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 114/131] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 114/149] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139001,10 +139001,10 @@ index dd506cd3..b980d53 100644 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From be083fb29207201d3db279f9d5654c5f8c2cb6de Mon Sep 17 00:00:00 2001 +From fd247161acad069df68411af0500b183fbc78063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:26:10 +0200 -Subject: [PATCH 115/131] firmware: bcm2835: Support legacy mailbox API +Subject: [PATCH 115/149] firmware: bcm2835: Support legacy mailbox API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139094,10 +139094,10 @@ index d3933af..9a08cf1 100644 u32 tag, void *data, size_t len); int rpi_firmware_property_list(struct rpi_firmware *fw, -From becc3412eae55ac3b1642ddc074cb9ca2cbc2e11 Mon Sep 17 00:00:00 2001 +From 491b53a48fc956dd91151f5998d54544ffeab094 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 116/131] char: broadcom: Add vcio module +Subject: [PATCH 116/149] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139321,10 +139321,10 @@ index 0000000..c19bc20 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 3349eaf79dd91c2e6f9b7aed0c155668e4f5a856 Mon Sep 17 00:00:00 2001 +From 0c90bfa500f9c896f42a8cb59f7037b2c78fc8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:37:19 +0200 -Subject: [PATCH 117/131] BCM270x: Switch to firmware driver +Subject: [PATCH 117/149] BCM270x: Switch to firmware driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139931,10 +139931,10 @@ index 06fb2c2f..2e4031b 100644 MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); MODULE_LICENSE("GPL"); -From 04f82e046133586649c9c9c72b565c2dbccf0e97 Mon Sep 17 00:00:00 2001 +From 261e67ec20793d9a0f615e16b7bce7ae7a70e138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:39:21 +0200 -Subject: [PATCH 118/131] bcm2835: Switch to firmware driver +Subject: [PATCH 118/149] bcm2835: Switch to firmware driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139990,17 +139990,17 @@ index 47f2a6a..c284414 100644 CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y -From 0dd4dae3071d135836946ab1b990061c0899e9b5 Mon Sep 17 00:00:00 2001 +From 564c166a50d6db491679366414e4c51d58b951d4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jul 2015 13:25:31 +0100 -Subject: [PATCH 119/131] Merge pull request #1059 from pelwell/rpi-4.0.y +Subject: [PATCH 119/149] Merge pull request #1059 from pelwell/rpi-4.0.y w1_therm: Back-port locking improvements from 4.2-rc1 --- - Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 | 6 + - Documentation/w1/slaves/w1_therm | 11 +- - drivers/w1/slaves/w1_therm.c | 162 ++++++++++++++++++++-- - 3 files changed, 163 insertions(+), 16 deletions(-) + Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 | 6 ++ + Documentation/w1/slaves/w1_therm | 11 ++- + drivers/w1/slaves/w1_therm.c | 102 +++++++++++++++++++++- + 3 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 diff --git a/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 b/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 @@ -140047,44 +140047,10 @@ index cc62a95..13411fe 100644 +w1_seq file. The file will contain a single line with an integer value +representing the device index in the bus starting at 0. diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c -index 1f11a20..2f029e8 100644 +index 55eb86c..2f029e8 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c -@@ -59,16 +59,32 @@ MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS28EA00)); - static int w1_strong_pullup = 1; - module_param_named(strong_pullup, w1_strong_pullup, int, 0); - -+struct w1_therm_family_data { -+ uint8_t rom[9]; -+ atomic_t refcnt; -+}; -+ -+/* return the address of the refcnt in the family data */ -+#define THERM_REFCNT(family_data) \ -+ (&((struct w1_therm_family_data*)family_data)->refcnt) -+ - static int w1_therm_add_slave(struct w1_slave *sl) - { -- sl->family_data = kzalloc(9, GFP_KERNEL); -+ sl->family_data = kzalloc(sizeof(struct w1_therm_family_data), -+ GFP_KERNEL); - if (!sl->family_data) - return -ENOMEM; -+ atomic_set(THERM_REFCNT(sl->family_data), 1); - return 0; - } - - static void w1_therm_remove_slave(struct w1_slave *sl) - { -+ int refcnt = atomic_sub_return(1, THERM_REFCNT(sl->family_data)); -+ while(refcnt) { -+ msleep(1000); -+ refcnt = atomic_read(THERM_REFCNT(sl->family_data)); -+ } - kfree(sl->family_data); - sl->family_data = NULL; - } -@@ -76,13 +92,24 @@ static void w1_therm_remove_slave(struct w1_slave *sl) +@@ -92,13 +92,24 @@ static void w1_therm_remove_slave(struct w1_slave *sl) static ssize_t w1_slave_show(struct device *device, struct device_attribute *attr, char *buf); @@ -140109,7 +140075,7 @@ index 1f11a20..2f029e8 100644 static struct w1_family_ops w1_therm_fops = { .add_slave = w1_therm_add_slave, -@@ -90,6 +117,12 @@ static struct w1_family_ops w1_therm_fops = { +@@ -106,6 +117,12 @@ static struct w1_family_ops w1_therm_fops = { .groups = w1_therm_groups, }; @@ -140122,7 +140088,7 @@ index 1f11a20..2f029e8 100644 static struct w1_family w1_therm_family_DS18S20 = { .fid = W1_THERM_DS18S20, .fops = &w1_therm_fops, -@@ -107,7 +140,7 @@ static struct w1_family w1_therm_family_DS1822 = { +@@ -123,7 +140,7 @@ static struct w1_family w1_therm_family_DS1822 = { static struct w1_family w1_therm_family_DS28EA00 = { .fid = W1_THERM_DS28EA00, @@ -140131,86 +140097,10 @@ index 1f11a20..2f029e8 100644 }; static struct w1_family w1_therm_family_DS1825 = { -@@ -194,13 +227,22 @@ static ssize_t w1_slave_show(struct device *device, - struct w1_slave *sl = dev_to_w1_slave(device); - struct w1_master *dev = sl->master; - u8 rom[9], crc, verdict, external_power; -- int i, max_trying = 10; -+ int i, ret, max_trying = 10; - ssize_t c = PAGE_SIZE; -+ u8 *family_data = sl->family_data; +@@ -316,6 +333,89 @@ static ssize_t w1_slave_show(struct device *device, + return ret; + } -- i = mutex_lock_interruptible(&dev->bus_mutex); -- if (i != 0) -- return i; -+ ret = mutex_lock_interruptible(&dev->bus_mutex); -+ if (ret != 0) -+ goto post_unlock; -+ -+ if(!sl->family_data) -+ { -+ ret = -ENODEV; -+ goto pre_unlock; -+ } - -+ /* prevent the slave from going away in sleep */ -+ atomic_inc(THERM_REFCNT(family_data)); - memset(rom, 0, sizeof(rom)); - - while (max_trying--) { -@@ -230,17 +272,19 @@ static ssize_t w1_slave_show(struct device *device, - mutex_unlock(&dev->bus_mutex); - - sleep_rem = msleep_interruptible(tm); -- if (sleep_rem != 0) -- return -EINTR; -+ if (sleep_rem != 0) { -+ ret = -EINTR; -+ goto post_unlock; -+ } - -- i = mutex_lock_interruptible(&dev->bus_mutex); -- if (i != 0) -- return i; -+ ret = mutex_lock_interruptible(&dev->bus_mutex); -+ if (ret != 0) -+ goto post_unlock; - } else if (!w1_strong_pullup) { - sleep_rem = msleep_interruptible(tm); - if (sleep_rem != 0) { -- mutex_unlock(&dev->bus_mutex); -- return -EINTR; -+ ret = -EINTR; -+ goto pre_unlock; - } - } - -@@ -269,19 +313,107 @@ static ssize_t w1_slave_show(struct device *device, - c -= snprintf(buf + PAGE_SIZE - c, c, ": crc=%02x %s\n", - crc, (verdict) ? "YES" : "NO"); - if (verdict) -- memcpy(sl->family_data, rom, sizeof(rom)); -+ memcpy(family_data, rom, sizeof(rom)); - else - dev_warn(device, "Read failed CRC check\n"); - - for (i = 0; i < 9; ++i) - c -= snprintf(buf + PAGE_SIZE - c, c, "%02x ", -- ((u8 *)sl->family_data)[i]); -+ ((u8 *)family_data)[i]); - - c -= snprintf(buf + PAGE_SIZE - c, c, "t=%d\n", - w1_convert_temp(rom, sl->family->fid)); -+ ret = PAGE_SIZE - c; -+ -+pre_unlock: - mutex_unlock(&dev->bus_mutex); - -+post_unlock: -+ atomic_dec(THERM_REFCNT(family_data)); -+ return ret; -+} -+ +#define W1_42_CHAIN 0x99 +#define W1_42_CHAIN_OFF 0x3C +#define W1_42_CHAIN_OFF_INV 0xC3 @@ -140288,18 +140178,20 @@ index 1f11a20..2f029e8 100644 + mutex_unlock(&sl->master->bus_mutex); + + c -= snprintf(buf + PAGE_SIZE - c, c, "%d\n", seq); - return PAGE_SIZE - c; ++ return PAGE_SIZE - c; +error: + mutex_unlock(&sl->master->bus_mutex); + return -EIO; - } - ++} ++ static int __init w1_therm_init(void) + { + int err, i; -From 042bc608f4877bcf9dd16db9657a33fcabd1023c Mon Sep 17 00:00:00 2001 +From 01f81174825984b4f3d309ffcdade224d94ab572 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 11:11:51 +0100 -Subject: [PATCH 120/131] vchiq_arm: Sort out the vmalloc case +Subject: [PATCH 120/149] vchiq_arm: Sort out the vmalloc case See: https://github.com/raspberrypi/linux/issues/1055 --- @@ -140338,10 +140230,10 @@ index 5edba23..56bff05 100644 *need_release = 0; /* do not try and release vmalloc pages */ } else { -From 133b98eee50e70510dbacae5b28a425987499bf8 Mon Sep 17 00:00:00 2001 +From 6a9ee1422507ded4b20bb30b34a1ae8151ae2141 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 121/131] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 121/149] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -140362,10 +140254,10 @@ index 92c909e..0535375 100644 }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 5705242586b4688004ff73869d53ac532c671f84 Mon Sep 17 00:00:00 2001 +From 710b1c336c5ca81b429212218b6209df1db468c9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 122/131] Merge pull request #1043 from XECDesign/sense-4.0 +Subject: [PATCH 122/149] Merge pull request #1043 from XECDesign/sense-4.0 mfd: Add Raspberry Pi Sense HAT core driver --- @@ -141298,10 +141190,10 @@ index 0000000..56196dc + +#endif -From dd0a5a6a6e441335df951679f1ee27bb8d35cdae Mon Sep 17 00:00:00 2001 +From 2dce729ff88f1ae4fc318dc36e16732c8f152469 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jul 2015 13:46:08 +0100 -Subject: [PATCH 123/131] leds-gpio: Implement the brightness_get method +Subject: [PATCH 123/149] leds-gpio: Implement the brightness_get method The power LED uses some clever logic that means it is driven by a voltage measuring circuit when configured as input, otherwise @@ -141344,10 +141236,10 @@ index 3cfbd6a..4e4e132 100644 state = !!gpiod_get_value_cansleep(led_dat->gpiod); else -From 232cca59a44a424f60e8af0517a3fb98c076393f Mon Sep 17 00:00:00 2001 +From 45d1edd1051ba8c3dcff92c18b0d56adea55ab5c Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Fri, 17 Jul 2015 09:50:55 +0200 -Subject: [PATCH 124/131] dmaengine: bcm2708-dmaengine: Fix memory leak when +Subject: [PATCH 124/149] dmaengine: bcm2708-dmaengine: Fix memory leak when stopping a running transfer --- @@ -141367,10 +141259,10 @@ index 987ed53..73c6c00 100644 bcm2835_dma_abort(c->chan_base); -From bc216042289449e4f8c07cea409a3d775d685a85 Mon Sep 17 00:00:00 2001 +From 5f40c5575ed6f7831637415de4e99400f270dd22 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:13 +0200 -Subject: [PATCH 125/131] BCM270X_DT: Fix I2S register map +Subject: [PATCH 125/149] BCM270X_DT: Fix I2S register map --- arch/arm/boot/dts/bcm2708_common.dtsi | 4 ++-- @@ -141392,10 +141284,10 @@ index 2dd25f7..728e14a 100644 //dmas = <&dma 2>, // <&dma 3>; -From a4c38fc82dc02bbf1bfdef2627c2ed1ed522611e Mon Sep 17 00:00:00 2001 +From cc5fa860bef4a444edca29c4493da61837e1b7e7 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 126/131] BCM2835_DT: Fix I2S register map +Subject: [PATCH 126/149] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -141449,10 +141341,10 @@ index 4a63704..1135120 100644 dmas = <&dma 2>, <&dma 3>; -From 76a6fde3d0ec48b42cc12cde51bb5713f8a8ee80 Mon Sep 17 00:00:00 2001 +From 0480e8bf45e8c4fd614ce16c1f3091d85ce95576 Mon Sep 17 00:00:00 2001 From: David Frey Date: Tue, 14 Jul 2015 15:57:36 +0200 -Subject: [PATCH 127/131] config: Enable SHT drivers for raspberry pi +Subject: [PATCH 127/149] config: Enable SHT drivers for raspberry pi The SHT temperature and humidity sensors are often used in weather station projects. @@ -141494,10 +141386,10 @@ index b9b5bdf..7b24274 100644 CONFIG_THERMAL_BCM2835=y CONFIG_WATCHDOG=y -From 49158f0283abf882fd4497394729fe8e03349ca8 Mon Sep 17 00:00:00 2001 +From a433727025805fd09e50b829738fc02b99446617 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:07:14 +0100 -Subject: [PATCH 128/131] BCM270X_DT: Correct typo in overlays/README +Subject: [PATCH 128/149] BCM270X_DT: Correct typo in overlays/README --- arch/arm/boot/dts/overlays/README | 2 +- @@ -141517,10 +141409,10 @@ index 8792f98..ed484ae 100644 i2c_arm Set to "on" to enable the ARM's i2c interface -From a5b4fabbfc1a60ae0cb13710b3084d62e6d1b27a Mon Sep 17 00:00:00 2001 +From 26be449bd477753ba005248dfde121a9e4c16a39 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 10:53:26 +0100 -Subject: [PATCH 129/131] bcm2835-sdhost: Add the ERASE capability +Subject: [PATCH 129/149] bcm2835-sdhost: Add the ERASE capability See: https://github.com/raspberrypi/linux/issues/1076 --- @@ -141541,10 +141433,10 @@ index d65870a..57a6ad3 100644 spin_lock_init(&host->lock); -From 48d4fef9df7f4d04ff6d7f37ab3b1c9b1737bdb3 Mon Sep 17 00:00:00 2001 +From 02c4ebf0f3e2f379496ce265f883e23a0b7be363 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 17:32:18 +0100 -Subject: [PATCH 130/131] bcm2835-sdhost: Ignore CRC7 for MMC CMD1 +Subject: [PATCH 130/149] bcm2835-sdhost: Ignore CRC7 for MMC CMD1 It seems that the sdhost interface returns CRC7 errors for CMD1, which is the MMC-specific SEND_OP_COND. Returning these errors to @@ -141608,10 +141500,10 @@ index 57a6ad3..84f645f 100644 if (host->cmd->flags & MMC_RSP_PRESENT) { -From e6a77a6da2720d0687e9cdd0e9656712f1317d55 Mon Sep 17 00:00:00 2001 +From 995b4ff06b418b3dbc8d560547c95d8e9e501c0c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:48:21 +0100 -Subject: [PATCH 131/131] BCM270X_DT: Add unit address to gpio node name +Subject: [PATCH 131/149] BCM270X_DT: Add unit address to gpio node name --- arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- @@ -141630,3 +141522,2264 @@ index 728e14a..cb608df 100644 compatible = "brcm,bcm2835-gpio"; reg = <0x7e200000 0xb4>; interrupts = <2 17>, <2 18>; + +From 56bc2c9c4ef10c7dc0b0ed9bf1868e2010e4adb6 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 24 Jul 2015 10:36:32 +0100 +Subject: [PATCH 132/149] BCM270X_DT: Use i2c_arm for rtc and bmp085 overlays + +--- + arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts | 2 +- + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts +index b830bf2..782b171 100644 +--- a/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts +@@ -6,7 +6,7 @@ + compatible = "brcm,bcm2708"; + + fragment@0 { +- target = <&i2c1>; ++ target = <&i2c_arm>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index 7052c71..fed4bd8 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -6,7 +6,7 @@ + compatible = "brcm,bcm2708"; + + fragment@0 { +- target = <&i2c1>; ++ target = <&i2c_arm>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + +From a3201af81c47ab3cf0ca61d3632a6df14e935b23 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 24 Jul 2015 12:11:31 +0100 +Subject: [PATCH 133/149] BCM2708_DT: CM dtparams for audio, watchdog and RNG + +--- + arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +index 34d4bc6..713e5a2 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +@@ -17,14 +17,14 @@ + status = "okay"; + }; + +-&audio { +- status = "okay"; +-}; +- + / { + __overrides__ { + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; ++ ++ audio = <&audio>,"status"; ++ watchdog = <&watchdog>,"status"; ++ random = <&random>,"status"; + }; + }; + +From 30929ea53242c1f5efc06caf4a17b9c7922fd437 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:13:18 +0200 +Subject: [PATCH 134/149] vchiq: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + .../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 17 +++++++++-------- + .../misc/vc04_services/interface/vchiq_arm/vchiq_arm.c | 17 +++++++++++++++++ + 3 files changed, 27 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index cb608df..df66e64 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -225,6 +225,7 @@ + reg = <0x7e00b840 0xf>; + interrupts = <0 2>; + cache-line-size = <32>; ++ firmware = <&firmware>; + }; + + thermal: thermal { +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +index 56bff05..c9febcc 100644 +--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +@@ -39,11 +39,11 @@ + #include + #include + #include +-#include + #include + #include + #include + #include ++#include + + #define TOTAL_SLOTS (VCHIQ_SLOT_ZERO_SLOTS + 2 * 32) + +@@ -89,10 +89,12 @@ free_pagelist(PAGELIST_T *pagelist, int actual); + int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) + { + struct device *dev = &pdev->dev; ++ struct rpi_firmware *fw = platform_get_drvdata(pdev); + VCHIQ_SLOT_ZERO_T *vchiq_slot_zero; + struct resource *res; + void *slot_mem; + dma_addr_t slot_phys; ++ u32 channelbase; + int slot_mem_size, frag_mem_size; + int err, irq, i; + +@@ -157,13 +159,12 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) + } + + /* Send the base address of the slots to VideoCore */ +- +- dsb(); /* Ensure all writes have completed */ +- +- err = bcm_mailbox_write(MBOX_CHAN_VCHIQ, (unsigned int)slot_phys); +- if (err) { +- dev_err(dev, "mailbox write failed\n"); +- return err; ++ channelbase = slot_phys; ++ err = rpi_firmware_property(fw, RPI_FIRMWARE_VCHIQ_INIT, ++ &channelbase, sizeof(channelbase)); ++ if (err || channelbase) { ++ dev_err(dev, "failed to set channelbase\n"); ++ return err ? : -ENXIO; + } + + vchiq_log_info(vchiq_arm_log_level, +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +index 31e2cba..e11c0e0 100644 +--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +@@ -45,7 +45,9 @@ + #include + #include + #include ++#include + #include ++#include + + #include "vchiq_core.h" + #include "vchiq_ioctl.h" +@@ -2793,9 +2795,24 @@ void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state, + + static int vchiq_probe(struct platform_device *pdev) + { ++ struct device_node *fw_node; ++ struct rpi_firmware *fw; + int err; + void *ptr_err; + ++ fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0); ++/* Remove comment when booting without Device Tree is no longer supported ++ if (!fw_node) { ++ dev_err(&pdev->dev, "Missing firmware node\n"); ++ return -ENOENT; ++ } ++*/ ++ fw = rpi_firmware_get(fw_node); ++ if (!fw) ++ return -EPROBE_DEFER; ++ ++ platform_set_drvdata(pdev, fw); ++ + /* create debugfs entries */ + err = vchiq_debugfs_init(); + if (err != 0) + +From 978ebf9c4c2ef238e19ea1478b5fd11c3252c912 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:17:10 +0200 +Subject: [PATCH 135/149] thermal: bcm2835: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. +Remove retry loop on failure to read temperature. +Clean up code. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + drivers/thermal/bcm2835-thermal.c | 197 +++++++++++++--------------------- + 2 files changed, 75 insertions(+), 123 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index df66e64..bd8ac0a 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -230,6 +230,7 @@ + + thermal: thermal { + compatible = "brcm,bcm2835-thermal"; ++ firmware = <&firmware>; + }; + }; + +diff --git a/drivers/thermal/bcm2835-thermal.c b/drivers/thermal/bcm2835-thermal.c +index 3bc80f1..c1d8f1b 100644 +--- a/drivers/thermal/bcm2835-thermal.c ++++ b/drivers/thermal/bcm2835-thermal.c +@@ -12,161 +12,113 @@ + * consent. + *****************************************************************************/ + +-#include + #include +-#include +-#include + #include +-#include +-#include + #include ++#include + +- +-/* --- DEFINITIONS --- */ +-#define MODULE_NAME "bcm2835_thermal" +- +-/*#define THERMAL_DEBUG_ENABLE*/ +- +-#ifdef THERMAL_DEBUG_ENABLE +-#define print_debug(fmt,...) printk(KERN_INFO "%s:%s:%d: "fmt"\n", MODULE_NAME, __func__, __LINE__, ##__VA_ARGS__) +-#else +-#define print_debug(fmt,...) +-#endif +-#define print_err(fmt,...) printk(KERN_ERR "%s:%s:%d: "fmt"\n", MODULE_NAME, __func__,__LINE__, ##__VA_ARGS__) +- +-#define VC_TAG_GET_TEMP 0x00030006 +-#define VC_TAG_GET_MAX_TEMP 0x0003000A +- +-typedef enum { +- TEMP, +- MAX_TEMP, +-} temp_type; +- +-/* --- STRUCTS --- */ +-/* tag part of the message */ +-struct vc_msg_tag { +- uint32_t tag_id; /* the tag ID for the temperature */ +- uint32_t buffer_size; /* size of the buffer (should be 8) */ +- uint32_t request_code; /* identifies message as a request (should be 0) */ +- uint32_t id; /* extra ID field (should be 0) */ +- uint32_t val; /* returned value of the temperature */ +-}; +- +-/* message structure to be sent to videocore */ +-struct vc_msg { +- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */ +- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */ +- struct vc_msg_tag tag; /* the tag structure above to make */ +- uint32_t end_tag; /* an end identifier, should be set to NULL */ +-}; +- +-struct bcm2835_thermal_data { +- struct thermal_zone_device *thermal_dev; +- struct vc_msg msg; +-}; +- +-/* --- GLOBALS --- */ +-static struct bcm2835_thermal_data bcm2835_data; +- +-/* Thermal Device Operations */ +-static struct thermal_zone_device_ops ops; +- +-/* --- FUNCTIONS --- */ +- +-static int bcm2835_get_temp_or_max(struct thermal_zone_device *thermal_dev, unsigned long *temp, unsigned tag_id) ++static int bcm2835_thermal_get_property(struct thermal_zone_device *tz, ++ unsigned long *temp, u32 tag) + { +- int result = -1, retry = 3; +- print_debug("IN"); ++ struct rpi_firmware *fw = tz->devdata; ++ struct { ++ u32 id; ++ u32 val; ++ } packet; ++ int ret; + + *temp = 0; +- while (result != 0 && retry-- > 0) { +- /* wipe all previous message data */ +- memset(&bcm2835_data.msg, 0, sizeof bcm2835_data.msg); +- +- /* prepare message */ +- bcm2835_data.msg.msg_size = sizeof bcm2835_data.msg; +- bcm2835_data.msg.tag.buffer_size = 8; +- bcm2835_data.msg.tag.tag_id = tag_id; +- +- /* send the message */ +- result = bcm_mailbox_property(&bcm2835_data.msg, sizeof bcm2835_data.msg); +- print_debug("Got %stemperature as %u (%d,%x)\n", tag_id==VC_TAG_GET_MAX_TEMP ? "max ":"", (uint)bcm2835_data.msg.tag.val, result, bcm2835_data.msg.request_code); +- if (!(bcm2835_data.msg.request_code & 0x80000000)) +- result = -1; ++ packet.id = 0; ++ ret = rpi_firmware_property(fw, tag, &packet, sizeof(packet)); ++ if (ret) { ++ dev_err(&tz->device, "Failed to get temperature\n"); ++ return ret; + } + +- /* check if it was all ok and return the rate in milli degrees C */ +- if (result == 0) +- *temp = (uint)bcm2835_data.msg.tag.val; +- else +- print_err("Failed to get temperature! (%x:%d)\n", tag_id, result); +- print_debug("OUT"); +- return result; ++ *temp = packet.val; ++ dev_dbg(&tz->device, "%stemp=%lu\n", ++ tag == RPI_FIRMWARE_GET_MAX_TEMPERATURE ? "max" : "", *temp); ++ ++ return 0; + } + +-static int bcm2835_get_temp(struct thermal_zone_device *thermal_dev, unsigned long *temp) ++static int bcm2835_thermal_get_temp(struct thermal_zone_device *tz, ++ unsigned long *temp) + { +- return bcm2835_get_temp_or_max(thermal_dev, temp, VC_TAG_GET_TEMP); ++ return bcm2835_thermal_get_property(tz, temp, ++ RPI_FIRMWARE_GET_TEMPERATURE); + } + +-static int bcm2835_get_max_temp(struct thermal_zone_device *thermal_dev, int trip_num, unsigned long *temp) ++static int bcm2835_thermal_get_max_temp(struct thermal_zone_device *tz, ++ int trip, unsigned long *temp) + { +- return bcm2835_get_temp_or_max(thermal_dev, temp, VC_TAG_GET_MAX_TEMP); ++ /* ++ * The maximum safe temperature of the SoC. ++ * Overclock may be disabled above this temperature. ++ */ ++ return bcm2835_thermal_get_property(tz, temp, ++ RPI_FIRMWARE_GET_MAX_TEMPERATURE); + } + +-static int bcm2835_get_trip_type(struct thermal_zone_device * thermal_dev, int trip_num, enum thermal_trip_type *trip_type) ++static int bcm2835_thermal_get_trip_type(struct thermal_zone_device *tz, ++ int trip, enum thermal_trip_type *type) + { +- *trip_type = THERMAL_TRIP_HOT; ++ *type = THERMAL_TRIP_HOT; ++ + return 0; + } + +- +-static int bcm2835_get_mode(struct thermal_zone_device *thermal_dev, enum thermal_device_mode *dev_mode) ++static int bcm2835_thermal_get_mode(struct thermal_zone_device *tz, ++ enum thermal_device_mode *mode) + { +- *dev_mode = THERMAL_DEVICE_ENABLED; ++ *mode = THERMAL_DEVICE_ENABLED; ++ + return 0; + } + ++static struct thermal_zone_device_ops ops = { ++ .get_temp = bcm2835_thermal_get_temp, ++ .get_trip_temp = bcm2835_thermal_get_max_temp, ++ .get_trip_type = bcm2835_thermal_get_trip_type, ++ .get_mode = bcm2835_thermal_get_mode, ++}; + + static int bcm2835_thermal_probe(struct platform_device *pdev) + { +- print_debug("IN"); +- print_debug("THERMAL Driver has been probed!"); +- +- /* check that the device isn't null!*/ +- if(pdev == NULL) +- { +- print_debug("Platform device is empty!"); +- return -ENODEV; ++ struct device_node *fw_np; ++ struct rpi_firmware *fw; ++ struct thermal_zone_device *tz; ++ ++ fw_np = of_parse_phandle(pdev->dev.of_node, "firmware", 0); ++/* Remove comment when booting without Device Tree is no longer supported ++ if (!fw_np) { ++ dev_err(&pdev->dev, "Missing firmware node\n"); ++ return -ENOENT; + } +- +- if(!(bcm2835_data.thermal_dev = thermal_zone_device_register("bcm2835_thermal", 1, 0, NULL, &ops, NULL, 0, 0))) +- { +- print_debug("Unable to register the thermal device!"); +- return -EFAULT; ++*/ ++ fw = rpi_firmware_get(fw_np); ++ if (!fw) ++ return -EPROBE_DEFER; ++ ++ tz = thermal_zone_device_register("bcm2835_thermal", 1, 0, fw, &ops, ++ NULL, 0, 0); ++ if (IS_ERR(tz)) { ++ dev_err(&pdev->dev, "Failed to register the thermal device\n"); ++ return PTR_ERR(tz); + } ++ ++ platform_set_drvdata(pdev, tz); ++ + return 0; + } + +- + static int bcm2835_thermal_remove(struct platform_device *pdev) + { +- print_debug("IN"); +- +- thermal_zone_device_unregister(bcm2835_data.thermal_dev); +- +- print_debug("OUT"); ++ thermal_zone_device_unregister(platform_get_drvdata(pdev)); + + return 0; + } + +-static struct thermal_zone_device_ops ops = { +- .get_temp = bcm2835_get_temp, +- .get_trip_temp = bcm2835_get_max_temp, +- .get_trip_type = bcm2835_get_trip_type, +- .get_mode = bcm2835_get_mode, +-}; +- + static const struct of_device_id bcm2835_thermal_of_match_table[] = { + { .compatible = "brcm,bcm2835-thermal", }, + {}, +@@ -177,14 +129,13 @@ static struct platform_driver bcm2835_thermal_driver = { + .probe = bcm2835_thermal_probe, + .remove = bcm2835_thermal_remove, + .driver = { +- .name = "bcm2835_thermal", +- .owner = THIS_MODULE, +- .of_match_table = bcm2835_thermal_of_match_table, +- }, ++ .name = "bcm2835_thermal", ++ .of_match_table = bcm2835_thermal_of_match_table, ++ }, + }; ++module_platform_driver(bcm2835_thermal_driver); + +-MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Dorian Peake"); ++MODULE_AUTHOR("Noralf Trønnes"); + MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +- +-module_platform_driver(bcm2835_thermal_driver); ++MODULE_LICENSE("GPL"); + +From 26b1f0b224f9e59fc87d02e8d0a683a3ca847356 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:18:36 +0200 +Subject: [PATCH 136/149] cpufreq: bcm2835: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. + +Signed-off-by: Noralf Trønnes +--- + drivers/cpufreq/bcm2835-cpufreq.c | 117 +++++++++++++++++--------------------- + 1 file changed, 53 insertions(+), 64 deletions(-) + +diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c +index 6735da9..3eb9e93 100644 +--- a/drivers/cpufreq/bcm2835-cpufreq.c ++++ b/drivers/cpufreq/bcm2835-cpufreq.c +@@ -26,7 +26,7 @@ + #include + #include + #include +-#include ++#include + + /* ---------- DEFINES ---------- */ + /*#define CPUFREQ_DEBUG_ENABLE*/ /* enable debugging */ +@@ -43,23 +43,6 @@ + #define print_err(fmt,...) pr_err("%s:%s:%d: "fmt, MODULE_NAME, __func__,__LINE__, ##__VA_ARGS__) + #define print_info(fmt,...) pr_info("%s: "fmt, MODULE_NAME, ##__VA_ARGS__) + +-/* tag part of the message */ +-struct vc_msg_tag { +- uint32_t tag_id; /* the message id */ +- uint32_t buffer_size; /* size of the buffer (which in this case is always 8 bytes) */ +- uint32_t data_size; /* amount of data being sent or received */ +- uint32_t dev_id; /* the ID of the clock/voltage to get or set */ +- uint32_t val; /* the value (e.g. rate (in Hz)) to set */ +-}; +- +-/* message structure to be sent to videocore */ +-struct vc_msg { +- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */ +- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */ +- struct vc_msg_tag tag; /* the tag structure above to make */ +- uint32_t end_tag; /* an end identifier, should be set to NULL */ +-}; +- + /* ---------- GLOBALS ---------- */ + static struct cpufreq_driver bcm2835_cpufreq_driver; /* the cpufreq driver global */ + +@@ -74,62 +57,63 @@ static struct cpufreq_frequency_table bcm2835_freq_table[] = { + clk_rate either gets or sets the clock rates. + =============================================== + */ +-static uint32_t bcm2835_cpufreq_set_clock(int cur_rate, int arm_rate) ++ ++static int bcm2835_cpufreq_clock_property(u32 tag, u32 id, u32 *val) + { +- int s, actual_rate=0; +- struct vc_msg msg; ++ struct rpi_firmware *fw = rpi_firmware_get(NULL); ++ struct { ++ u32 id; ++ u32 val; ++ } packet; ++ int ret; ++ ++ packet.id = id; ++ packet.val = *val; ++ ret = rpi_firmware_property(fw, tag, &packet, sizeof(packet)); ++ if (ret) ++ return ret; + +- /* wipe all previous message data */ +- memset(&msg, 0, sizeof msg); ++ *val = packet.val; + +- msg.msg_size = sizeof msg; ++ return 0; ++} + +- msg.tag.tag_id = VCMSG_SET_CLOCK_RATE; +- msg.tag.buffer_size = 8; +- msg.tag.data_size = 8; /* we're sending the clock ID and the new rates which is a total of 2 words */ +- msg.tag.dev_id = VCMSG_ID_ARM_CLOCK; +- msg.tag.val = arm_rate * 1000; ++static uint32_t bcm2835_cpufreq_set_clock(int cur_rate, int arm_rate) ++{ ++ u32 rate = arm_rate * 1000; ++ int ret; + +- /* send the message */ +- s = bcm_mailbox_property(&msg, sizeof msg); ++ ret = bcm2835_cpufreq_clock_property(RPI_FIRMWARE_SET_CLOCK_RATE, VCMSG_ID_ARM_CLOCK, &rate); ++ if (ret) { ++ print_err("Failed to set clock: %d (%d)\n", arm_rate, ret); ++ return 0; ++ } + +- /* check if it was all ok and return the rate in KHz */ +- if (s == 0 && (msg.request_code & 0x80000000)) +- actual_rate = msg.tag.val/1000; ++ rate /= 1000; ++ print_debug("Setting new frequency = %d -> %d (actual %d)\n", cur_rate, arm_rate, rate); + +- print_debug("Setting new frequency = %d -> %d (actual %d)\n", cur_rate, arm_rate, actual_rate); +- return actual_rate; ++ return rate; + } + + static uint32_t bcm2835_cpufreq_get_clock(int tag) + { +- int s; +- int arm_rate = 0; +- struct vc_msg msg; +- +- /* wipe all previous message data */ +- memset(&msg, 0, sizeof msg); +- +- msg.msg_size = sizeof msg; +- msg.tag.tag_id = tag; +- msg.tag.buffer_size = 8; +- msg.tag.data_size = 4; /* we're just sending the clock ID which is one word long */ +- msg.tag.dev_id = VCMSG_ID_ARM_CLOCK; ++ u32 rate; ++ int ret; + +- /* send the message */ +- s = bcm_mailbox_property(&msg, sizeof msg); +- +- /* check if it was all ok and return the rate in KHz */ +- if (s == 0 && (msg.request_code & 0x80000000)) +- arm_rate = msg.tag.val/1000; ++ ret = bcm2835_cpufreq_clock_property(tag, VCMSG_ID_ARM_CLOCK, &rate); ++ if (ret) { ++ print_err("Failed to get clock (%d)\n", ret); ++ return 0; ++ } + +- print_debug("%s frequency = %d\n", +- tag == VCMSG_GET_CLOCK_RATE ? "Current": +- tag == VCMSG_GET_MIN_CLOCK ? "Min": +- tag == VCMSG_GET_MAX_CLOCK ? "Max": +- "Unexpected", arm_rate); ++ rate /= 1000; ++ print_debug("%s frequency = %u\n", ++ tag == RPI_FIRMWARE_GET_CLOCK_RATE ? "Current": ++ tag == RPI_FIRMWARE_GET_MIN_CLOCK_RATE ? "Min": ++ tag == RPI_FIRMWARE_GET_MAX_CLOCK_RATE ? "Max": ++ "Unexpected", rate); + +- return arm_rate; ++ return rate; + } + + /* +@@ -165,9 +149,14 @@ static int bcm2835_cpufreq_driver_init(struct cpufreq_policy *policy) + /* measured value of how long it takes to change frequency */ + const unsigned int transition_latency = 355000; /* ns */ + ++ if (!rpi_firmware_get(NULL)) { ++ print_err("Firmware is not available\n"); ++ return -ENODEV; ++ } ++ + /* now find out what the maximum and minimum frequencies are */ +- bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MIN_CLOCK); +- bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MAX_CLOCK); ++ bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_MIN_CLOCK_RATE); ++ bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_MAX_CLOCK_RATE); + + print_info("min=%d max=%d\n", bcm2835_freq_table[0].frequency, bcm2835_freq_table[1].frequency); + return cpufreq_generic_init(policy, bcm2835_freq_table, transition_latency); +@@ -201,8 +190,8 @@ static int bcm2835_cpufreq_driver_target_index(struct cpufreq_policy *policy, un + + static unsigned int bcm2835_cpufreq_driver_get(unsigned int cpu) + { +- unsigned int actual_rate = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); +- print_debug("%d: freq=%d\n", cpu, actual_rate); ++ unsigned int actual_rate = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_CLOCK_RATE); ++ print_debug("cpu%d: freq=%d\n", cpu, actual_rate); + return actual_rate <= bcm2835_freq_table[0].frequency ? bcm2835_freq_table[0].frequency : bcm2835_freq_table[1].frequency; + } + + +From a15106c0300ea7958fa7e1cc62c573d999eb4ee2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:20:59 +0200 +Subject: [PATCH 137/149] fbdev: bcm2708: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + drivers/video/fbdev/bcm2708_fb.c | 273 +++++++++++++++++++--------------- + 2 files changed, 152 insertions(+), 122 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index bd8ac0a..d1c3bdf 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -217,6 +217,7 @@ + + fb: fb { + compatible = "brcm,bcm2708-fb"; ++ firmware = <&firmware>; + status = "disabled"; + }; + +diff --git a/drivers/video/fbdev/bcm2708_fb.c b/drivers/video/fbdev/bcm2708_fb.c +index f6ac7da..06a96d16 100644 +--- a/drivers/video/fbdev/bcm2708_fb.c ++++ b/drivers/video/fbdev/bcm2708_fb.c +@@ -25,7 +25,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -34,6 +33,7 @@ + #include + #include + #include ++#include + + //#define BCM2708_FB_DEBUG + #define MODULE_NAME "bcm2708_fb" +@@ -58,15 +58,19 @@ static u32 dma_busy_wait_threshold = 1<<15; + module_param(dma_busy_wait_threshold, int, 0644); + MODULE_PARM_DESC(dma_busy_wait_threshold, "Busy-wait for DMA completion below this area"); + +-/* this data structure describes each frame buffer device we find */ +- +-struct fbinfo_s { +- u32 xres, yres, xres_virtual, yres_virtual; +- u32 pitch, bpp; ++struct fb_alloc_tags { ++ struct rpi_firmware_property_tag_header tag1; ++ u32 xres, yres; ++ struct rpi_firmware_property_tag_header tag2; ++ u32 xres_virtual, yres_virtual; ++ struct rpi_firmware_property_tag_header tag3; ++ u32 bpp; ++ struct rpi_firmware_property_tag_header tag4; + u32 xoffset, yoffset; +- u32 base; +- u32 screen_size; +- u16 cmap[256]; ++ struct rpi_firmware_property_tag_header tag5; ++ u32 base, screen_size; ++ struct rpi_firmware_property_tag_header tag6; ++ u32 pitch; + }; + + struct bcm2708_fb_stats { +@@ -78,9 +82,9 @@ struct bcm2708_fb_stats { + struct bcm2708_fb { + struct fb_info fb; + struct platform_device *dev; +- struct fbinfo_s *info; +- dma_addr_t dma; ++ struct rpi_firmware *fw; + u32 cmap[16]; ++ u32 gpu_cmap[256]; + int dma_chan; + int dma_irq; + void __iomem *dma_chan_base; +@@ -270,69 +274,71 @@ static int bcm2708_fb_check_var(struct fb_var_screeninfo *var, + + static int bcm2708_fb_set_par(struct fb_info *info) + { +- uint32_t val = 0; + struct bcm2708_fb *fb = to_bcm2708(info); +- volatile struct fbinfo_s *fbinfo = fb->info; +- fbinfo->xres = info->var.xres; +- fbinfo->yres = info->var.yres; +- fbinfo->xres_virtual = info->var.xres_virtual; +- fbinfo->yres_virtual = info->var.yres_virtual; +- fbinfo->bpp = info->var.bits_per_pixel; +- fbinfo->xoffset = info->var.xoffset; +- fbinfo->yoffset = info->var.yoffset; +- fbinfo->base = 0; /* filled in by VC */ +- fbinfo->pitch = 0; /* filled in by VC */ ++ struct fb_alloc_tags fbinfo = { ++ .tag1 = { RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT, ++ 8, 0, }, ++ .xres = info->var.xres, ++ .yres = info->var.yres, ++ .tag2 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT, ++ 8, 0, }, ++ .xres_virtual = info->var.xres_virtual, ++ .yres_virtual = info->var.yres_virtual, ++ .tag3 = { RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH, 4, 0 }, ++ .bpp = info->var.bits_per_pixel, ++ .tag4 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET, 8, 0 }, ++ .xoffset = info->var.xoffset, ++ .yoffset = info->var.yoffset, ++ .tag5 = { RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE, 8, 0 }, ++ .base = 0, ++ .screen_size = 0, ++ .tag6 = { RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH, 4, 0 }, ++ .pitch = 0, ++ }; ++ int ret; + + print_debug("bcm2708_fb_set_par info(%p) %dx%d (%dx%d), %d, %d\n", info, + info->var.xres, info->var.yres, info->var.xres_virtual, + info->var.yres_virtual, (int)info->screen_size, + info->var.bits_per_pixel); + +- /* ensure last write to fbinfo is visible to GPU */ +- wmb(); +- +- /* inform vc about new framebuffer */ +- bcm_mailbox_write(MBOX_CHAN_FB, fb->dma); +- +- /* TODO: replace fb driver with vchiq version */ +- /* wait for response */ +- bcm_mailbox_read(MBOX_CHAN_FB, &val); +- +- /* ensure GPU writes are visible to us */ +- rmb(); +- +- if (val == 0) { +- fb->fb.fix.line_length = fbinfo->pitch; +- +- if (info->var.bits_per_pixel <= 8) +- fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR; +- else +- fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; +- +- fb->fb_bus_address = fbinfo->base; +- fbinfo->base &= ~0xc0000000; +- fb->fb.fix.smem_start = fbinfo->base; +- fb->fb.fix.smem_len = fbinfo->pitch * fbinfo->yres_virtual; +- fb->fb.screen_size = fbinfo->screen_size; +- if (fb->fb.screen_base) +- iounmap(fb->fb.screen_base); +- fb->fb.screen_base = +- (void *)ioremap_wc(fbinfo->base, fb->fb.screen_size); +- if (!fb->fb.screen_base) { +- /* the console may currently be locked */ +- console_trylock(); +- console_unlock(); +- pr_err("bcm2708_fb_set_par: Failed to set screen_base\n"); +- return -EIO; +- } ++ ret = rpi_firmware_property_list(fb->fw, &fbinfo, sizeof(fbinfo)); ++ if (ret) { ++ dev_err(info->device, ++ "Failed to allocate GPU framebuffer (%d)\n", ret); ++ return ret; + } ++ ++ if (info->var.bits_per_pixel <= 8) ++ fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR; ++ else ++ fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; ++ ++ fb->fb.fix.line_length = fbinfo.pitch; ++ fbinfo.base |= 0x40000000; ++ fb->fb_bus_address = fbinfo.base; ++ fbinfo.base &= ~0xc0000000; ++ fb->fb.fix.smem_start = fbinfo.base; ++ fb->fb.fix.smem_len = fbinfo.pitch * fbinfo.yres_virtual; ++ fb->fb.screen_size = fbinfo.screen_size; ++ if (fb->fb.screen_base) ++ iounmap(fb->fb.screen_base); ++ fb->fb.screen_base = ioremap_wc(fbinfo.base, fb->fb.screen_size); ++ if (!fb->fb.screen_base) { ++ /* the console may currently be locked */ ++ console_trylock(); ++ console_unlock(); ++ dev_err(info->device, "Failed to set screen_base\n"); ++ return -ENOMEM; ++ } ++ + print_debug +- ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d success=%d\n", ++ ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d\n", + (void *)fb->fb.screen_base, (void *)fb->fb_bus_address, +- fbinfo->xres, fbinfo->yres, fbinfo->bpp, +- fbinfo->pitch, (int)fb->fb.screen_size, val); ++ fbinfo.xres, fbinfo.yres, fbinfo.bpp, ++ fbinfo.pitch, (int)fb->fb.screen_size); + +- return val; ++ return 0; + } + + static inline u32 convert_bitfield(int val, struct fb_bitfield *bf) +@@ -352,15 +358,34 @@ static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red, + /*print_debug("BCM2708FB: setcolreg %d:(%02x,%02x,%02x,%02x) %x\n", regno, red, green, blue, transp, fb->fb.fix.visual);*/ + if (fb->fb.var.bits_per_pixel <= 8) { + if (regno < 256) { +- /* blue [0:4], green [5:10], red [11:15] */ +- fb->info->cmap[regno] = ((red >> (16-5)) & 0x1f) << 11 | +- ((green >> (16-6)) & 0x3f) << 5 | +- ((blue >> (16-5)) & 0x1f) << 0; ++ /* blue [23:16], green [15:8], red [7:0] */ ++ fb->gpu_cmap[regno] = ((red >> 8) & 0xff) << 0 | ++ ((green >> 8) & 0xff) << 8 | ++ ((blue >> 8) & 0xff) << 16; + } + /* Hack: we need to tell GPU the palette has changed, but currently bcm2708_fb_set_par takes noticable time when called for every (256) colour */ + /* So just call it for what looks like the last colour in a list for now. */ +- if (regno == 15 || regno == 255) +- bcm2708_fb_set_par(info); ++ if (regno == 15 || regno == 255) { ++ struct packet { ++ u32 offset; ++ u32 length; ++ u32 cmap[256]; ++ } *packet; ++ int ret; ++ ++ packet = kmalloc(sizeof(*packet), GFP_KERNEL); ++ if (!packet) ++ return -ENOMEM; ++ packet->offset = 0; ++ packet->length = regno + 1; ++ memcpy(packet->cmap, fb->gpu_cmap, sizeof(packet->cmap)); ++ ret = rpi_firmware_property(fb->fw, RPI_FIRMWARE_FRAMEBUFFER_SET_PALETTE, ++ packet, (2 + packet->length) * sizeof(u32)); ++ if (ret || packet->offset) ++ dev_err(info->device, "Failed to set palette (%d,%u)\n", ++ ret, packet->offset); ++ kfree(packet); ++ } + } else if (regno < 16) { + fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) | + convert_bitfield(blue, &fb->fb.var.blue) | +@@ -372,27 +397,31 @@ static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red, + + static int bcm2708_fb_blank(int blank_mode, struct fb_info *info) + { +- s32 result = -1; +- u32 p[7]; +- if ( (blank_mode == FB_BLANK_NORMAL) || +- (blank_mode == FB_BLANK_UNBLANK)) { +- +- p[0] = 28; // size = sizeof u32 * length of p +- p[1] = VCMSG_PROCESS_REQUEST; // process request +- p[2] = VCMSG_SET_BLANK_SCREEN; // (the tag id) +- p[3] = 4; // (size of the response buffer) +- p[4] = 4; // (size of the request data) +- p[5] = blank_mode; +- p[6] = VCMSG_PROPERTY_END; // end tag +- +- bcm_mailbox_property(&p, p[0]); +- +- if ( p[1] == VCMSG_REQUEST_SUCCESSFUL ) +- result = 0; +- else +- pr_err("bcm2708_fb_blank(%d) returns=%d p[1]=0x%x\n", blank_mode, p[5], p[1]); ++ struct bcm2708_fb *fb = to_bcm2708(info); ++ u32 value; ++ int ret; ++ ++ switch (blank_mode) { ++ case FB_BLANK_UNBLANK: ++ value = 0; ++ break; ++ case FB_BLANK_NORMAL: ++ case FB_BLANK_VSYNC_SUSPEND: ++ case FB_BLANK_HSYNC_SUSPEND: ++ case FB_BLANK_POWERDOWN: ++ value = 1; ++ break; ++ default: ++ return -EINVAL; + } +- return result; ++ ++ ret = rpi_firmware_property(fb->fw, RPI_FIRMWARE_FRAMEBUFFER_BLANK, ++ &value, sizeof(value)); ++ if (ret) ++ dev_err(info->device, "bcm2708_fb_blank(%d) failed: %d\n", ++ blank_mode, ret); ++ ++ return ret; + } + + static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) +@@ -408,25 +437,25 @@ static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info + + static int bcm2708_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) + { +- s32 result = -1; +- u32 p[7]; +- if (cmd == FBIO_WAITFORVSYNC) { +- p[0] = 28; // size = sizeof u32 * length of p +- p[1] = VCMSG_PROCESS_REQUEST; // process request +- p[2] = VCMSG_SET_VSYNC; // (the tag id) +- p[3] = 4; // (size of the response buffer) +- p[4] = 4; // (size of the request data) +- p[5] = 0; // dummy +- p[6] = VCMSG_PROPERTY_END; // end tag +- +- bcm_mailbox_property(&p, p[0]); +- +- if ( p[1] == VCMSG_REQUEST_SUCCESSFUL ) +- result = 0; +- else +- pr_err("bcm2708_fb_ioctl %x,%lx returns=%d p[1]=0x%x\n", cmd, arg, p[5], p[1]); ++ struct bcm2708_fb *fb = to_bcm2708(info); ++ u32 dummy = 0; ++ int ret; ++ ++ switch (cmd) { ++ case FBIO_WAITFORVSYNC: ++ ret = rpi_firmware_property(fb->fw, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_VSYNC, ++ &dummy, sizeof(dummy)); ++ break; ++ default: ++ dev_err(info->device, "Unknown ioctl 0x%x\n", cmd); ++ return -EINVAL; + } +- return result; ++ ++ if (ret) ++ dev_err(info->device, "ioctl 0x%x failed (%d)\n", cmd, ret); ++ ++ return ret; + } + static void bcm2708_fb_fillrect(struct fb_info *info, + const struct fb_fillrect *rect) +@@ -621,20 +650,7 @@ static struct fb_ops bcm2708_fb_ops = { + static int bcm2708_fb_register(struct bcm2708_fb *fb) + { + int ret; +- dma_addr_t dma; +- void *mem; +- +- mem = +- dma_alloc_coherent(&fb->dev->dev, PAGE_ALIGN(sizeof(*fb->info)), &dma, +- GFP_KERNEL); + +- if (NULL == mem) { +- pr_err(": unable to allocate fbinfo buffer\n"); +- ret = -ENOMEM; +- } else { +- fb->info = (struct fbinfo_s *)mem; +- fb->dma = dma; +- } + fb->fb.fbops = &bcm2708_fb_ops; + fb->fb.flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_COPYAREA; + fb->fb.pseudo_palette = fb->cmap; +@@ -693,9 +709,22 @@ static int bcm2708_fb_register(struct bcm2708_fb *fb) + + static int bcm2708_fb_probe(struct platform_device *dev) + { ++ struct device_node *fw_np; ++ struct rpi_firmware *fw; + struct bcm2708_fb *fb; + int ret; + ++ fw_np = of_parse_phandle(dev->dev.of_node, "firmware", 0); ++/* Remove comment when booting without Device Tree is no longer supported ++ if (!fw_np) { ++ dev_err(&dev->dev, "Missing firmware node\n"); ++ return -ENOENT; ++ } ++*/ ++ fw = rpi_firmware_get(fw_np); ++ if (!fw) ++ return -EPROBE_DEFER; ++ + fb = kzalloc(sizeof(struct bcm2708_fb), GFP_KERNEL); + if (!fb) { + dev_err(&dev->dev, +@@ -704,6 +733,7 @@ static int bcm2708_fb_probe(struct platform_device *dev) + goto free_region; + } + ++ fb->fw = fw; + bcm2708_fb_debugfs_init(fb); + + fb->cb_base = dma_alloc_writecombine(&dev->dev, SZ_64K, +@@ -737,6 +767,7 @@ static int bcm2708_fb_probe(struct platform_device *dev) + fb->dma_chan, fb->dma_chan_base); + + fb->dev = dev; ++ fb->fb.device = &dev->dev; + + ret = bcm2708_fb_register(fb); + if (ret == 0) { +@@ -769,8 +800,6 @@ static int bcm2708_fb_remove(struct platform_device *dev) + dma_free_writecombine(&dev->dev, SZ_64K, fb->cb_base, fb->cb_handle); + bcm_dma_chan_free(fb->dma_chan); + +- dma_free_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), (void *)fb->info, +- fb->dma); + bcm2708_fb_debugfs_deinit(fb); + + free_irq(fb->dma_irq, fb); + +From 8af174253322c75147e90fbc0ec0698d171e15ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:27:17 +0200 +Subject: [PATCH 138/149] bcm2835: Add firmware property to affected devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Also move firmware depending devices to the rpi dtsi file since +they depend on the Pi specific firmware. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2835-rpi.dtsi | 22 ++++++++++++++++++---- + arch/arm/boot/dts/bcm2835.dtsi | 15 --------------- + 2 files changed, 18 insertions(+), 19 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi +index 5cdfd5a..6c3daaf 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi +@@ -32,6 +32,24 @@ + compatible = "raspberrypi,bcm2835-firmware"; + mboxes = <&mailbox>; + }; ++ ++ fb: fb { ++ compatible = "brcm,bcm2708-fb"; ++ firmware = <&firmware>; ++ }; ++ ++ thermal: thermal { ++ compatible = "brcm,bcm2835-thermal"; ++ firmware = <&firmware>; ++ }; ++ ++ vchiq: vchiq { ++ compatible = "brcm,bcm2835-vchiq"; ++ reg = <0x7e00b840 0xf>; ++ interrupts = <0 2>; ++ cache-line-size = <32>; ++ firmware = <&firmware>; ++ }; + }; + + /* Onboard audio */ +@@ -101,10 +119,6 @@ + bus-width = <4>; + }; + +-&fb { +- status = "okay"; +-}; +- + / { + __overrides__ { + i2s = <&i2s>,"status"; +diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi +index 1135120..807264d 100644 +--- a/arch/arm/boot/dts/bcm2835.dtsi ++++ b/arch/arm/boot/dts/bcm2835.dtsi +@@ -160,21 +160,6 @@ + arm-pmu { + compatible = "arm,arm1176-pmu"; + }; +- +- fb: fb { +- compatible = "brcm,bcm2708-fb"; +- status = "disabled"; +- }; +- +- vchiq: vchiq { +- compatible = "brcm,bcm2835-vchiq"; +- reg = <0x7e00b840 0xf>; +- interrupts = <0 2>; +- }; +- +- thermal: thermal { +- compatible = "brcm,bcm2835-thermal"; +- }; + }; + + clocks { + +From 66840ef91d4a460062686c8312f267264b567f98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Tue, 21 Jul 2015 19:09:39 +0200 +Subject: [PATCH 139/149] rpi-ft5406: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts | 1 + + drivers/input/touchscreen/rpi-ft5406.c | 74 ++++++++++------------- + 2 files changed, 32 insertions(+), 43 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +index 40deab5..2e53a17 100644 +--- a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts ++++ b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +@@ -9,6 +9,7 @@ + __overlay__ { + rpi_ft5406: rpi_ft5406 { + compatible = "rpi,rpi-ft5406"; ++ firmware = <&firmware>; + status = "okay"; + }; + }; +diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c +index d41851d..c08817e 100644 +--- a/drivers/input/touchscreen/rpi-ft5406.c ++++ b/drivers/input/touchscreen/rpi-ft5406.c +@@ -21,7 +21,7 @@ + #include + #include + #include +-#include ++#include + + #define MAXIMUM_SUPPORTED_POINTS 10 + struct ft5406_regs { +@@ -49,23 +49,6 @@ struct ft5406 { + struct task_struct * thread; + }; + +- +-/* tag part of the message */ +-struct vc_msg_tag { +- uint32_t tag_id; /* the message id */ +- uint32_t buffer_size; /* size of the buffer (which in this case is always 8 bytes) */ +- uint32_t data_size; /* amount of data being sent or received */ +- uint32_t val; /* data buffer */ +-}; +- +-/* message structure to be sent to videocore */ +-struct vc_msg { +- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */ +- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */ +- struct vc_msg_tag tag; /* the tag structure above to make */ +- uint32_t end_tag; /* an end identifier, should be set to NULL */ +-}; +- + /* Thread to poll for touchscreen events + * + * This thread polls the memory based register copy of the ft5406 registers +@@ -136,11 +119,37 @@ static int ft5406_probe(struct platform_device *pdev) + { + int ret; + struct input_dev * input_dev = input_allocate_device(); +- struct vc_msg request; + struct ft5406 * ts; ++ struct device_node *fw_node; ++ struct rpi_firmware *fw; ++ u32 touchbuf; + + dev_info(&pdev->dev, "Probing device\n"); + ++ fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0); ++ if (!fw_node) { ++ dev_err(&pdev->dev, "Missing firmware node\n"); ++ return -ENOENT; ++ } ++ ++ fw = rpi_firmware_get(fw_node); ++ if (!fw) ++ return -EPROBE_DEFER; ++ ++ ret = rpi_firmware_property(fw, RPI_FIRMWARE_FRAMEBUFFER_GET_TOUCHBUF, ++ &touchbuf, sizeof(touchbuf)); ++ if (ret) { ++ dev_err(&pdev->dev, "Failed to get touch buffer\n"); ++ return ret; ++ } ++ ++ if (!touchbuf) { ++ dev_err(&pdev->dev, "Touchscreen not detected\n"); ++ return -ENODEV; ++ } ++ ++ dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", touchbuf); ++ + ts = kzalloc(sizeof(struct ft5406), GFP_KERNEL); + + if (!ts || !input_dev) { +@@ -174,36 +183,15 @@ static int ft5406_probe(struct platform_device *pdev) + return ret; + } + +- memset(&request, 0, sizeof request); +- +- request.msg_size = sizeof request; +- request.request_code = VCMSG_PROCESS_REQUEST; +- request.tag.tag_id = VCMSG_GET_TOUCHBUF; +- request.tag.buffer_size = 4; +- request.tag.data_size = 4; +- +- bcm_mailbox_property(&request, sizeof(request)); +- +- if(request.request_code == VCMSG_REQUEST_SUCCESSFUL && request.tag.val != 0) +- { +- dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); +- } +- else +- { +- input_unregister_device(input_dev); +- kzfree(ts); +- return -1; +- } +- + // mmap the physical memory +- request.tag.val &= ~0xc0000000; +- ts->ts_base = ioremap(request.tag.val, sizeof(*ts->regs)); ++ touchbuf &= ~0xc0000000; ++ ts->ts_base = ioremap(touchbuf, sizeof(*ts->regs)); + if(ts->ts_base == NULL) + { + dev_err(&pdev->dev, "Failed to map physical address\n"); + input_unregister_device(input_dev); + kzfree(ts); +- return -1; ++ return -ENOMEM; + } + + ts->regs = (struct ft5406_regs *) ts->ts_base; + +From c1a5966807b9f6111684fda87e17df03f948e4d2 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 140/149] irqchip: bcm2835: Add FIQ support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add a duplicate irq range with an offset on the hwirq's so the +driver can detect that enable_fiq() is used. +Tested with downstream dwc_otg USB controller driver. + +Signed-off-by: Noralf Trønnes +Reviewed-by: Eric Anholt +Acked-by: Stephen Warren +--- + arch/arm/mach-bcm/Kconfig | 1 + + drivers/irqchip/irq-bcm2835.c | 53 ++++++++++++++++++++++++++++++++++++++----- + 2 files changed, 48 insertions(+), 6 deletions(-) + +diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig +index 8b11f44..7cfef7b 100644 +--- a/arch/arm/mach-bcm/Kconfig ++++ b/arch/arm/mach-bcm/Kconfig +@@ -114,6 +114,7 @@ config ARCH_BCM2835 + select ARM_ERRATA_411920 + select ARM_TIMER_SP804 + select CLKSRC_OF ++ select FIQ + select PINCTRL + select PINCTRL_BCM2835 + help +diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c +index 5916d6c..db66246 100644 +--- a/drivers/irqchip/irq-bcm2835.c ++++ b/drivers/irqchip/irq-bcm2835.c +@@ -56,7 +56,7 @@ + #include "irqchip.h" + + /* Put the bank and irq (32 bits) into the hwirq */ +-#define MAKE_HWIRQ(b, n) ((b << 5) | (n)) ++#define MAKE_HWIRQ(b, n) (((b) << 5) | (n)) + #define HWIRQ_BANK(i) (i >> 5) + #define HWIRQ_BIT(i) BIT(i & 0x1f) + +@@ -72,9 +72,13 @@ + | SHORTCUT1_MASK | SHORTCUT2_MASK) + + #define REG_FIQ_CONTROL 0x0c ++#define REG_FIQ_ENABLE 0x80 ++#define REG_FIQ_DISABLE 0 + + #define NR_BANKS 3 + #define IRQS_PER_BANK 32 ++#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0) ++#define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0)) + + static int reg_pending[] __initconst = { 0x00, 0x04, 0x08 }; + static int reg_enable[] __initconst = { 0x18, 0x10, 0x14 }; +@@ -98,14 +102,38 @@ static struct armctrl_ic intc __read_mostly; + static void __exception_irq_entry bcm2835_handle_irq( + struct pt_regs *regs); + ++static inline unsigned int hwirq_to_fiq(unsigned long hwirq) ++{ ++ hwirq -= NUMBER_IRQS; ++ /* ++ * The hwirq numbering used in this driver is: ++ * BASE (0-7) GPU1 (32-63) GPU2 (64-95). ++ * This differ from the one used in the FIQ register: ++ * GPU1 (0-31) GPU2 (32-63) BASE (64-71) ++ */ ++ if (hwirq >= 32) ++ return hwirq - 32; ++ ++ return hwirq + 64; ++} ++ + static void armctrl_mask_irq(struct irq_data *d) + { +- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.disable[HWIRQ_BANK(d->hwirq)]); ++ if (d->hwirq >= NUMBER_IRQS) ++ writel_relaxed(REG_FIQ_DISABLE, intc.base + REG_FIQ_CONTROL); ++ else ++ writel_relaxed(HWIRQ_BIT(d->hwirq), ++ intc.disable[HWIRQ_BANK(d->hwirq)]); + } + + static void armctrl_unmask_irq(struct irq_data *d) + { +- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.enable[HWIRQ_BANK(d->hwirq)]); ++ if (d->hwirq >= NUMBER_IRQS) ++ writel_relaxed(REG_FIQ_ENABLE | hwirq_to_fiq(d->hwirq), ++ intc.base + REG_FIQ_CONTROL); ++ else ++ writel_relaxed(HWIRQ_BIT(d->hwirq), ++ intc.enable[HWIRQ_BANK(d->hwirq)]); + } + + static struct irq_chip armctrl_chip = { +@@ -150,8 +178,9 @@ static int __init armctrl_of_init(struct device_node *node, + panic("%s: unable to map IC registers\n", + node->full_name); + +- intc.domain = irq_domain_add_linear(node, MAKE_HWIRQ(NR_BANKS, 0), +- &armctrl_ops, NULL); ++ intc.base = base; ++ intc.domain = irq_domain_add_linear(node, NUMBER_IRQS * 2, ++ &armctrl_ops, NULL); + if (!intc.domain) + panic("%s: unable to create IRQ domain\n", node->full_name); + +@@ -168,8 +197,20 @@ static int __init armctrl_of_init(struct device_node *node, + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); + } + } +- + set_handle_irq(bcm2835_handle_irq); ++ ++ /* Make a duplicate irq range which is used to enable FIQ */ ++ for (b = 0; b < NR_BANKS; b++) { ++ for (i = 0; i < bank_irqs[b]; i++) { ++ irq = irq_create_mapping(intc.domain, ++ MAKE_HWIRQ(b, i) + NUMBER_IRQS); ++ BUG_ON(irq <= 0); ++ irq_set_chip(irq, &armctrl_chip); ++ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); ++ } ++ } ++ init_FIQ(FIQ_START); ++ + return 0; + } + + +From 0086c10ac490fb95a1ec82df80587b591ee74ab3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 15:50:04 +0200 +Subject: [PATCH 141/149] dwc_otg: Add ARCH_BCM2835 support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + drivers/usb/host/dwc_otg/dwc_otg_driver.c | 1 + + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 1 - + drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 4 ++++ + 3 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +index 53307f0..95edadf 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +@@ -723,6 +723,7 @@ static int dwc_otg_driver_probe( + + memset(dwc_otg_device, 0, sizeof(*dwc_otg_device)); + dwc_otg_device->os_dep.reg_offset = 0xFFFFFFFF; ++ dwc_otg_device->os_dep.platformdev = _dev; + + /* + * Map the DWC_otg Core memory into virtual address space. +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 8a31562..3f71f29 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -36,7 +36,6 @@ + #include "dwc_otg_regs.h" + + #include +-#include + #include + + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +index 0f4ebcd..5c83309 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +@@ -445,7 +445,11 @@ static void hcd_init_fiq(void *cookie) + DWC_WARN("MPHI periph has NOT been enabled"); + #endif + // Enable FIQ interrupt from USB peripheral ++#ifdef CONFIG_ARCH_BCM2835 ++ enable_fiq(platform_get_irq(otg_dev->os_dep.platformdev, 1)); ++#else + enable_fiq(INTERRUPT_VC_USB); ++#endif + local_fiq_enable(); + } + + +From 025a502906cf5454047391a95846c4d6a3065240 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 15:50:24 +0200 +Subject: [PATCH 142/149] bcm2835: Use DWC_OTG +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2835.dtsi | 8 +++++--- + arch/arm/configs/bcm2835_defconfig | 1 + + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi +index 807264d..8a5d6ec 100644 +--- a/arch/arm/boot/dts/bcm2835.dtsi ++++ b/arch/arm/boot/dts/bcm2835.dtsi +@@ -152,9 +152,11 @@ + }; + + usb: usb@7e980000 { +- compatible = "brcm,bcm2835-usb"; +- reg = <0x7e980000 0x10000>; +- interrupts = <1 9>; ++ compatible = "brcm,bcm2708-usb"; ++ reg = <0x7e980000 0x10000>, ++ <0x7e006000 0x1000>; ++ interrupts = <2 0>, ++ <1 9>; + }; + + arm-pmu { +diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig +index c284414..14ef294 100644 +--- a/arch/arm/configs/bcm2835_defconfig ++++ b/arch/arm/configs/bcm2835_defconfig +@@ -869,6 +869,7 @@ CONFIG_USB_HIDDEV=y + CONFIG_USB=y + CONFIG_USB_ANNOUNCE_NEW_DEVICES=y + CONFIG_USB_MON=m ++CONFIG_USB_DWCOTG=y + CONFIG_USB_PRINTER=m + CONFIG_USB_STORAGE=y + CONFIG_USB_STORAGE_REALTEK=m + +From 808a80f803c9f8897b0867a5a7c0d52cfe984bfe Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:33:16 +0200 +Subject: [PATCH 143/149] Fix RASPBERRYPI_FIRMWARE dependents +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If forgot this when converting the drivers. + +Signed-off-by: Noralf Trønnes +--- + drivers/cpufreq/Kconfig.arm | 2 +- + drivers/input/touchscreen/Kconfig | 2 +- + drivers/misc/vc04_services/Kconfig | 2 +- + drivers/thermal/Kconfig | 2 +- + drivers/video/fbdev/Kconfig | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm +index a1039f0..0037516 100644 +--- a/drivers/cpufreq/Kconfig.arm ++++ b/drivers/cpufreq/Kconfig.arm +@@ -259,7 +259,7 @@ config ARM_SPEAR_CPUFREQ + This adds the CPUFreq driver support for SPEAr SOCs. + + config ARM_BCM2835_CPUFREQ +- depends on BCM2708_MBOX ++ depends on RASPBERRYPI_FIRMWARE + bool "BCM2835 Driver" + default y + help +diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig +index 5848562..d7e74a1 100644 +--- a/drivers/input/touchscreen/Kconfig ++++ b/drivers/input/touchscreen/Kconfig +@@ -585,7 +585,7 @@ config TOUCHSCREEN_EDT_FT5X06 + + config TOUCHSCREEN_RPI_FT5406 + tristate "Raspberry Pi FT5406 driver" +- depends on ARCH_BCM2708 || ARCH_BCM2709 ++ depends on RASPBERRYPI_FIRMWARE + help + Say Y here to enable the Raspberry Pi memory based FT5406 device + +diff --git a/drivers/misc/vc04_services/Kconfig b/drivers/misc/vc04_services/Kconfig +index c5ba283..db8e1be 100644 +--- a/drivers/misc/vc04_services/Kconfig ++++ b/drivers/misc/vc04_services/Kconfig +@@ -1,6 +1,6 @@ + config BCM2708_VCHIQ + tristate "Videocore VCHIQ" +- depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2708_MBOX ++ depends on RASPBERRYPI_FIRMWARE + default y + help + Kernel to VideoCore communication interface for the +diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig +index ddc77ad..b911213 100644 +--- a/drivers/thermal/Kconfig ++++ b/drivers/thermal/Kconfig +@@ -239,7 +239,7 @@ config INTEL_POWERCLAMP + user interface is exposed via generic thermal framework. + + config THERMAL_BCM2835 +- depends on BCM2708_MBOX ++ depends on RASPBERRYPI_FIRMWARE + tristate "BCM2835 Thermal Driver" + help + This will enable temperature monitoring for the Broadcom BCM2835 +diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig +index 3444a4c..c073d55 100644 +--- a/drivers/video/fbdev/Kconfig ++++ b/drivers/video/fbdev/Kconfig +@@ -226,7 +226,7 @@ comment "Frame buffer hardware drivers" + + config FB_BCM2708 + tristate "BCM2708 framebuffer support" +- depends on FB && ARM && BCM2708_MBOX ++ depends on FB && RASPBERRYPI_FIRMWARE + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + +From eca36789db0d78a939c6520e28bbb7f7e8ea1442 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:33:46 +0200 +Subject: [PATCH 144/149] vc_mem: Remove unnecessary include +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + drivers/char/broadcom/vc_mem.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/char/broadcom/vc_mem.c b/drivers/char/broadcom/vc_mem.c +index fcde6b1..be64f23 100644 +--- a/drivers/char/broadcom/vc_mem.c ++++ b/drivers/char/broadcom/vc_mem.c +@@ -22,7 +22,6 @@ + #include + #include + #include +-#include + #include + + #define DRIVER_NAME "vc-mem" + +From 89df011c7e129660df28ee2bc7744f8ff60ed316 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:34:06 +0200 +Subject: [PATCH 145/149] configs: Remove BCM2708_MBOX +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + arch/arm/configs/bcm2709_defconfig | 1 - + arch/arm/configs/bcm2835_defconfig | 1 - + arch/arm/configs/bcmrpi_defconfig | 1 - + 3 files changed, 3 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index dd00e7c..e3155da 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1078,7 +1078,6 @@ CONFIG_FB_TFT_WATTEROTT=m + CONFIG_FB_FLEX=m + CONFIG_FB_TFT_FBTFT_DEVICE=m + CONFIG_MAILBOX=y +-CONFIG_BCM2708_MBOX=y + CONFIG_BCM2835_MBOX=y + # CONFIG_IOMMU_SUPPORT is not set + CONFIG_EXTCON=m +diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig +index 14ef294..24d4df6 100644 +--- a/arch/arm/configs/bcm2835_defconfig ++++ b/arch/arm/configs/bcm2835_defconfig +@@ -1065,7 +1065,6 @@ CONFIG_FB_TFT_WATTEROTT=m + CONFIG_FB_FLEX=m + CONFIG_FB_TFT_FBTFT_DEVICE=m + CONFIG_MAILBOX=y +-CONFIG_BCM2708_MBOX=y + CONFIG_BCM2835_MBOX=y + # CONFIG_IOMMU_SUPPORT is not set + CONFIG_EXTCON=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 7b24274..0859113 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1071,7 +1071,6 @@ CONFIG_FB_TFT_WATTEROTT=m + CONFIG_FB_FLEX=m + CONFIG_FB_TFT_FBTFT_DEVICE=m + CONFIG_MAILBOX=y +-CONFIG_BCM2708_MBOX=y + CONFIG_BCM2835_MBOX=y + # CONFIG_IOMMU_SUPPORT is not set + CONFIG_EXTCON=m + +From 73e04a4d5c4e57aa0874fa5e79688e2b8eb6d0f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:34:31 +0200 +Subject: [PATCH 146/149] bcm2708-vcio: Remove module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +All drivers have been converted to the new firmware API, so this +module is not needed anymore. + +Signed-off-by: Noralf Trønnes +--- + drivers/mailbox/Kconfig | 6 -- + drivers/mailbox/Makefile | 2 - + drivers/mailbox/bcm2708-vcio.c | 86 ----------------- + include/linux/platform_data/mailbox-bcm2708.h | 127 -------------------------- + 4 files changed, 221 deletions(-) + delete mode 100644 drivers/mailbox/bcm2708-vcio.c + delete mode 100644 include/linux/platform_data/mailbox-bcm2708.h + +diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig +index d1a6671..3965e10 100644 +--- a/drivers/mailbox/Kconfig ++++ b/drivers/mailbox/Kconfig +@@ -7,12 +7,6 @@ menuconfig MAILBOX + + if MAILBOX + +-config BCM2708_MBOX +- bool "Broadcom BCM2708 Mailbox (vcio)" +- depends on BCM2835_MBOX +- help +- Broadcom BCM2708 Mailbox (vcio) +- + config ARM_MHU + tristate "ARM MHU Mailbox" + depends on ARM_AMBA +diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile +index c86bc91..8e6d822 100644 +--- a/drivers/mailbox/Makefile ++++ b/drivers/mailbox/Makefile +@@ -2,8 +2,6 @@ + + obj-$(CONFIG_MAILBOX) += mailbox.o + +-obj-$(CONFIG_BCM2708_MBOX) += bcm2708-vcio.o +- + obj-$(CONFIG_ARM_MHU) += arm_mhu.o + + obj-$(CONFIG_PL320_MBOX) += pl320-ipc.o +diff --git a/drivers/mailbox/bcm2708-vcio.c b/drivers/mailbox/bcm2708-vcio.c +deleted file mode 100644 +index 2e4031b..0000000 +--- a/drivers/mailbox/bcm2708-vcio.c ++++ /dev/null +@@ -1,86 +0,0 @@ +-/* +- * Copyright (C) 2010 Broadcom +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- * +- * This device provides a shared mechanism for writing to the mailboxes, +- * semaphores, doorbells etc. that are shared between the ARM and the +- * VideoCore processor +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#define DRIVER_NAME "bcm2708_vcio" +- +-extern int bcm_mailbox_write(unsigned chan, uint32_t data28) +-{ +- struct rpi_firmware *fw = rpi_firmware_get(NULL); +- +- if (!fw) +- return -ENODEV; +- +- return rpi_firmware_transaction(fw, chan, data28); +-} +-EXPORT_SYMBOL_GPL(bcm_mailbox_write); +- +-extern int bcm_mailbox_read(unsigned chan, uint32_t *data28) +-{ +- struct rpi_firmware *fw = rpi_firmware_get(NULL); +- +- if (!fw) +- return -ENODEV; +- +- *data28 = rpi_firmware_transaction_received(fw); +- +- return 0; +-} +-EXPORT_SYMBOL_GPL(bcm_mailbox_read); +- +-static DEFINE_MUTEX(mailbox_lock); +-extern int bcm_mailbox_property(void *data, int size) +-{ +- uint32_t success; +- dma_addr_t mem_bus; /* the memory address accessed from videocore */ +- void *mem_kern; /* the memory address accessed from driver */ +- int s = 0; +- +- mutex_lock(&mailbox_lock); +- /* allocate some memory for the messages communicating with GPU */ +- mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus, +- GFP_KERNEL); +- if (mem_kern) { +- /* create the message */ +- memcpy(mem_kern, data, size); +- +- /* send the message */ +- wmb(); +- s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus); +- if (s == 0) +- s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success); +- if (s == 0) { +- /* copy the response */ +- rmb(); +- memcpy(data, mem_kern, size); +- } +- dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus); +- } else { +- s = -ENOMEM; +- } +- if (s != 0) +- pr_err(DRIVER_NAME ": %s failed (%d)\n", __func__, s); +- +- mutex_unlock(&mailbox_lock); +- return s; +-} +-EXPORT_SYMBOL_GPL(bcm_mailbox_property); +- +-MODULE_AUTHOR("Gray Girling"); +-MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); +-MODULE_LICENSE("GPL"); +diff --git a/include/linux/platform_data/mailbox-bcm2708.h b/include/linux/platform_data/mailbox-bcm2708.h +deleted file mode 100644 +index d3ea839..0000000 +--- a/include/linux/platform_data/mailbox-bcm2708.h ++++ /dev/null +@@ -1,127 +0,0 @@ +-/* +- * Copyright (C) 2010 Broadcom +- * +- * 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; either version 2 of the License, or +- * (at your option) any later version. +- * +- * 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. +- */ +-#ifndef _PLAT_MAILBOX_BCM2708_H +-#define _PLAT_MAILBOX_BCM2708_H +- +-/* Routines to handle I/O via the VideoCore "ARM control" registers +- * (semaphores, doorbells, mailboxes) +- */ +- +-/* Constants shared with the ARM identifying separate mailbox channels */ +-#define MBOX_CHAN_POWER 0 /* for use by the power management interface */ +-#define MBOX_CHAN_FB 1 /* for use by the frame buffer */ +-#define MBOX_CHAN_VCHIQ 3 /* for use by the VCHIQ interface */ +-#define MBOX_CHAN_PROPERTY 8 /* for use by the property channel */ +-#define MBOX_CHAN_COUNT 9 +- +-enum { +- VCMSG_PROCESS_REQUEST = 0x00000000 +-}; +- +-enum { +- VCMSG_REQUEST_SUCCESSFUL = 0x80000000, +- VCMSG_REQUEST_FAILED = 0x80000001 +-}; +- +-/* Mailbox property tags */ +-enum { +- VCMSG_PROPERTY_END = 0x00000000, +- VCMSG_GET_FIRMWARE_REVISION = 0x00000001, +- VCMSG_GET_BOARD_MODEL = 0x00010001, +- VCMSG_GET_BOARD_REVISION = 0x00010002, +- VCMSG_GET_BOARD_MAC_ADDRESS = 0x00010003, +- VCMSG_GET_BOARD_SERIAL = 0x00010004, +- VCMSG_GET_ARM_MEMORY = 0x00010005, +- VCMSG_GET_VC_MEMORY = 0x00010006, +- VCMSG_GET_CLOCKS = 0x00010007, +- VCMSG_GET_COMMAND_LINE = 0x00050001, +- VCMSG_GET_DMA_CHANNELS = 0x00060001, +- VCMSG_GET_POWER_STATE = 0x00020001, +- VCMSG_GET_TIMING = 0x00020002, +- VCMSG_SET_POWER_STATE = 0x00028001, +- VCMSG_GET_CLOCK_STATE = 0x00030001, +- VCMSG_SET_CLOCK_STATE = 0x00038001, +- VCMSG_GET_CLOCK_RATE = 0x00030002, +- VCMSG_SET_CLOCK_RATE = 0x00038002, +- VCMSG_GET_VOLTAGE = 0x00030003, +- VCMSG_SET_VOLTAGE = 0x00038003, +- VCMSG_GET_MAX_CLOCK = 0x00030004, +- VCMSG_GET_MAX_VOLTAGE = 0x00030005, +- VCMSG_GET_TEMPERATURE = 0x00030006, +- VCMSG_GET_MIN_CLOCK = 0x00030007, +- VCMSG_GET_MIN_VOLTAGE = 0x00030008, +- VCMSG_GET_TURBO = 0x00030009, +- VCMSG_GET_MAX_TEMPERATURE = 0x0003000a, +- VCMSG_GET_STC = 0x0003000b, +- VCMSG_SET_TURBO = 0x00038009, +- VCMSG_SET_ALLOCATE_MEM = 0x0003000c, +- VCMSG_SET_LOCK_MEM = 0x0003000d, +- VCMSG_SET_UNLOCK_MEM = 0x0003000e, +- VCMSG_SET_RELEASE_MEM = 0x0003000f, +- VCMSG_SET_EXECUTE_CODE = 0x00030010, +- VCMSG_SET_EXECUTE_QPU = 0x00030011, +- VCMSG_SET_ENABLE_QPU = 0x00030012, +- VCMSG_GET_RESOURCE_HANDLE = 0x00030014, +- VCMSG_GET_EDID_BLOCK = 0x00030020, +- VCMSG_GET_CUSTOMER_OTP = 0x00030021, +- VCMSG_SET_CUSTOMER_OTP = 0x00038021, +- VCMSG_SET_ALLOCATE_BUFFER = 0x00040001, +- VCMSG_SET_RELEASE_BUFFER = 0x00048001, +- VCMSG_SET_BLANK_SCREEN = 0x00040002, +- VCMSG_TST_BLANK_SCREEN = 0x00044002, +- VCMSG_GET_PHYSICAL_WIDTH_HEIGHT = 0x00040003, +- VCMSG_TST_PHYSICAL_WIDTH_HEIGHT = 0x00044003, +- VCMSG_SET_PHYSICAL_WIDTH_HEIGHT = 0x00048003, +- VCMSG_GET_VIRTUAL_WIDTH_HEIGHT = 0x00040004, +- VCMSG_TST_VIRTUAL_WIDTH_HEIGHT = 0x00044004, +- VCMSG_SET_VIRTUAL_WIDTH_HEIGHT = 0x00048004, +- VCMSG_GET_DEPTH = 0x00040005, +- VCMSG_TST_DEPTH = 0x00044005, +- VCMSG_SET_DEPTH = 0x00048005, +- VCMSG_GET_PIXEL_ORDER = 0x00040006, +- VCMSG_TST_PIXEL_ORDER = 0x00044006, +- VCMSG_SET_PIXEL_ORDER = 0x00048006, +- VCMSG_GET_ALPHA_MODE = 0x00040007, +- VCMSG_TST_ALPHA_MODE = 0x00044007, +- VCMSG_SET_ALPHA_MODE = 0x00048007, +- VCMSG_GET_PITCH = 0x00040008, +- VCMSG_TST_PITCH = 0x00044008, +- VCMSG_SET_PITCH = 0x00048008, +- VCMSG_GET_VIRTUAL_OFFSET = 0x00040009, +- VCMSG_TST_VIRTUAL_OFFSET = 0x00044009, +- VCMSG_SET_VIRTUAL_OFFSET = 0x00048009, +- VCMSG_GET_OVERSCAN = 0x0004000a, +- VCMSG_TST_OVERSCAN = 0x0004400a, +- VCMSG_SET_OVERSCAN = 0x0004800a, +- VCMSG_GET_PALETTE = 0x0004000b, +- VCMSG_TST_PALETTE = 0x0004400b, +- VCMSG_SET_PALETTE = 0x0004800b, +- VCMSG_GET_LAYER = 0x0004000c, +- VCMSG_TST_LAYER = 0x0004400c, +- VCMSG_SET_LAYER = 0x0004800c, +- VCMSG_GET_TRANSFORM = 0x0004000d, +- VCMSG_TST_TRANSFORM = 0x0004400d, +- VCMSG_SET_TRANSFORM = 0x0004800d, +- VCMSG_TST_VSYNC = 0x0004400e, +- VCMSG_SET_VSYNC = 0x0004800e, +- VCMSG_GET_TOUCHBUF = 0x0004000f, +- VCMSG_SET_CURSOR_INFO = 0x00008010, +- VCMSG_SET_CURSOR_STATE = 0x00008011, +-}; +- +-int bcm_mailbox_read(unsigned chan, uint32_t *data28); +-int bcm_mailbox_write(unsigned chan, uint32_t data28); +-int bcm_mailbox_property(void *data, int size); +- +-#endif + +From f69941fbc0eb961fbf580165ad5022e26095db49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:34:55 +0200 +Subject: [PATCH 147/149] Revert "firmware: bcm2835: Support legacy mailbox + API" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 40aa3c4f0c430cd5c574498f4d1d5e9f0bc1cf11. + +The legacy mailbox API has been removed so this is not needed. + +Signed-off-by: Noralf Trønnes +--- + drivers/firmware/raspberrypi.c | 15 ++------------- + include/soc/bcm2835/raspberrypi-firmware.h | 2 -- + 2 files changed, 2 insertions(+), 15 deletions(-) + +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index 89421a9..b980d53 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -19,7 +19,6 @@ + #define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) + #define MBOX_CHAN(msg) ((msg) & 0xf) + #define MBOX_DATA28(msg) ((msg) & ~0xf) +-#define MBOX_CHAN_VCHIQ 3 + #define MBOX_CHAN_PROPERTY 8 + + struct rpi_firmware { +@@ -27,7 +26,6 @@ struct rpi_firmware { + struct mbox_chan *chan; /* The property channel. */ + struct completion c; + u32 enabled; +- u32 received; + }; + + static struct platform_device *g_pdev; +@@ -37,7 +35,6 @@ static DEFINE_MUTEX(transaction_lock); + static void response_callback(struct mbox_client *cl, void *msg) + { + struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl); +- fw->received = *(u32 *)msg; + complete(&fw->c); + } + +@@ -45,7 +42,7 @@ static void response_callback(struct mbox_client *cl, void *msg) + * Sends a request to the firmware through the BCM2835 mailbox driver, + * and synchronously waits for the reply. + */ +-int ++static int + rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + { + u32 message = MBOX_MSG(chan, data); +@@ -57,8 +54,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + reinit_completion(&fw->c); + ret = mbox_send_message(fw->chan, &message); + if (ret >= 0) { +- if (chan != MBOX_CHAN_VCHIQ) +- wait_for_completion(&fw->c); ++ wait_for_completion(&fw->c); + ret = 0; + } else { + dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret); +@@ -67,13 +63,6 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + + return ret; + } +-EXPORT_SYMBOL(rpi_firmware_transaction); +- +-u32 rpi_firmware_transaction_received(struct rpi_firmware *fw) +-{ +- return MBOX_DATA28(fw->received); +-} +-EXPORT_SYMBOL(rpi_firmware_transaction_received); + + /** + * rpi_firmware_property_list - Submit firmware property list +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index 9a08cf1..d3933af 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -116,8 +116,6 @@ enum rpi_firmware_property_tag { + RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, + }; + +-int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); +-u32 rpi_firmware_transaction_received(struct rpi_firmware *fw); + int rpi_firmware_property(struct rpi_firmware *fw, + u32 tag, void *data, size_t len); + int rpi_firmware_property_list(struct rpi_firmware *fw, + +From 63de8df89946ca2bf9e663941c6d9108d212d1ba Mon Sep 17 00:00:00 2001 +From: Jonathan Bell +Date: Tue, 30 Jun 2015 12:35:39 +0100 +Subject: [PATCH 148/149] pinctrl: bcm2835: Clear the event latch register when + disabling interrupts + +It's possible to hit a race condition if interrupts are generated on a GPIO +pin when the IRQ line in question is being disabled. + +If the interrupt is freed, bcm2835_gpio_irq_disable() is called which +disables the event generation sources (edge, level). If an event occurred +between the last disabling of hard IRQs and the write to the event +source registers, a bit would be set in the GPIO event detect register +(GPEDSn) which goes unacknowledged by bcm2835_gpio_irq_handler() +so Linux complains loudly. + +There is no per-GPIO mask register, so when disabling GPIO interrupts +write 1 to the relevant bit in GPEDSn to clear out any stale events. + +Signed-off-by: Jonathan Bell +Acked-by: Stephen Warren +Signed-off-by: Linus Walleij +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +index 986779a..61ef002 100644 +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -503,6 +503,8 @@ static void bcm2835_gpio_irq_disable(struct irq_data *data) + + spin_lock_irqsave(&pc->irq_lock[bank], flags); + bcm2835_gpio_irq_config(pc, gpio, false); ++ /* Clear events that were latched prior to clearing event sources */ ++ bcm2835_gpio_set_bit(pc, GPEDS0, gpio); + clear_bit(offset, &pc->enabled_irq_map[bank]); + spin_unlock_irqrestore(&pc->irq_lock[bank], flags); + } + +From 8dcf91adc86b5ee16627c8fe777b4e2f5ca4efc1 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Tue, 4 Aug 2015 01:15:20 +0100 +Subject: [PATCH 149/149] dwc_otg: fiq_fsm: Make high-speed isochronous strided + transfers work properly + +Certain low-bandwidth high-speed USB devices (specialist audio devices, +compressed-frame webcams) have packet intervals > 1 microframe. + +Stride these transfers in the FIQ by using the start-of-frame interrupt +to restart the channel at the right time. +--- + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 17 +++++++++++++---- + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h | 5 ++++- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 7 ++++++- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 6 ++++-- + 4 files changed, 27 insertions(+), 8 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 7e0c726..85d82f3 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +@@ -615,8 +615,11 @@ static int notrace noinline fiq_fsm_do_sof(struct fiq_state *state, int num_chan + break; + + case FIQ_HS_ISOC_SLEEPING: +- state->channel[n].fsm = FIQ_HS_ISOC_TURBO; +- fiq_fsm_restart_channel(state, n, 0); ++ /* Is it time to wake this channel yet? */ ++ if (--state->channel[n].uframe_sleeps == 0) { ++ state->channel[n].fsm = FIQ_HS_ISOC_TURBO; ++ fiq_fsm_restart_channel(state, n, 0); ++ } + break; + + case FIQ_PER_SSPLIT_QUEUED: +@@ -624,7 +627,7 @@ static int notrace noinline fiq_fsm_do_sof(struct fiq_state *state, int num_chan + break; + if(!fiq_fsm_tt_in_use(state, num_channels, n)) { + if (!fiq_fsm_too_late(state, n)) { +- fiq_print(FIQDBG_INT, st, "SOF GO %01d", n); ++ fiq_print(FIQDBG_INT, state, "SOF GO %01d", n); + fiq_fsm_restart_channel(state, n, 0); + state->channel[n].fsm = FIQ_PER_SSPLIT_STARTED; + } else { +@@ -1069,8 +1072,14 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c + if (fiq_fsm_update_hs_isoc(state, n, hcint)) { + /* more transactions to come */ + handled = 1; +- restart = 1; + fiq_print(FIQDBG_INT, state, "HSISO M "); ++ /* For strided transfers, put ourselves to sleep */ ++ if (st->hs_isoc_info.stride > 1) { ++ st->uframe_sleeps = st->hs_isoc_info.stride - 1; ++ st->fsm = FIQ_HS_ISOC_SLEEPING; ++ } else { ++ restart = 1; ++ } + } else { + st->fsm = FIQ_HS_ISOC_DONE; + fiq_print(FIQDBG_INT, state, "HSISO F "); +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 8455324..f9fddfb 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h +@@ -260,12 +260,13 @@ struct fiq_dma_blob { + * @iso_frame: Pointer to the array of OTG URB iso_frame_descs. + * @nrframes: Total length of iso_frame_desc array + * @index: Current index (FIQ-maintained) +- * ++ * @stride: Interval in uframes between HS isoc transactions + */ + struct fiq_hs_isoc_info { + struct dwc_otg_hcd_iso_packet_desc *iso_desc; + unsigned int nrframes; + unsigned int index; ++ unsigned int stride; + }; + + /** +@@ -296,6 +297,8 @@ struct fiq_channel_state { + /* Hardware bug workaround: sometimes channel halt interrupts are + * delayed until the next SOF. Keep track of when we expected to get interrupted. */ + unsigned int expected_uframe; ++ /* number of uframes remaining (for interval > 1 HS isoc transfers) before next transfer */ ++ unsigned int uframe_sleeps; + /* in/out for communicating number of dma buffers used, or number of ISOC to do */ + unsigned int nrpackets; + struct fiq_dma_info dma_info; +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index 4d7c7bb..135b611 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -1678,6 +1678,9 @@ int fiq_fsm_queue_isoc_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + } + } + ++ st->hs_isoc_info.stride = qh->interval; ++ st->uframe_sleeps = 0; ++ + fiq_print(FIQDBG_INT, hcd->fiq_state, "FSMQ %01d ", hc->hc_num); + fiq_print(FIQDBG_INT, hcd->fiq_state, "%08x", st->hcchar_copy.d32); + fiq_print(FIQDBG_INT, hcd->fiq_state, "%08x", st->hctsiz_copy.d32); +@@ -1692,9 +1695,11 @@ int fiq_fsm_queue_isoc_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + DWC_WRITE_REG32(&hc_regs->hcintmsk, st->hcintmsk_copy.d32); + if (hfnum.b.frrem < PERIODIC_FRREM_BACKOFF) { + /* Prevent queueing near EOF1. Bad things happen if a periodic +- * split transaction is queued very close to EOF. ++ * split transaction is queued very close to EOF. SOF interrupt handler ++ * will wake this channel at the next interrupt. + */ + st->fsm = FIQ_HS_ISOC_SLEEPING; ++ st->uframe_sleeps = 1; + } else { + st->fsm = FIQ_HS_ISOC_TURBO; + st->hcchar_copy.b.chen = 1; +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 3f71f29..8db3dfc 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -2297,10 +2297,10 @@ void dwc_otg_fiq_unmangle_isoc(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh, dwc_otg_qtd + dwc_urb->error_count++; + } + } ++ qh->sched_frame = dwc_frame_num_inc(qh->sched_frame, qh->interval * (nr_frames - 1)); ++ + //printk_ratelimited(KERN_INFO "%s: HS isochronous of %d/%d frames with %d errors complete\n", + // __FUNCTION__, i, dwc_urb->packet_count, dwc_urb->error_count); +- hcd->fops->complete(hcd, dwc_urb->priv, dwc_urb, 0); +- release_channel(hcd, qh->channel, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); + } + + /** +@@ -2543,6 +2543,8 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) + * fail. + */ + dwc_otg_fiq_unmangle_isoc(hcd, qh, qtd, num); ++ hcd->fops->complete(hcd, qtd->urb->priv, qtd->urb, 0); ++ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); + break; + + case FIQ_PER_SPLIT_LS_ABORTED: diff --git a/projects/RPi2/patches/linux/linux-01-RPi_support.patch b/projects/RPi2/patches/linux/linux-01-RPi_support.patch index c87244fc95..d6377736e5 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 57f6047cdbd633f660b9a859b903503709cc821e Mon Sep 17 00:00:00 2001 +From 0e8bd84a8406e37307c00a246c5a0f62aac6b8d3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 001/131] Main bcm2708/bcm2709 linux port +Subject: [PATCH 001/149] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From eef200f75c4a6f6701f1693f8f59ab2c83d1abcd Mon Sep 17 00:00:00 2001 +From 347ffd7de4bb0ccd64731fb76814dd9e626bf1c5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 002/131] Add bcm2708_gpio driver +Subject: [PATCH 002/149] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7635,10 +7635,10 @@ index 0000000..fb69624 + +#endif -From 6f5003498da677a660cbdfaf9be78d3c0aff2e4c Mon Sep 17 00:00:00 2001 +From eb3917f2c39b485511607da826cd9dbba16751b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 19:11:03 +0200 -Subject: [PATCH 003/131] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 003/149] mailbox: bcm2708: Add bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -8269,10 +8269,10 @@ index 0000000..cc284ed + +#endif -From 7c8a47937b598fa8dad4cd50753164b5ee44f8c1 Mon Sep 17 00:00:00 2001 +From dac4f2f5791de43cb28c829c03b74b03187b7535 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 004/131] Add dwc_otg driver +Subject: [PATCH 004/149] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -9180,10 +9180,10 @@ index 358ca8d..abaac7c 100644 return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index 3b71516..8324c14 100644 +index 1e9a8c9..7e9f79f 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -4922,7 +4922,7 @@ static void port_event(struct usb_hub *hub, int port1) +@@ -4906,7 +4906,7 @@ static void port_event(struct usb_hub *hub, int port1) if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; @@ -69546,10 +69546,10 @@ index 0000000..cdc9963 +test_main(); +0; -From 70cf7eac2e13367cb8939741ee140c6bbac32f62 Mon Sep 17 00:00:00 2001 +From cb7293f71c4de308f8d2f1dda81889fa1ccc5f70 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 005/131] bcm2708 watchdog driver +Subject: [PATCH 005/149] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -69986,10 +69986,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 6655b0b613cde9e4eb6aacaf43d04a388d8cd6c6 Mon Sep 17 00:00:00 2001 +From 3f93f22131290ce805bd9fe0a2c23fc23e9d0d02 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 006/131] bcm2708 framebuffer driver +Subject: [PATCH 006/149] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73428,10 +73428,10 @@ index 3c14e43..7626beb6a 100644 +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 0f8c3ed7803f3a871df49398b678c364aa4929c2 Mon Sep 17 00:00:00 2001 +From d7b8efef115448b4899c4d3327cbdfed06144d29 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 007/131] dmaengine: Add support for BCM2708 +Subject: [PATCH 007/149] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75199,10 +75199,10 @@ index 0000000..2310e34 + +#endif /* _PLAT_BCM2708_DMA_H */ -From 0464f674cf3e441b8651c4a5ea0131fa24a3adc4 Mon Sep 17 00:00:00 2001 +From c5a2f57f382bb863ec39be702d5c7dd1abf43a1e Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 008/131] MMC: added alternative MMC driver +Subject: [PATCH 008/149] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -77018,10 +77018,10 @@ index 0000000..b7c4883 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 7bf3e966797438781e11dbc233e17bbe4746bd5b Mon Sep 17 00:00:00 2001 +From 42f6bf501dfd96a293a001811c66f81a599a7c0a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 009/131] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 009/149] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -78791,10 +78791,10 @@ index 0000000..eef8a24 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 2bb9c01de4c90a8b7a9b52be95f504177abeaf45 Mon Sep 17 00:00:00 2001 +From 4e1d2a7a36c3a6a50b8e3e180840f5de3c59dab9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 010/131] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 010/149] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix @@ -80119,10 +80119,10 @@ index 0000000..5325832 + +#endif /* VC_CMA_H */ -From 801a4cbc4ea0f0ffd64b4fa0065be3f791b9d1d0 Mon Sep 17 00:00:00 2001 +From 0e75dc8f6ada5d524b64787a3f6a1f7774c19ad1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 011/131] bcm2708: alsa sound driver +Subject: [PATCH 011/149] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -82964,10 +82964,10 @@ index 0000000..af3e6eb + +#endif // _VC_AUDIO_DEFS_H_ -From 32495b1b4a656f2388b1dc133278a80616e40994 Mon Sep 17 00:00:00 2001 +From f99733b7c93f18f7bb2519462760a71817e2282c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 012/131] bcm2708 vchiq driver +Subject: [PATCH 012/149] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -96221,10 +96221,10 @@ index 0000000..b6bfa21 + return vchiq_build_time; +} -From 8909329c134abdf242dc345a4528e98e86c85c33 Mon Sep 17 00:00:00 2001 +From bb99de1085903aae1acd33f9333636668a2d0940 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 013/131] vc_mem: Add vc_mem driver +Subject: [PATCH 013/149] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -97230,10 +97230,10 @@ index 0000000..20a4753 + +#endif /* _VC_MEM_H */ -From 3dc51b65ed267fd3cc57feeda298e6c02af5cf82 Mon Sep 17 00:00:00 2001 +From 2835e674ab3568be62a2cd50e060f4172c6d7760 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 014/131] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 014/149] vcsm: VideoCore shared memory service for BCM2835 Add experimental support for the VideoCore shared memory service. This allows user processes to allocate memory from VideoCore's @@ -101643,10 +101643,10 @@ index 0000000..0bfb42e +MODULE_DESCRIPTION("VideoCore SharedMemory Driver"); +MODULE_LICENSE("GPL v2"); -From 250314915c749fccd25d98aca0b9a2d29f55ec1c Mon Sep 17 00:00:00 2001 +From d956b1bd6c339852f27e912d2e79ed1ae1f770d3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 015/131] Add hwrng (hardware random number generator) driver +Subject: [PATCH 015/149] Add hwrng (hardware random number generator) driver --- drivers/char/hw_random/Kconfig | 13 +++- @@ -101823,10 +101823,10 @@ index 0000000..340f004 +MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver"); +MODULE_LICENSE("GPL and additional rights"); -From e074d656e4011eae32577e4d20d7ce6dfa15f6e8 Mon Sep 17 00:00:00 2001 +From 0a234b968ca8409fdf24ee38b84144ea6df901c1 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 016/131] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 016/149] 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 @@ -102679,10 +102679,10 @@ index 0000000..24563ec +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Enable debugging messages"); -From ccdc49f30be0caec97b9b7e4352b8c63eb45acdd Mon Sep 17 00:00:00 2001 +From 8aa5df1654dc0d99e6edaee56960a62a759642f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 017/131] Add cpufreq driver +Subject: [PATCH 017/149] Add cpufreq driver Signed-off-by: popcornmix --- @@ -102955,10 +102955,10 @@ index 0000000..6735da9 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From b7e45ce253f9aa6f3f4b33967b124198d3e2b74f Mon Sep 17 00:00:00 2001 +From a78e95402f25318bb6049c253a586bdabf0e3934 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 018/131] Added hwmon/thermal driver for reporting core +Subject: [PATCH 018/149] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -103255,10 +103255,10 @@ index 0000000..3bc80f1 + +module_platform_driver(bcm2835_thermal_driver); -From f65673287078cca868595a556d8613802e9a1743 Mon Sep 17 00:00:00 2001 +From fe524efc70536aa67e3568f97bc373031e4de4ea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 019/131] Add Chris Boot's spi driver. +Subject: [PATCH 019/149] Add Chris Boot's spi driver. spi: bcm2708: add device tree support @@ -104170,10 +104170,10 @@ index 0000000..041b5e2 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 31dade83cc4f448f81d7d460c59d02b9ebc3b05b Mon Sep 17 00:00:00 2001 +From b42f499d093bb6ed2991c6f304338bff3a85b429 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 020/131] Add Chris Boot's i2c driver +Subject: [PATCH 020/149] Add Chris Boot's i2c driver i2c-bcm2708: fixed baudrate @@ -104974,10 +104974,10 @@ index 0000000..8773203 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 170ee05def27ef6ddedf2561d1dd770c992962b1 Mon Sep 17 00:00:00 2001 +From 8e40d3346d2607cee13a9eee8c2357b1c0cdb48a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 021/131] bcm2835: add v4l2 camera device +Subject: [PATCH 021/149] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -112304,10 +112304,10 @@ index 0000000..9d1d11e + +#endif /* MMAL_VCHIQ_H */ -From e864404b1afe2fdb0dbd9b3bc5968ea2173fd3e7 Mon Sep 17 00:00:00 2001 +From 7a4688d4481948917c7d09d4745c21c7f802da18 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 022/131] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 022/149] scripts/dtc: Update to upstream version with overlay patches --- @@ -117520,10 +117520,10 @@ index 54d4e904..d644002 100644 -#define DTC_VERSION "DTC 1.4.0-dirty" +#define DTC_VERSION "DTC 1.4.1-g36c70742" -From 5b2523aae9c5beb443315a7814633fc740992d07 Mon Sep 17 00:00:00 2001 +From e9e0f3cef41db19f29ab37a403feabe9f55f83fc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 023/131] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 023/149] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -118008,10 +118008,10 @@ index 0000000..3dff948 + return (($val eq 'y') || ($val eq '1')); +} -From 2d9c312e5b7a52fc0e311f909bb475ecc68b1199 Mon Sep 17 00:00:00 2001 +From 996a96ca5045f3ea6e39192d242062441c3c797b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 024/131] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 024/149] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- @@ -118066,10 +118066,10 @@ index cde35c5d01..dd7fbfe 100644 pr_debug("Command line is: %s\n", (char*)data); -From 73ffc770b510d914757449f9bd52ff5e0b300a52 Mon Sep 17 00:00:00 2001 +From 25f3e064afc8b7be40bc92af946b59bce9ed6c58 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 025/131] BCM2708: Add core Device Tree support +Subject: [PATCH 025/149] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -121946,10 +121946,10 @@ index 0000000..66a98f6 + }; +}; -From 4559e395eaf5d2a4c9af93066c8edc7d184287e3 Mon Sep 17 00:00:00 2001 +From d4f6c4010632825e49b58d95db228b4ab394f3f0 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 026/131] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 026/149] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -122042,10 +122042,10 @@ index fb795c3..fa72af0 100644 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From 68d4d166abf2d287a3b333bbae60e2c9c027fa71 Mon Sep 17 00:00:00 2001 +From 5539b4d21d0d0485e548a1bd0bc259abc7403767 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 029/131] Speed up console framebuffer imageblit function +Subject: [PATCH 029/149] 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 @@ -122254,10 +122254,10 @@ index a2bb276..436494f 100644 start_index, pitch_index); } else -From 5e3834b22d4c560ac1354cfff30a6713b6d94e64 Mon Sep 17 00:00:00 2001 +From 683a06a250e735c94ec3640d9288528ee50ddf16 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 030/131] Allow mac address to be set in smsc95xx +Subject: [PATCH 030/149] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -122348,10 +122348,10 @@ index 26423ad..e29a323 100644 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -From 9c50f6318fdf116e5abaeb05bffa0b65e48ba259 Mon Sep 17 00:00:00 2001 +From 4f3ab22c324a811dda12f53cd9e77d3a32c3a113 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 031/131] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 031/149] 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 @@ -122749,10 +122749,10 @@ index d58594a..feae942 100644 unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 2722779be49b7b76dea3de564e03d9fd0083f094 Mon Sep 17 00:00:00 2001 +From 853fe067aeff8a0be4027b63f50dd0478103f723 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 033/131] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 033/149] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -122761,10 +122761,10 @@ Subject: [PATCH 033/131] config: Enable CONFIG_MEMCG, but leave it disabled 2 files changed, 24 insertions(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c -index 469dd54..c9684da 100644 +index e8a5491..2428355 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c -@@ -5395,6 +5395,29 @@ static int __init cgroup_disable(char *str) +@@ -5393,6 +5393,29 @@ static int __init cgroup_disable(char *str) } __setup("cgroup_disable=", cgroup_disable); @@ -122807,10 +122807,10 @@ index a04225d..a2ef8af 100644 /** -From 27e4ffc36fc9366bfcefe25321191a78460ba1fd Mon Sep 17 00:00:00 2001 +From 02f4298dead0071add7bb58678d7451bf06d4b7f Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 034/131] ASoC: Add support for BCM2708 +Subject: [PATCH 034/149] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -123953,10 +123953,10 @@ index 0000000..6fdcbc1 + +#endif -From c368e010eacbc50e6a5f527fcc8651ea1cdc5f26 Mon Sep 17 00:00:00 2001 +From 9dca125b0468d40894de4138982400ba5b833e4d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 035/131] ASoC: Add support for PCM5102A codec +Subject: [PATCH 035/149] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -124081,10 +124081,10 @@ index 0000000..126f1e9 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 1ae47f91380b552b3bb3adb28f3283be31786064 Mon Sep 17 00:00:00 2001 +From 45a02391f0fa3d34235ff795c299638fbf3f5773 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 036/131] BCM2708: Add I2S support to board file +Subject: [PATCH 036/149] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -124173,10 +124173,10 @@ index a3b65dc..a515992 100644 for (i = 0; i <= 1; i++) { void __iomem *base; -From 65a3e3f912faa5d0c0cdb937b23e641d45608236 Mon Sep 17 00:00:00 2001 +From 19cea6e827bb706afe8bb57e43ee5f3fa7cd1731 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 037/131] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 037/149] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -124325,10 +124325,10 @@ index 0000000..4b70b45 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 1fee3fa181deb59422ad4f5f08262c8328189370 Mon Sep 17 00:00:00 2001 +From 7528f3f5f51e0f304d5726a82dd9178f87b1ca41 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 038/131] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 038/149] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -124376,10 +124376,10 @@ index 01f2de7..1d9b788 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; -From c5a634c60f6706ba7ffaec669d6ddae793a7b889 Mon Sep 17 00:00:00 2001 +From 48355b1b1b0ae407d17524fb836fa61f2341d579 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 039/131] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 039/149] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -124674,10 +124674,10 @@ index 0000000..b4eaa44 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From c739ac8e078de6188449830672c7dd1e5b57af52 Mon Sep 17 00:00:00 2001 +From ee415b9db413a155e99d81537a776b7becf60227 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 040/131] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 040/149] 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 @@ -124717,10 +124717,10 @@ index 1e403f6..d4efa85 100644 #define WM8804_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_64000 | \ -From 7cce7a2fdf84a988e7b23caa129dddbcc7613b10 Mon Sep 17 00:00:00 2001 +From 4e0d1e894adb9184eb45a7c343907df881e3a523 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 041/131] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 041/149] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -124985,10 +124985,10 @@ index 0000000..92e9e46 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 6912c1ddd399d69d7704e9f6445014d40ec21c9b Mon Sep 17 00:00:00 2001 +From 5c4656d103da802e6d0412eb55c8dc9164935867 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 042/131] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 042/149] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -125035,10 +125035,10 @@ index 6d53beb..a062d7f 100644 bcm_register_device_dt(&snd_rpi_dac_device); bcm_register_device_dt(&snd_pcm1794a_codec_device); -From c1291a2b3390ab53e3a6ca2325e39d0a01908d87 Mon Sep 17 00:00:00 2001 +From 87f8afdc7be60f059356680542fa556055434a0b Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 043/131] ASoC: wm8804: Set idle_bias_off to false Idle bias +Subject: [PATCH 043/149] ASoC: wm8804: Set idle_bias_off to false Idle bias has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek @@ -125060,10 +125060,10 @@ index d4efa85..f3f26a2 100644 .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From 3cefe8f4539e290215418a54ff815913bb658814 Mon Sep 17 00:00:00 2001 +From 02e362cf47d55e3e6e075d14a6f5eda064e832a9 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 044/131] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 044/149] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -125271,10 +125271,10 @@ index 0000000..aff7377 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 63dc5102ff1e782a18c891169ef614ff83fd16da Mon Sep 17 00:00:00 2001 +From 6ccb62cc7e401082561c12ed6258dc3382264875 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 045/131] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 045/149] vmstat: Workaround for issue where dirty page count goes negative See: @@ -125301,10 +125301,10 @@ index 82e7db7..f87d16d 100644 static inline void __inc_zone_page_state(struct page *page, -From 4b7eb6e29aee506fd82e9eea37b951f0a4101f8a Mon Sep 17 00:00:00 2001 +From 7db38451aa2a58b2f7e9e9cd60842e5167732ba0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 046/131] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 046/149] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125340,10 +125340,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From e35b74b6335b49387b09d114966b89549a13f1d5 Mon Sep 17 00:00:00 2001 +From ede6ae920d5614aeaca3793cab45e68d7a5667f4 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 047/131] Added support for HiFiBerry DAC+ +Subject: [PATCH 047/149] 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. @@ -125554,10 +125554,10 @@ index 0000000..c63387b +MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+"); +MODULE_LICENSE("GPL v2"); -From ee406533a463686db7d11c7ad0f626578c1edcac Mon Sep 17 00:00:00 2001 +From 7f32b28e3ecbddf73a8a2b849fe1950d1d3d6441 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 048/131] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 048/149] 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. @@ -126426,10 +126426,10 @@ index 0000000..8f019e0 + +#endif /* _TAS5713_H */ -From b904f76b1090667c9f4741a60da8e60cebc8a91c Mon Sep 17 00:00:00 2001 +From 5342cc918f42da5b299e861b708d0986f42f4c81 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 049/131] bcm2708: Allow option card devices to be configured +Subject: [PATCH 049/149] bcm2708: Allow option card devices to be configured via DT If the kernel is built with Device Tree support, and if a DT blob @@ -126454,10 +126454,10 @@ index 03fa1cb..c816526 100644 static struct platform_driver bcm2835_i2s_driver = { .probe = bcm2835_i2s_probe, -From 8b4aab9c9a47544e493ba3479ad0e6397e4ea27a Mon Sep 17 00:00:00 2001 +From c2db87de57679d93a7b54ded9f2ad2c29b449c58 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 050/131] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 050/149] Adding Device Tree support for some RPi audio cards --- arch/arm/mach-bcm2709/bcm2709.c | 143 ++++++++++++++++++++++++++++++++++++++ @@ -126820,10 +126820,10 @@ index 126f1e9..7c6598e 100644 }; -From bc32dfd7d696d4e3c381344064aabc38961b7f46 Mon Sep 17 00:00:00 2001 +From decbd54190fce2736e5f8614c974f6d236eebd15 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 051/131] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 051/149] Added support to reserve/enable a GPIO pin to be used from pps-gpio module (LinuxPPS). Enable PPS modules in default config for RPi. @@ -126959,10 +126959,10 @@ index 57e1f3d..721559b 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); -From 5b706049d22fc0593a14a1d94ebf7f9bf54feeea Mon Sep 17 00:00:00 2001 +From 128bbd307de47c1a0748dcf84e5d948c2df3db38 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 052/131] Update ds1307 driver for device-tree support +Subject: [PATCH 052/149] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -126989,10 +126989,10 @@ index 4ffabb3..c6789a7 100644 .driver = { .name = "rtc-ds1307", -From 1578dbee8e10fed1be0f64820fe511dc4b7a720e Mon Sep 17 00:00:00 2001 +From 0fcc1245d4ba1391e0bcc754e2c521cecbb10179 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 053/131] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 053/149] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -127103,10 +127103,10 @@ index 0000000..2ca2b98 +MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); +MODULE_LICENSE("GPL"); -From a926a1d2720eef63b580a4510a9aec4540836d40 Mon Sep 17 00:00:00 2001 +From 2b9a2491e2554f5dc92a62be523ef8932a5eb85e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 054/131] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 054/149] bcm2709: Simplify and strip down IRQ handler --- arch/arm/include/asm/entry-macro-multi.S | 2 + @@ -127325,10 +127325,10 @@ index d08591b..08d184c 100644 +1: get_irqnr_and_base r0, r2, r6, lr + .endm -From 39cf4677b7c38fac3da503b75d5cd7efc64dd19a Mon Sep 17 00:00:00 2001 +From 145d538784f1fb1a938a6f037df9d85898ea1ba4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 055/131] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 055/149] Fix LED "input" trigger implementation for 3.19 --- drivers/leds/leds-gpio.c | 10 +++++++++- @@ -127415,10 +127415,10 @@ index 9a2b000..60accc5 100644 /* Set LED brightness level */ /* Must not sleep, use a workqueue if needed */ -From d6f122c984a90914b054c16def454ee77a002bad Mon Sep 17 00:00:00 2001 +From 20a42859d52cff889adbec5697ba61870b22c423 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 056/131] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 056/149] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -127440,10 +127440,10 @@ index 8d908e3..7a1900d 100644 .can_sleep = false, }; -From 0bb455e4eca847aa74560f58bfd7daa13e9fb496 Mon Sep 17 00:00:00 2001 +From 812a64aaa5d3dec21864e49c612b38ee65273b17 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 057/131] pinctrl-bcm2835: bcm2835_gpio_direction_output must +Subject: [PATCH 057/149] pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value --- @@ -127471,10 +127471,10 @@ index 7a1900d..62f85aa 100644 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) -From 1ee5ccaeae81a9acd296d4d3eaba9fa1807b9e17 Mon Sep 17 00:00:00 2001 +From 09041f7ccbd1cde792edae91c41266886d5d1382 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 058/131] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 058/149] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -127620,10 +127620,10 @@ index 62f85aa..c7cf266 100644 }, }; -From 7e2506a80d3a218bab8db21c947187c92d29812c Mon Sep 17 00:00:00 2001 +From 523ce9c5aa97607b0847833b93a8d34965808132 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 059/131] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 059/149] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -127650,10 +127650,10 @@ index c7cf266..986779a 100644 pc->irq_data[i].irqgroup = i; -From 69c25727685034a06c041fee3938afba0b84e582 Mon Sep 17 00:00:00 2001 +From ee9c77a3cc5d83e87e52f3424f7a29d605d562ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 060/131] enc28j60: Add device tree compatible string and an +Subject: [PATCH 060/149] enc28j60: Add device tree compatible string and an overlay --- @@ -127687,10 +127687,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From 9ea362cfd9b8e0b2a8896a713b8b82c0c5834a68 Mon Sep 17 00:00:00 2001 +From 0c87fa341259d332ce8402d1a3703f2b69af5219 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 061/131] Add driver for rpi-proto +Subject: [PATCH 061/149] 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 @@ -127905,10 +127905,10 @@ index 0000000..c6e45a0 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From db5f1ae7154cf08397ba74b67af282f246a17ddf Mon Sep 17 00:00:00 2001 +From 458dc19741c5295b62ff78882b94a4d6dc8aaac2 Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 062/131] Add Device Tree support for RPi-DAC. +Subject: [PATCH 062/149] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -127983,10 +127983,10 @@ index b4eaa44..afe1b41 100644 }; -From 0fa5223ca68a9c68b92b6ea149fccc42d50c3357 Mon Sep 17 00:00:00 2001 +From 4c33cf46121a5662ebfb84ad34a5a632c2c679f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 063/131] config: Add default configs +Subject: [PATCH 063/149] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1204 ++++++++++++++++++++++++++++++++++++ @@ -130411,10 +130411,10 @@ index 0000000..6a41231 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 4fc03ec1bfe73a125775bb06937a246be639dc55 Mon Sep 17 00:00:00 2001 +From f8b20b1317fd46d23a2a9944a53df547904a238f Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 064/131] smsx95xx: fix crimes against truesize +Subject: [PATCH 064/149] 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. @@ -130449,10 +130449,10 @@ index e29a323..aff63dc usbnet_skb_return(dev, ax_skb); } -From 9131a29e8e039bdc5055dad93d41f11a111a13b9 Mon Sep 17 00:00:00 2001 +From 7b168915af2a8d731046afeed5cdf939cd9c4323 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 065/131] smsc95xx: Disable turbo mode by default +Subject: [PATCH 065/149] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -130472,10 +130472,10 @@ index aff63dc..08a8a8c 100755 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 510eb2621d1b1b74618236a324538c19c9106ece Mon Sep 17 00:00:00 2001 +From aab95f9b10e8c3d32de2bf163b86f220c88214fe Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 066/131] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 066/149] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130486,10 +130486,10 @@ Subject: [PATCH 066/131] Add blk_pos parameter to mmc multi_io_quirk callback 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c -index 60f7141..1f15cb5 100644 +index 31d2627..8484ec9 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c -@@ -1413,6 +1413,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, +@@ -1415,6 +1415,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, brq->data.blocks = card->host->ops->multi_io_quirk(card, (rq_data_dir(req) == READ) ? MMC_DATA_READ : MMC_DATA_WRITE, @@ -130558,10 +130558,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From d2482f75a64fce6da8a4138f88a6c59cb0de4d9b Mon Sep 17 00:00:00 2001 +From 9a092ad62309aecb8c27cde5fb5f863a7447b90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 29 Apr 2015 17:24:02 +0200 -Subject: [PATCH 067/131] bcm2835: bcm2835_defconfig +Subject: [PATCH 067/149] bcm2835: bcm2835_defconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -131891,10 +131891,10 @@ index 31cb073..2e8a95a 100644 # CONFIG_XZ_DEC_ARM is not set # CONFIG_XZ_DEC_ARMTHUMB is not set -From 984698645ff73ed2100b4bfea99ed035139ac721 Mon Sep 17 00:00:00 2001 +From 4ab42e0f9eab22619622ea5f13195280aebc0d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 1 May 2015 23:00:15 +0200 -Subject: [PATCH 068/131] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 068/149] BCM270x_DT: Add mailbox bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -131935,10 +131935,10 @@ index 721559b..4a00561 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); -From 156ce0fa550bbcb8e63eb60d11ac05cc28c14775 Mon Sep 17 00:00:00 2001 +From fa2b33b614fead97a2eb8b950fb1c77e73f0eb28 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 069/131] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 069/149] rpi-ft5406: Add touchscreen driver for pi LCD display --- drivers/input/touchscreen/Kconfig | 7 + @@ -132255,10 +132255,10 @@ index cc284ed..d3ea839 100644 VCMSG_SET_CURSOR_STATE = 0x00008011, }; -From e2149721bbb442d9f1622bfd0b4c89a892afd88f Mon Sep 17 00:00:00 2001 +From 5cbcb76ee23807632fcd5db19ebcc2d913011f17 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 070/131] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 070/149] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -133783,10 +133783,10 @@ index 3e58d71..0622891 100644 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 92f76fcdda43617a0f3461741bba9e6d328684da Mon Sep 17 00:00:00 2001 +From b196781e4110a44416cf5926cf1ff350a1533c94 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 071/131] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 071/149] bcm2835-audio: Create the platform device if the DT node is disabled For backwards compatibility, allow the built-in ALSA driver to be enabled @@ -133840,10 +133840,10 @@ index 4a00561..dec8043 100644 bcm_register_device_dt(&bcm2708_spi_device); -From e64ab6c66db34627b7765099e815a8c2d4957296 Mon Sep 17 00:00:00 2001 +From 35fb850719835a0029eb91480b214fbaf2a99dc3 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 072/131] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 072/149] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -133902,10 +133902,10 @@ index 70f2f39..f7fdacd 100644 static const char * const bcm2835_compat[] = { -From 8a609b1977da490cd177740e61169444383fd8c4 Mon Sep 17 00:00:00 2001 +From fb9bb42b9875d61716503c9eb330e73d720f5a64 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 073/131] platform: Add force_core command line setting to boot +Subject: [PATCH 073/149] platform: Add force_core command line setting to boot from a different core number --- @@ -133976,10 +133976,10 @@ index dec8043..fe71c50 100644 module_param(serial, uint, 0644); module_param(uart_clock, uint, 0644); -From 2efab5a48bc519a3901b62da297ee5523c91ee58 Mon Sep 17 00:00:00 2001 +From 63a651b12cbd98ba14d2ac6f038f230a4b3ce336 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 074/131] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 074/149] mach-bcm270x: Enable the building of pinctrl-bcm2835 --- drivers/pinctrl/Makefile | 1 + @@ -133998,10 +133998,10 @@ index 6eadf04..9119513 100644 obj-$(CONFIG_ARCH_BERLIN) += berlin/ obj-y += freescale/ -From 436bd2ba164863768b90c2456a943dcfed3b053c Mon Sep 17 00:00:00 2001 +From 30e79675077f83c35b77f74ae833212cbff42b6f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Jun 2015 16:41:39 +0100 -Subject: [PATCH 075/131] BCM270X_DT: Document the i2s-mmap overlay +Subject: [PATCH 075/149] BCM270X_DT: Document the i2s-mmap overlay --- arch/arm/boot/dts/overlays/README | 6 ++++++ @@ -134025,10 +134025,10 @@ index 3e08f98..7fa6d33 100644 Info: Configures the IQaudio DAC audio card Load: dtoverlay=iqaudio-dac -From 175d8f77d2fe5ed0d43d53ece08978fd50c97a97 Mon Sep 17 00:00:00 2001 +From 1dd7bc29051074b4aedba9ed05bbc920ed67a654 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 11:36:53 +0100 -Subject: [PATCH 076/131] bcm2835-sdhost: Improve error handling and recovery +Subject: [PATCH 076/149] bcm2835-sdhost: Improve error handling and recovery 1) Expose the hw_reset method to the MMC framework, removing many internal calls by the driver. @@ -135120,10 +135120,10 @@ index eef8a24..6277e43 100644 if (host->allow_dma) { -From 48297e4045a1d8a3b2a0edbe6cf371a34c5eb3be Mon Sep 17 00:00:00 2001 +From e6a1ebfa363797e35902c3d466af7c92ef05a62f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:46 -0700 -Subject: [PATCH 077/131] ARM: bcm2835: Add the Raspberry Pi firmware driver +Subject: [PATCH 077/149] ARM: bcm2835: Add the Raspberry Pi firmware driver This gives us a function for making mailbox property channel requests of the firmware, which is most notable in that it will let us get and @@ -135557,10 +135557,10 @@ index 0000000..9d9efb7 + void *data, size_t tag_size); +struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); -From 9762ae8cc9ebb55739cb553f3b2c5bc604aec9e4 Mon Sep 17 00:00:00 2001 +From dce877ba363b979281f5781ec75a197875fd21a9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 22 Mar 2015 13:33:23 +0000 -Subject: [PATCH 078/131] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING +Subject: [PATCH 078/149] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -135612,10 +135612,10 @@ index 6a41231..cacde14 100644 CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_DRBD=m -From dd888666ae9c4f80521f3bbe48edb86b423bb6f6 Mon Sep 17 00:00:00 2001 +From 2f04df7aef19d4e087c80fa7371e3f5139233570 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Mon, 22 Jun 2015 16:27:07 +0100 -Subject: [PATCH 079/131] Add rpi-ft5406 overlay Add rpi-ft5406 driver as +Subject: [PATCH 079/149] Add rpi-ft5406 overlay Add rpi-ft5406 driver as module --- @@ -135702,10 +135702,10 @@ index cacde14..f952ff2 100644 CONFIG_TOUCHSCREEN_STMPE=m CONFIG_INPUT_MISC=y -From afae7dff11e5ee1d5aaf0d00cf26ea3cf24db2d8 Mon Sep 17 00:00:00 2001 +From bf09fbb31f813db47e4b64fddbc1ea1d089133c2 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 23 Jun 2015 09:53:40 +0100 -Subject: [PATCH 080/131] Fix driver detection failure Check that the buffer +Subject: [PATCH 080/149] Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected --- @@ -135726,10 +135726,10 @@ index f55151b..d41851d 100644 dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); } -From 9e053b2e623361aa3a3bbfa298e7b8d33adf7abc Mon Sep 17 00:00:00 2001 +From e8fe55cc59f200121b845a93110d6c41e7daeb01 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 13:24:01 +0100 -Subject: [PATCH 081/131] config: Enable 8250 serial port +Subject: [PATCH 081/149] config: Enable 8250 serial port --- arch/arm/configs/bcm2709_defconfig | 7 +++++++ @@ -135777,10 +135777,10 @@ index f952ff2..0c25d8b 100644 CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_BCM2835=m -From 60300e1082cd46b3ae2732854776ee549e217387 Mon Sep 17 00:00:00 2001 +From 02dfc389b34d52a0c97428a666d0314216c2cb34 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 14:10:58 +0100 -Subject: [PATCH 082/131] config: Enable POWER_RESET_GPIO +Subject: [PATCH 082/149] config: Enable POWER_RESET_GPIO --- arch/arm/configs/bcm2709_defconfig | 2 ++ @@ -135814,10 +135814,10 @@ index 0c25d8b..e757db6 100644 CONFIG_THERMAL=y CONFIG_THERMAL_BCM2835=y -From 79796a03fa8311ea9030817db27690f24f72214c Mon Sep 17 00:00:00 2001 +From 83d5bd935a9a83db9e7bf89bb3cd123fc7a6999f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Jun 2015 17:37:38 +0100 -Subject: [PATCH 083/131] bcm2708-vcio: Remove restriction of only a single +Subject: [PATCH 083/149] bcm2708-vcio: Remove restriction of only a single instance being open We need more than one process to be able to use mailbox interface (e.g. HW cursor in fbturbo and hello_fft). @@ -135862,10 +135862,10 @@ index d91672b..06fb2c2f 100644 return 0; -From 6bda1bf0de21592f772c2d65b3e66ddf89d50bdf Mon Sep 17 00:00:00 2001 +From 08ab3b10ef3b9fee5c05f7c1463fefa3206e36eb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:39:19 +0100 -Subject: [PATCH 084/131] BCM270X_DT: Create a "core" clock, use it for SPI and +Subject: [PATCH 084/149] BCM270X_DT: Create a "core" clock, use it for SPI and sdhost --- @@ -136016,10 +136016,10 @@ index b408ab4..897204a 100644 }; }; -From d4a0abb7a644365a9f21204a5e3f530a8112d5e8 Mon Sep 17 00:00:00 2001 +From a3c04e353a23787157f52097715422aed626198d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 09:24:31 +0100 -Subject: [PATCH 085/131] BCM270X_DT: Add MCP7941X to i2c-rtc overlay +Subject: [PATCH 085/149] BCM270X_DT: Add MCP7941X to i2c-rtc overlay --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -136072,10 +136072,10 @@ index 6bccfdc..7052c71 100644 pcf8523 = <&pcf8523>,"status"; pcf8563 = <&pcf8563>,"status"; -From 54695dcb27d8e4c37e8dd9620e85257b8abb89d8 Mon Sep 17 00:00:00 2001 +From 89ce29fd10942fcb3a8a72a88ed399d5bbac6f56 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 24 Jun 2015 11:23:06 +0100 -Subject: [PATCH 086/131] dts/overlays: document DHT11 overlay +Subject: [PATCH 086/149] dts/overlays: document DHT11 overlay --- arch/arm/boot/dts/overlays/README | 8 ++++++++ @@ -136101,10 +136101,10 @@ index 425eb19..9406cf3 100644 -From 842fe412d512dabb76d169395086b6337150015a Mon Sep 17 00:00:00 2001 +From e5230cc9bbb441510c38faf9f0c82a839afbba71 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 087/131] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 087/149] 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 @@ -136219,10 +136219,10 @@ index e5332f1..6e3fec2 100644 "%s: pm_power_off function already registered", __func__); -From 311119b99b34e88df249d706c69bdcffcd8dafb5 Mon Sep 17 00:00:00 2001 +From c7c9f2995da703a41e6c70bce53d9eef408b1b46 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 17:10:40 +0100 -Subject: [PATCH 088/131] BCM270x_DT: Default Compute Module i2c, i2s and spi +Subject: [PATCH 088/149] BCM270x_DT: Default Compute Module i2c, i2s and spi support --- @@ -136312,10 +136312,10 @@ index e82fcb2..af252bd 100755 }; }; -From bd6dabc8c7f6cdaba821ff3246034cd704f6364d Mon Sep 17 00:00:00 2001 +From 44c63dcdaca924590d42106b99b5f4e30dcbfbe3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:21:55 +0100 -Subject: [PATCH 089/131] BCM270X_DT: Sort nodes by bus address, and +Subject: [PATCH 089/149] BCM270X_DT: Sort nodes by bus address, and consolidate aliases --- @@ -136557,10 +136557,10 @@ index 24fa849..ccb9c31 100644 &gpio { -From f40ed032e6f0892778bac7d33d45593c0483628b Mon Sep 17 00:00:00 2001 +From 870b67c8c48467c19fbbccb90aeb8137ce5e9bea Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:23:03 +0100 -Subject: [PATCH 090/131] i2c-bcm2708/BCM270X_DT: Add support for I2C2 +Subject: [PATCH 090/149] i2c-bcm2708/BCM270X_DT: Add support for I2C2 The third I2C bus (I2C2) is normally reserved for HDMI use. Careless use of this bus can break an attached display - use with caution. @@ -136733,10 +136733,10 @@ index 8773203..7a24fbe 100644 goto out_free_bi; } -From 9451939c7a95b4f81886a2bf89f953be1833189d Mon Sep 17 00:00:00 2001 +From 207f6d593f3d6b5e5bbe5b12f8e915d7f6b85dd7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Jun 2015 12:14:02 +0100 -Subject: [PATCH 091/131] BCM270X_DT: Correct the lirc-rpi overlay +Subject: [PATCH 091/149] BCM270X_DT: Correct the lirc-rpi overlay documentation The polarity of the "sense" parameter was inverted with respect to reality. @@ -136762,10 +136762,10 @@ index 0ed7094..ec762d2 100644 (default "-1") -From d645d31525be338b1baa22916217f3ac0c3705f9 Mon Sep 17 00:00:00 2001 +From 919c9342b5a5c83686dc932935276d621b5cccae Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 08:47:09 +0100 -Subject: [PATCH 092/131] bcm2835-sdhost: Further improve overclock back-off +Subject: [PATCH 092/149] bcm2835-sdhost: Further improve overclock back-off --- drivers/mmc/host/bcm2835-sdhost.c | 144 +++++++++++++++++++++----------------- @@ -137057,10 +137057,10 @@ index 6277e43..a03db06 100644 iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); -From 11667799f99dca096d4d92e63b7823db2a8f8779 Mon Sep 17 00:00:00 2001 +From 23382239529f6cb7af467a9247e8e24e70a4aa06 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:28:59 +0100 -Subject: [PATCH 093/131] i2c-bcm2708: Increase timeouts to allow larger +Subject: [PATCH 093/149] i2c-bcm2708: Increase timeouts to allow larger transfers Use the timeout value provided by the I2C_TIMEOUT ioctl when waiting @@ -137098,10 +137098,10 @@ index 7a24fbe..8b8762d 100644 dev_err(&adap->dev, "transfer timed out\n"); goto error_timeout; -From 04f7264e602d7148822f3a162176190fcc41f71a Mon Sep 17 00:00:00 2001 +From f3d59521e6139a0e1cf79eaacffea5a576360185 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:33:52 +0100 -Subject: [PATCH 094/131] spi-bcm2708: Increase timeout from 150ms to 1s +Subject: [PATCH 094/149] spi-bcm2708: Increase timeout from 150ms to 1s See: https://github.com/raspberrypi/linux/issues/260 --- @@ -137125,10 +137125,10 @@ index 041b5e2..5c0214e 100644 struct bcm2708_spi { spinlock_t lock; -From 2e6c5de15687dadf4c24d880d0cdcb6763aacda5 Mon Sep 17 00:00:00 2001 +From ea8bb97ffa4e1f4bd832e7a9bed797551685625b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 09:59:38 +0100 -Subject: [PATCH 095/131] bcm2708-spi: Don't use static pin configuration with +Subject: [PATCH 095/149] bcm2708-spi: Don't use static pin configuration with DT Also remove superfluous error checking - the SPI framework ensures the @@ -137167,10 +137167,10 @@ index 5c0214e..781c747 100644 master = spi_alloc_master(&pdev->dev, sizeof(*bs)); if (!master) { -From 699c056af380b45856086c0b33a65acc3d2ad3d8 Mon Sep 17 00:00:00 2001 +From a141cf018b63c08c9907aa0d7b1b2791ee9250d0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 10:10:59 +0100 -Subject: [PATCH 096/131] bcm2708-i2s: Don't use static pin configuration with +Subject: [PATCH 096/149] bcm2708-i2s: Don't use static pin configuration with DT --- @@ -137193,10 +137193,10 @@ index a515992..5e93cd6 100644 /* * Adjust the data length according to the format. -From 6b8e6f74b78fcc225c873ea1b07890352dd77ee5 Mon Sep 17 00:00:00 2001 +From 9ac08a7ad7b65014eada794cf252828d10b6cb91 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 097/131] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 097/149] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -137216,10 +137216,10 @@ index 4506e40..f03a19a 100644 for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From 5131bc710dd79b98d12c08b2f22477f48fdbd0d3 Mon Sep 17 00:00:00 2001 +From e3ee14936302400a2b6389b4062e4ce45046cb2e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:50:11 +0100 -Subject: [PATCH 098/131] BCM270X_DT: Add overlay to enable uart1 +Subject: [PATCH 098/149] BCM270X_DT: Add overlay to enable uart1 N.B. The UART1 clock is derived from the core clock. The firmware will update clock-frequency if core_freq is set, but be aware @@ -137388,10 +137388,10 @@ index e757db6..363c894 100644 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y CONFIG_SERIAL_OF_PLATFORM=y -From 72d2ba8d7fa2d47c53ed1425501c2dac2aa909b0 Mon Sep 17 00:00:00 2001 +From 6ee396162a3700157252585fd19ed67e22b8aa34 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 099/131] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 099/149] 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 @@ -137472,10 +137472,10 @@ index 37875cf..55e81c2 100644 /* and set up the "mode" and level */ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", -From 4bf9c275c9733d1fcf41f6ee70b40e321b39eac1 Mon Sep 17 00:00:00 2001 +From 2f890ad4ea68997c62f8d58af8c2800b7eeab056 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 17:37:38 +0100 -Subject: [PATCH 100/131] BCM270X_DT: Change pio_limit of sdhost driver to 1 +Subject: [PATCH 100/149] BCM270X_DT: Change pio_limit of sdhost driver to 1 --- arch/arm/boot/dts/overlays/sdhost-overlay.dts | 2 +- @@ -137495,10 +137495,10 @@ index 897204a..2da14a4 100644 }; }; -From 0ca1e1d7ffdfcf1e716205491a00bf025fb71a77 Mon Sep 17 00:00:00 2001 +From a9ac939580e8cf0c43c4242bb458db7d27a6deea Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Jul 2015 12:51:52 +0100 -Subject: [PATCH 101/131] bcm2835-sdhost: Clear HBLC for PIO mode +Subject: [PATCH 101/149] bcm2835-sdhost: Clear HBLC for PIO mode Also update pio_limit default in overlay README. --- @@ -137534,10 +137534,10 @@ index a03db06..d65870a 100644 BUG_ON(!host->data); } -From f158c5aa486712cfad1c405eb849d65272b2cbc3 Mon Sep 17 00:00:00 2001 +From 7b05003d4f07188e83919e476ac48dc5c219f8ed Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 12:21:01 +0100 -Subject: [PATCH 102/131] BCM270X_DT: I2S needs function Alt2 +Subject: [PATCH 102/149] BCM270X_DT: I2S needs function Alt2 --- arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 2 +- @@ -137599,10 +137599,10 @@ index f25f0a2..62d1c62 100644 }; -From 704b53d89697a2542dfa6d23224f49c0d5350abb Mon Sep 17 00:00:00 2001 +From 7a39e0bdf178dd83ffca4766bfc0a2acc1b6c3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:16:15 +0200 -Subject: [PATCH 103/131] configs: Incorporate v4.1 dependency changes +Subject: [PATCH 103/149] configs: Incorporate v4.1 dependency changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -137765,10 +137765,10 @@ index 363c894..80f84d7 100644 CONFIG_CRC_ITU_T=y CONFIG_LIBCRC32C=y -From d47845877b27576daac3c55bdb742a43209baaed Mon Sep 17 00:00:00 2001 +From 01a50411ad1528451d53f69d5ad1c7370db0dbee Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 15:47:33 +0100 -Subject: [PATCH 104/131] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for +Subject: [PATCH 104/149] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for HifiBerry Digi) 4.1 has split out support for the I2C and SPI variants, so it now @@ -137803,10 +137803,10 @@ index 80f84d7..14b91fdf 100644 CONFIG_SOUND_PRIME=m CONFIG_HIDRAW=y -From a984b5d876c74984fad16d90507b95a50db22fba Mon Sep 17 00:00:00 2001 +From c3934ab548244c7fd691ca2e78f9a950d8eff269 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 4 Jul 2015 19:55:23 +0100 -Subject: [PATCH 105/131] squash: BCM270X_DT: I2S only needs Alt2 on 28-31 +Subject: [PATCH 105/149] squash: BCM270X_DT: I2S only needs Alt2 on 28-31 See: https://github.com/raspberrypi/linux/issues/1046 --- @@ -137855,10 +137855,10 @@ index 62d1c62..f25f0a2 100644 }; -From edb21286ac7e246dfe7c9ee05101880f719e00e8 Mon Sep 17 00:00:00 2001 +From acd32a30be3e6952f7486c9569429fce70fb8d9e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 8 Jul 2015 14:48:57 +0100 -Subject: [PATCH 106/131] vchiq_arm: Two cacheing fixes +Subject: [PATCH 106/149] vchiq_arm: Two cacheing fixes 1) Make fragment size vary with cache line size Without this patch, non-cache-line-aligned transfers may corrupt @@ -138129,10 +138129,10 @@ index c739083..5edba23 100644 kfree(pagelist); } -From 265838d467aedd75abf2949373d889cfec090168 Mon Sep 17 00:00:00 2001 +From d3f1bad2c2095c829d0111a41763ec4cf3fbdeb3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 09:10:36 +0100 -Subject: [PATCH 107/131] BCM270X_DT: Overlay for the Fen Logic VGA666 board +Subject: [PATCH 107/149] BCM270X_DT: Overlay for the Fen Logic VGA666 board The VGA666 board requires GPIOs 2-21 (so no I2C or UART). Using the overlay (instead of a custom dt-blob.bin) has the advantage that it will @@ -138214,10 +138214,10 @@ index 0000000..7fcab96 + }; +}; -From 5c8148df6f5147fcaa9fe81425b58a3e7a64cdba Mon Sep 17 00:00:00 2001 +From f92a566b5dcec58d56cc8e7e629601f449325b0c Mon Sep 17 00:00:00 2001 From: petit-miner Date: Fri, 10 Jul 2015 13:59:18 +0200 -Subject: [PATCH 108/131] Added support for 2 mcp2515 CAN Bus IC +Subject: [PATCH 108/149] Added support for 2 mcp2515 CAN Bus IC See: https://github.com/raspberrypi/linux/issues/1018 https://github.com/raspberrypi/linux/pull/1049 @@ -138347,10 +138347,10 @@ index 0000000..6bef9ae + }; +}; -From a097ef23c580bdcad619cca1deabd71eb6237984 Mon Sep 17 00:00:00 2001 +From 5d7fd1e72db3384293037ca586ed2936b45748d3 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 5 May 2015 13:27:45 -0700 -Subject: [PATCH 109/131] mailbox: Enable BCM2835 mailbox support +Subject: [PATCH 109/149] mailbox: Enable BCM2835 mailbox support This mailbox driver provides a single mailbox channel to write 32-bit values to the VPU and get a 32-bit response. The Raspberry Pi @@ -138629,10 +138629,10 @@ index 0000000..4b13268 +MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); +MODULE_LICENSE("GPL v2"); -From aa1ca835a9a179168f9d8355a458bd0eecda3912 Mon Sep 17 00:00:00 2001 +From 44369d3764961e5cb7a7dfce2fdb31a86ff16b14 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 13 May 2015 13:10:32 -0700 -Subject: [PATCH 110/131] mailbox/bcm2835: Fix mailbox full detection. +Subject: [PATCH 110/149] mailbox/bcm2835: Fix mailbox full detection. With the VC reader blocked and the ARM writing, MAIL0_STA reads empty permanently while MAIL1_STA goes from empty (0x40000000) to non-empty @@ -138671,10 +138671,10 @@ index 4b13268..0b47dd4 100644 return ret; } -From 36301913195582a2398add6d60477be534d4f603 Mon Sep 17 00:00:00 2001 +From 4e08351a07fbe7f6e8625e3e538e94a2bc4c08bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:19:30 +0200 -Subject: [PATCH 111/131] mailbox: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 111/149] mailbox: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -138790,10 +138790,10 @@ index 19b491d..cc07d71 100644 dev_dbg(dev, "%s: mailbox not free\n", __func__); mutex_unlock(&con_mutex); -From e3d1e45b4cf84fead585758e48adad894858670c Mon Sep 17 00:00:00 2001 +From 3389224055b1ee2a518308c13583361f88ff5f82 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:47 -0700 -Subject: [PATCH 112/131] ARM: bcm2835: Add the firmware driver information to +Subject: [PATCH 112/149] ARM: bcm2835: Add the firmware driver information to the RPi DT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -138827,10 +138827,10 @@ index 466f02b..5cdfd5a 100644 audio: audio { compatible = "brcm,bcm2835-audio"; -From 4b72dfbcb5e820f4bfdb2ccb423538b2e4821329 Mon Sep 17 00:00:00 2001 +From cc901351e0dd5e50ee5e11b8697a6f5b1f35ee0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:21:20 +0200 -Subject: [PATCH 113/131] firmware: bcm2835: Add missing property tags +Subject: [PATCH 113/149] firmware: bcm2835: Add missing property tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -138892,10 +138892,10 @@ index 9d9efb7..d3933af 100644 RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From d72c334f7fe3305ae13034ac0562123c26820ade Mon Sep 17 00:00:00 2001 +From 31139cf5452a835f8e160b7093b05dca12c6dd29 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 114/131] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 114/149] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139001,10 +139001,10 @@ index dd506cd3..b980d53 100644 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From be083fb29207201d3db279f9d5654c5f8c2cb6de Mon Sep 17 00:00:00 2001 +From fd247161acad069df68411af0500b183fbc78063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:26:10 +0200 -Subject: [PATCH 115/131] firmware: bcm2835: Support legacy mailbox API +Subject: [PATCH 115/149] firmware: bcm2835: Support legacy mailbox API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139094,10 +139094,10 @@ index d3933af..9a08cf1 100644 u32 tag, void *data, size_t len); int rpi_firmware_property_list(struct rpi_firmware *fw, -From becc3412eae55ac3b1642ddc074cb9ca2cbc2e11 Mon Sep 17 00:00:00 2001 +From 491b53a48fc956dd91151f5998d54544ffeab094 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 116/131] char: broadcom: Add vcio module +Subject: [PATCH 116/149] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139321,10 +139321,10 @@ index 0000000..c19bc20 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 3349eaf79dd91c2e6f9b7aed0c155668e4f5a856 Mon Sep 17 00:00:00 2001 +From 0c90bfa500f9c896f42a8cb59f7037b2c78fc8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:37:19 +0200 -Subject: [PATCH 117/131] BCM270x: Switch to firmware driver +Subject: [PATCH 117/149] BCM270x: Switch to firmware driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139931,10 +139931,10 @@ index 06fb2c2f..2e4031b 100644 MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); MODULE_LICENSE("GPL"); -From 04f82e046133586649c9c9c72b565c2dbccf0e97 Mon Sep 17 00:00:00 2001 +From 261e67ec20793d9a0f615e16b7bce7ae7a70e138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:39:21 +0200 -Subject: [PATCH 118/131] bcm2835: Switch to firmware driver +Subject: [PATCH 118/149] bcm2835: Switch to firmware driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139990,17 +139990,17 @@ index 47f2a6a..c284414 100644 CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y -From 0dd4dae3071d135836946ab1b990061c0899e9b5 Mon Sep 17 00:00:00 2001 +From 564c166a50d6db491679366414e4c51d58b951d4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jul 2015 13:25:31 +0100 -Subject: [PATCH 119/131] Merge pull request #1059 from pelwell/rpi-4.0.y +Subject: [PATCH 119/149] Merge pull request #1059 from pelwell/rpi-4.0.y w1_therm: Back-port locking improvements from 4.2-rc1 --- - Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 | 6 + - Documentation/w1/slaves/w1_therm | 11 +- - drivers/w1/slaves/w1_therm.c | 162 ++++++++++++++++++++-- - 3 files changed, 163 insertions(+), 16 deletions(-) + Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 | 6 ++ + Documentation/w1/slaves/w1_therm | 11 ++- + drivers/w1/slaves/w1_therm.c | 102 +++++++++++++++++++++- + 3 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 diff --git a/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 b/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 @@ -140047,44 +140047,10 @@ index cc62a95..13411fe 100644 +w1_seq file. The file will contain a single line with an integer value +representing the device index in the bus starting at 0. diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c -index 1f11a20..2f029e8 100644 +index 55eb86c..2f029e8 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c -@@ -59,16 +59,32 @@ MODULE_ALIAS("w1-family-" __stringify(W1_THERM_DS28EA00)); - static int w1_strong_pullup = 1; - module_param_named(strong_pullup, w1_strong_pullup, int, 0); - -+struct w1_therm_family_data { -+ uint8_t rom[9]; -+ atomic_t refcnt; -+}; -+ -+/* return the address of the refcnt in the family data */ -+#define THERM_REFCNT(family_data) \ -+ (&((struct w1_therm_family_data*)family_data)->refcnt) -+ - static int w1_therm_add_slave(struct w1_slave *sl) - { -- sl->family_data = kzalloc(9, GFP_KERNEL); -+ sl->family_data = kzalloc(sizeof(struct w1_therm_family_data), -+ GFP_KERNEL); - if (!sl->family_data) - return -ENOMEM; -+ atomic_set(THERM_REFCNT(sl->family_data), 1); - return 0; - } - - static void w1_therm_remove_slave(struct w1_slave *sl) - { -+ int refcnt = atomic_sub_return(1, THERM_REFCNT(sl->family_data)); -+ while(refcnt) { -+ msleep(1000); -+ refcnt = atomic_read(THERM_REFCNT(sl->family_data)); -+ } - kfree(sl->family_data); - sl->family_data = NULL; - } -@@ -76,13 +92,24 @@ static void w1_therm_remove_slave(struct w1_slave *sl) +@@ -92,13 +92,24 @@ static void w1_therm_remove_slave(struct w1_slave *sl) static ssize_t w1_slave_show(struct device *device, struct device_attribute *attr, char *buf); @@ -140109,7 +140075,7 @@ index 1f11a20..2f029e8 100644 static struct w1_family_ops w1_therm_fops = { .add_slave = w1_therm_add_slave, -@@ -90,6 +117,12 @@ static struct w1_family_ops w1_therm_fops = { +@@ -106,6 +117,12 @@ static struct w1_family_ops w1_therm_fops = { .groups = w1_therm_groups, }; @@ -140122,7 +140088,7 @@ index 1f11a20..2f029e8 100644 static struct w1_family w1_therm_family_DS18S20 = { .fid = W1_THERM_DS18S20, .fops = &w1_therm_fops, -@@ -107,7 +140,7 @@ static struct w1_family w1_therm_family_DS1822 = { +@@ -123,7 +140,7 @@ static struct w1_family w1_therm_family_DS1822 = { static struct w1_family w1_therm_family_DS28EA00 = { .fid = W1_THERM_DS28EA00, @@ -140131,86 +140097,10 @@ index 1f11a20..2f029e8 100644 }; static struct w1_family w1_therm_family_DS1825 = { -@@ -194,13 +227,22 @@ static ssize_t w1_slave_show(struct device *device, - struct w1_slave *sl = dev_to_w1_slave(device); - struct w1_master *dev = sl->master; - u8 rom[9], crc, verdict, external_power; -- int i, max_trying = 10; -+ int i, ret, max_trying = 10; - ssize_t c = PAGE_SIZE; -+ u8 *family_data = sl->family_data; +@@ -316,6 +333,89 @@ static ssize_t w1_slave_show(struct device *device, + return ret; + } -- i = mutex_lock_interruptible(&dev->bus_mutex); -- if (i != 0) -- return i; -+ ret = mutex_lock_interruptible(&dev->bus_mutex); -+ if (ret != 0) -+ goto post_unlock; -+ -+ if(!sl->family_data) -+ { -+ ret = -ENODEV; -+ goto pre_unlock; -+ } - -+ /* prevent the slave from going away in sleep */ -+ atomic_inc(THERM_REFCNT(family_data)); - memset(rom, 0, sizeof(rom)); - - while (max_trying--) { -@@ -230,17 +272,19 @@ static ssize_t w1_slave_show(struct device *device, - mutex_unlock(&dev->bus_mutex); - - sleep_rem = msleep_interruptible(tm); -- if (sleep_rem != 0) -- return -EINTR; -+ if (sleep_rem != 0) { -+ ret = -EINTR; -+ goto post_unlock; -+ } - -- i = mutex_lock_interruptible(&dev->bus_mutex); -- if (i != 0) -- return i; -+ ret = mutex_lock_interruptible(&dev->bus_mutex); -+ if (ret != 0) -+ goto post_unlock; - } else if (!w1_strong_pullup) { - sleep_rem = msleep_interruptible(tm); - if (sleep_rem != 0) { -- mutex_unlock(&dev->bus_mutex); -- return -EINTR; -+ ret = -EINTR; -+ goto pre_unlock; - } - } - -@@ -269,19 +313,107 @@ static ssize_t w1_slave_show(struct device *device, - c -= snprintf(buf + PAGE_SIZE - c, c, ": crc=%02x %s\n", - crc, (verdict) ? "YES" : "NO"); - if (verdict) -- memcpy(sl->family_data, rom, sizeof(rom)); -+ memcpy(family_data, rom, sizeof(rom)); - else - dev_warn(device, "Read failed CRC check\n"); - - for (i = 0; i < 9; ++i) - c -= snprintf(buf + PAGE_SIZE - c, c, "%02x ", -- ((u8 *)sl->family_data)[i]); -+ ((u8 *)family_data)[i]); - - c -= snprintf(buf + PAGE_SIZE - c, c, "t=%d\n", - w1_convert_temp(rom, sl->family->fid)); -+ ret = PAGE_SIZE - c; -+ -+pre_unlock: - mutex_unlock(&dev->bus_mutex); - -+post_unlock: -+ atomic_dec(THERM_REFCNT(family_data)); -+ return ret; -+} -+ +#define W1_42_CHAIN 0x99 +#define W1_42_CHAIN_OFF 0x3C +#define W1_42_CHAIN_OFF_INV 0xC3 @@ -140288,18 +140178,20 @@ index 1f11a20..2f029e8 100644 + mutex_unlock(&sl->master->bus_mutex); + + c -= snprintf(buf + PAGE_SIZE - c, c, "%d\n", seq); - return PAGE_SIZE - c; ++ return PAGE_SIZE - c; +error: + mutex_unlock(&sl->master->bus_mutex); + return -EIO; - } - ++} ++ static int __init w1_therm_init(void) + { + int err, i; -From 042bc608f4877bcf9dd16db9657a33fcabd1023c Mon Sep 17 00:00:00 2001 +From 01f81174825984b4f3d309ffcdade224d94ab572 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 11:11:51 +0100 -Subject: [PATCH 120/131] vchiq_arm: Sort out the vmalloc case +Subject: [PATCH 120/149] vchiq_arm: Sort out the vmalloc case See: https://github.com/raspberrypi/linux/issues/1055 --- @@ -140338,10 +140230,10 @@ index 5edba23..56bff05 100644 *need_release = 0; /* do not try and release vmalloc pages */ } else { -From 133b98eee50e70510dbacae5b28a425987499bf8 Mon Sep 17 00:00:00 2001 +From 6a9ee1422507ded4b20bb30b34a1ae8151ae2141 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 121/131] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 121/149] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -140362,10 +140254,10 @@ index 92c909e..0535375 100644 }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 5705242586b4688004ff73869d53ac532c671f84 Mon Sep 17 00:00:00 2001 +From 710b1c336c5ca81b429212218b6209df1db468c9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 122/131] Merge pull request #1043 from XECDesign/sense-4.0 +Subject: [PATCH 122/149] Merge pull request #1043 from XECDesign/sense-4.0 mfd: Add Raspberry Pi Sense HAT core driver --- @@ -141298,10 +141190,10 @@ index 0000000..56196dc + +#endif -From dd0a5a6a6e441335df951679f1ee27bb8d35cdae Mon Sep 17 00:00:00 2001 +From 2dce729ff88f1ae4fc318dc36e16732c8f152469 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jul 2015 13:46:08 +0100 -Subject: [PATCH 123/131] leds-gpio: Implement the brightness_get method +Subject: [PATCH 123/149] leds-gpio: Implement the brightness_get method The power LED uses some clever logic that means it is driven by a voltage measuring circuit when configured as input, otherwise @@ -141344,10 +141236,10 @@ index 3cfbd6a..4e4e132 100644 state = !!gpiod_get_value_cansleep(led_dat->gpiod); else -From 232cca59a44a424f60e8af0517a3fb98c076393f Mon Sep 17 00:00:00 2001 +From 45d1edd1051ba8c3dcff92c18b0d56adea55ab5c Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Fri, 17 Jul 2015 09:50:55 +0200 -Subject: [PATCH 124/131] dmaengine: bcm2708-dmaengine: Fix memory leak when +Subject: [PATCH 124/149] dmaengine: bcm2708-dmaengine: Fix memory leak when stopping a running transfer --- @@ -141367,10 +141259,10 @@ index 987ed53..73c6c00 100644 bcm2835_dma_abort(c->chan_base); -From bc216042289449e4f8c07cea409a3d775d685a85 Mon Sep 17 00:00:00 2001 +From 5f40c5575ed6f7831637415de4e99400f270dd22 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:13 +0200 -Subject: [PATCH 125/131] BCM270X_DT: Fix I2S register map +Subject: [PATCH 125/149] BCM270X_DT: Fix I2S register map --- arch/arm/boot/dts/bcm2708_common.dtsi | 4 ++-- @@ -141392,10 +141284,10 @@ index 2dd25f7..728e14a 100644 //dmas = <&dma 2>, // <&dma 3>; -From a4c38fc82dc02bbf1bfdef2627c2ed1ed522611e Mon Sep 17 00:00:00 2001 +From cc5fa860bef4a444edca29c4493da61837e1b7e7 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 126/131] BCM2835_DT: Fix I2S register map +Subject: [PATCH 126/149] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -141449,10 +141341,10 @@ index 4a63704..1135120 100644 dmas = <&dma 2>, <&dma 3>; -From 76a6fde3d0ec48b42cc12cde51bb5713f8a8ee80 Mon Sep 17 00:00:00 2001 +From 0480e8bf45e8c4fd614ce16c1f3091d85ce95576 Mon Sep 17 00:00:00 2001 From: David Frey Date: Tue, 14 Jul 2015 15:57:36 +0200 -Subject: [PATCH 127/131] config: Enable SHT drivers for raspberry pi +Subject: [PATCH 127/149] config: Enable SHT drivers for raspberry pi The SHT temperature and humidity sensors are often used in weather station projects. @@ -141494,10 +141386,10 @@ index b9b5bdf..7b24274 100644 CONFIG_THERMAL_BCM2835=y CONFIG_WATCHDOG=y -From 49158f0283abf882fd4497394729fe8e03349ca8 Mon Sep 17 00:00:00 2001 +From a433727025805fd09e50b829738fc02b99446617 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:07:14 +0100 -Subject: [PATCH 128/131] BCM270X_DT: Correct typo in overlays/README +Subject: [PATCH 128/149] BCM270X_DT: Correct typo in overlays/README --- arch/arm/boot/dts/overlays/README | 2 +- @@ -141517,10 +141409,10 @@ index 8792f98..ed484ae 100644 i2c_arm Set to "on" to enable the ARM's i2c interface -From a5b4fabbfc1a60ae0cb13710b3084d62e6d1b27a Mon Sep 17 00:00:00 2001 +From 26be449bd477753ba005248dfde121a9e4c16a39 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 10:53:26 +0100 -Subject: [PATCH 129/131] bcm2835-sdhost: Add the ERASE capability +Subject: [PATCH 129/149] bcm2835-sdhost: Add the ERASE capability See: https://github.com/raspberrypi/linux/issues/1076 --- @@ -141541,10 +141433,10 @@ index d65870a..57a6ad3 100644 spin_lock_init(&host->lock); -From 48d4fef9df7f4d04ff6d7f37ab3b1c9b1737bdb3 Mon Sep 17 00:00:00 2001 +From 02c4ebf0f3e2f379496ce265f883e23a0b7be363 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 17:32:18 +0100 -Subject: [PATCH 130/131] bcm2835-sdhost: Ignore CRC7 for MMC CMD1 +Subject: [PATCH 130/149] bcm2835-sdhost: Ignore CRC7 for MMC CMD1 It seems that the sdhost interface returns CRC7 errors for CMD1, which is the MMC-specific SEND_OP_COND. Returning these errors to @@ -141608,10 +141500,10 @@ index 57a6ad3..84f645f 100644 if (host->cmd->flags & MMC_RSP_PRESENT) { -From e6a77a6da2720d0687e9cdd0e9656712f1317d55 Mon Sep 17 00:00:00 2001 +From 995b4ff06b418b3dbc8d560547c95d8e9e501c0c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:48:21 +0100 -Subject: [PATCH 131/131] BCM270X_DT: Add unit address to gpio node name +Subject: [PATCH 131/149] BCM270X_DT: Add unit address to gpio node name --- arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- @@ -141630,3 +141522,2264 @@ index 728e14a..cb608df 100644 compatible = "brcm,bcm2835-gpio"; reg = <0x7e200000 0xb4>; interrupts = <2 17>, <2 18>; + +From 56bc2c9c4ef10c7dc0b0ed9bf1868e2010e4adb6 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 24 Jul 2015 10:36:32 +0100 +Subject: [PATCH 132/149] BCM270X_DT: Use i2c_arm for rtc and bmp085 overlays + +--- + arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts | 2 +- + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts +index b830bf2..782b171 100644 +--- a/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts +@@ -6,7 +6,7 @@ + compatible = "brcm,bcm2708"; + + fragment@0 { +- target = <&i2c1>; ++ target = <&i2c_arm>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index 7052c71..fed4bd8 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -6,7 +6,7 @@ + compatible = "brcm,bcm2708"; + + fragment@0 { +- target = <&i2c1>; ++ target = <&i2c_arm>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + +From a3201af81c47ab3cf0ca61d3632a6df14e935b23 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 24 Jul 2015 12:11:31 +0100 +Subject: [PATCH 133/149] BCM2708_DT: CM dtparams for audio, watchdog and RNG + +--- + arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +index 34d4bc6..713e5a2 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi +@@ -17,14 +17,14 @@ + status = "okay"; + }; + +-&audio { +- status = "okay"; +-}; +- + / { + __overrides__ { + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; ++ ++ audio = <&audio>,"status"; ++ watchdog = <&watchdog>,"status"; ++ random = <&random>,"status"; + }; + }; + +From 30929ea53242c1f5efc06caf4a17b9c7922fd437 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:13:18 +0200 +Subject: [PATCH 134/149] vchiq: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + .../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 17 +++++++++-------- + .../misc/vc04_services/interface/vchiq_arm/vchiq_arm.c | 17 +++++++++++++++++ + 3 files changed, 27 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index cb608df..df66e64 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -225,6 +225,7 @@ + reg = <0x7e00b840 0xf>; + interrupts = <0 2>; + cache-line-size = <32>; ++ firmware = <&firmware>; + }; + + thermal: thermal { +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +index 56bff05..c9febcc 100644 +--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +@@ -39,11 +39,11 @@ + #include + #include + #include +-#include + #include + #include + #include + #include ++#include + + #define TOTAL_SLOTS (VCHIQ_SLOT_ZERO_SLOTS + 2 * 32) + +@@ -89,10 +89,12 @@ free_pagelist(PAGELIST_T *pagelist, int actual); + int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) + { + struct device *dev = &pdev->dev; ++ struct rpi_firmware *fw = platform_get_drvdata(pdev); + VCHIQ_SLOT_ZERO_T *vchiq_slot_zero; + struct resource *res; + void *slot_mem; + dma_addr_t slot_phys; ++ u32 channelbase; + int slot_mem_size, frag_mem_size; + int err, irq, i; + +@@ -157,13 +159,12 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) + } + + /* Send the base address of the slots to VideoCore */ +- +- dsb(); /* Ensure all writes have completed */ +- +- err = bcm_mailbox_write(MBOX_CHAN_VCHIQ, (unsigned int)slot_phys); +- if (err) { +- dev_err(dev, "mailbox write failed\n"); +- return err; ++ channelbase = slot_phys; ++ err = rpi_firmware_property(fw, RPI_FIRMWARE_VCHIQ_INIT, ++ &channelbase, sizeof(channelbase)); ++ if (err || channelbase) { ++ dev_err(dev, "failed to set channelbase\n"); ++ return err ? : -ENXIO; + } + + vchiq_log_info(vchiq_arm_log_level, +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +index 31e2cba..e11c0e0 100644 +--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +@@ -45,7 +45,9 @@ + #include + #include + #include ++#include + #include ++#include + + #include "vchiq_core.h" + #include "vchiq_ioctl.h" +@@ -2793,9 +2795,24 @@ void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state, + + static int vchiq_probe(struct platform_device *pdev) + { ++ struct device_node *fw_node; ++ struct rpi_firmware *fw; + int err; + void *ptr_err; + ++ fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0); ++/* Remove comment when booting without Device Tree is no longer supported ++ if (!fw_node) { ++ dev_err(&pdev->dev, "Missing firmware node\n"); ++ return -ENOENT; ++ } ++*/ ++ fw = rpi_firmware_get(fw_node); ++ if (!fw) ++ return -EPROBE_DEFER; ++ ++ platform_set_drvdata(pdev, fw); ++ + /* create debugfs entries */ + err = vchiq_debugfs_init(); + if (err != 0) + +From 978ebf9c4c2ef238e19ea1478b5fd11c3252c912 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:17:10 +0200 +Subject: [PATCH 135/149] thermal: bcm2835: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. +Remove retry loop on failure to read temperature. +Clean up code. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + drivers/thermal/bcm2835-thermal.c | 197 +++++++++++++--------------------- + 2 files changed, 75 insertions(+), 123 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index df66e64..bd8ac0a 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -230,6 +230,7 @@ + + thermal: thermal { + compatible = "brcm,bcm2835-thermal"; ++ firmware = <&firmware>; + }; + }; + +diff --git a/drivers/thermal/bcm2835-thermal.c b/drivers/thermal/bcm2835-thermal.c +index 3bc80f1..c1d8f1b 100644 +--- a/drivers/thermal/bcm2835-thermal.c ++++ b/drivers/thermal/bcm2835-thermal.c +@@ -12,161 +12,113 @@ + * consent. + *****************************************************************************/ + +-#include + #include +-#include +-#include + #include +-#include +-#include + #include ++#include + +- +-/* --- DEFINITIONS --- */ +-#define MODULE_NAME "bcm2835_thermal" +- +-/*#define THERMAL_DEBUG_ENABLE*/ +- +-#ifdef THERMAL_DEBUG_ENABLE +-#define print_debug(fmt,...) printk(KERN_INFO "%s:%s:%d: "fmt"\n", MODULE_NAME, __func__, __LINE__, ##__VA_ARGS__) +-#else +-#define print_debug(fmt,...) +-#endif +-#define print_err(fmt,...) printk(KERN_ERR "%s:%s:%d: "fmt"\n", MODULE_NAME, __func__,__LINE__, ##__VA_ARGS__) +- +-#define VC_TAG_GET_TEMP 0x00030006 +-#define VC_TAG_GET_MAX_TEMP 0x0003000A +- +-typedef enum { +- TEMP, +- MAX_TEMP, +-} temp_type; +- +-/* --- STRUCTS --- */ +-/* tag part of the message */ +-struct vc_msg_tag { +- uint32_t tag_id; /* the tag ID for the temperature */ +- uint32_t buffer_size; /* size of the buffer (should be 8) */ +- uint32_t request_code; /* identifies message as a request (should be 0) */ +- uint32_t id; /* extra ID field (should be 0) */ +- uint32_t val; /* returned value of the temperature */ +-}; +- +-/* message structure to be sent to videocore */ +-struct vc_msg { +- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */ +- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */ +- struct vc_msg_tag tag; /* the tag structure above to make */ +- uint32_t end_tag; /* an end identifier, should be set to NULL */ +-}; +- +-struct bcm2835_thermal_data { +- struct thermal_zone_device *thermal_dev; +- struct vc_msg msg; +-}; +- +-/* --- GLOBALS --- */ +-static struct bcm2835_thermal_data bcm2835_data; +- +-/* Thermal Device Operations */ +-static struct thermal_zone_device_ops ops; +- +-/* --- FUNCTIONS --- */ +- +-static int bcm2835_get_temp_or_max(struct thermal_zone_device *thermal_dev, unsigned long *temp, unsigned tag_id) ++static int bcm2835_thermal_get_property(struct thermal_zone_device *tz, ++ unsigned long *temp, u32 tag) + { +- int result = -1, retry = 3; +- print_debug("IN"); ++ struct rpi_firmware *fw = tz->devdata; ++ struct { ++ u32 id; ++ u32 val; ++ } packet; ++ int ret; + + *temp = 0; +- while (result != 0 && retry-- > 0) { +- /* wipe all previous message data */ +- memset(&bcm2835_data.msg, 0, sizeof bcm2835_data.msg); +- +- /* prepare message */ +- bcm2835_data.msg.msg_size = sizeof bcm2835_data.msg; +- bcm2835_data.msg.tag.buffer_size = 8; +- bcm2835_data.msg.tag.tag_id = tag_id; +- +- /* send the message */ +- result = bcm_mailbox_property(&bcm2835_data.msg, sizeof bcm2835_data.msg); +- print_debug("Got %stemperature as %u (%d,%x)\n", tag_id==VC_TAG_GET_MAX_TEMP ? "max ":"", (uint)bcm2835_data.msg.tag.val, result, bcm2835_data.msg.request_code); +- if (!(bcm2835_data.msg.request_code & 0x80000000)) +- result = -1; ++ packet.id = 0; ++ ret = rpi_firmware_property(fw, tag, &packet, sizeof(packet)); ++ if (ret) { ++ dev_err(&tz->device, "Failed to get temperature\n"); ++ return ret; + } + +- /* check if it was all ok and return the rate in milli degrees C */ +- if (result == 0) +- *temp = (uint)bcm2835_data.msg.tag.val; +- else +- print_err("Failed to get temperature! (%x:%d)\n", tag_id, result); +- print_debug("OUT"); +- return result; ++ *temp = packet.val; ++ dev_dbg(&tz->device, "%stemp=%lu\n", ++ tag == RPI_FIRMWARE_GET_MAX_TEMPERATURE ? "max" : "", *temp); ++ ++ return 0; + } + +-static int bcm2835_get_temp(struct thermal_zone_device *thermal_dev, unsigned long *temp) ++static int bcm2835_thermal_get_temp(struct thermal_zone_device *tz, ++ unsigned long *temp) + { +- return bcm2835_get_temp_or_max(thermal_dev, temp, VC_TAG_GET_TEMP); ++ return bcm2835_thermal_get_property(tz, temp, ++ RPI_FIRMWARE_GET_TEMPERATURE); + } + +-static int bcm2835_get_max_temp(struct thermal_zone_device *thermal_dev, int trip_num, unsigned long *temp) ++static int bcm2835_thermal_get_max_temp(struct thermal_zone_device *tz, ++ int trip, unsigned long *temp) + { +- return bcm2835_get_temp_or_max(thermal_dev, temp, VC_TAG_GET_MAX_TEMP); ++ /* ++ * The maximum safe temperature of the SoC. ++ * Overclock may be disabled above this temperature. ++ */ ++ return bcm2835_thermal_get_property(tz, temp, ++ RPI_FIRMWARE_GET_MAX_TEMPERATURE); + } + +-static int bcm2835_get_trip_type(struct thermal_zone_device * thermal_dev, int trip_num, enum thermal_trip_type *trip_type) ++static int bcm2835_thermal_get_trip_type(struct thermal_zone_device *tz, ++ int trip, enum thermal_trip_type *type) + { +- *trip_type = THERMAL_TRIP_HOT; ++ *type = THERMAL_TRIP_HOT; ++ + return 0; + } + +- +-static int bcm2835_get_mode(struct thermal_zone_device *thermal_dev, enum thermal_device_mode *dev_mode) ++static int bcm2835_thermal_get_mode(struct thermal_zone_device *tz, ++ enum thermal_device_mode *mode) + { +- *dev_mode = THERMAL_DEVICE_ENABLED; ++ *mode = THERMAL_DEVICE_ENABLED; ++ + return 0; + } + ++static struct thermal_zone_device_ops ops = { ++ .get_temp = bcm2835_thermal_get_temp, ++ .get_trip_temp = bcm2835_thermal_get_max_temp, ++ .get_trip_type = bcm2835_thermal_get_trip_type, ++ .get_mode = bcm2835_thermal_get_mode, ++}; + + static int bcm2835_thermal_probe(struct platform_device *pdev) + { +- print_debug("IN"); +- print_debug("THERMAL Driver has been probed!"); +- +- /* check that the device isn't null!*/ +- if(pdev == NULL) +- { +- print_debug("Platform device is empty!"); +- return -ENODEV; ++ struct device_node *fw_np; ++ struct rpi_firmware *fw; ++ struct thermal_zone_device *tz; ++ ++ fw_np = of_parse_phandle(pdev->dev.of_node, "firmware", 0); ++/* Remove comment when booting without Device Tree is no longer supported ++ if (!fw_np) { ++ dev_err(&pdev->dev, "Missing firmware node\n"); ++ return -ENOENT; + } +- +- if(!(bcm2835_data.thermal_dev = thermal_zone_device_register("bcm2835_thermal", 1, 0, NULL, &ops, NULL, 0, 0))) +- { +- print_debug("Unable to register the thermal device!"); +- return -EFAULT; ++*/ ++ fw = rpi_firmware_get(fw_np); ++ if (!fw) ++ return -EPROBE_DEFER; ++ ++ tz = thermal_zone_device_register("bcm2835_thermal", 1, 0, fw, &ops, ++ NULL, 0, 0); ++ if (IS_ERR(tz)) { ++ dev_err(&pdev->dev, "Failed to register the thermal device\n"); ++ return PTR_ERR(tz); + } ++ ++ platform_set_drvdata(pdev, tz); ++ + return 0; + } + +- + static int bcm2835_thermal_remove(struct platform_device *pdev) + { +- print_debug("IN"); +- +- thermal_zone_device_unregister(bcm2835_data.thermal_dev); +- +- print_debug("OUT"); ++ thermal_zone_device_unregister(platform_get_drvdata(pdev)); + + return 0; + } + +-static struct thermal_zone_device_ops ops = { +- .get_temp = bcm2835_get_temp, +- .get_trip_temp = bcm2835_get_max_temp, +- .get_trip_type = bcm2835_get_trip_type, +- .get_mode = bcm2835_get_mode, +-}; +- + static const struct of_device_id bcm2835_thermal_of_match_table[] = { + { .compatible = "brcm,bcm2835-thermal", }, + {}, +@@ -177,14 +129,13 @@ static struct platform_driver bcm2835_thermal_driver = { + .probe = bcm2835_thermal_probe, + .remove = bcm2835_thermal_remove, + .driver = { +- .name = "bcm2835_thermal", +- .owner = THIS_MODULE, +- .of_match_table = bcm2835_thermal_of_match_table, +- }, ++ .name = "bcm2835_thermal", ++ .of_match_table = bcm2835_thermal_of_match_table, ++ }, + }; ++module_platform_driver(bcm2835_thermal_driver); + +-MODULE_LICENSE("GPL"); + MODULE_AUTHOR("Dorian Peake"); ++MODULE_AUTHOR("Noralf Trønnes"); + MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +- +-module_platform_driver(bcm2835_thermal_driver); ++MODULE_LICENSE("GPL"); + +From 26b1f0b224f9e59fc87d02e8d0a683a3ca847356 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:18:36 +0200 +Subject: [PATCH 136/149] cpufreq: bcm2835: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. + +Signed-off-by: Noralf Trønnes +--- + drivers/cpufreq/bcm2835-cpufreq.c | 117 +++++++++++++++++--------------------- + 1 file changed, 53 insertions(+), 64 deletions(-) + +diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c +index 6735da9..3eb9e93 100644 +--- a/drivers/cpufreq/bcm2835-cpufreq.c ++++ b/drivers/cpufreq/bcm2835-cpufreq.c +@@ -26,7 +26,7 @@ + #include + #include + #include +-#include ++#include + + /* ---------- DEFINES ---------- */ + /*#define CPUFREQ_DEBUG_ENABLE*/ /* enable debugging */ +@@ -43,23 +43,6 @@ + #define print_err(fmt,...) pr_err("%s:%s:%d: "fmt, MODULE_NAME, __func__,__LINE__, ##__VA_ARGS__) + #define print_info(fmt,...) pr_info("%s: "fmt, MODULE_NAME, ##__VA_ARGS__) + +-/* tag part of the message */ +-struct vc_msg_tag { +- uint32_t tag_id; /* the message id */ +- uint32_t buffer_size; /* size of the buffer (which in this case is always 8 bytes) */ +- uint32_t data_size; /* amount of data being sent or received */ +- uint32_t dev_id; /* the ID of the clock/voltage to get or set */ +- uint32_t val; /* the value (e.g. rate (in Hz)) to set */ +-}; +- +-/* message structure to be sent to videocore */ +-struct vc_msg { +- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */ +- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */ +- struct vc_msg_tag tag; /* the tag structure above to make */ +- uint32_t end_tag; /* an end identifier, should be set to NULL */ +-}; +- + /* ---------- GLOBALS ---------- */ + static struct cpufreq_driver bcm2835_cpufreq_driver; /* the cpufreq driver global */ + +@@ -74,62 +57,63 @@ static struct cpufreq_frequency_table bcm2835_freq_table[] = { + clk_rate either gets or sets the clock rates. + =============================================== + */ +-static uint32_t bcm2835_cpufreq_set_clock(int cur_rate, int arm_rate) ++ ++static int bcm2835_cpufreq_clock_property(u32 tag, u32 id, u32 *val) + { +- int s, actual_rate=0; +- struct vc_msg msg; ++ struct rpi_firmware *fw = rpi_firmware_get(NULL); ++ struct { ++ u32 id; ++ u32 val; ++ } packet; ++ int ret; ++ ++ packet.id = id; ++ packet.val = *val; ++ ret = rpi_firmware_property(fw, tag, &packet, sizeof(packet)); ++ if (ret) ++ return ret; + +- /* wipe all previous message data */ +- memset(&msg, 0, sizeof msg); ++ *val = packet.val; + +- msg.msg_size = sizeof msg; ++ return 0; ++} + +- msg.tag.tag_id = VCMSG_SET_CLOCK_RATE; +- msg.tag.buffer_size = 8; +- msg.tag.data_size = 8; /* we're sending the clock ID and the new rates which is a total of 2 words */ +- msg.tag.dev_id = VCMSG_ID_ARM_CLOCK; +- msg.tag.val = arm_rate * 1000; ++static uint32_t bcm2835_cpufreq_set_clock(int cur_rate, int arm_rate) ++{ ++ u32 rate = arm_rate * 1000; ++ int ret; + +- /* send the message */ +- s = bcm_mailbox_property(&msg, sizeof msg); ++ ret = bcm2835_cpufreq_clock_property(RPI_FIRMWARE_SET_CLOCK_RATE, VCMSG_ID_ARM_CLOCK, &rate); ++ if (ret) { ++ print_err("Failed to set clock: %d (%d)\n", arm_rate, ret); ++ return 0; ++ } + +- /* check if it was all ok and return the rate in KHz */ +- if (s == 0 && (msg.request_code & 0x80000000)) +- actual_rate = msg.tag.val/1000; ++ rate /= 1000; ++ print_debug("Setting new frequency = %d -> %d (actual %d)\n", cur_rate, arm_rate, rate); + +- print_debug("Setting new frequency = %d -> %d (actual %d)\n", cur_rate, arm_rate, actual_rate); +- return actual_rate; ++ return rate; + } + + static uint32_t bcm2835_cpufreq_get_clock(int tag) + { +- int s; +- int arm_rate = 0; +- struct vc_msg msg; +- +- /* wipe all previous message data */ +- memset(&msg, 0, sizeof msg); +- +- msg.msg_size = sizeof msg; +- msg.tag.tag_id = tag; +- msg.tag.buffer_size = 8; +- msg.tag.data_size = 4; /* we're just sending the clock ID which is one word long */ +- msg.tag.dev_id = VCMSG_ID_ARM_CLOCK; ++ u32 rate; ++ int ret; + +- /* send the message */ +- s = bcm_mailbox_property(&msg, sizeof msg); +- +- /* check if it was all ok and return the rate in KHz */ +- if (s == 0 && (msg.request_code & 0x80000000)) +- arm_rate = msg.tag.val/1000; ++ ret = bcm2835_cpufreq_clock_property(tag, VCMSG_ID_ARM_CLOCK, &rate); ++ if (ret) { ++ print_err("Failed to get clock (%d)\n", ret); ++ return 0; ++ } + +- print_debug("%s frequency = %d\n", +- tag == VCMSG_GET_CLOCK_RATE ? "Current": +- tag == VCMSG_GET_MIN_CLOCK ? "Min": +- tag == VCMSG_GET_MAX_CLOCK ? "Max": +- "Unexpected", arm_rate); ++ rate /= 1000; ++ print_debug("%s frequency = %u\n", ++ tag == RPI_FIRMWARE_GET_CLOCK_RATE ? "Current": ++ tag == RPI_FIRMWARE_GET_MIN_CLOCK_RATE ? "Min": ++ tag == RPI_FIRMWARE_GET_MAX_CLOCK_RATE ? "Max": ++ "Unexpected", rate); + +- return arm_rate; ++ return rate; + } + + /* +@@ -165,9 +149,14 @@ static int bcm2835_cpufreq_driver_init(struct cpufreq_policy *policy) + /* measured value of how long it takes to change frequency */ + const unsigned int transition_latency = 355000; /* ns */ + ++ if (!rpi_firmware_get(NULL)) { ++ print_err("Firmware is not available\n"); ++ return -ENODEV; ++ } ++ + /* now find out what the maximum and minimum frequencies are */ +- bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MIN_CLOCK); +- bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MAX_CLOCK); ++ bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_MIN_CLOCK_RATE); ++ bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_MAX_CLOCK_RATE); + + print_info("min=%d max=%d\n", bcm2835_freq_table[0].frequency, bcm2835_freq_table[1].frequency); + return cpufreq_generic_init(policy, bcm2835_freq_table, transition_latency); +@@ -201,8 +190,8 @@ static int bcm2835_cpufreq_driver_target_index(struct cpufreq_policy *policy, un + + static unsigned int bcm2835_cpufreq_driver_get(unsigned int cpu) + { +- unsigned int actual_rate = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); +- print_debug("%d: freq=%d\n", cpu, actual_rate); ++ unsigned int actual_rate = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_CLOCK_RATE); ++ print_debug("cpu%d: freq=%d\n", cpu, actual_rate); + return actual_rate <= bcm2835_freq_table[0].frequency ? bcm2835_freq_table[0].frequency : bcm2835_freq_table[1].frequency; + } + + +From a15106c0300ea7958fa7e1cc62c573d999eb4ee2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:20:59 +0200 +Subject: [PATCH 137/149] fbdev: bcm2708: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the new firmware API instead of the legacy mailbox API. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2708_common.dtsi | 1 + + drivers/video/fbdev/bcm2708_fb.c | 273 +++++++++++++++++++--------------- + 2 files changed, 152 insertions(+), 122 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index bd8ac0a..d1c3bdf 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -217,6 +217,7 @@ + + fb: fb { + compatible = "brcm,bcm2708-fb"; ++ firmware = <&firmware>; + status = "disabled"; + }; + +diff --git a/drivers/video/fbdev/bcm2708_fb.c b/drivers/video/fbdev/bcm2708_fb.c +index f6ac7da..06a96d16 100644 +--- a/drivers/video/fbdev/bcm2708_fb.c ++++ b/drivers/video/fbdev/bcm2708_fb.c +@@ -25,7 +25,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -34,6 +33,7 @@ + #include + #include + #include ++#include + + //#define BCM2708_FB_DEBUG + #define MODULE_NAME "bcm2708_fb" +@@ -58,15 +58,19 @@ static u32 dma_busy_wait_threshold = 1<<15; + module_param(dma_busy_wait_threshold, int, 0644); + MODULE_PARM_DESC(dma_busy_wait_threshold, "Busy-wait for DMA completion below this area"); + +-/* this data structure describes each frame buffer device we find */ +- +-struct fbinfo_s { +- u32 xres, yres, xres_virtual, yres_virtual; +- u32 pitch, bpp; ++struct fb_alloc_tags { ++ struct rpi_firmware_property_tag_header tag1; ++ u32 xres, yres; ++ struct rpi_firmware_property_tag_header tag2; ++ u32 xres_virtual, yres_virtual; ++ struct rpi_firmware_property_tag_header tag3; ++ u32 bpp; ++ struct rpi_firmware_property_tag_header tag4; + u32 xoffset, yoffset; +- u32 base; +- u32 screen_size; +- u16 cmap[256]; ++ struct rpi_firmware_property_tag_header tag5; ++ u32 base, screen_size; ++ struct rpi_firmware_property_tag_header tag6; ++ u32 pitch; + }; + + struct bcm2708_fb_stats { +@@ -78,9 +82,9 @@ struct bcm2708_fb_stats { + struct bcm2708_fb { + struct fb_info fb; + struct platform_device *dev; +- struct fbinfo_s *info; +- dma_addr_t dma; ++ struct rpi_firmware *fw; + u32 cmap[16]; ++ u32 gpu_cmap[256]; + int dma_chan; + int dma_irq; + void __iomem *dma_chan_base; +@@ -270,69 +274,71 @@ static int bcm2708_fb_check_var(struct fb_var_screeninfo *var, + + static int bcm2708_fb_set_par(struct fb_info *info) + { +- uint32_t val = 0; + struct bcm2708_fb *fb = to_bcm2708(info); +- volatile struct fbinfo_s *fbinfo = fb->info; +- fbinfo->xres = info->var.xres; +- fbinfo->yres = info->var.yres; +- fbinfo->xres_virtual = info->var.xres_virtual; +- fbinfo->yres_virtual = info->var.yres_virtual; +- fbinfo->bpp = info->var.bits_per_pixel; +- fbinfo->xoffset = info->var.xoffset; +- fbinfo->yoffset = info->var.yoffset; +- fbinfo->base = 0; /* filled in by VC */ +- fbinfo->pitch = 0; /* filled in by VC */ ++ struct fb_alloc_tags fbinfo = { ++ .tag1 = { RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT, ++ 8, 0, }, ++ .xres = info->var.xres, ++ .yres = info->var.yres, ++ .tag2 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT, ++ 8, 0, }, ++ .xres_virtual = info->var.xres_virtual, ++ .yres_virtual = info->var.yres_virtual, ++ .tag3 = { RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH, 4, 0 }, ++ .bpp = info->var.bits_per_pixel, ++ .tag4 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET, 8, 0 }, ++ .xoffset = info->var.xoffset, ++ .yoffset = info->var.yoffset, ++ .tag5 = { RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE, 8, 0 }, ++ .base = 0, ++ .screen_size = 0, ++ .tag6 = { RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH, 4, 0 }, ++ .pitch = 0, ++ }; ++ int ret; + + print_debug("bcm2708_fb_set_par info(%p) %dx%d (%dx%d), %d, %d\n", info, + info->var.xres, info->var.yres, info->var.xres_virtual, + info->var.yres_virtual, (int)info->screen_size, + info->var.bits_per_pixel); + +- /* ensure last write to fbinfo is visible to GPU */ +- wmb(); +- +- /* inform vc about new framebuffer */ +- bcm_mailbox_write(MBOX_CHAN_FB, fb->dma); +- +- /* TODO: replace fb driver with vchiq version */ +- /* wait for response */ +- bcm_mailbox_read(MBOX_CHAN_FB, &val); +- +- /* ensure GPU writes are visible to us */ +- rmb(); +- +- if (val == 0) { +- fb->fb.fix.line_length = fbinfo->pitch; +- +- if (info->var.bits_per_pixel <= 8) +- fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR; +- else +- fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; +- +- fb->fb_bus_address = fbinfo->base; +- fbinfo->base &= ~0xc0000000; +- fb->fb.fix.smem_start = fbinfo->base; +- fb->fb.fix.smem_len = fbinfo->pitch * fbinfo->yres_virtual; +- fb->fb.screen_size = fbinfo->screen_size; +- if (fb->fb.screen_base) +- iounmap(fb->fb.screen_base); +- fb->fb.screen_base = +- (void *)ioremap_wc(fbinfo->base, fb->fb.screen_size); +- if (!fb->fb.screen_base) { +- /* the console may currently be locked */ +- console_trylock(); +- console_unlock(); +- pr_err("bcm2708_fb_set_par: Failed to set screen_base\n"); +- return -EIO; +- } ++ ret = rpi_firmware_property_list(fb->fw, &fbinfo, sizeof(fbinfo)); ++ if (ret) { ++ dev_err(info->device, ++ "Failed to allocate GPU framebuffer (%d)\n", ret); ++ return ret; + } ++ ++ if (info->var.bits_per_pixel <= 8) ++ fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR; ++ else ++ fb->fb.fix.visual = FB_VISUAL_TRUECOLOR; ++ ++ fb->fb.fix.line_length = fbinfo.pitch; ++ fbinfo.base |= 0x40000000; ++ fb->fb_bus_address = fbinfo.base; ++ fbinfo.base &= ~0xc0000000; ++ fb->fb.fix.smem_start = fbinfo.base; ++ fb->fb.fix.smem_len = fbinfo.pitch * fbinfo.yres_virtual; ++ fb->fb.screen_size = fbinfo.screen_size; ++ if (fb->fb.screen_base) ++ iounmap(fb->fb.screen_base); ++ fb->fb.screen_base = ioremap_wc(fbinfo.base, fb->fb.screen_size); ++ if (!fb->fb.screen_base) { ++ /* the console may currently be locked */ ++ console_trylock(); ++ console_unlock(); ++ dev_err(info->device, "Failed to set screen_base\n"); ++ return -ENOMEM; ++ } ++ + print_debug +- ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d success=%d\n", ++ ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d\n", + (void *)fb->fb.screen_base, (void *)fb->fb_bus_address, +- fbinfo->xres, fbinfo->yres, fbinfo->bpp, +- fbinfo->pitch, (int)fb->fb.screen_size, val); ++ fbinfo.xres, fbinfo.yres, fbinfo.bpp, ++ fbinfo.pitch, (int)fb->fb.screen_size); + +- return val; ++ return 0; + } + + static inline u32 convert_bitfield(int val, struct fb_bitfield *bf) +@@ -352,15 +358,34 @@ static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red, + /*print_debug("BCM2708FB: setcolreg %d:(%02x,%02x,%02x,%02x) %x\n", regno, red, green, blue, transp, fb->fb.fix.visual);*/ + if (fb->fb.var.bits_per_pixel <= 8) { + if (regno < 256) { +- /* blue [0:4], green [5:10], red [11:15] */ +- fb->info->cmap[regno] = ((red >> (16-5)) & 0x1f) << 11 | +- ((green >> (16-6)) & 0x3f) << 5 | +- ((blue >> (16-5)) & 0x1f) << 0; ++ /* blue [23:16], green [15:8], red [7:0] */ ++ fb->gpu_cmap[regno] = ((red >> 8) & 0xff) << 0 | ++ ((green >> 8) & 0xff) << 8 | ++ ((blue >> 8) & 0xff) << 16; + } + /* Hack: we need to tell GPU the palette has changed, but currently bcm2708_fb_set_par takes noticable time when called for every (256) colour */ + /* So just call it for what looks like the last colour in a list for now. */ +- if (regno == 15 || regno == 255) +- bcm2708_fb_set_par(info); ++ if (regno == 15 || regno == 255) { ++ struct packet { ++ u32 offset; ++ u32 length; ++ u32 cmap[256]; ++ } *packet; ++ int ret; ++ ++ packet = kmalloc(sizeof(*packet), GFP_KERNEL); ++ if (!packet) ++ return -ENOMEM; ++ packet->offset = 0; ++ packet->length = regno + 1; ++ memcpy(packet->cmap, fb->gpu_cmap, sizeof(packet->cmap)); ++ ret = rpi_firmware_property(fb->fw, RPI_FIRMWARE_FRAMEBUFFER_SET_PALETTE, ++ packet, (2 + packet->length) * sizeof(u32)); ++ if (ret || packet->offset) ++ dev_err(info->device, "Failed to set palette (%d,%u)\n", ++ ret, packet->offset); ++ kfree(packet); ++ } + } else if (regno < 16) { + fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) | + convert_bitfield(blue, &fb->fb.var.blue) | +@@ -372,27 +397,31 @@ static int bcm2708_fb_setcolreg(unsigned int regno, unsigned int red, + + static int bcm2708_fb_blank(int blank_mode, struct fb_info *info) + { +- s32 result = -1; +- u32 p[7]; +- if ( (blank_mode == FB_BLANK_NORMAL) || +- (blank_mode == FB_BLANK_UNBLANK)) { +- +- p[0] = 28; // size = sizeof u32 * length of p +- p[1] = VCMSG_PROCESS_REQUEST; // process request +- p[2] = VCMSG_SET_BLANK_SCREEN; // (the tag id) +- p[3] = 4; // (size of the response buffer) +- p[4] = 4; // (size of the request data) +- p[5] = blank_mode; +- p[6] = VCMSG_PROPERTY_END; // end tag +- +- bcm_mailbox_property(&p, p[0]); +- +- if ( p[1] == VCMSG_REQUEST_SUCCESSFUL ) +- result = 0; +- else +- pr_err("bcm2708_fb_blank(%d) returns=%d p[1]=0x%x\n", blank_mode, p[5], p[1]); ++ struct bcm2708_fb *fb = to_bcm2708(info); ++ u32 value; ++ int ret; ++ ++ switch (blank_mode) { ++ case FB_BLANK_UNBLANK: ++ value = 0; ++ break; ++ case FB_BLANK_NORMAL: ++ case FB_BLANK_VSYNC_SUSPEND: ++ case FB_BLANK_HSYNC_SUSPEND: ++ case FB_BLANK_POWERDOWN: ++ value = 1; ++ break; ++ default: ++ return -EINVAL; + } +- return result; ++ ++ ret = rpi_firmware_property(fb->fw, RPI_FIRMWARE_FRAMEBUFFER_BLANK, ++ &value, sizeof(value)); ++ if (ret) ++ dev_err(info->device, "bcm2708_fb_blank(%d) failed: %d\n", ++ blank_mode, ret); ++ ++ return ret; + } + + static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) +@@ -408,25 +437,25 @@ static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info + + static int bcm2708_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) + { +- s32 result = -1; +- u32 p[7]; +- if (cmd == FBIO_WAITFORVSYNC) { +- p[0] = 28; // size = sizeof u32 * length of p +- p[1] = VCMSG_PROCESS_REQUEST; // process request +- p[2] = VCMSG_SET_VSYNC; // (the tag id) +- p[3] = 4; // (size of the response buffer) +- p[4] = 4; // (size of the request data) +- p[5] = 0; // dummy +- p[6] = VCMSG_PROPERTY_END; // end tag +- +- bcm_mailbox_property(&p, p[0]); +- +- if ( p[1] == VCMSG_REQUEST_SUCCESSFUL ) +- result = 0; +- else +- pr_err("bcm2708_fb_ioctl %x,%lx returns=%d p[1]=0x%x\n", cmd, arg, p[5], p[1]); ++ struct bcm2708_fb *fb = to_bcm2708(info); ++ u32 dummy = 0; ++ int ret; ++ ++ switch (cmd) { ++ case FBIO_WAITFORVSYNC: ++ ret = rpi_firmware_property(fb->fw, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_VSYNC, ++ &dummy, sizeof(dummy)); ++ break; ++ default: ++ dev_err(info->device, "Unknown ioctl 0x%x\n", cmd); ++ return -EINVAL; + } +- return result; ++ ++ if (ret) ++ dev_err(info->device, "ioctl 0x%x failed (%d)\n", cmd, ret); ++ ++ return ret; + } + static void bcm2708_fb_fillrect(struct fb_info *info, + const struct fb_fillrect *rect) +@@ -621,20 +650,7 @@ static struct fb_ops bcm2708_fb_ops = { + static int bcm2708_fb_register(struct bcm2708_fb *fb) + { + int ret; +- dma_addr_t dma; +- void *mem; +- +- mem = +- dma_alloc_coherent(&fb->dev->dev, PAGE_ALIGN(sizeof(*fb->info)), &dma, +- GFP_KERNEL); + +- if (NULL == mem) { +- pr_err(": unable to allocate fbinfo buffer\n"); +- ret = -ENOMEM; +- } else { +- fb->info = (struct fbinfo_s *)mem; +- fb->dma = dma; +- } + fb->fb.fbops = &bcm2708_fb_ops; + fb->fb.flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_COPYAREA; + fb->fb.pseudo_palette = fb->cmap; +@@ -693,9 +709,22 @@ static int bcm2708_fb_register(struct bcm2708_fb *fb) + + static int bcm2708_fb_probe(struct platform_device *dev) + { ++ struct device_node *fw_np; ++ struct rpi_firmware *fw; + struct bcm2708_fb *fb; + int ret; + ++ fw_np = of_parse_phandle(dev->dev.of_node, "firmware", 0); ++/* Remove comment when booting without Device Tree is no longer supported ++ if (!fw_np) { ++ dev_err(&dev->dev, "Missing firmware node\n"); ++ return -ENOENT; ++ } ++*/ ++ fw = rpi_firmware_get(fw_np); ++ if (!fw) ++ return -EPROBE_DEFER; ++ + fb = kzalloc(sizeof(struct bcm2708_fb), GFP_KERNEL); + if (!fb) { + dev_err(&dev->dev, +@@ -704,6 +733,7 @@ static int bcm2708_fb_probe(struct platform_device *dev) + goto free_region; + } + ++ fb->fw = fw; + bcm2708_fb_debugfs_init(fb); + + fb->cb_base = dma_alloc_writecombine(&dev->dev, SZ_64K, +@@ -737,6 +767,7 @@ static int bcm2708_fb_probe(struct platform_device *dev) + fb->dma_chan, fb->dma_chan_base); + + fb->dev = dev; ++ fb->fb.device = &dev->dev; + + ret = bcm2708_fb_register(fb); + if (ret == 0) { +@@ -769,8 +800,6 @@ static int bcm2708_fb_remove(struct platform_device *dev) + dma_free_writecombine(&dev->dev, SZ_64K, fb->cb_base, fb->cb_handle); + bcm_dma_chan_free(fb->dma_chan); + +- dma_free_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), (void *)fb->info, +- fb->dma); + bcm2708_fb_debugfs_deinit(fb); + + free_irq(fb->dma_irq, fb); + +From 8af174253322c75147e90fbc0ec0698d171e15ad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Mon, 20 Jul 2015 12:27:17 +0200 +Subject: [PATCH 138/149] bcm2835: Add firmware property to affected devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Also move firmware depending devices to the rpi dtsi file since +they depend on the Pi specific firmware. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2835-rpi.dtsi | 22 ++++++++++++++++++---- + arch/arm/boot/dts/bcm2835.dtsi | 15 --------------- + 2 files changed, 18 insertions(+), 19 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi +index 5cdfd5a..6c3daaf 100644 +--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi +@@ -32,6 +32,24 @@ + compatible = "raspberrypi,bcm2835-firmware"; + mboxes = <&mailbox>; + }; ++ ++ fb: fb { ++ compatible = "brcm,bcm2708-fb"; ++ firmware = <&firmware>; ++ }; ++ ++ thermal: thermal { ++ compatible = "brcm,bcm2835-thermal"; ++ firmware = <&firmware>; ++ }; ++ ++ vchiq: vchiq { ++ compatible = "brcm,bcm2835-vchiq"; ++ reg = <0x7e00b840 0xf>; ++ interrupts = <0 2>; ++ cache-line-size = <32>; ++ firmware = <&firmware>; ++ }; + }; + + /* Onboard audio */ +@@ -101,10 +119,6 @@ + bus-width = <4>; + }; + +-&fb { +- status = "okay"; +-}; +- + / { + __overrides__ { + i2s = <&i2s>,"status"; +diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi +index 1135120..807264d 100644 +--- a/arch/arm/boot/dts/bcm2835.dtsi ++++ b/arch/arm/boot/dts/bcm2835.dtsi +@@ -160,21 +160,6 @@ + arm-pmu { + compatible = "arm,arm1176-pmu"; + }; +- +- fb: fb { +- compatible = "brcm,bcm2708-fb"; +- status = "disabled"; +- }; +- +- vchiq: vchiq { +- compatible = "brcm,bcm2835-vchiq"; +- reg = <0x7e00b840 0xf>; +- interrupts = <0 2>; +- }; +- +- thermal: thermal { +- compatible = "brcm,bcm2835-thermal"; +- }; + }; + + clocks { + +From 66840ef91d4a460062686c8312f267264b567f98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Tue, 21 Jul 2015 19:09:39 +0200 +Subject: [PATCH 139/149] rpi-ft5406: Use firmware API +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts | 1 + + drivers/input/touchscreen/rpi-ft5406.c | 74 ++++++++++------------- + 2 files changed, 32 insertions(+), 43 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +index 40deab5..2e53a17 100644 +--- a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts ++++ b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +@@ -9,6 +9,7 @@ + __overlay__ { + rpi_ft5406: rpi_ft5406 { + compatible = "rpi,rpi-ft5406"; ++ firmware = <&firmware>; + status = "okay"; + }; + }; +diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c +index d41851d..c08817e 100644 +--- a/drivers/input/touchscreen/rpi-ft5406.c ++++ b/drivers/input/touchscreen/rpi-ft5406.c +@@ -21,7 +21,7 @@ + #include + #include + #include +-#include ++#include + + #define MAXIMUM_SUPPORTED_POINTS 10 + struct ft5406_regs { +@@ -49,23 +49,6 @@ struct ft5406 { + struct task_struct * thread; + }; + +- +-/* tag part of the message */ +-struct vc_msg_tag { +- uint32_t tag_id; /* the message id */ +- uint32_t buffer_size; /* size of the buffer (which in this case is always 8 bytes) */ +- uint32_t data_size; /* amount of data being sent or received */ +- uint32_t val; /* data buffer */ +-}; +- +-/* message structure to be sent to videocore */ +-struct vc_msg { +- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */ +- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */ +- struct vc_msg_tag tag; /* the tag structure above to make */ +- uint32_t end_tag; /* an end identifier, should be set to NULL */ +-}; +- + /* Thread to poll for touchscreen events + * + * This thread polls the memory based register copy of the ft5406 registers +@@ -136,11 +119,37 @@ static int ft5406_probe(struct platform_device *pdev) + { + int ret; + struct input_dev * input_dev = input_allocate_device(); +- struct vc_msg request; + struct ft5406 * ts; ++ struct device_node *fw_node; ++ struct rpi_firmware *fw; ++ u32 touchbuf; + + dev_info(&pdev->dev, "Probing device\n"); + ++ fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0); ++ if (!fw_node) { ++ dev_err(&pdev->dev, "Missing firmware node\n"); ++ return -ENOENT; ++ } ++ ++ fw = rpi_firmware_get(fw_node); ++ if (!fw) ++ return -EPROBE_DEFER; ++ ++ ret = rpi_firmware_property(fw, RPI_FIRMWARE_FRAMEBUFFER_GET_TOUCHBUF, ++ &touchbuf, sizeof(touchbuf)); ++ if (ret) { ++ dev_err(&pdev->dev, "Failed to get touch buffer\n"); ++ return ret; ++ } ++ ++ if (!touchbuf) { ++ dev_err(&pdev->dev, "Touchscreen not detected\n"); ++ return -ENODEV; ++ } ++ ++ dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", touchbuf); ++ + ts = kzalloc(sizeof(struct ft5406), GFP_KERNEL); + + if (!ts || !input_dev) { +@@ -174,36 +183,15 @@ static int ft5406_probe(struct platform_device *pdev) + return ret; + } + +- memset(&request, 0, sizeof request); +- +- request.msg_size = sizeof request; +- request.request_code = VCMSG_PROCESS_REQUEST; +- request.tag.tag_id = VCMSG_GET_TOUCHBUF; +- request.tag.buffer_size = 4; +- request.tag.data_size = 4; +- +- bcm_mailbox_property(&request, sizeof(request)); +- +- if(request.request_code == VCMSG_REQUEST_SUCCESSFUL && request.tag.val != 0) +- { +- dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); +- } +- else +- { +- input_unregister_device(input_dev); +- kzfree(ts); +- return -1; +- } +- + // mmap the physical memory +- request.tag.val &= ~0xc0000000; +- ts->ts_base = ioremap(request.tag.val, sizeof(*ts->regs)); ++ touchbuf &= ~0xc0000000; ++ ts->ts_base = ioremap(touchbuf, sizeof(*ts->regs)); + if(ts->ts_base == NULL) + { + dev_err(&pdev->dev, "Failed to map physical address\n"); + input_unregister_device(input_dev); + kzfree(ts); +- return -1; ++ return -ENOMEM; + } + + ts->regs = (struct ft5406_regs *) ts->ts_base; + +From c1a5966807b9f6111684fda87e17df03f948e4d2 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 140/149] irqchip: bcm2835: Add FIQ support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add a duplicate irq range with an offset on the hwirq's so the +driver can detect that enable_fiq() is used. +Tested with downstream dwc_otg USB controller driver. + +Signed-off-by: Noralf Trønnes +Reviewed-by: Eric Anholt +Acked-by: Stephen Warren +--- + arch/arm/mach-bcm/Kconfig | 1 + + drivers/irqchip/irq-bcm2835.c | 53 ++++++++++++++++++++++++++++++++++++++----- + 2 files changed, 48 insertions(+), 6 deletions(-) + +diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig +index 8b11f44..7cfef7b 100644 +--- a/arch/arm/mach-bcm/Kconfig ++++ b/arch/arm/mach-bcm/Kconfig +@@ -114,6 +114,7 @@ config ARCH_BCM2835 + select ARM_ERRATA_411920 + select ARM_TIMER_SP804 + select CLKSRC_OF ++ select FIQ + select PINCTRL + select PINCTRL_BCM2835 + help +diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c +index 5916d6c..db66246 100644 +--- a/drivers/irqchip/irq-bcm2835.c ++++ b/drivers/irqchip/irq-bcm2835.c +@@ -56,7 +56,7 @@ + #include "irqchip.h" + + /* Put the bank and irq (32 bits) into the hwirq */ +-#define MAKE_HWIRQ(b, n) ((b << 5) | (n)) ++#define MAKE_HWIRQ(b, n) (((b) << 5) | (n)) + #define HWIRQ_BANK(i) (i >> 5) + #define HWIRQ_BIT(i) BIT(i & 0x1f) + +@@ -72,9 +72,13 @@ + | SHORTCUT1_MASK | SHORTCUT2_MASK) + + #define REG_FIQ_CONTROL 0x0c ++#define REG_FIQ_ENABLE 0x80 ++#define REG_FIQ_DISABLE 0 + + #define NR_BANKS 3 + #define IRQS_PER_BANK 32 ++#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0) ++#define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0)) + + static int reg_pending[] __initconst = { 0x00, 0x04, 0x08 }; + static int reg_enable[] __initconst = { 0x18, 0x10, 0x14 }; +@@ -98,14 +102,38 @@ static struct armctrl_ic intc __read_mostly; + static void __exception_irq_entry bcm2835_handle_irq( + struct pt_regs *regs); + ++static inline unsigned int hwirq_to_fiq(unsigned long hwirq) ++{ ++ hwirq -= NUMBER_IRQS; ++ /* ++ * The hwirq numbering used in this driver is: ++ * BASE (0-7) GPU1 (32-63) GPU2 (64-95). ++ * This differ from the one used in the FIQ register: ++ * GPU1 (0-31) GPU2 (32-63) BASE (64-71) ++ */ ++ if (hwirq >= 32) ++ return hwirq - 32; ++ ++ return hwirq + 64; ++} ++ + static void armctrl_mask_irq(struct irq_data *d) + { +- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.disable[HWIRQ_BANK(d->hwirq)]); ++ if (d->hwirq >= NUMBER_IRQS) ++ writel_relaxed(REG_FIQ_DISABLE, intc.base + REG_FIQ_CONTROL); ++ else ++ writel_relaxed(HWIRQ_BIT(d->hwirq), ++ intc.disable[HWIRQ_BANK(d->hwirq)]); + } + + static void armctrl_unmask_irq(struct irq_data *d) + { +- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.enable[HWIRQ_BANK(d->hwirq)]); ++ if (d->hwirq >= NUMBER_IRQS) ++ writel_relaxed(REG_FIQ_ENABLE | hwirq_to_fiq(d->hwirq), ++ intc.base + REG_FIQ_CONTROL); ++ else ++ writel_relaxed(HWIRQ_BIT(d->hwirq), ++ intc.enable[HWIRQ_BANK(d->hwirq)]); + } + + static struct irq_chip armctrl_chip = { +@@ -150,8 +178,9 @@ static int __init armctrl_of_init(struct device_node *node, + panic("%s: unable to map IC registers\n", + node->full_name); + +- intc.domain = irq_domain_add_linear(node, MAKE_HWIRQ(NR_BANKS, 0), +- &armctrl_ops, NULL); ++ intc.base = base; ++ intc.domain = irq_domain_add_linear(node, NUMBER_IRQS * 2, ++ &armctrl_ops, NULL); + if (!intc.domain) + panic("%s: unable to create IRQ domain\n", node->full_name); + +@@ -168,8 +197,20 @@ static int __init armctrl_of_init(struct device_node *node, + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); + } + } +- + set_handle_irq(bcm2835_handle_irq); ++ ++ /* Make a duplicate irq range which is used to enable FIQ */ ++ for (b = 0; b < NR_BANKS; b++) { ++ for (i = 0; i < bank_irqs[b]; i++) { ++ irq = irq_create_mapping(intc.domain, ++ MAKE_HWIRQ(b, i) + NUMBER_IRQS); ++ BUG_ON(irq <= 0); ++ irq_set_chip(irq, &armctrl_chip); ++ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); ++ } ++ } ++ init_FIQ(FIQ_START); ++ + return 0; + } + + +From 0086c10ac490fb95a1ec82df80587b591ee74ab3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 15:50:04 +0200 +Subject: [PATCH 141/149] dwc_otg: Add ARCH_BCM2835 support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + drivers/usb/host/dwc_otg/dwc_otg_driver.c | 1 + + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 1 - + drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 4 ++++ + 3 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +index 53307f0..95edadf 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +@@ -723,6 +723,7 @@ static int dwc_otg_driver_probe( + + memset(dwc_otg_device, 0, sizeof(*dwc_otg_device)); + dwc_otg_device->os_dep.reg_offset = 0xFFFFFFFF; ++ dwc_otg_device->os_dep.platformdev = _dev; + + /* + * Map the DWC_otg Core memory into virtual address space. +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 8a31562..3f71f29 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -36,7 +36,6 @@ + #include "dwc_otg_regs.h" + + #include +-#include + #include + + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +index 0f4ebcd..5c83309 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +@@ -445,7 +445,11 @@ static void hcd_init_fiq(void *cookie) + DWC_WARN("MPHI periph has NOT been enabled"); + #endif + // Enable FIQ interrupt from USB peripheral ++#ifdef CONFIG_ARCH_BCM2835 ++ enable_fiq(platform_get_irq(otg_dev->os_dep.platformdev, 1)); ++#else + enable_fiq(INTERRUPT_VC_USB); ++#endif + local_fiq_enable(); + } + + +From 025a502906cf5454047391a95846c4d6a3065240 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 15:50:24 +0200 +Subject: [PATCH 142/149] bcm2835: Use DWC_OTG +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/bcm2835.dtsi | 8 +++++--- + arch/arm/configs/bcm2835_defconfig | 1 + + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi +index 807264d..8a5d6ec 100644 +--- a/arch/arm/boot/dts/bcm2835.dtsi ++++ b/arch/arm/boot/dts/bcm2835.dtsi +@@ -152,9 +152,11 @@ + }; + + usb: usb@7e980000 { +- compatible = "brcm,bcm2835-usb"; +- reg = <0x7e980000 0x10000>; +- interrupts = <1 9>; ++ compatible = "brcm,bcm2708-usb"; ++ reg = <0x7e980000 0x10000>, ++ <0x7e006000 0x1000>; ++ interrupts = <2 0>, ++ <1 9>; + }; + + arm-pmu { +diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig +index c284414..14ef294 100644 +--- a/arch/arm/configs/bcm2835_defconfig ++++ b/arch/arm/configs/bcm2835_defconfig +@@ -869,6 +869,7 @@ CONFIG_USB_HIDDEV=y + CONFIG_USB=y + CONFIG_USB_ANNOUNCE_NEW_DEVICES=y + CONFIG_USB_MON=m ++CONFIG_USB_DWCOTG=y + CONFIG_USB_PRINTER=m + CONFIG_USB_STORAGE=y + CONFIG_USB_STORAGE_REALTEK=m + +From 808a80f803c9f8897b0867a5a7c0d52cfe984bfe Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:33:16 +0200 +Subject: [PATCH 143/149] Fix RASPBERRYPI_FIRMWARE dependents +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If forgot this when converting the drivers. + +Signed-off-by: Noralf Trønnes +--- + drivers/cpufreq/Kconfig.arm | 2 +- + drivers/input/touchscreen/Kconfig | 2 +- + drivers/misc/vc04_services/Kconfig | 2 +- + drivers/thermal/Kconfig | 2 +- + drivers/video/fbdev/Kconfig | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm +index a1039f0..0037516 100644 +--- a/drivers/cpufreq/Kconfig.arm ++++ b/drivers/cpufreq/Kconfig.arm +@@ -259,7 +259,7 @@ config ARM_SPEAR_CPUFREQ + This adds the CPUFreq driver support for SPEAr SOCs. + + config ARM_BCM2835_CPUFREQ +- depends on BCM2708_MBOX ++ depends on RASPBERRYPI_FIRMWARE + bool "BCM2835 Driver" + default y + help +diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig +index 5848562..d7e74a1 100644 +--- a/drivers/input/touchscreen/Kconfig ++++ b/drivers/input/touchscreen/Kconfig +@@ -585,7 +585,7 @@ config TOUCHSCREEN_EDT_FT5X06 + + config TOUCHSCREEN_RPI_FT5406 + tristate "Raspberry Pi FT5406 driver" +- depends on ARCH_BCM2708 || ARCH_BCM2709 ++ depends on RASPBERRYPI_FIRMWARE + help + Say Y here to enable the Raspberry Pi memory based FT5406 device + +diff --git a/drivers/misc/vc04_services/Kconfig b/drivers/misc/vc04_services/Kconfig +index c5ba283..db8e1be 100644 +--- a/drivers/misc/vc04_services/Kconfig ++++ b/drivers/misc/vc04_services/Kconfig +@@ -1,6 +1,6 @@ + config BCM2708_VCHIQ + tristate "Videocore VCHIQ" +- depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2708_MBOX ++ depends on RASPBERRYPI_FIRMWARE + default y + help + Kernel to VideoCore communication interface for the +diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig +index ddc77ad..b911213 100644 +--- a/drivers/thermal/Kconfig ++++ b/drivers/thermal/Kconfig +@@ -239,7 +239,7 @@ config INTEL_POWERCLAMP + user interface is exposed via generic thermal framework. + + config THERMAL_BCM2835 +- depends on BCM2708_MBOX ++ depends on RASPBERRYPI_FIRMWARE + tristate "BCM2835 Thermal Driver" + help + This will enable temperature monitoring for the Broadcom BCM2835 +diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig +index 3444a4c..c073d55 100644 +--- a/drivers/video/fbdev/Kconfig ++++ b/drivers/video/fbdev/Kconfig +@@ -226,7 +226,7 @@ comment "Frame buffer hardware drivers" + + config FB_BCM2708 + tristate "BCM2708 framebuffer support" +- depends on FB && ARM && BCM2708_MBOX ++ depends on FB && RASPBERRYPI_FIRMWARE + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + +From eca36789db0d78a939c6520e28bbb7f7e8ea1442 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:33:46 +0200 +Subject: [PATCH 144/149] vc_mem: Remove unnecessary include +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + drivers/char/broadcom/vc_mem.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/char/broadcom/vc_mem.c b/drivers/char/broadcom/vc_mem.c +index fcde6b1..be64f23 100644 +--- a/drivers/char/broadcom/vc_mem.c ++++ b/drivers/char/broadcom/vc_mem.c +@@ -22,7 +22,6 @@ + #include + #include + #include +-#include + #include + + #define DRIVER_NAME "vc-mem" + +From 89df011c7e129660df28ee2bc7744f8ff60ed316 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:34:06 +0200 +Subject: [PATCH 145/149] configs: Remove BCM2708_MBOX +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Noralf Trønnes +--- + arch/arm/configs/bcm2709_defconfig | 1 - + arch/arm/configs/bcm2835_defconfig | 1 - + arch/arm/configs/bcmrpi_defconfig | 1 - + 3 files changed, 3 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index dd00e7c..e3155da 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1078,7 +1078,6 @@ CONFIG_FB_TFT_WATTEROTT=m + CONFIG_FB_FLEX=m + CONFIG_FB_TFT_FBTFT_DEVICE=m + CONFIG_MAILBOX=y +-CONFIG_BCM2708_MBOX=y + CONFIG_BCM2835_MBOX=y + # CONFIG_IOMMU_SUPPORT is not set + CONFIG_EXTCON=m +diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig +index 14ef294..24d4df6 100644 +--- a/arch/arm/configs/bcm2835_defconfig ++++ b/arch/arm/configs/bcm2835_defconfig +@@ -1065,7 +1065,6 @@ CONFIG_FB_TFT_WATTEROTT=m + CONFIG_FB_FLEX=m + CONFIG_FB_TFT_FBTFT_DEVICE=m + CONFIG_MAILBOX=y +-CONFIG_BCM2708_MBOX=y + CONFIG_BCM2835_MBOX=y + # CONFIG_IOMMU_SUPPORT is not set + CONFIG_EXTCON=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 7b24274..0859113 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1071,7 +1071,6 @@ CONFIG_FB_TFT_WATTEROTT=m + CONFIG_FB_FLEX=m + CONFIG_FB_TFT_FBTFT_DEVICE=m + CONFIG_MAILBOX=y +-CONFIG_BCM2708_MBOX=y + CONFIG_BCM2835_MBOX=y + # CONFIG_IOMMU_SUPPORT is not set + CONFIG_EXTCON=m + +From 73e04a4d5c4e57aa0874fa5e79688e2b8eb6d0f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:34:31 +0200 +Subject: [PATCH 146/149] bcm2708-vcio: Remove module +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +All drivers have been converted to the new firmware API, so this +module is not needed anymore. + +Signed-off-by: Noralf Trønnes +--- + drivers/mailbox/Kconfig | 6 -- + drivers/mailbox/Makefile | 2 - + drivers/mailbox/bcm2708-vcio.c | 86 ----------------- + include/linux/platform_data/mailbox-bcm2708.h | 127 -------------------------- + 4 files changed, 221 deletions(-) + delete mode 100644 drivers/mailbox/bcm2708-vcio.c + delete mode 100644 include/linux/platform_data/mailbox-bcm2708.h + +diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig +index d1a6671..3965e10 100644 +--- a/drivers/mailbox/Kconfig ++++ b/drivers/mailbox/Kconfig +@@ -7,12 +7,6 @@ menuconfig MAILBOX + + if MAILBOX + +-config BCM2708_MBOX +- bool "Broadcom BCM2708 Mailbox (vcio)" +- depends on BCM2835_MBOX +- help +- Broadcom BCM2708 Mailbox (vcio) +- + config ARM_MHU + tristate "ARM MHU Mailbox" + depends on ARM_AMBA +diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile +index c86bc91..8e6d822 100644 +--- a/drivers/mailbox/Makefile ++++ b/drivers/mailbox/Makefile +@@ -2,8 +2,6 @@ + + obj-$(CONFIG_MAILBOX) += mailbox.o + +-obj-$(CONFIG_BCM2708_MBOX) += bcm2708-vcio.o +- + obj-$(CONFIG_ARM_MHU) += arm_mhu.o + + obj-$(CONFIG_PL320_MBOX) += pl320-ipc.o +diff --git a/drivers/mailbox/bcm2708-vcio.c b/drivers/mailbox/bcm2708-vcio.c +deleted file mode 100644 +index 2e4031b..0000000 +--- a/drivers/mailbox/bcm2708-vcio.c ++++ /dev/null +@@ -1,86 +0,0 @@ +-/* +- * Copyright (C) 2010 Broadcom +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- * +- * This device provides a shared mechanism for writing to the mailboxes, +- * semaphores, doorbells etc. that are shared between the ARM and the +- * VideoCore processor +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#define DRIVER_NAME "bcm2708_vcio" +- +-extern int bcm_mailbox_write(unsigned chan, uint32_t data28) +-{ +- struct rpi_firmware *fw = rpi_firmware_get(NULL); +- +- if (!fw) +- return -ENODEV; +- +- return rpi_firmware_transaction(fw, chan, data28); +-} +-EXPORT_SYMBOL_GPL(bcm_mailbox_write); +- +-extern int bcm_mailbox_read(unsigned chan, uint32_t *data28) +-{ +- struct rpi_firmware *fw = rpi_firmware_get(NULL); +- +- if (!fw) +- return -ENODEV; +- +- *data28 = rpi_firmware_transaction_received(fw); +- +- return 0; +-} +-EXPORT_SYMBOL_GPL(bcm_mailbox_read); +- +-static DEFINE_MUTEX(mailbox_lock); +-extern int bcm_mailbox_property(void *data, int size) +-{ +- uint32_t success; +- dma_addr_t mem_bus; /* the memory address accessed from videocore */ +- void *mem_kern; /* the memory address accessed from driver */ +- int s = 0; +- +- mutex_lock(&mailbox_lock); +- /* allocate some memory for the messages communicating with GPU */ +- mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus, +- GFP_KERNEL); +- if (mem_kern) { +- /* create the message */ +- memcpy(mem_kern, data, size); +- +- /* send the message */ +- wmb(); +- s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus); +- if (s == 0) +- s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success); +- if (s == 0) { +- /* copy the response */ +- rmb(); +- memcpy(data, mem_kern, size); +- } +- dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus); +- } else { +- s = -ENOMEM; +- } +- if (s != 0) +- pr_err(DRIVER_NAME ": %s failed (%d)\n", __func__, s); +- +- mutex_unlock(&mailbox_lock); +- return s; +-} +-EXPORT_SYMBOL_GPL(bcm_mailbox_property); +- +-MODULE_AUTHOR("Gray Girling"); +-MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); +-MODULE_LICENSE("GPL"); +diff --git a/include/linux/platform_data/mailbox-bcm2708.h b/include/linux/platform_data/mailbox-bcm2708.h +deleted file mode 100644 +index d3ea839..0000000 +--- a/include/linux/platform_data/mailbox-bcm2708.h ++++ /dev/null +@@ -1,127 +0,0 @@ +-/* +- * Copyright (C) 2010 Broadcom +- * +- * 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; either version 2 of the License, or +- * (at your option) any later version. +- * +- * 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. +- */ +-#ifndef _PLAT_MAILBOX_BCM2708_H +-#define _PLAT_MAILBOX_BCM2708_H +- +-/* Routines to handle I/O via the VideoCore "ARM control" registers +- * (semaphores, doorbells, mailboxes) +- */ +- +-/* Constants shared with the ARM identifying separate mailbox channels */ +-#define MBOX_CHAN_POWER 0 /* for use by the power management interface */ +-#define MBOX_CHAN_FB 1 /* for use by the frame buffer */ +-#define MBOX_CHAN_VCHIQ 3 /* for use by the VCHIQ interface */ +-#define MBOX_CHAN_PROPERTY 8 /* for use by the property channel */ +-#define MBOX_CHAN_COUNT 9 +- +-enum { +- VCMSG_PROCESS_REQUEST = 0x00000000 +-}; +- +-enum { +- VCMSG_REQUEST_SUCCESSFUL = 0x80000000, +- VCMSG_REQUEST_FAILED = 0x80000001 +-}; +- +-/* Mailbox property tags */ +-enum { +- VCMSG_PROPERTY_END = 0x00000000, +- VCMSG_GET_FIRMWARE_REVISION = 0x00000001, +- VCMSG_GET_BOARD_MODEL = 0x00010001, +- VCMSG_GET_BOARD_REVISION = 0x00010002, +- VCMSG_GET_BOARD_MAC_ADDRESS = 0x00010003, +- VCMSG_GET_BOARD_SERIAL = 0x00010004, +- VCMSG_GET_ARM_MEMORY = 0x00010005, +- VCMSG_GET_VC_MEMORY = 0x00010006, +- VCMSG_GET_CLOCKS = 0x00010007, +- VCMSG_GET_COMMAND_LINE = 0x00050001, +- VCMSG_GET_DMA_CHANNELS = 0x00060001, +- VCMSG_GET_POWER_STATE = 0x00020001, +- VCMSG_GET_TIMING = 0x00020002, +- VCMSG_SET_POWER_STATE = 0x00028001, +- VCMSG_GET_CLOCK_STATE = 0x00030001, +- VCMSG_SET_CLOCK_STATE = 0x00038001, +- VCMSG_GET_CLOCK_RATE = 0x00030002, +- VCMSG_SET_CLOCK_RATE = 0x00038002, +- VCMSG_GET_VOLTAGE = 0x00030003, +- VCMSG_SET_VOLTAGE = 0x00038003, +- VCMSG_GET_MAX_CLOCK = 0x00030004, +- VCMSG_GET_MAX_VOLTAGE = 0x00030005, +- VCMSG_GET_TEMPERATURE = 0x00030006, +- VCMSG_GET_MIN_CLOCK = 0x00030007, +- VCMSG_GET_MIN_VOLTAGE = 0x00030008, +- VCMSG_GET_TURBO = 0x00030009, +- VCMSG_GET_MAX_TEMPERATURE = 0x0003000a, +- VCMSG_GET_STC = 0x0003000b, +- VCMSG_SET_TURBO = 0x00038009, +- VCMSG_SET_ALLOCATE_MEM = 0x0003000c, +- VCMSG_SET_LOCK_MEM = 0x0003000d, +- VCMSG_SET_UNLOCK_MEM = 0x0003000e, +- VCMSG_SET_RELEASE_MEM = 0x0003000f, +- VCMSG_SET_EXECUTE_CODE = 0x00030010, +- VCMSG_SET_EXECUTE_QPU = 0x00030011, +- VCMSG_SET_ENABLE_QPU = 0x00030012, +- VCMSG_GET_RESOURCE_HANDLE = 0x00030014, +- VCMSG_GET_EDID_BLOCK = 0x00030020, +- VCMSG_GET_CUSTOMER_OTP = 0x00030021, +- VCMSG_SET_CUSTOMER_OTP = 0x00038021, +- VCMSG_SET_ALLOCATE_BUFFER = 0x00040001, +- VCMSG_SET_RELEASE_BUFFER = 0x00048001, +- VCMSG_SET_BLANK_SCREEN = 0x00040002, +- VCMSG_TST_BLANK_SCREEN = 0x00044002, +- VCMSG_GET_PHYSICAL_WIDTH_HEIGHT = 0x00040003, +- VCMSG_TST_PHYSICAL_WIDTH_HEIGHT = 0x00044003, +- VCMSG_SET_PHYSICAL_WIDTH_HEIGHT = 0x00048003, +- VCMSG_GET_VIRTUAL_WIDTH_HEIGHT = 0x00040004, +- VCMSG_TST_VIRTUAL_WIDTH_HEIGHT = 0x00044004, +- VCMSG_SET_VIRTUAL_WIDTH_HEIGHT = 0x00048004, +- VCMSG_GET_DEPTH = 0x00040005, +- VCMSG_TST_DEPTH = 0x00044005, +- VCMSG_SET_DEPTH = 0x00048005, +- VCMSG_GET_PIXEL_ORDER = 0x00040006, +- VCMSG_TST_PIXEL_ORDER = 0x00044006, +- VCMSG_SET_PIXEL_ORDER = 0x00048006, +- VCMSG_GET_ALPHA_MODE = 0x00040007, +- VCMSG_TST_ALPHA_MODE = 0x00044007, +- VCMSG_SET_ALPHA_MODE = 0x00048007, +- VCMSG_GET_PITCH = 0x00040008, +- VCMSG_TST_PITCH = 0x00044008, +- VCMSG_SET_PITCH = 0x00048008, +- VCMSG_GET_VIRTUAL_OFFSET = 0x00040009, +- VCMSG_TST_VIRTUAL_OFFSET = 0x00044009, +- VCMSG_SET_VIRTUAL_OFFSET = 0x00048009, +- VCMSG_GET_OVERSCAN = 0x0004000a, +- VCMSG_TST_OVERSCAN = 0x0004400a, +- VCMSG_SET_OVERSCAN = 0x0004800a, +- VCMSG_GET_PALETTE = 0x0004000b, +- VCMSG_TST_PALETTE = 0x0004400b, +- VCMSG_SET_PALETTE = 0x0004800b, +- VCMSG_GET_LAYER = 0x0004000c, +- VCMSG_TST_LAYER = 0x0004400c, +- VCMSG_SET_LAYER = 0x0004800c, +- VCMSG_GET_TRANSFORM = 0x0004000d, +- VCMSG_TST_TRANSFORM = 0x0004400d, +- VCMSG_SET_TRANSFORM = 0x0004800d, +- VCMSG_TST_VSYNC = 0x0004400e, +- VCMSG_SET_VSYNC = 0x0004800e, +- VCMSG_GET_TOUCHBUF = 0x0004000f, +- VCMSG_SET_CURSOR_INFO = 0x00008010, +- VCMSG_SET_CURSOR_STATE = 0x00008011, +-}; +- +-int bcm_mailbox_read(unsigned chan, uint32_t *data28); +-int bcm_mailbox_write(unsigned chan, uint32_t data28); +-int bcm_mailbox_property(void *data, int size); +- +-#endif + +From f69941fbc0eb961fbf580165ad5022e26095db49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Fri, 24 Jul 2015 19:34:55 +0200 +Subject: [PATCH 147/149] Revert "firmware: bcm2835: Support legacy mailbox + API" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 40aa3c4f0c430cd5c574498f4d1d5e9f0bc1cf11. + +The legacy mailbox API has been removed so this is not needed. + +Signed-off-by: Noralf Trønnes +--- + drivers/firmware/raspberrypi.c | 15 ++------------- + include/soc/bcm2835/raspberrypi-firmware.h | 2 -- + 2 files changed, 2 insertions(+), 15 deletions(-) + +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index 89421a9..b980d53 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -19,7 +19,6 @@ + #define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) + #define MBOX_CHAN(msg) ((msg) & 0xf) + #define MBOX_DATA28(msg) ((msg) & ~0xf) +-#define MBOX_CHAN_VCHIQ 3 + #define MBOX_CHAN_PROPERTY 8 + + struct rpi_firmware { +@@ -27,7 +26,6 @@ struct rpi_firmware { + struct mbox_chan *chan; /* The property channel. */ + struct completion c; + u32 enabled; +- u32 received; + }; + + static struct platform_device *g_pdev; +@@ -37,7 +35,6 @@ static DEFINE_MUTEX(transaction_lock); + static void response_callback(struct mbox_client *cl, void *msg) + { + struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl); +- fw->received = *(u32 *)msg; + complete(&fw->c); + } + +@@ -45,7 +42,7 @@ static void response_callback(struct mbox_client *cl, void *msg) + * Sends a request to the firmware through the BCM2835 mailbox driver, + * and synchronously waits for the reply. + */ +-int ++static int + rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + { + u32 message = MBOX_MSG(chan, data); +@@ -57,8 +54,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + reinit_completion(&fw->c); + ret = mbox_send_message(fw->chan, &message); + if (ret >= 0) { +- if (chan != MBOX_CHAN_VCHIQ) +- wait_for_completion(&fw->c); ++ wait_for_completion(&fw->c); + ret = 0; + } else { + dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret); +@@ -67,13 +63,6 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + + return ret; + } +-EXPORT_SYMBOL(rpi_firmware_transaction); +- +-u32 rpi_firmware_transaction_received(struct rpi_firmware *fw) +-{ +- return MBOX_DATA28(fw->received); +-} +-EXPORT_SYMBOL(rpi_firmware_transaction_received); + + /** + * rpi_firmware_property_list - Submit firmware property list +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index 9a08cf1..d3933af 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -116,8 +116,6 @@ enum rpi_firmware_property_tag { + RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, + }; + +-int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); +-u32 rpi_firmware_transaction_received(struct rpi_firmware *fw); + int rpi_firmware_property(struct rpi_firmware *fw, + u32 tag, void *data, size_t len); + int rpi_firmware_property_list(struct rpi_firmware *fw, + +From 63de8df89946ca2bf9e663941c6d9108d212d1ba Mon Sep 17 00:00:00 2001 +From: Jonathan Bell +Date: Tue, 30 Jun 2015 12:35:39 +0100 +Subject: [PATCH 148/149] pinctrl: bcm2835: Clear the event latch register when + disabling interrupts + +It's possible to hit a race condition if interrupts are generated on a GPIO +pin when the IRQ line in question is being disabled. + +If the interrupt is freed, bcm2835_gpio_irq_disable() is called which +disables the event generation sources (edge, level). If an event occurred +between the last disabling of hard IRQs and the write to the event +source registers, a bit would be set in the GPIO event detect register +(GPEDSn) which goes unacknowledged by bcm2835_gpio_irq_handler() +so Linux complains loudly. + +There is no per-GPIO mask register, so when disabling GPIO interrupts +write 1 to the relevant bit in GPEDSn to clear out any stale events. + +Signed-off-by: Jonathan Bell +Acked-by: Stephen Warren +Signed-off-by: Linus Walleij +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +index 986779a..61ef002 100644 +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -503,6 +503,8 @@ static void bcm2835_gpio_irq_disable(struct irq_data *data) + + spin_lock_irqsave(&pc->irq_lock[bank], flags); + bcm2835_gpio_irq_config(pc, gpio, false); ++ /* Clear events that were latched prior to clearing event sources */ ++ bcm2835_gpio_set_bit(pc, GPEDS0, gpio); + clear_bit(offset, &pc->enabled_irq_map[bank]); + spin_unlock_irqrestore(&pc->irq_lock[bank], flags); + } + +From 8dcf91adc86b5ee16627c8fe777b4e2f5ca4efc1 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Tue, 4 Aug 2015 01:15:20 +0100 +Subject: [PATCH 149/149] dwc_otg: fiq_fsm: Make high-speed isochronous strided + transfers work properly + +Certain low-bandwidth high-speed USB devices (specialist audio devices, +compressed-frame webcams) have packet intervals > 1 microframe. + +Stride these transfers in the FIQ by using the start-of-frame interrupt +to restart the channel at the right time. +--- + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 17 +++++++++++++---- + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h | 5 ++++- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 7 ++++++- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 6 ++++-- + 4 files changed, 27 insertions(+), 8 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 7e0c726..85d82f3 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +@@ -615,8 +615,11 @@ static int notrace noinline fiq_fsm_do_sof(struct fiq_state *state, int num_chan + break; + + case FIQ_HS_ISOC_SLEEPING: +- state->channel[n].fsm = FIQ_HS_ISOC_TURBO; +- fiq_fsm_restart_channel(state, n, 0); ++ /* Is it time to wake this channel yet? */ ++ if (--state->channel[n].uframe_sleeps == 0) { ++ state->channel[n].fsm = FIQ_HS_ISOC_TURBO; ++ fiq_fsm_restart_channel(state, n, 0); ++ } + break; + + case FIQ_PER_SSPLIT_QUEUED: +@@ -624,7 +627,7 @@ static int notrace noinline fiq_fsm_do_sof(struct fiq_state *state, int num_chan + break; + if(!fiq_fsm_tt_in_use(state, num_channels, n)) { + if (!fiq_fsm_too_late(state, n)) { +- fiq_print(FIQDBG_INT, st, "SOF GO %01d", n); ++ fiq_print(FIQDBG_INT, state, "SOF GO %01d", n); + fiq_fsm_restart_channel(state, n, 0); + state->channel[n].fsm = FIQ_PER_SSPLIT_STARTED; + } else { +@@ -1069,8 +1072,14 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c + if (fiq_fsm_update_hs_isoc(state, n, hcint)) { + /* more transactions to come */ + handled = 1; +- restart = 1; + fiq_print(FIQDBG_INT, state, "HSISO M "); ++ /* For strided transfers, put ourselves to sleep */ ++ if (st->hs_isoc_info.stride > 1) { ++ st->uframe_sleeps = st->hs_isoc_info.stride - 1; ++ st->fsm = FIQ_HS_ISOC_SLEEPING; ++ } else { ++ restart = 1; ++ } + } else { + st->fsm = FIQ_HS_ISOC_DONE; + fiq_print(FIQDBG_INT, state, "HSISO F "); +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 8455324..f9fddfb 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h ++++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h +@@ -260,12 +260,13 @@ struct fiq_dma_blob { + * @iso_frame: Pointer to the array of OTG URB iso_frame_descs. + * @nrframes: Total length of iso_frame_desc array + * @index: Current index (FIQ-maintained) +- * ++ * @stride: Interval in uframes between HS isoc transactions + */ + struct fiq_hs_isoc_info { + struct dwc_otg_hcd_iso_packet_desc *iso_desc; + unsigned int nrframes; + unsigned int index; ++ unsigned int stride; + }; + + /** +@@ -296,6 +297,8 @@ struct fiq_channel_state { + /* Hardware bug workaround: sometimes channel halt interrupts are + * delayed until the next SOF. Keep track of when we expected to get interrupted. */ + unsigned int expected_uframe; ++ /* number of uframes remaining (for interval > 1 HS isoc transfers) before next transfer */ ++ unsigned int uframe_sleeps; + /* in/out for communicating number of dma buffers used, or number of ISOC to do */ + unsigned int nrpackets; + struct fiq_dma_info dma_info; +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index 4d7c7bb..135b611 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -1678,6 +1678,9 @@ int fiq_fsm_queue_isoc_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + } + } + ++ st->hs_isoc_info.stride = qh->interval; ++ st->uframe_sleeps = 0; ++ + fiq_print(FIQDBG_INT, hcd->fiq_state, "FSMQ %01d ", hc->hc_num); + fiq_print(FIQDBG_INT, hcd->fiq_state, "%08x", st->hcchar_copy.d32); + fiq_print(FIQDBG_INT, hcd->fiq_state, "%08x", st->hctsiz_copy.d32); +@@ -1692,9 +1695,11 @@ int fiq_fsm_queue_isoc_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) + DWC_WRITE_REG32(&hc_regs->hcintmsk, st->hcintmsk_copy.d32); + if (hfnum.b.frrem < PERIODIC_FRREM_BACKOFF) { + /* Prevent queueing near EOF1. Bad things happen if a periodic +- * split transaction is queued very close to EOF. ++ * split transaction is queued very close to EOF. SOF interrupt handler ++ * will wake this channel at the next interrupt. + */ + st->fsm = FIQ_HS_ISOC_SLEEPING; ++ st->uframe_sleeps = 1; + } else { + st->fsm = FIQ_HS_ISOC_TURBO; + st->hcchar_copy.b.chen = 1; +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 3f71f29..8db3dfc 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -2297,10 +2297,10 @@ void dwc_otg_fiq_unmangle_isoc(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh, dwc_otg_qtd + dwc_urb->error_count++; + } + } ++ qh->sched_frame = dwc_frame_num_inc(qh->sched_frame, qh->interval * (nr_frames - 1)); ++ + //printk_ratelimited(KERN_INFO "%s: HS isochronous of %d/%d frames with %d errors complete\n", + // __FUNCTION__, i, dwc_urb->packet_count, dwc_urb->error_count); +- hcd->fops->complete(hcd, dwc_urb->priv, dwc_urb, 0); +- release_channel(hcd, qh->channel, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); + } + + /** +@@ -2543,6 +2543,8 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) + * fail. + */ + dwc_otg_fiq_unmangle_isoc(hcd, qh, qtd, num); ++ hcd->fops->complete(hcd, qtd->urb->priv, qtd->urb, 0); ++ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); + break; + + case FIQ_PER_SPLIT_LS_ABORTED: