diff --git a/projects/RPi/linux/linux.arm.conf b/projects/RPi/linux/linux.arm.conf index 30dad992dc..0de50ca38d 100644 --- a/projects/RPi/linux/linux.arm.conf +++ b/projects/RPi/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.1.6 Kernel Configuration +# Linux/arm 4.1.8 Kernel Configuration # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -940,6 +940,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 # Misc devices # # CONFIG_SENSORS_LIS3LV02D is not set +CONFIG_BCM2835_SMI=m # CONFIG_AD525X_DPOT is not set # CONFIG_DUMMY_IRQ is not set # CONFIG_ICS932S401 is not set @@ -1387,6 +1388,7 @@ CONFIG_BCM2708_VCMEM=y CONFIG_BCM_VCIO=y CONFIG_BCM_VC_SM=y CONFIG_BCM2835_DEVGPIOMEM=m +CONFIG_BCM2835_SMI_DEV=m # CONFIG_XILLYBUS is not set # diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index 8bef3a7273..dfccd7cdaa 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 bc7d015ceaa36adc088675b0cdd3a7df05dfd9ed Mon Sep 17 00:00:00 2001 +From 609529b2f8865f8ad63cf2bc3be48a009c8e6f9d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 001/184] Main bcm2708/bcm2709 linux port +Subject: [PATCH 001/192] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124,7 +124,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 arch/arm/mach-bcm2709/vc_support.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 45df48b..bd9b2f3 100644 +index 19f4cc6..3ec1319 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -314,6 +314,42 @@ choice @@ -170,7 +170,7 @@ index 45df48b..bd9b2f3 100644 config ARCH_MULTIPLATFORM bool "Allow multiple platforms to be selected" depends on MMU -@@ -823,6 +859,9 @@ config ARCH_VIRT +@@ -824,6 +860,9 @@ config ARCH_VIRT # Kconfigs may be included either alphabetically (according to the # plat- suffix) or along side the corresponding mach-* source. # @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From 52397f48b515f888ad61b3bfb16fea22e5b83cad Mon Sep 17 00:00:00 2001 +From b13e8a3ef8cefa74548308f24bcdfc341aca70ee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 002/184] Add bcm2708_gpio driver +Subject: [PATCH 002/192] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7635,10 +7635,10 @@ index 0000000..fb69624 + +#endif -From 4e831e4d013b83364e41b463cf77c7acf4b454b3 Mon Sep 17 00:00:00 2001 +From 3b96584732e783101c33b3f93685fdb9c29f2f56 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/184] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 003/192] 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 7429b1db539759f0586f7e12c9332915477faf86 Mon Sep 17 00:00:00 2001 +From 1682b073c4ee65bbad4d422dc7e1e4335fb7520f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 004/184] Add dwc_otg driver +Subject: [PATCH 004/192] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69546,10 +69546,10 @@ index 0000000..cdc9963 +test_main(); +0; -From fbad81377923fa23914e15a8bab283b79293618f Mon Sep 17 00:00:00 2001 +From 5aad6d9cc7a07fab68fa8a809d1ef68227815b4e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 005/184] bcm2708 watchdog driver +Subject: [PATCH 005/192] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -69986,10 +69986,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 59bf8fe3c21caf11d56af182811b7f954c5ac1fb Mon Sep 17 00:00:00 2001 +From 0d7d0291c377904694bb5b28fee22c47c8842d88 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 006/184] bcm2708 framebuffer driver +Subject: [PATCH 006/192] 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 8533ef2eaa41d422d0fb87b60f6f3378b29a5b64 Mon Sep 17 00:00:00 2001 +From 8f7071a6b7d56dcacdb37d4dd106344b083275b6 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 007/184] dmaengine: Add support for BCM2708 +Subject: [PATCH 007/192] 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 d1f7e6f8f55a509533ac7468aa2bcb7608bfc1bb Mon Sep 17 00:00:00 2001 +From e07323745508bb0f376e4d459a54480fd3e31d44 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 008/184] MMC: added alternative MMC driver +Subject: [PATCH 008/192] 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 b66971c49c262d192b95882baa1d331f2863e6a8 Mon Sep 17 00:00:00 2001 +From dc41079232e59b916ca82d40e4e7206d4ab62aaa Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 009/184] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 009/192] 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 b6f82e619a4f4cb01f5916daea7e2dd9d3bbd743 Mon Sep 17 00:00:00 2001 +From 9377edd0d7701aaeeabb96cafd00c0716e34c571 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 010/184] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 010/192] 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 2a35225a6b978ed75d0ddb8137fbc63b8ef54a91 Mon Sep 17 00:00:00 2001 +From c19f082a656bb2d1d95030a5950c505ea48489b3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 011/184] bcm2708: alsa sound driver +Subject: [PATCH 011/192] 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 dfbd0d5b4ac667a5bba7dd9cfae952c1560e6e3a Mon Sep 17 00:00:00 2001 +From 1576308395a8e3ae6a6f8f9777929618ef427c89 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 012/184] bcm2708 vchiq driver +Subject: [PATCH 012/192] 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 272ac55666b71fbf9071d39d40a8fe9a7019b31e Mon Sep 17 00:00:00 2001 +From f17e4badf3975d0a1b7b1c20b524f2ef4a21571b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 013/184] vc_mem: Add vc_mem driver +Subject: [PATCH 013/192] 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 face5c60abadb506a565165e62898c31285daf6f Mon Sep 17 00:00:00 2001 +From 6f96fdd646856cefb12b44e5f08ece670f0181c2 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 014/184] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 014/192] 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 c359129bff7af01a9c405b65c23f337e0860fd4b Mon Sep 17 00:00:00 2001 +From 8ced4cc73e1a9ea263ac6fd724bd8959879b3da0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 015/184] Add hwrng (hardware random number generator) driver +Subject: [PATCH 015/192] 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 8999a27eaf7185af1543fbabc7b1125ed4d100d7 Mon Sep 17 00:00:00 2001 +From b669c0907ef1104dd084fea17c12650131eca5e5 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 016/184] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 016/192] 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 f11d95b418dbf7cbe56a115b38cf4f92ac3ad449 Mon Sep 17 00:00:00 2001 +From 557f263ec0d9a8c0ac86327ee6f82fb430321138 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 017/184] Add cpufreq driver +Subject: [PATCH 017/192] 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 64161aa8d6162ad77539322657cfbebb0501afe7 Mon Sep 17 00:00:00 2001 +From 9bcee345f285fc890d89c13ab810e00011c746e0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 018/184] Added hwmon/thermal driver for reporting core +Subject: [PATCH 018/192] 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 0829e2506b76ae45cd2b10cf87b9eb482038b1ea Mon Sep 17 00:00:00 2001 +From 400a88cfab32bbc52f75adf0383dc1b0894e7c3f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 019/184] Add Chris Boot's spi driver. +Subject: [PATCH 019/192] 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 1f7bcb7ddfa9650775d711f80f2e560bafaec33e Mon Sep 17 00:00:00 2001 +From d5c4f6a12d0593030ea5a934fb2c83f45298f412 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 020/184] Add Chris Boot's i2c driver +Subject: [PATCH 020/192] 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 0be494d1b3e0a66d2a0429097e31eb5f8bd8fa7a Mon Sep 17 00:00:00 2001 +From c3abf3ec4df5a8aaf4b5772ab69636734d87997b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 021/184] bcm2835: add v4l2 camera device +Subject: [PATCH 021/192] 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 e00c0af8fa949c4a76e6ff3b58c51fff83957933 Mon Sep 17 00:00:00 2001 +From 7b9ed5d65c02cce23d54b30c3e51ae404d2a7f48 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 022/184] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 022/192] 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 5a3fb4b186514770f97fc5f4a75cbd82ab12a762 Mon Sep 17 00:00:00 2001 +From 032973fcd78ccde1187013067269944722eaed55 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 023/184] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 023/192] 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 c368aad99d0aaf23d962631c7ede7c64cb7df083 Mon Sep 17 00:00:00 2001 +From 0f413a81d7dcf73f80a51b348cff64341dee7eb4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 024/184] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 024/192] 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 bc87493bc445a355c39d8a27aae1f23667fb7497 Mon Sep 17 00:00:00 2001 +From 33131a27961d07a2a612c9e8d3c7a1133e08f4e1 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 025/184] BCM2708: Add core Device Tree support +Subject: [PATCH 025/192] 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 1874c77dceab6b0805da4a330a46d2b2d6dc1afd Mon Sep 17 00:00:00 2001 +From 3ad1dddd91565b7f8246685072c5a7582c4c1030 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 026/184] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 026/192] 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 63c5fbdc6e2770243abb05c5ee78c74c80c8f9d3 Mon Sep 17 00:00:00 2001 +From cedcba17d7d61f257782b8a27d476207d9013699 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 029/184] Speed up console framebuffer imageblit function +Subject: [PATCH 029/192] 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 f870ef6cde2474f86c12f0bc4d0c3f773e5f85ef Mon Sep 17 00:00:00 2001 +From 1b61dd3ec17ab86f48f36710318c26bae5ee1acc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 030/184] Allow mac address to be set in smsc95xx +Subject: [PATCH 030/192] 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 ef1520a1e31048375d37fdd2bd5f5a1d199b0b3e Mon Sep 17 00:00:00 2001 +From 875b987168c33dbd9e3ffb259277d62a535970ab Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 031/184] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 031/192] 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 235c37961456b4c334680ed4c25c5a96ab00abda Mon Sep 17 00:00:00 2001 +From a7a7923fb977c1511cca7992d36d70c2c5b304d4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 033/184] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 033/192] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -122761,10 +122761,10 @@ Subject: [PATCH 033/184] config: Enable CONFIG_MEMCG, but leave it disabled 2 files changed, 24 insertions(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c -index e8a5491..2428355 100644 +index 4d65b66..dd258ff 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c -@@ -5393,6 +5393,29 @@ static int __init cgroup_disable(char *str) +@@ -5394,6 +5394,29 @@ static int __init cgroup_disable(char *str) } __setup("cgroup_disable=", cgroup_disable); @@ -122807,10 +122807,10 @@ index a04225d..a2ef8af 100644 /** -From 913dab2ce61697ccf445a510795adcf8a52c66da Mon Sep 17 00:00:00 2001 +From 0e5e372ca2240e9d70ae4c52662a49c3e16f7ba9 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 034/184] ASoC: Add support for BCM2708 +Subject: [PATCH 034/192] 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 e502c438fcd082ccf630a4d509588fda0905ac52 Mon Sep 17 00:00:00 2001 +From b2e44c6378b2db6d65be04c95ab877b91b8d9f1e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 035/184] ASoC: Add support for PCM5102A codec +Subject: [PATCH 035/192] 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 335030fdfe2302fa65d841e1b450d1b1741b11cf Mon Sep 17 00:00:00 2001 +From 7d8babed7b82e7e0288b21e4e7230cf6afe60c8d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 036/184] BCM2708: Add I2S support to board file +Subject: [PATCH 036/192] 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 b7c72ec1c00a776d4e47eaf7e584c6fbdf99876c Mon Sep 17 00:00:00 2001 +From 5ac22a8bd8d72cdd0943c5253f69246a9f67d809 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 037/184] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 037/192] 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 74faf52e4cd92d9b20ee66c7139b4bbaa041b103 Mon Sep 17 00:00:00 2001 +From 20d20b334afca6fd5e71e036285f542a74375d16 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 038/184] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 038/192] 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 86435cf0c576f7cec47ee95722502c94fc61f181 Mon Sep 17 00:00:00 2001 +From cad54b0a9c94257e08529fc9d2e673543851e817 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 039/184] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 039/192] 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 2e2e77e106ca29d0bafa7e0b2d69375f472fcf15 Mon Sep 17 00:00:00 2001 +From 2efb8725682fe9c9997677ce267f795db66b220e Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 040/184] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 040/192] 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 a67cb15ccb58a4156c5a01e3fe0ad1e6b1a599aa Mon Sep 17 00:00:00 2001 +From 575c0192a56f9b78175226f441dac7f850d5570a Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 041/184] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 041/192] 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 1a9fc6343d77113ca453ee67243581a044a6a636 Mon Sep 17 00:00:00 2001 +From 7be683eb602b189605fd7fc7c0871ff69ba60319 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 042/184] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 042/192] 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 798b0abaaa050086db1269ef60e16f14f5d81f3a Mon Sep 17 00:00:00 2001 +From f65b15497d822d0ee124653988e1c1a77d7e1c39 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 043/184] ASoC: wm8804: Set idle_bias_off to false Idle bias +Subject: [PATCH 043/192] 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 4459cf8e37437ea463683b47c7ade1234d23576e Mon Sep 17 00:00:00 2001 +From a3a8607f21c913660338ecfeab3e8f09e6f46a7e Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 044/184] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 044/192] 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 51bee497636d074c655c3a43023de3bdf7d91acd Mon Sep 17 00:00:00 2001 +From a83f2448dd653557e1532d92b581c56e4dc471c2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 045/184] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 045/192] 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 bd40c05a978de0af53014919088688d79be28f0c Mon Sep 17 00:00:00 2001 +From 4678e30fad78c70aa9fb1489c2c585e74d308973 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 046/184] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 046/192] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125312,7 +125312,7 @@ Reduces overhead when using X 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c -index bfbe1be..a738b25 100644 +index eab5bd6..ca47de9 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -49,7 +49,7 @@ @@ -125340,10 +125340,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From bb5991f459cc07182237b7fce76f7badf8a05056 Mon Sep 17 00:00:00 2001 +From e00dd94e1cf5cf4f7c9c49271d624695acfe2e6a Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 047/184] Added support for HiFiBerry DAC+ +Subject: [PATCH 047/192] 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 6f59fa3f213e8f4c1e86c7bdb5b4621153e0968d Mon Sep 17 00:00:00 2001 +From 169fecad9b21239bfa863add3a28c2b28c0771d5 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 048/184] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 048/192] 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 450553c3330e2f5b190cbdb561a0140ba3831af6 Mon Sep 17 00:00:00 2001 +From bfaa96ef753c4e4b8bd6fa32d98dec3d29a27828 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 049/184] bcm2708: Allow option card devices to be configured +Subject: [PATCH 049/192] 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 11037211a5e9c0063842ab8e6c66bb27de44883c Mon Sep 17 00:00:00 2001 +From 004ae70ecd0ba75f44339b5ecd4e1741051ac6fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 050/184] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 050/192] 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 feb1cc5051d14d50af22f923fb5c4540792d8cd5 Mon Sep 17 00:00:00 2001 +From 9ec5f902ca815afa5ad61c4820b16e7bfe6e8497 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 051/184] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 051/192] 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 59e0365feeea7499c0c4d1ceff5ca41fed4ef1bc Mon Sep 17 00:00:00 2001 +From 48370c036cd319379aba97fb3b5b0bc5a476c34d Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 052/184] Update ds1307 driver for device-tree support +Subject: [PATCH 052/192] 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 482c49893aaac62f57fa40b6f9edebd408820b79 Mon Sep 17 00:00:00 2001 +From 55ac310dca9f3610902db3937ebf301b18b3f6ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 053/184] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 053/192] 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 9590c4e749ca71df812a8d9bd5eece4346f058fc Mon Sep 17 00:00:00 2001 +From 022a8e47780f3e5077d6b2710734b6603c44952b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 054/184] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 054/192] 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 a216c02ac5863401ae356b2acf713e65ec2219f1 Mon Sep 17 00:00:00 2001 +From 0583ae47b0a83f3e8ace8bf7c5d0da6de8efe28e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 055/184] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 055/192] 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 6cf3b859717b84122aa78dca571787c56733d6a8 Mon Sep 17 00:00:00 2001 +From 7c65cd90b282b3ed93ad70f855db6131db3a265d Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 056/184] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 056/192] 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 21f644aed21c73b9723a75a747f0faf42674131e Mon Sep 17 00:00:00 2001 +From a5aa225de371133af222f8cc2d64cca5845f245f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 057/184] pinctrl-bcm2835: bcm2835_gpio_direction_output must +Subject: [PATCH 057/192] 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 b8404e667d8682395bc3bfcc9110f8fcd73f8b81 Mon Sep 17 00:00:00 2001 +From 93528a99004c5273cfbacbd3efa439f919f35126 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 058/184] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 058/192] 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 68072d1daec97449eecf6955dc3430f6b8b8d60e Mon Sep 17 00:00:00 2001 +From 350a32f43794babaedca70c9686bf91a4d76ec79 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 059/184] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 059/192] 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 0d70a95f8103110191c97ca8d4d19407c707c1a5 Mon Sep 17 00:00:00 2001 +From 002d8609b029cb3240dfeb872587427d8ad7cfa8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 060/184] enc28j60: Add device tree compatible string and an +Subject: [PATCH 060/192] enc28j60: Add device tree compatible string and an overlay --- @@ -127687,10 +127687,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From a0f1d5f050c95dcde0eb503ce0612892c5f15ac7 Mon Sep 17 00:00:00 2001 +From 9a7f2623274c034d489d2bde8479050ab7e8c00a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 061/184] Add driver for rpi-proto +Subject: [PATCH 061/192] 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 818086dcc405fe6ead7fd0dbf15e8dc80d7a9286 Mon Sep 17 00:00:00 2001 +From 8372895d37d8430a0ebd1a6ecaac2e1c5a3b812d Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 062/184] Add Device Tree support for RPi-DAC. +Subject: [PATCH 062/192] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -127983,10 +127983,10 @@ index b4eaa44..afe1b41 100644 }; -From 00fc3532672cd1626453f564d33144b6845e86b8 Mon Sep 17 00:00:00 2001 +From 583994e31e3e463163484a0d4b5ca4fb6249c014 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 063/184] config: Add default configs +Subject: [PATCH 063/192] 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 2cb806ce2289c605ed171074fd9b72847bac0ec9 Mon Sep 17 00:00:00 2001 +From 1f4b5f09c42a0cffa2cb1edb046b40c3edf0876d Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 064/184] smsx95xx: fix crimes against truesize +Subject: [PATCH 064/192] 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 7fd399f9583dc5f88f15a6c19e3d91696d45ee6f Mon Sep 17 00:00:00 2001 +From 0b6139e6075209396b47af33509cec1a78cc9fcb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 065/184] smsc95xx: Disable turbo mode by default +Subject: [PATCH 065/192] 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 30ee1f5b151b91c2df6f0206add7e39e7f503ca0 Mon Sep 17 00:00:00 2001 +From 2334df3103a87c0f035438ae4965e9068439bdf3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 066/184] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 066/192] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130558,10 +130558,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From e16b2fa757a4ea5b1d11a870b905a774421a73fa Mon Sep 17 00:00:00 2001 +From b4681b0522340cc6b5437ed1c0599b8fd90a6f6a 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/184] bcm2835: bcm2835_defconfig +Subject: [PATCH 067/192] 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 b934d0040c1e6cfc9921a68c48f064d63f642055 Mon Sep 17 00:00:00 2001 +From 2a9988d49a89b6decd3594930753f2a26f65bd24 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/184] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 068/192] 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 418832e4df7a8218f1b09f72304c3c6cf2b51234 Mon Sep 17 00:00:00 2001 +From ae4cde25a8fb5a195befa3b731b5a66e324a23e2 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 069/184] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 069/192] 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 67f08cf63765e86662a352a8fb557d9e4faa97c3 Mon Sep 17 00:00:00 2001 +From d22a193b895ee5d962c1ca9af1da96f1b6390c04 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 070/184] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 070/192] 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 0efe8388b6c12c59896db65f13c181d95987fb7c Mon Sep 17 00:00:00 2001 +From 9873c8a1e6a5a473081af4cc91d7de1a05d1f7ca Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 071/184] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 071/192] 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 3a007cbf03ab806c16be135da50f9115425dff36 Mon Sep 17 00:00:00 2001 +From 428c15e2c44134e3965874ea636ff17b1f30647e 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/184] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 072/192] 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 56b59b9109aade207c33d7d9fece724d89edb0e7 Mon Sep 17 00:00:00 2001 +From 0dfd9537626392726c642be4349428c2c9ff30cc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 073/184] platform: Add force_core command line setting to boot +Subject: [PATCH 073/192] 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 3d3b2dae4acf7b1ef7e6e33dfa3421add05af5a2 Mon Sep 17 00:00:00 2001 +From bd76380d909bf43f5b0e58ba97cac4de78ed112f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 074/184] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 074/192] 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 59de23cd60ae9def330db5eb018cecd113c47525 Mon Sep 17 00:00:00 2001 +From 540db38d70932afa9082b471b8e0cef881ee9c93 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Jun 2015 16:41:39 +0100 -Subject: [PATCH 075/184] BCM270X_DT: Document the i2s-mmap overlay +Subject: [PATCH 075/192] 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 529b778be78beef39f873c952e3e2f47b32cfffa Mon Sep 17 00:00:00 2001 +From 777f50046b3972b9adbb72dcf0e8a6222295d021 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 11:36:53 +0100 -Subject: [PATCH 076/184] bcm2835-sdhost: Improve error handling and recovery +Subject: [PATCH 076/192] 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 3f34f98a2708c28689e290b115b35d3714215069 Mon Sep 17 00:00:00 2001 +From 5129948c33f7747e199f35cfc4b800a14bb60874 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:46 -0700 -Subject: [PATCH 077/184] ARM: bcm2835: Add the Raspberry Pi firmware driver +Subject: [PATCH 077/192] 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 8cad06720e98df848427e6335567887f7040a6b8 Mon Sep 17 00:00:00 2001 +From db77f4974bcf574c2e8171752cb1e5c4aa57e367 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 22 Mar 2015 13:33:23 +0000 -Subject: [PATCH 078/184] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING +Subject: [PATCH 078/192] 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 2561ea7629a48c6876bcb049912b4145914189a7 Mon Sep 17 00:00:00 2001 +From 13fe405dc46bf5fbc787303ea266ac5f8968e367 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Mon, 22 Jun 2015 16:27:07 +0100 -Subject: [PATCH 079/184] Add rpi-ft5406 overlay Add rpi-ft5406 driver as +Subject: [PATCH 079/192] 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 087cdcdd8bd7d5c78758cdb5903230f58c9cc9a7 Mon Sep 17 00:00:00 2001 +From c2187533e3a163020c2fa5f93a307c8f009a9beb Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 23 Jun 2015 09:53:40 +0100 -Subject: [PATCH 080/184] Fix driver detection failure Check that the buffer +Subject: [PATCH 080/192] 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 7426319a8035baf3a38be576d1723dc1758d0ffe Mon Sep 17 00:00:00 2001 +From 14882c1c06a7fc116a527c56939d624a3ff31a93 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 13:24:01 +0100 -Subject: [PATCH 081/184] config: Enable 8250 serial port +Subject: [PATCH 081/192] 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 5eaee11e5c9f4b5ca5aa478d9d392a0c058fb4a9 Mon Sep 17 00:00:00 2001 +From 3a51951e18f4346bcf8297e5c14f8ff26d8c2ecb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 14:10:58 +0100 -Subject: [PATCH 082/184] config: Enable POWER_RESET_GPIO +Subject: [PATCH 082/192] 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 594144c43882d4f1cb7d00ec6ebb7d31b40a9c87 Mon Sep 17 00:00:00 2001 +From cfdf9d309e1e63e88876aa12a7e9579bebfae6de Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Jun 2015 17:37:38 +0100 -Subject: [PATCH 083/184] bcm2708-vcio: Remove restriction of only a single +Subject: [PATCH 083/192] 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 a352664afb3a70c30f22c5216fc6fe235aea3d51 Mon Sep 17 00:00:00 2001 +From 8d9f0a812d37b52a72dd33b082c5681efb72c539 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:39:19 +0100 -Subject: [PATCH 084/184] BCM270X_DT: Create a "core" clock, use it for SPI and +Subject: [PATCH 084/192] BCM270X_DT: Create a "core" clock, use it for SPI and sdhost --- @@ -136016,10 +136016,10 @@ index b408ab4..897204a 100644 }; }; -From 6ecb561eee8e124283009a79872823feb0ba06ec Mon Sep 17 00:00:00 2001 +From 7903edbb124634b2f953e9573d0a8995212a229f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 09:24:31 +0100 -Subject: [PATCH 085/184] BCM270X_DT: Add MCP7941X to i2c-rtc overlay +Subject: [PATCH 085/192] 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 8c0f34fca8a1509cc4f176d8e1e80f8a3678547f Mon Sep 17 00:00:00 2001 +From a0ec918bcbee508aa2225dcbe1661082cc84339c Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 24 Jun 2015 11:23:06 +0100 -Subject: [PATCH 086/184] dts/overlays: document DHT11 overlay +Subject: [PATCH 086/192] dts/overlays: document DHT11 overlay --- arch/arm/boot/dts/overlays/README | 8 ++++++++ @@ -136101,10 +136101,10 @@ index 425eb19..9406cf3 100644 -From 62a764969502398f404c9af8a01a9dc1c32ff498 Mon Sep 17 00:00:00 2001 +From cb0cf2cf18e4f6a672bcb7cd5c36d8b7c29fb4c3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 087/184] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 087/192] 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 aa912e8fc6344ed58355709e9e6722247c62fe7d Mon Sep 17 00:00:00 2001 +From 422f627455cd585e82251a4980509b58b8a24bdc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 17:10:40 +0100 -Subject: [PATCH 088/184] BCM270x_DT: Default Compute Module i2c, i2s and spi +Subject: [PATCH 088/192] BCM270x_DT: Default Compute Module i2c, i2s and spi support --- @@ -136312,10 +136312,10 @@ index e82fcb2..af252bd 100755 }; }; -From c2c12dc7820ce23316226277a090372d285f8d71 Mon Sep 17 00:00:00 2001 +From 0b3f2c73d03ef9541e05e35ccd69b6731a1e44f1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:21:55 +0100 -Subject: [PATCH 089/184] BCM270X_DT: Sort nodes by bus address, and +Subject: [PATCH 089/192] BCM270X_DT: Sort nodes by bus address, and consolidate aliases --- @@ -136557,10 +136557,10 @@ index 24fa849..ccb9c31 100644 &gpio { -From d07909257b284c7e672acb3f2f3d10463d36efb4 Mon Sep 17 00:00:00 2001 +From 596aae25defa66a027ff755bfbaa4927b4069ea5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:23:03 +0100 -Subject: [PATCH 090/184] i2c-bcm2708/BCM270X_DT: Add support for I2C2 +Subject: [PATCH 090/192] 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 279cb2310d229572ad89ca72c8827a6ee3eeca84 Mon Sep 17 00:00:00 2001 +From 6b690b074fef2a156777f6cfe4b039be5f750580 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Jun 2015 12:14:02 +0100 -Subject: [PATCH 091/184] BCM270X_DT: Correct the lirc-rpi overlay +Subject: [PATCH 091/192] 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 728c39dd915bab8db237206508db61f2b54ef031 Mon Sep 17 00:00:00 2001 +From d4e71046e5780edf317b9f46339ac4806ea523ef Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 08:47:09 +0100 -Subject: [PATCH 092/184] bcm2835-sdhost: Further improve overclock back-off +Subject: [PATCH 092/192] 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 26e7a55831a1753aad02313f1773d9ce6d54da07 Mon Sep 17 00:00:00 2001 +From b6a92ce71483993af45e67ea6f36169a0f830345 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:28:59 +0100 -Subject: [PATCH 093/184] i2c-bcm2708: Increase timeouts to allow larger +Subject: [PATCH 093/192] 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 eeb5edf190d6e60cde7cbb207528711ada055049 Mon Sep 17 00:00:00 2001 +From 06903fef22d5a4aa1d01d074ace7525b08700de6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:33:52 +0100 -Subject: [PATCH 094/184] spi-bcm2708: Increase timeout from 150ms to 1s +Subject: [PATCH 094/192] 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 b30d2301dbba44c13d59a7db5bbccad352a404aa Mon Sep 17 00:00:00 2001 +From 407ee1c2c3e70a2aefc441582e65e84ed89fc157 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 09:59:38 +0100 -Subject: [PATCH 095/184] bcm2708-spi: Don't use static pin configuration with +Subject: [PATCH 095/192] 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 b4f34ab5ffaf7fe832808f3c07facaf8d7f23fbe Mon Sep 17 00:00:00 2001 +From 72fd701def8bc905196e699d8dc7920145920985 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 10:10:59 +0100 -Subject: [PATCH 096/184] bcm2708-i2s: Don't use static pin configuration with +Subject: [PATCH 096/192] 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 1a19fc07ad65550b059cd965c31c6d7d97aaafc2 Mon Sep 17 00:00:00 2001 +From bb84c0676d675942bba9b1028e58558525aa1555 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 097/184] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 097/192] 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 4eee95c676b8cf9d802fbfa060eb4baadd6a6d7a Mon Sep 17 00:00:00 2001 +From 815181f5a9b19b78999ab59ddcf633e5a7109eaf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:50:11 +0100 -Subject: [PATCH 098/184] BCM270X_DT: Add overlay to enable uart1 +Subject: [PATCH 098/192] 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 e47856fbd3512bf40fb11102e4af60187eaf0d15 Mon Sep 17 00:00:00 2001 +From e61326ded97b93b02072eb60490487fb0082a819 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 099/184] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 099/192] 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 @@ -137408,10 +137408,10 @@ Signed-off-by: Phil Elwell 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 37875cf..55e81c2 100644 +index a506773..cf3190f 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c -@@ -359,6 +359,8 @@ static int bcm2835_spi_setup(struct spi_device *spi) +@@ -376,6 +376,8 @@ static int bcm2835_spi_setup(struct spi_device *spi) { int err; struct gpio_chip *chip; @@ -137420,7 +137420,7 @@ index 37875cf..55e81c2 100644 /* * sanity checking the native-chipselects */ -@@ -375,15 +377,42 @@ static int bcm2835_spi_setup(struct spi_device *spi) +@@ -392,15 +394,42 @@ static int bcm2835_spi_setup(struct spi_device *spi) "setup: only two native chip-selects are supported\n"); return -EINVAL; } @@ -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 7b9d931331e58ba7ffc0d41a9584d69e7984101c Mon Sep 17 00:00:00 2001 +From 716af635225849cc0b689e794e0ce5174d5a2218 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 17:37:38 +0100 -Subject: [PATCH 100/184] BCM270X_DT: Change pio_limit of sdhost driver to 1 +Subject: [PATCH 100/192] 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 b812ac14b8bcf869d1c83126317632f93e3ebc57 Mon Sep 17 00:00:00 2001 +From 11f29a2e4b02f7a16b50e4aec2491fbfee5048ae Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Jul 2015 12:51:52 +0100 -Subject: [PATCH 101/184] bcm2835-sdhost: Clear HBLC for PIO mode +Subject: [PATCH 101/192] 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 584bac220641fdc6f55b37941a4bd86e1d1cadac Mon Sep 17 00:00:00 2001 +From 9b4922dff10f1ca81cdc0d4074beeb7a3ad59850 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 12:21:01 +0100 -Subject: [PATCH 102/184] BCM270X_DT: I2S needs function Alt2 +Subject: [PATCH 102/192] 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 50930aa3c01d78a30f5950d425d4fa06a0ad5449 Mon Sep 17 00:00:00 2001 +From 50fd96b5cb84dc39a0f4c1901230338822b99000 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/184] configs: Incorporate v4.1 dependency changes +Subject: [PATCH 103/192] 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 40a66a1d7396779f489655073ab662e68ac027d7 Mon Sep 17 00:00:00 2001 +From bee1ff8246521c98c30d45c8b6b443ae10312d49 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 15:47:33 +0100 -Subject: [PATCH 104/184] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for +Subject: [PATCH 104/192] 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 bd98cb1eea3040c796e3c0242c26256fa20c0e8d Mon Sep 17 00:00:00 2001 +From 8309bfc0b04c5c60f2f65398d6691829dccb3841 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 4 Jul 2015 19:55:23 +0100 -Subject: [PATCH 105/184] squash: BCM270X_DT: I2S only needs Alt2 on 28-31 +Subject: [PATCH 105/192] 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 51ed3e44eb5905dad99bc6ce5d30057cca2b32c2 Mon Sep 17 00:00:00 2001 +From 172aff3948311932c95b7a2e211df26638e3a07e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 8 Jul 2015 14:48:57 +0100 -Subject: [PATCH 106/184] vchiq_arm: Two cacheing fixes +Subject: [PATCH 106/192] 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 94a4064adc9600f4693325b4088cf2f6f0c53797 Mon Sep 17 00:00:00 2001 +From 607d6a667b81d12a1acd00e847769fcbae5fdc06 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 09:10:36 +0100 -Subject: [PATCH 107/184] BCM270X_DT: Overlay for the Fen Logic VGA666 board +Subject: [PATCH 107/192] 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 3111035f87ebd8678da3bf5dfd87391015b14bf7 Mon Sep 17 00:00:00 2001 +From 79d8c2b5d515b281a7edb90d131ffb5b40abe175 Mon Sep 17 00:00:00 2001 From: petit-miner Date: Fri, 10 Jul 2015 13:59:18 +0200 -Subject: [PATCH 108/184] Added support for 2 mcp2515 CAN Bus IC +Subject: [PATCH 108/192] 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 70652d81539d3b880e133879bca441066310aa5d Mon Sep 17 00:00:00 2001 +From 0e7e559458e0ac6cd98e31d22bdec517d4fbc5ac Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 5 May 2015 13:27:45 -0700 -Subject: [PATCH 109/184] mailbox: Enable BCM2835 mailbox support +Subject: [PATCH 109/192] 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 e243b106d74d3a80c384195435b6bbd8f3b33147 Mon Sep 17 00:00:00 2001 +From 895893101b62145fbbf31701d8d21b5ed1b388b5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 13 May 2015 13:10:32 -0700 -Subject: [PATCH 110/184] mailbox/bcm2835: Fix mailbox full detection. +Subject: [PATCH 110/192] 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 f8eebe64090e66b29cab0d3618f7146daf825019 Mon Sep 17 00:00:00 2001 +From 06b12346293fb13dc45bb7fcc7a66abd1358e881 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/184] mailbox: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 111/192] 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 fc2520b79dcb97dedc70c566306fd41002c97efe Mon Sep 17 00:00:00 2001 +From b1528cb117ad1b7245dd08e1169b3a6763ca2fc3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:47 -0700 -Subject: [PATCH 112/184] ARM: bcm2835: Add the firmware driver information to +Subject: [PATCH 112/192] 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 1a6e34aa4c859a11bb2f5e43bc0608694251c2a0 Mon Sep 17 00:00:00 2001 +From a598409cb3143b78a7b7d14af0013c8ef23360c2 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/184] firmware: bcm2835: Add missing property tags +Subject: [PATCH 113/192] 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 c35d120d66f971a95785b212d1377f738e2b7d48 Mon Sep 17 00:00:00 2001 +From 053d4a654a4c93a03673b75558096a71a96188b6 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/184] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 114/192] 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 37dfa9878eb3ccb0163f4b480e6082984d873d3d Mon Sep 17 00:00:00 2001 +From c283182d1690a0cc5425276386eaa259af64cc25 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/184] firmware: bcm2835: Support legacy mailbox API +Subject: [PATCH 115/192] 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 debef1395e6c969933b6315f4a32cd93767d635c Mon Sep 17 00:00:00 2001 +From 5f8125ffe004ab3feac693049b27054aa421f751 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/184] char: broadcom: Add vcio module +Subject: [PATCH 116/192] 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 f52d69c675780db112e1f93dc5ce66e0bd65b1a4 Mon Sep 17 00:00:00 2001 +From 1d303f5e9c3ec0dbc6f8486e334dd4c9943142c8 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/184] BCM270x: Switch to firmware driver +Subject: [PATCH 117/192] 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 995c9559c468fe0f7ecca47d2c9bb0d0932468a5 Mon Sep 17 00:00:00 2001 +From ce2bb52fb7a2cd00f96c4977e00fa0a6fd3993a6 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/184] bcm2835: Switch to firmware driver +Subject: [PATCH 118/192] bcm2835: Switch to firmware driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139990,10 +139990,10 @@ index 47f2a6a..c284414 100644 CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y -From 01f938b9ed2c6b5b5ca16a070be8f2c87a4bc9e7 Mon Sep 17 00:00:00 2001 +From 8539add30257919e1313ca766c63f715b0f3337b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jul 2015 13:25:31 +0100 -Subject: [PATCH 119/184] Merge pull request #1059 from pelwell/rpi-4.0.y +Subject: [PATCH 119/192] Merge pull request #1059 from pelwell/rpi-4.0.y w1_therm: Back-port locking improvements from 4.2-rc1 --- @@ -140188,10 +140188,10 @@ index 55eb86c..2f029e8 100644 { int err, i; -From ef190db16a7945f6549271142039b59c39f23c09 Mon Sep 17 00:00:00 2001 +From 42d3e810841a1f6e2076f30aa7dcb436f7dd6165 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 11:11:51 +0100 -Subject: [PATCH 120/184] vchiq_arm: Sort out the vmalloc case +Subject: [PATCH 120/192] vchiq_arm: Sort out the vmalloc case See: https://github.com/raspberrypi/linux/issues/1055 --- @@ -140230,10 +140230,10 @@ index 5edba23..56bff05 100644 *need_release = 0; /* do not try and release vmalloc pages */ } else { -From 944d0bd0ccd1a3bb898758ad10330705edfa66bf Mon Sep 17 00:00:00 2001 +From 368b0be0685c3adf312bc6db8a8f37e19ece8a57 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 121/184] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 121/192] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -140254,10 +140254,10 @@ index 92c909e..0535375 100644 }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 1f8e0c611125001bed1e1160e6618ae9a3c1ee3f Mon Sep 17 00:00:00 2001 +From 99061bbd52c6b72e32b65c8c1e7b8b315cf242eb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 122/184] Merge pull request #1043 from XECDesign/sense-4.0 +Subject: [PATCH 122/192] Merge pull request #1043 from XECDesign/sense-4.0 mfd: Add Raspberry Pi Sense HAT core driver --- @@ -141190,10 +141190,10 @@ index 0000000..56196dc + +#endif -From 442e27bafaa6a4cbc19783fc86a93b46805cabf6 Mon Sep 17 00:00:00 2001 +From fe5f9d51a9a506546fd4eed8c2df8ed86eba938e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jul 2015 13:46:08 +0100 -Subject: [PATCH 123/184] leds-gpio: Implement the brightness_get method +Subject: [PATCH 123/192] 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 @@ -141236,10 +141236,10 @@ index 3cfbd6a..4e4e132 100644 state = !!gpiod_get_value_cansleep(led_dat->gpiod); else -From e022aeef3a53e5f201d387daf974288e5c2df29f Mon Sep 17 00:00:00 2001 +From 660e3b8498bc3069ea74571f87a937ec0e9719e6 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Fri, 17 Jul 2015 09:50:55 +0200 -Subject: [PATCH 124/184] dmaengine: bcm2708-dmaengine: Fix memory leak when +Subject: [PATCH 124/192] dmaengine: bcm2708-dmaengine: Fix memory leak when stopping a running transfer --- @@ -141259,10 +141259,10 @@ index 987ed53..73c6c00 100644 bcm2835_dma_abort(c->chan_base); -From 5864bb774fb11a9bba6a1c10791894e393a18984 Mon Sep 17 00:00:00 2001 +From fbb4e35f5138fcf615dafdad6c560b285e30d30c Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:13 +0200 -Subject: [PATCH 125/184] BCM270X_DT: Fix I2S register map +Subject: [PATCH 125/192] BCM270X_DT: Fix I2S register map --- arch/arm/boot/dts/bcm2708_common.dtsi | 4 ++-- @@ -141284,10 +141284,10 @@ index 2dd25f7..728e14a 100644 //dmas = <&dma 2>, // <&dma 3>; -From 8ecc196ee828c68cadd7ade3759032a9947023ea Mon Sep 17 00:00:00 2001 +From 0e979a30a41088e31e6f364afb962a92dece990f Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 126/184] BCM2835_DT: Fix I2S register map +Subject: [PATCH 126/192] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -141341,10 +141341,10 @@ index 4a63704..1135120 100644 dmas = <&dma 2>, <&dma 3>; -From c8ab3e3f25614623c45c149ed34bc7475bc2ed83 Mon Sep 17 00:00:00 2001 +From 5f2426c4b7a9043f0390d1b4268ef4b4a83a2e3d Mon Sep 17 00:00:00 2001 From: David Frey Date: Tue, 14 Jul 2015 15:57:36 +0200 -Subject: [PATCH 127/184] config: Enable SHT drivers for raspberry pi +Subject: [PATCH 127/192] config: Enable SHT drivers for raspberry pi The SHT temperature and humidity sensors are often used in weather station projects. @@ -141386,10 +141386,10 @@ index b9b5bdf..7b24274 100644 CONFIG_THERMAL_BCM2835=y CONFIG_WATCHDOG=y -From ec4ad86b999bd1ba27313547604aa485664e6811 Mon Sep 17 00:00:00 2001 +From d0b201bfe2ca24227632e744c06e6612e4a52de4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:07:14 +0100 -Subject: [PATCH 128/184] BCM270X_DT: Correct typo in overlays/README +Subject: [PATCH 128/192] BCM270X_DT: Correct typo in overlays/README --- arch/arm/boot/dts/overlays/README | 2 +- @@ -141409,10 +141409,10 @@ index 8792f98..ed484ae 100644 i2c_arm Set to "on" to enable the ARM's i2c interface -From 25121f1d38b2cb6ce9997ea5207b315bc003ad37 Mon Sep 17 00:00:00 2001 +From a13b6ec4c9d17246df1a3cb7b4e4ce5f1c62ec32 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 10:53:26 +0100 -Subject: [PATCH 129/184] bcm2835-sdhost: Add the ERASE capability +Subject: [PATCH 129/192] bcm2835-sdhost: Add the ERASE capability See: https://github.com/raspberrypi/linux/issues/1076 --- @@ -141433,10 +141433,10 @@ index d65870a..57a6ad3 100644 spin_lock_init(&host->lock); -From fa3e5a05ccb81804a480e083b0dd835e538549c0 Mon Sep 17 00:00:00 2001 +From d619c2d2963b97eea071434b0ba4f2da88bb8e8d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 17:32:18 +0100 -Subject: [PATCH 130/184] bcm2835-sdhost: Ignore CRC7 for MMC CMD1 +Subject: [PATCH 130/192] 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 @@ -141500,10 +141500,10 @@ index 57a6ad3..84f645f 100644 if (host->cmd->flags & MMC_RSP_PRESENT) { -From 462a5895b5d87b1af87fd19a37f60e22d4b3c0df Mon Sep 17 00:00:00 2001 +From a308ade267a5e55f928258def08529290cf3c66e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:48:21 +0100 -Subject: [PATCH 131/184] BCM270X_DT: Add unit address to gpio node name +Subject: [PATCH 131/192] BCM270X_DT: Add unit address to gpio node name --- arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- @@ -141523,10 +141523,10 @@ index 728e14a..cb608df 100644 reg = <0x7e200000 0xb4>; interrupts = <2 17>, <2 18>; -From 758d28781ebe88535099cf422f601d9f144aab9e Mon Sep 17 00:00:00 2001 +From 2e0f8d9d1cb87fea0a6e0cb3c8736d067d594e15 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 24 Jul 2015 10:36:32 +0100 -Subject: [PATCH 132/184] BCM270X_DT: Use i2c_arm for rtc and bmp085 overlays +Subject: [PATCH 132/192] BCM270X_DT: Use i2c_arm for rtc and bmp085 overlays --- arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts | 2 +- @@ -141560,10 +141560,10 @@ index 7052c71..fed4bd8 100644 #address-cells = <1>; #size-cells = <0>; -From e735b74604fbb8c87e6203a81e07213dfd3ca6e0 Mon Sep 17 00:00:00 2001 +From db8ee9703f6dcf58156f1154468f761d4a2aaf27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 24 Jul 2015 12:11:31 +0100 -Subject: [PATCH 133/184] BCM2708_DT: CM dtparams for audio, watchdog and RNG +Subject: [PATCH 133/192] BCM2708_DT: CM dtparams for audio, watchdog and RNG --- arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 8 ++++---- @@ -141593,10 +141593,10 @@ index 34d4bc6..713e5a2 100644 }; }; -From 6163a630fcf3c74fd23fcc85862c5eebc870038d Mon Sep 17 00:00:00 2001 +From 5ee323dd815f9a10b56ccb79f9db3b03cb10a957 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/184] vchiq: Use firmware API +Subject: [PATCH 134/192] vchiq: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -141712,10 +141712,10 @@ index 31e2cba..e11c0e0 100644 err = vchiq_debugfs_init(); if (err != 0) -From eadb752bb2b90fc4181f512f697c131d32e4ab10 Mon Sep 17 00:00:00 2001 +From c8494b6d8b9c4a09d5802c5bd214b81abb24076e 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/184] thermal: bcm2835: Use firmware API +Subject: [PATCH 135/192] thermal: bcm2835: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -141998,10 +141998,10 @@ index 3bc80f1..c1d8f1b 100644 -module_platform_driver(bcm2835_thermal_driver); +MODULE_LICENSE("GPL"); -From cf6eb4ad6dad593e7e6c528c6d86b015acf91c0f Mon Sep 17 00:00:00 2001 +From 80165470382ba4f58bb1c15abfae346681424e73 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/184] cpufreq: bcm2835: Use firmware API +Subject: [PATCH 136/192] cpufreq: bcm2835: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142185,10 +142185,10 @@ index 6735da9..3eb9e93 100644 } -From 00a5e22858cc58fa8ac1eacd335d25287366ddae Mon Sep 17 00:00:00 2001 +From 0c0902575883dcd51e97c4aed67a9854688046d1 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/184] fbdev: bcm2708: Use firmware API +Subject: [PATCH 137/192] fbdev: bcm2708: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142604,10 +142604,10 @@ index f6ac7da..06a96d16 100644 free_irq(fb->dma_irq, fb); -From 1448227b91675fd216387c85bc2014ff4d135ac2 Mon Sep 17 00:00:00 2001 +From 1d8059b467a053294c0d09d77ed8b327bec980f8 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/184] bcm2835: Add firmware property to affected devices +Subject: [PATCH 138/192] bcm2835: Add firmware property to affected devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142688,10 +142688,10 @@ index 1135120..807264d 100644 clocks { -From 62c08611186b6182c89b69284adc6f4d00380903 Mon Sep 17 00:00:00 2001 +From 0b404a0bb7397a70fda6917887baf12d3d1738b8 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/184] rpi-ft5406: Use firmware API +Subject: [PATCH 139/192] rpi-ft5406: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142831,10 +142831,10 @@ index d41851d..c08817e 100644 ts->regs = (struct ft5406_regs *) ts->ts_base; -From 49911adc1dccdd0cd478596656d44276a49f410c Mon Sep 17 00:00:00 2001 +From 84575dc4faf5752d6799114c23523d21f79185b8 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/184] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 140/192] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142966,10 +142966,10 @@ index 5916d6c..db66246 100644 } -From 9f64e381e13c68b6f872f1d07021cee23c15e5e7 Mon Sep 17 00:00:00 2001 +From 739f93ecccd3dab84ea01874f11c318342cabc6b 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/184] dwc_otg: Add ARCH_BCM2835 support +Subject: [PATCH 141/192] dwc_otg: Add ARCH_BCM2835 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143022,10 +143022,10 @@ index 0f4ebcd..5c83309 100644 } -From 5797256945e9317e7e1d440865b24cf4784601e4 Mon Sep 17 00:00:00 2001 +From 09a1b81021504e4ca5b46e5fdb93acd917c7f0b7 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/184] bcm2835: Use DWC_OTG +Subject: [PATCH 142/192] bcm2835: Use DWC_OTG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143068,10 +143068,10 @@ index c284414..14ef294 100644 CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From e33c0a84c836ef521623cc9172ee1620941242e3 Mon Sep 17 00:00:00 2001 +From 909ccc236c5073e67181862026b117415c5508ec 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/184] Fix RASPBERRYPI_FIRMWARE dependents +Subject: [PATCH 143/192] Fix RASPBERRYPI_FIRMWARE dependents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143152,10 +143152,10 @@ index 3444a4c..c073d55 100644 select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT -From 3e31ca6b4b24f3838db543f90f32f5f201ba4edf Mon Sep 17 00:00:00 2001 +From a8a882bd995ade6396b700e9fa50d52e14c2d773 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/184] vc_mem: Remove unnecessary include +Subject: [PATCH 144/192] vc_mem: Remove unnecessary include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143178,10 +143178,10 @@ index fcde6b1..be64f23 100644 #define DRIVER_NAME "vc-mem" -From c9653a1d393f156fb669497270e6b5ca610b9583 Mon Sep 17 00:00:00 2001 +From 2915e91353123b4e57a9b7fea529e76733fa804d 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/184] configs: Remove BCM2708_MBOX +Subject: [PATCH 145/192] configs: Remove BCM2708_MBOX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143230,10 +143230,10 @@ index 7b24274..0859113 100644 # CONFIG_IOMMU_SUPPORT is not set CONFIG_EXTCON=m -From 1da6dd03e494645777be455c30eb1e04edaf4f88 Mon Sep 17 00:00:00 2001 +From edfc6b5684eb61ca1c7bb8d726a876b3510c7967 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/184] bcm2708-vcio: Remove module +Subject: [PATCH 146/192] bcm2708-vcio: Remove module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143507,10 +143507,10 @@ index d3ea839..0000000 - -#endif -From 550768460da9842305ce282bb40810efedc40b5e Mon Sep 17 00:00:00 2001 +From b50a77017186456a6eac9f5879527011ad639735 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/184] Revert "firmware: bcm2835: Support legacy mailbox +Subject: [PATCH 147/192] Revert "firmware: bcm2835: Support legacy mailbox API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -143601,10 +143601,10 @@ index 9a08cf1..d3933af 100644 u32 tag, void *data, size_t len); int rpi_firmware_property_list(struct rpi_firmware *fw, -From dc27d5306bfcdfcaf7b2cf8866a5219b061a66ae Mon Sep 17 00:00:00 2001 +From 6a216d3e39f569440e30e699ce0c937d5bb18f8f Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 30 Jun 2015 12:35:39 +0100 -Subject: [PATCH 148/184] pinctrl: bcm2835: Clear the event latch register when +Subject: [PATCH 148/192] 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 @@ -143641,10 +143641,10 @@ index 986779a..61ef002 100644 spin_unlock_irqrestore(&pc->irq_lock[bank], flags); } -From 27cf775aec3d94076f68a6e736ff493bed02609a Mon Sep 17 00:00:00 2001 +From c3ad1ccc7ba3cef5f36c1919b05c9cb1b43c7d41 Mon Sep 17 00:00:00 2001 From: P33M Date: Tue, 4 Aug 2015 01:15:20 +0100 -Subject: [PATCH 149/184] dwc_otg: fiq_fsm: Make high-speed isochronous strided +Subject: [PATCH 149/192] dwc_otg: fiq_fsm: Make high-speed isochronous strided transfers work properly Certain low-bandwidth high-speed USB devices (specialist audio devices, @@ -143784,10 +143784,10 @@ index 3f71f29..8db3dfc 100644 case FIQ_PER_SPLIT_LS_ABORTED: -From 5fe40f23b4f9dd3bb73240c0be25e1d4a410db51 Mon Sep 17 00:00:00 2001 +From d713fd8a8c98886c4965393cb35351eec484ecb6 Mon Sep 17 00:00:00 2001 From: Uli Middelberg Date: Wed, 17 Jun 2015 10:36:56 +0200 -Subject: [PATCH 150/184] added basic docker support +Subject: [PATCH 150/192] added basic docker support --- arch/arm/configs/bcm2709_defconfig | 3 +++ @@ -143851,10 +143851,10 @@ index 0859113..06e7529 100644 CONFIG_FSCACHE_STATS=y CONFIG_FSCACHE_HISTOGRAM=y -From 6abbb618faa7ffbba07dec6282ce0da316b47db6 Mon Sep 17 00:00:00 2001 +From d0f6349262824e0c97c3348203fe38c98acb559b Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 2 Jul 2015 19:32:04 -0500 -Subject: [PATCH 151/184] bcm2835 camera planar/packed stride length +Subject: [PATCH 151/192] bcm2835 camera planar/packed stride length Added a field to the mmal_fmt struct used to compute the bytes per line when using a particular format. This results in the correct stride being @@ -144026,10 +144026,10 @@ index 35698c8..15788a1 100644 /* buffer for one video frame */ -From 00ecf7f3a41aa6c99de8e6bf805ed77b08ade2a8 Mon Sep 17 00:00:00 2001 +From c6586122744f32872b423f29cd60f80bc9ec817c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 28 Jul 2015 13:55:04 +0100 -Subject: [PATCH 153/184] config: Add Mediatek mt7601u wifi driver +Subject: [PATCH 153/192] config: Add Mediatek mt7601u wifi driver --- arch/arm/configs/bcm2709_defconfig | 2 ++ @@ -144063,10 +144063,10 @@ index 06e7529..a377222 100644 CONFIG_ZD1211RW=m CONFIG_MWIFIEX=m -From 85b039dbb91fdbb7e053db80f31c401c3e259b3f Mon Sep 17 00:00:00 2001 +From 9ade15dfc93bc7c34e6e48a4dc061eaa70f54b41 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 17 Aug 2015 10:49:44 +0100 -Subject: [PATCH 154/184] BCM270X_DT: Add pwm and pwm-2chan overlays +Subject: [PATCH 154/192] BCM270X_DT: Add pwm and pwm-2chan overlays From the README entries: Legal pin,function combinations for each channel: @@ -144332,10 +144332,10 @@ index b1541f4..90591a9 100644 PWM framework driver for BCM2835 controller (Raspberry Pi) -From 3700467492f28ee6e89677b0b5cd5752b68c649e Mon Sep 17 00:00:00 2001 +From c2159b8e35da50b260b86b2752c369262f03e5aa Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 22 Apr 2015 07:33:03 +0000 -Subject: [PATCH 155/184] spi: bcm2835: fallback to interrupt for polling +Subject: [PATCH 155/192] spi: bcm2835: fallback to interrupt for polling timeouts exceeding 2 jiffies The polling mode of the driver is designed for transfers that run @@ -144359,7 +144359,7 @@ Signed-off-by: Mark Brown 1 file changed, 50 insertions(+), 37 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 55e81c2..fc3c6f7 100644 +index cf3190f..505a993 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -69,7 +69,7 @@ @@ -144471,10 +144471,10 @@ index 55e81c2..fc3c6f7 100644 struct spi_device *spi, struct spi_transfer *tfr) -From d9065397f6cf6d9de56617eb1b912b94ae1a165d Mon Sep 17 00:00:00 2001 +From ca6851997c29f85cb1965470c3c649cb04c83e04 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Sun, 10 May 2015 20:47:28 +0000 -Subject: [PATCH 156/184] spi: bcm2835: enable dma modes for transfers meeting +Subject: [PATCH 156/192] spi: bcm2835: enable dma modes for transfers meeting certain conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -144514,7 +144514,7 @@ Signed-off-by: Mark Brown 1 file changed, 301 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index fc3c6f7..7af0fb2 100644 +index 505a993..27fb5b0 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -23,15 +23,18 @@ @@ -144850,7 +144850,7 @@ index fc3c6f7..7af0fb2 100644 static int bcm2835_spi_transfer_one_poll(struct spi_master *master, struct spi_device *spi, struct spi_transfer *tfr, -@@ -301,12 +582,26 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, +@@ -299,6 +580,11 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, return bcm2835_spi_transfer_one_poll(master, spi, tfr, cs, xfer_time_us); @@ -144862,6 +144862,7 @@ index fc3c6f7..7af0fb2 100644 return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); } +@@ -324,6 +610,15 @@ static int bcm2835_spi_prepare_message(struct spi_master *master, static void bcm2835_spi_handle_err(struct spi_master *master, struct spi_message *msg) { @@ -144877,7 +144878,7 @@ index fc3c6f7..7af0fb2 100644 bcm2835_spi_reset_hw(master); } -@@ -505,6 +800,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) +@@ -523,6 +818,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) goto out_clk_disable; } @@ -144886,7 +144887,7 @@ index fc3c6f7..7af0fb2 100644 /* initialise the hardware with the default polarities */ bcm2835_wr(bs, BCM2835_SPI_CS, BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); -@@ -535,6 +832,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev) +@@ -553,6 +850,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev) clk_disable_unprepare(bs->clk); @@ -144896,10 +144897,10 @@ index fc3c6f7..7af0fb2 100644 } -From af1af3ed6685094dce51d4effb48bac98b624218 Mon Sep 17 00:00:00 2001 +From 37c41ffd1ccf9a9051b461f2786a988a1d4f9f5f Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 12 May 2015 10:32:08 +0000 -Subject: [PATCH 157/184] spi: bcm2835: fix kbuild compile warnings/errors and +Subject: [PATCH 157/192] spi: bcm2835: fix kbuild compile warnings/errors and a typo fixes several warnings/error emmitted by the kbuild system: @@ -144920,7 +144921,7 @@ Signed-off-by: Mark Brown 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 7af0fb2..9d80cea 100644 +index 27fb5b0..52aaf2d 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -20,6 +20,7 @@ @@ -144955,10 +144956,10 @@ index 7af0fb2..9d80cea 100644 "Unaligned spi tx-transfer bridging page\n"); return false; -From c4805d933460e5d8a588d19725d2e06123000c3c Mon Sep 17 00:00:00 2001 +From 4fa31f69b2b08f8b6b57ac80664efd3bfb510532 Mon Sep 17 00:00:00 2001 From: kbuild test robot Date: Tue, 12 May 2015 19:43:59 +0800 -Subject: [PATCH 158/184] spi: bcm2835: bcm2835_dma_release() can be static +Subject: [PATCH 158/192] spi: bcm2835: bcm2835_dma_release() can be static Signed-off-by: Fengguang Wu Signed-off-by: Mark Brown @@ -144968,7 +144969,7 @@ Signed-off-by: Mark Brown 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 9d80cea..338babc3 100644 +index 52aaf2d..bad36c5 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -401,7 +401,7 @@ static bool bcm2835_spi_can_dma(struct spi_master *master, @@ -144990,42 +144991,10 @@ index 9d80cea..338babc3 100644 struct dma_slave_config slave_config; const __be32 *addr; -From 3c527383f8c3db402df3888563ceca7f6c62577d Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 22 Jul 2015 07:43:28 +0000 -Subject: [PATCH 159/184] spi: bcm2835: fixed compile issues due to embedded - comments... replaced with #if to avoid issues in the future. - -Signed-off-by: Martin Sperl ---- - drivers/spi/spi-bcm2835.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 338babc3..cedffe1 100644 ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -592,6 +592,7 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); - } - -+#if 0 - static void bcm2835_spi_handle_err(struct spi_master *master, - struct spi_message *msg) - { -@@ -606,6 +607,7 @@ static void bcm2835_spi_handle_err(struct spi_master *master, - /* and reset */ - bcm2835_spi_reset_hw(master); - } -+#endif - - static void bcm2835_spi_set_cs(struct spi_device *spi, bool gpio_level) - { - -From e3c37563e0a076f89ca9bd275d1c5280565f4ae4 Mon Sep 17 00:00:00 2001 +From 0281d714a74623919046ec0a7871cbfffaa129fa Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 22 Jul 2015 08:34:41 +0000 -Subject: [PATCH 160/184] dt-overlay to enable dma for spi driver +Subject: [PATCH 159/192] dt-overlay to enable dma for spi driver Signed-off-by: Martin Sperl --- @@ -145073,10 +145042,10 @@ index 0000000..266cf9d + }; + }; -From 8223ed39177c0808f6cb2a5fd118f44a4ce064a5 Mon Sep 17 00:00:00 2001 +From 5601dff1bc5af8007e0cd741e6314777dcc26950 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 22 Jul 2015 12:41:54 +0000 -Subject: [PATCH 161/184] dt: overlay: added documentation of spi-dma overlay +Subject: [PATCH 160/192] dt: overlay: added documentation of spi-dma overlay Signed-off-by: Martin Sperl --- @@ -145101,10 +145070,10 @@ index 1cd2140..bda8c14 100644 Info: 3.5" Color TFT Display by www.tinylcd.com Options: Touch, RTC, keypad -From 9b8ee6a132dd2d50bd3a0b7c0b1b842e3071873f Mon Sep 17 00:00:00 2001 +From a0f798dc95f6e80210560c2f539531ac8cd727ba Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 17 Aug 2015 18:06:16 +0100 -Subject: [PATCH 162/184] rpisense-fb: add low-light mode and gamma control +Subject: [PATCH 161/192] rpisense-fb: add low-light mode and gamma control --- drivers/video/fbdev/rpisense-fb.c | 68 +++++++++++++++++++++++++++++--- @@ -145247,40 +145216,10 @@ index c4c1118..2ba95d7 100644 struct rpisense; -From 54e2f2668f26d946d63f2df69c5fd7229c502a6c Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 18 Aug 2015 11:50:03 +0100 -Subject: [PATCH 163/184] spi: bcm2835: Fix buld error from previous commit - ---- - drivers/spi/spi-bcm2835.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index cedffe1..338babc3 100644 ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -592,7 +592,6 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); - } - --#if 0 - static void bcm2835_spi_handle_err(struct spi_master *master, - struct spi_message *msg) - { -@@ -607,7 +606,6 @@ static void bcm2835_spi_handle_err(struct spi_master *master, - /* and reset */ - bcm2835_spi_reset_hw(master); - } --#endif - - static void bcm2835_spi_set_cs(struct spi_device *spi, bool gpio_level) - { - -From ca899b2fc8a14bcb38849829add2d1734e30ca15 Mon Sep 17 00:00:00 2001 +From ae6f1c2b07d663f56d74520dd112e70fb0a345da Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 19 Aug 2015 11:38:10 +0100 -Subject: [PATCH 164/184] BCM270X_DT: README - add note on indentation +Subject: [PATCH 162/192] BCM270X_DT: README - add note on indentation --- arch/arm/boot/dts/overlays/README | 4 ++++ @@ -145302,10 +145241,10 @@ index bda8c14..ac9c427 100644 Info: Configures the base Raspberry Pi hardware Load: -From 6fd290129689eee60f1e88e938e5259eddd63e9f Mon Sep 17 00:00:00 2001 +From 533a2295a023e63baa2da24f7ceb464f50481e86 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 20 Aug 2015 13:50:18 +0100 -Subject: [PATCH 165/184] bcm2708-dmaengine: Use more DMA channels (but not 12) +Subject: [PATCH 163/192] bcm2708-dmaengine: Use more DMA channels (but not 12) 1) Only the bcm2708_fb drivers uses the legacy DMA API, and it requires a BULK-capable channel, so all other types @@ -145479,10 +145418,10 @@ index 73c6c00..85ce18b 100644 rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (rc) -From 1f776a2e469043351fc5f16bc3ea95dd8d926983 Mon Sep 17 00:00:00 2001 +From 2565daf4ff590ea8bfff9242920b7046855f8c14 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 166/184] RaspiDAC3 support +Subject: [PATCH 164/192] RaspiDAC3 support Signed-off-by: Jan Grulich --- @@ -145833,10 +145772,10 @@ index 0000000..fddaeec +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From e61d2a8fffe86ed426657867e092b062fff16ea3 Mon Sep 17 00:00:00 2001 +From e07994e21afdb0689e92735f5251fb32c781dead Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Jul 2015 16:55:02 +0100 -Subject: [PATCH 167/184] config: Add SND_SOC_ADAU1701 module +Subject: [PATCH 165/192] config: Add SND_SOC_ADAU1701 module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -145868,98 +145807,10 @@ index 8979f23..7dd4fd4 100644 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From 06f3b6b14af2f66eff3787372ca44210368eb7d7 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Tue, 28 Jul 2015 14:03:12 +0000 -Subject: [PATCH 168/184] spi: bcm2835: set up spi-mode before asserting - cs-gpio - -When using reverse polarity for clock (spi-cpol) on a device -the clock line gets altered after chip-select has been asserted -resulting in an additional clock beat, which confuses hardware. - -This did not show when using native-CS, as the same register -is used to control cs as well as polarity, so the changes came -into effect at the same time. Unfortunately this is not true -with gpio-cs. - -To avoid this situation this patch moves the setup of polarity -(spi-cpol and spi-cpha) outside of the chip-select into -prepare_message, which is run prior to asserting chip-select. - -Also fixes resetting 3-wire mode after use of rx-mode, so that -a 3-Wire sequence TX, RX, TX works as well (right now it runs -TX, RX, RX instead) - -Reported-by: Noralf Tronnes -Signed-off-by: Martin Sperl -Signed-off-by: Mark Brown -Cc: stable@vger.kernel.org -(cherry picked from commit acace73df2c1913a526c1b41e4741a4a6704c863) ---- - drivers/spi/spi-bcm2835.c | 28 +++++++++++++++++++++++----- - 1 file changed, 23 insertions(+), 5 deletions(-) - -diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 338babc3..bad36c5 100644 ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -553,13 +553,11 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - spi_used_hz = cdiv ? (clk_hz / cdiv) : (clk_hz / 65536); - bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv); - -- /* handle all the modes */ -+ /* handle all the 3-wire mode */ - if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf)) - cs |= BCM2835_SPI_CS_REN; -- if (spi->mode & SPI_CPOL) -- cs |= BCM2835_SPI_CS_CPOL; -- if (spi->mode & SPI_CPHA) -- cs |= BCM2835_SPI_CS_CPHA; -+ else -+ cs &= ~BCM2835_SPI_CS_REN; - - /* for gpio_cs set dummy CS so that no HW-CS get changed - * we can not run this in bcm2835_spi_set_cs, as it does -@@ -592,6 +590,25 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); - } - -+static int bcm2835_spi_prepare_message(struct spi_master *master, -+ struct spi_message *msg) -+{ -+ struct spi_device *spi = msg->spi; -+ struct bcm2835_spi *bs = spi_master_get_devdata(master); -+ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); -+ -+ cs &= ~(BCM2835_SPI_CS_CPOL | BCM2835_SPI_CS_CPHA); -+ -+ if (spi->mode & SPI_CPOL) -+ cs |= BCM2835_SPI_CS_CPOL; -+ if (spi->mode & SPI_CPHA) -+ cs |= BCM2835_SPI_CS_CPHA; -+ -+ bcm2835_wr(bs, BCM2835_SPI_CS, cs); -+ -+ return 0; -+} -+ - static void bcm2835_spi_handle_err(struct spi_master *master, - struct spi_message *msg) - { -@@ -768,6 +785,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev) - master->set_cs = bcm2835_spi_set_cs; - master->transfer_one = bcm2835_spi_transfer_one; - master->handle_err = bcm2835_spi_handle_err; -+ master->prepare_message = bcm2835_spi_prepare_message; - master->dev.of_node = pdev->dev.of_node; - - bs = spi_master_get_devdata(master); - -From e1b011f11feef5876783d9ff54997f9cda9e72a7 Mon Sep 17 00:00:00 2001 +From 8673fd1c1cdf2581b8e55049850feb454641c833 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 29 Jul 2015 07:34:10 +0000 -Subject: [PATCH 169/184] spi: bcm2835: fix overflow in calculation of transfer +Subject: [PATCH 166/192] spi: bcm2835: fix overflow in calculation of transfer time This resulted in the use of polling mode when other approaches @@ -146012,10 +145863,10 @@ index bad36c5..b68991c 100644 /* for short requests run polling*/ if (xfer_time_us <= BCM2835_SPI_POLLING_LIMIT_US) -From ced8015657540a68001e6bdb303beb3d1754e4c5 Mon Sep 17 00:00:00 2001 +From 0cbc260f0615a727118bf81a0a96f1a943ea1496 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Sep 2015 15:14:50 +0100 -Subject: [PATCH 170/184] BCM270X_DT: Add SDIO overlay +Subject: [PATCH 167/192] BCM270X_DT: Add SDIO overlay Enable SDIO from MMC interface via GPIOs 22-27. Includes the sdhost overlay to free up the MMC interface. @@ -146100,10 +145951,10 @@ index 0000000..164f269 + }; +}; -From b0ff905303eb5003d3725a7fbfa90d3077d1301b Mon Sep 17 00:00:00 2001 +From 744173c6e20ce4939cb0df99b5a413badcc9b0be Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 171/184] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 168/192] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren --- @@ -146448,10 +146299,10 @@ index 0000000..0085e13 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From f329efa3857552cca450f708fbd7ff1527a20358 Mon Sep 17 00:00:00 2001 +From b716c7690be5dca3f1329bd3bcb6468033bb1696 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:02:34 +0100 -Subject: [PATCH 172/184] tpa6130a2: Add headphone switch control +Subject: [PATCH 169/192] tpa6130a2: Add headphone switch control Signed-off-by: Jan Grulich --- @@ -146542,10 +146393,10 @@ index 6fac9e0..f60ebe1c 100644 /* -From 64c5d9fb0fc6960c05d92ec1131d54db465646db Mon Sep 17 00:00:00 2001 +From dec2eb1d6594733d66a5f2da0e2e59f21e8cad90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 11 Jul 2015 18:48:10 +0200 -Subject: [PATCH 173/184] staging: fbtft: Add reset to fbtft_init_display_dt() +Subject: [PATCH 170/192] staging: fbtft: Add reset to fbtft_init_display_dt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146577,10 +146428,10 @@ index 53b748b..4f165d3 100644 if (val & FBTFT_OF_INIT_CMD) { val &= 0xFFFF; -From 9ee9c962e47ace5c2d3114eba2e9fb7f9380a70c Mon Sep 17 00:00:00 2001 +From 0f1a50554d440626c49ba73113efbad679ca1fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 19 Jul 2015 18:57:06 +0200 -Subject: [PATCH 174/184] BCM270X_DT: mz61581: Revert to spi-bcm2708 +Subject: [PATCH 171/192] BCM270X_DT: mz61581: Revert to spi-bcm2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146611,10 +146462,10 @@ index c06fe12..f674a66 100644 spidev@0{ -From 20833437fd604e72ba715d51c11dd6de8b8fef52 Mon Sep 17 00:00:00 2001 +From 7dabf2942aac0a52a59e429e992b58d1213c7024 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 1 Sep 2015 16:52:34 +0000 -Subject: [PATCH 175/184] vchiq: fix NULL pointer dereference when closing +Subject: [PATCH 172/192] vchiq: fix NULL pointer dereference when closing driver The following code run as root will cause a null pointer dereference oops: @@ -146714,10 +146565,10 @@ index f4d0b66..4055d4b 100644 struct semaphore pop; struct semaphore push; -From 020b3c7b02ec04895dc499d6b6851e7d4ba92194 Mon Sep 17 00:00:00 2001 +From b6bed67a8b4fc7ac46554940153aa550f889f08c Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:13:17 -0400 -Subject: [PATCH 176/184] bcm2708_fb: remove redundant code as detected by +Subject: [PATCH 173/192] bcm2708_fb: remove redundant code as detected by static analysis static analysis with cppcheck detected some redundant code which @@ -146749,10 +146600,10 @@ index 06a96d16..fed0672 100644 } -From 51a3a0c4969b782510a42c15d326b622174f171b Mon Sep 17 00:00:00 2001 +From 3277fb201dd353df15a0181afefbc966d1700b93 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:15:38 -0400 -Subject: [PATCH 177/184] bcm2708_fb: remove unnecessary initialization of +Subject: [PATCH 174/192] bcm2708_fb: remove unnecessary initialization of result static analysis by cppcheck detected an unnecessary initialization @@ -146781,10 +146632,10 @@ index fed0672..0f62d76 100644 info->var.yoffset = var->yoffset; result = bcm2708_fb_set_par(info); -From 1026505b7b2b504815271e8808a47ebb41fe48c3 Mon Sep 17 00:00:00 2001 +From 3a8c5b7cd8499af8718d1628646c1704a38b6cec Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:27:36 -0400 -Subject: [PATCH 178/184] vcsm: increment res_stats MAP_FAIL stats before we +Subject: [PATCH 175/192] vcsm: increment res_stats MAP_FAIL stats before we potentially release the resource resource can be kfree'd when the reference count is zero, so we should @@ -146818,10 +146669,10 @@ index 0bfb42e..b62a3b2 100644 } -From 005154797ae52cc7503554b8d35d156eefded00c Mon Sep 17 00:00:00 2001 +From f4b1401d6a2bd32b7bdc1ea5bba49ba45923f34e Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:33:39 -0400 -Subject: [PATCH 179/184] bcm2835: camera: check for scene not being found +Subject: [PATCH 176/192] bcm2835: camera: check for scene not being found static analysis by cppcheck detected some potential NULL pointer dereference issues: @@ -146852,10 +146703,10 @@ index 3017b94..f9f903f 100644 return -EINVAL; -From 7b88107888ad75072ded5ec3dfbf0cb6ceec1c1d Mon Sep 17 00:00:00 2001 +From e9bce32c5fdf1d19f499fd4a3acb518df5eddda8 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:47:51 -0400 -Subject: [PATCH 180/184] bcm2835: memcpy port data to m rather than rmsg +Subject: [PATCH 177/192] bcm2835: memcpy port data to m rather than rmsg static analysis by cppcheck detected a memcpy to rmsg which is not actually initialized at that point. The memcpy should be copying @@ -146880,10 +146731,10 @@ index 76f249e..7813225 100644 ret = send_synchronous_mmal_msg(instance, &m, -From 2a8c0025020895de45b699178d09d7dd3987f694 Mon Sep 17 00:00:00 2001 +From f37b5b98c6a1dd867fe57768347d4099c8c350a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 13 Sep 2015 15:54:28 +0200 -Subject: [PATCH 181/184] Revert "BCM270X_DT: mz61581: Revert to spi-bcm2708" +Subject: [PATCH 178/192] Revert "BCM270X_DT: mz61581: Revert to spi-bcm2708" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146911,10 +146762,10 @@ index f674a66..c06fe12 100644 spidev@0{ -From 5893b0be5d790411fbc1afc16b92bc9be59144a1 Mon Sep 17 00:00:00 2001 +From 6d02ee2eb00466bcf8485620de01dc4f0354a901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 13 Sep 2015 17:17:14 +0200 -Subject: [PATCH 182/184] BCM270X_DT: mz61581: Set txbuflen to 32k +Subject: [PATCH 179/192] BCM270X_DT: mz61581: Set txbuflen to 32k MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146963,10 +146814,10 @@ index c06fe12..9242a6e 100644 xohms = <&mz61581_ts>,"ti,x-plate-ohms;0"; }; -From a137fc76d8742832a01e087f05115811727d310b Mon Sep 17 00:00:00 2001 +From 3e8afc7044965075d11b52c83ad0bd0584bbd15d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 11 Sep 2015 12:10:15 +0100 -Subject: [PATCH 183/184] bcm2835-mmc: Don't overwrite MMC capabilities from DT +Subject: [PATCH 180/192] bcm2835-mmc: Don't overwrite MMC capabilities from DT --- drivers/mmc/host/bcm2835-mmc.c | 5 +++-- @@ -146989,10 +146840,10 @@ index b7c4883..164bfad 100644 host->flags = SDHCI_AUTO_CMD23; -From 48dfdc5eae4b84ea43ae068a733313a5f557a70b Mon Sep 17 00:00:00 2001 +From fbe9273f1ed02f6d6e0c01add59bc9d85a2748a8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 11 Sep 2015 09:14:01 +0100 -Subject: [PATCH 184/184] BCM270X_DT: Use fixed-factor-clock for uart1 +Subject: [PATCH 181/192] BCM270X_DT: Use fixed-factor-clock for uart1 The BCM2835 mini-UART is almost 8250-compatible, but there is a factor-of-two difference in the clock divider for the baud rate. @@ -147091,3 +146942,2793 @@ index f25f0a2..76d44a2 100644 i2s = <&i2s>,"status"; spi = <&spi0>,"status"; i2c0 = <&i2c0>,"status"; + +From 08152264f7564a5bd77ae9a58a34309f6ab9a5fc Mon Sep 17 00:00:00 2001 +From: Luke Wren +Date: Sat, 5 Sep 2015 01:14:45 +0100 +Subject: [PATCH 182/192] Add SMI driver + +Signed-off-by: Luke Wren +--- + .../bindings/misc/brcm,bcm2835-smi-dev.txt | 17 + + .../devicetree/bindings/misc/brcm,bcm2835-smi.txt | 48 + + arch/arm/boot/dts/bcm2708_common.dtsi | 11 + + arch/arm/boot/dts/overlays/Makefile | 2 + + arch/arm/boot/dts/overlays/smi-dev-overlay.dts | 18 + + arch/arm/boot/dts/overlays/smi-overlay.dts | 37 + + drivers/char/broadcom/Kconfig | 8 + + drivers/char/broadcom/Makefile | 2 +- + drivers/char/broadcom/bcm2835_smi_dev.c | 402 +++++++++ + drivers/misc/Kconfig | 8 + + drivers/misc/Makefile | 1 + + drivers/misc/bcm2835_smi.c | 985 +++++++++++++++++++++ + include/linux/broadcom/bcm2835_smi.h | 391 ++++++++ + 13 files changed, 1929 insertions(+), 1 deletion(-) + create mode 100644 Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt + create mode 100644 Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt + create mode 100644 arch/arm/boot/dts/overlays/smi-dev-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/smi-overlay.dts + create mode 100644 drivers/char/broadcom/bcm2835_smi_dev.c + create mode 100644 drivers/misc/bcm2835_smi.c + create mode 100644 include/linux/broadcom/bcm2835_smi.h + +diff --git a/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt +new file mode 100644 +index 0000000..68cc8eb +--- /dev/null ++++ b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt +@@ -0,0 +1,17 @@ ++* Broadcom BCM2835 SMI character device driver. ++ ++SMI or secondary memory interface is a peripheral specific to certain Broadcom ++SOCs, and is helpful for talking to things like parallel-interface displays ++and NAND flashes (in fact, most things with a parallel register interface). ++ ++This driver adds a character device which provides a user-space interface to ++an instance of the SMI driver. ++ ++Required properties: ++- compatible: "brcm,bcm2835-smi-dev" ++- smi_handle: a phandle to the smi node. ++ ++Optional properties: ++- None. ++ ++ +diff --git a/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt +new file mode 100644 +index 0000000..b76dc69 +--- /dev/null ++++ b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt +@@ -0,0 +1,48 @@ ++* Broadcom BCM2835 SMI driver. ++ ++SMI or secondary memory interface is a peripheral specific to certain Broadcom ++SOCs, and is helpful for talking to things like parallel-interface displays ++and NAND flashes (in fact, most things with a parallel register interface). ++ ++Required properties: ++- compatible: "brcm,bcm2835-smi" ++- reg: Should contain location and length of SMI registers and SMI clkman regs ++- interrupts: *the* SMI interrupt. ++- pinctrl-names: should be "default". ++- pinctrl-0: the phandle of the gpio pin node. ++- brcm,smi-clock-source: the clock source for clkman ++- brcm,smi-clock-divisor: the integer clock divisor for clkman ++- dmas: the dma controller phandle and the DREQ number (4 on a 2835) ++- dma-names: the name used by the driver to request its channel. ++ Should be "rx-tx". ++ ++Optional properties: ++- None. ++ ++Examples: ++ ++8 data pin configuration: ++ ++smi: smi@7e600000 { ++ compatible = "brcm,bcm2835-smi"; ++ reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>; ++ interrupts = <2 16>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smi_pins>; ++ brcm,smi-clock-source = <6>; ++ brcm,smi-clock-divisor = <4>; ++ dmas = <&dma 4>; ++ dma-names = "rx-tx"; ++ ++ status = "okay"; ++}; ++ ++smi_pins: smi_pins { ++ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12 13 14 15>; ++ /* Alt 1: SMI */ ++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 5 5 5>; ++ /* /CS, /WE and /OE are pulled high, as they are ++ generally active low signals */ ++ brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0>; ++}; ++ +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index 4d1cc67..933711e 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -205,6 +205,17 @@ + status = "disabled"; + }; + ++ smi: smi@7e600000 { ++ compatible = "brcm,bcm2835-smi"; ++ reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>; ++ interrupts = <2 16>; ++ brcm,smi-clock-source = <6>; ++ brcm,smi-clock-divisor = <4>; ++ dmas = <&dma 4>; ++ dma-names = "rx-tx"; ++ status = "disabled"; ++ }; ++ + usb: usb@7e980000 { + compatible = "brcm,bcm2708-usb"; + reg = <0x7e980000 0x10000>, +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 43e9c96..f8f2c034 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -13,6 +13,8 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) + endif + + dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/smi-dev-overlay.dts b/arch/arm/boot/dts/overlays/smi-dev-overlay.dts +new file mode 100644 +index 0000000..b610d82 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/smi-dev-overlay.dts +@@ -0,0 +1,18 @@ ++// Description: Overlay to enable character device interface for SMI. ++// Author: Luke Wren ++ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ fragment@0 { ++ target = <&soc>; ++ __overlay__ { ++ smi_dev { ++ compatible = "brcm,bcm2835-smi-dev"; ++ smi_handle = <&smi>; ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/smi-overlay.dts b/arch/arm/boot/dts/overlays/smi-overlay.dts +new file mode 100644 +index 0000000..095f52c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/smi-overlay.dts +@@ -0,0 +1,37 @@ ++// Description: Overlay to enable the secondary memory interface peripheral ++// Author: Luke Wren ++ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&smi>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smi_pins>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ smi_pins: smi_pins { ++ /* Don't configure the top two address bits, as ++ these are already used as ID_SD and ID_SC */ ++ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12 13 14 15 ++ 16 17 18 19 20 21 22 23 24 25>; ++ /* Alt 0: SMI */ ++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ++ 5 5 5 5 5 5 5 5 5>; ++ /* /CS, /WE and /OE are pulled high, as they are ++ generally active low signals */ ++ brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 ++ 0 0 0 0 0 0 0>; ++ }; ++ }; ++ }; ++}; +diff --git a/drivers/char/broadcom/Kconfig b/drivers/char/broadcom/Kconfig +index bc2eb1e..5489f19 100644 +--- a/drivers/char/broadcom/Kconfig ++++ b/drivers/char/broadcom/Kconfig +@@ -47,3 +47,11 @@ config BCM2835_DEVGPIOMEM + on the 2835. Calling mmap(/dev/gpiomem) will map the GPIO + register page to the user's pointer. + ++config BCM2835_SMI_DEV ++ tristate "Character device driver for BCM2835 Secondary Memory Interface" ++ depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI ++ default m ++ help ++ This driver provides a character device interface (ioctl + read/write) to ++ Broadcom's Secondary Memory interface. The low-level functionality is provided ++ by the SMI driver itself. +diff --git a/drivers/char/broadcom/Makefile b/drivers/char/broadcom/Makefile +index 664e2c4..14775c9 100644 +--- a/drivers/char/broadcom/Makefile ++++ b/drivers/char/broadcom/Makefile +@@ -4,4 +4,4 @@ obj-$(CONFIG_BCM_VCIO) += vcio.o + obj-$(CONFIG_BCM_VC_SM) += vc_sm/ + + obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o +- ++obj-$(CONFIG_BCM2835_SMI_DEV) += bcm2835_smi_dev.o +diff --git a/drivers/char/broadcom/bcm2835_smi_dev.c b/drivers/char/broadcom/bcm2835_smi_dev.c +new file mode 100644 +index 0000000..d6efd92 +--- /dev/null ++++ b/drivers/char/broadcom/bcm2835_smi_dev.c +@@ -0,0 +1,402 @@ ++/** ++ * Character device driver for Broadcom Secondary Memory Interface ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define DEVICE_NAME "bcm2835-smi-dev" ++#define DRIVER_NAME "smi-dev-bcm2835" ++#define DEVICE_MINOR 0 ++ ++static struct cdev bcm2835_smi_cdev; ++static dev_t bcm2835_smi_devid; ++static struct class *bcm2835_smi_class; ++static struct device *bcm2835_smi_dev; ++ ++struct bcm2835_smi_dev_instance { ++ struct device *dev; ++}; ++ ++static struct bcm2835_smi_instance *smi_inst; ++static struct bcm2835_smi_dev_instance *inst; ++ ++static const char *const ioctl_names[] = { ++ "READ_SETTINGS", ++ "WRITE_SETTINGS", ++ "ADDRESS" ++}; ++ ++/**************************************************************************** ++* ++* SMI chardev file ops ++* ++***************************************************************************/ ++static long ++bcm2835_smi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ long ret = 0; ++ ++ dev_info(inst->dev, "serving ioctl..."); ++ ++ switch (cmd) { ++ case BCM2835_SMI_IOC_GET_SETTINGS:{ ++ struct smi_settings *settings; ++ ++ dev_info(inst->dev, "Reading SMI settings to user."); ++ settings = bcm2835_smi_get_settings_from_regs(smi_inst); ++ if (copy_to_user((void *)arg, settings, ++ sizeof(struct smi_settings))) ++ dev_err(inst->dev, "settings copy failed."); ++ break; ++ } ++ case BCM2835_SMI_IOC_WRITE_SETTINGS:{ ++ struct smi_settings *settings; ++ ++ dev_info(inst->dev, "Setting user's SMI settings."); ++ settings = bcm2835_smi_get_settings_from_regs(smi_inst); ++ if (copy_from_user(settings, (void *)arg, ++ sizeof(struct smi_settings))) ++ dev_err(inst->dev, "settings copy failed."); ++ else ++ bcm2835_smi_set_regs_from_settings(smi_inst); ++ break; ++ } ++ case BCM2835_SMI_IOC_ADDRESS: ++ dev_info(inst->dev, "SMI address set: 0x%02x", (int)arg); ++ bcm2835_smi_set_address(smi_inst, arg); ++ break; ++ default: ++ dev_err(inst->dev, "invalid ioctl cmd: %d", cmd); ++ ret = -ENOTTY; ++ break; ++ } ++ ++ return ret; ++} ++ ++static int bcm2835_smi_open(struct inode *inode, struct file *file) ++{ ++ int dev = iminor(inode); ++ ++ dev_dbg(inst->dev, "SMI device opened."); ++ ++ if (dev != DEVICE_MINOR) { ++ dev_err(inst->dev, ++ "bcm2835_smi_release: Unknown minor device: %d", ++ dev); ++ return -ENXIO; ++ } ++ ++ return 0; ++} ++ ++static int bcm2835_smi_release(struct inode *inode, struct file *file) ++{ ++ int dev = iminor(inode); ++ ++ if (dev != DEVICE_MINOR) { ++ dev_err(inst->dev, ++ "bcm2835_smi_release: Unknown minor device %d", dev); ++ return -ENXIO; ++ } ++ ++ return 0; ++} ++ ++static ssize_t dma_bounce_user( ++ enum dma_transfer_direction dma_dir, ++ char __user *user_ptr, ++ size_t count, ++ struct bcm2835_smi_bounce_info *bounce) ++{ ++ int chunk_size; ++ int chunk_no = 0; ++ int count_left = count; ++ ++ while (count_left) { ++ int rv; ++ void *buf; ++ ++ /* Wait for current chunk to complete: */ ++ if (down_timeout(&bounce->callback_sem, ++ msecs_to_jiffies(1000))) { ++ dev_err(inst->dev, "DMA bounce timed out"); ++ count -= (count_left); ++ break; ++ } ++ ++ if (bounce->callback_sem.count >= DMA_BOUNCE_BUFFER_COUNT - 1) ++ dev_err(inst->dev, "WARNING: Ring buffer overflow"); ++ chunk_size = count_left > DMA_BOUNCE_BUFFER_SIZE ? ++ DMA_BOUNCE_BUFFER_SIZE : count_left; ++ buf = bounce->buffer[chunk_no % DMA_BOUNCE_BUFFER_COUNT]; ++ if (dma_dir == DMA_DEV_TO_MEM) ++ rv = copy_to_user(user_ptr, buf, chunk_size); ++ else ++ rv = copy_from_user(buf, user_ptr, chunk_size); ++ if (rv) ++ dev_err(inst->dev, "copy_*_user() failed!: %d", rv); ++ user_ptr += chunk_size; ++ count_left -= chunk_size; ++ chunk_no++; ++ } ++ return count; ++} ++ ++static ssize_t ++bcm2835_read_file(struct file *f, char __user *user_ptr, ++ size_t count, loff_t *offs) ++{ ++ int odd_bytes; ++ ++ dev_dbg(inst->dev, "User reading %d bytes from SMI.", count); ++ /* We don't want to DMA a number of bytes % 4 != 0 (32 bit FIFO) */ ++ if (count > DMA_THRESHOLD_BYTES) ++ odd_bytes = count & 0x3; ++ else ++ odd_bytes = count; ++ count -= odd_bytes; ++ if (count) { ++ struct bcm2835_smi_bounce_info *bounce; ++ ++ count = bcm2835_smi_user_dma(smi_inst, ++ DMA_DEV_TO_MEM, user_ptr, count, ++ &bounce); ++ if (count) ++ count = dma_bounce_user(DMA_DEV_TO_MEM, user_ptr, ++ count, bounce); ++ } ++ if (odd_bytes) { ++ /* Read from FIFO directly if not using DMA */ ++ uint8_t buf[DMA_THRESHOLD_BYTES]; ++ ++ bcm2835_smi_read_buf(smi_inst, buf, odd_bytes); ++ if (copy_to_user(user_ptr, buf, odd_bytes)) ++ dev_err(inst->dev, "copy_to_user() failed."); ++ count += odd_bytes; ++ ++ } ++ return count; ++} ++ ++static ssize_t ++bcm2835_write_file(struct file *f, const char __user *user_ptr, ++ size_t count, loff_t *offs) ++{ ++ int odd_bytes; ++ ++ dev_dbg(inst->dev, "User writing %d bytes to SMI.", count); ++ if (count > DMA_THRESHOLD_BYTES) ++ odd_bytes = count & 0x3; ++ else ++ odd_bytes = count; ++ count -= odd_bytes; ++ if (count) { ++ struct bcm2835_smi_bounce_info *bounce; ++ ++ count = bcm2835_smi_user_dma(smi_inst, ++ DMA_MEM_TO_DEV, (char __user *)user_ptr, count, ++ &bounce); ++ if (count) ++ count = dma_bounce_user(DMA_MEM_TO_DEV, ++ (char __user *)user_ptr, ++ count, bounce); ++ } ++ if (odd_bytes) { ++ uint8_t buf[DMA_THRESHOLD_BYTES]; ++ ++ if (copy_from_user(buf, user_ptr, odd_bytes)) ++ dev_err(inst->dev, "copy_from_user() failed."); ++ else ++ bcm2835_smi_write_buf(smi_inst, buf, odd_bytes); ++ count += odd_bytes; ++ } ++ return count; ++} ++ ++static const struct file_operations ++bcm2835_smi_fops = { ++ .owner = THIS_MODULE, ++ .unlocked_ioctl = bcm2835_smi_ioctl, ++ .open = bcm2835_smi_open, ++ .release = bcm2835_smi_release, ++ .read = bcm2835_read_file, ++ .write = bcm2835_write_file, ++}; ++ ++ ++/**************************************************************************** ++* ++* bcm2835_smi_probe - called when the driver is loaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_dev_probe(struct platform_device *pdev) ++{ ++ int err; ++ void *ptr_err; ++ struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node, *smi_node; ++ ++ if (!node) { ++ dev_err(dev, "No device tree node supplied!"); ++ return -EINVAL; ++ } ++ ++ smi_node = of_parse_phandle(node, "smi_handle", 0); ++ ++ if (!smi_node) { ++ dev_err(dev, "No such property: smi_handle"); ++ return -ENXIO; ++ } ++ ++ smi_inst = bcm2835_smi_get(smi_node); ++ ++ if (!smi_inst) ++ return -EPROBE_DEFER; ++ ++ /* Allocate buffers and instance data */ ++ ++ inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL); ++ ++ if (!inst) ++ return -ENOMEM; ++ ++ inst->dev = dev; ++ ++ /* Create character device entries */ ++ ++ err = alloc_chrdev_region(&bcm2835_smi_devid, ++ DEVICE_MINOR, 1, DEVICE_NAME); ++ if (err != 0) { ++ dev_err(inst->dev, "unable to allocate device number"); ++ return -ENOMEM; ++ } ++ cdev_init(&bcm2835_smi_cdev, &bcm2835_smi_fops); ++ bcm2835_smi_cdev.owner = THIS_MODULE; ++ err = cdev_add(&bcm2835_smi_cdev, bcm2835_smi_devid, 1); ++ if (err != 0) { ++ dev_err(inst->dev, "unable to register device"); ++ err = -ENOMEM; ++ goto failed_cdev_add; ++ } ++ ++ /* Create sysfs entries */ ++ ++ bcm2835_smi_class = class_create(THIS_MODULE, DEVICE_NAME); ++ ptr_err = bcm2835_smi_class; ++ if (IS_ERR(ptr_err)) ++ goto failed_class_create; ++ ++ bcm2835_smi_dev = device_create(bcm2835_smi_class, NULL, ++ bcm2835_smi_devid, NULL, ++ "smi"); ++ ptr_err = bcm2835_smi_dev; ++ if (IS_ERR(ptr_err)) ++ goto failed_device_create; ++ ++ dev_info(inst->dev, "initialised"); ++ ++ return 0; ++ ++failed_device_create: ++ class_destroy(bcm2835_smi_class); ++failed_class_create: ++ cdev_del(&bcm2835_smi_cdev); ++ err = PTR_ERR(ptr_err); ++failed_cdev_add: ++ unregister_chrdev_region(bcm2835_smi_devid, 1); ++ dev_err(dev, "could not load bcm2835_smi_dev"); ++ return err; ++} ++ ++/**************************************************************************** ++* ++* bcm2835_smi_remove - called when the driver is unloaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_dev_remove(struct platform_device *pdev) ++{ ++ device_destroy(bcm2835_smi_class, bcm2835_smi_devid); ++ class_destroy(bcm2835_smi_class); ++ cdev_del(&bcm2835_smi_cdev); ++ unregister_chrdev_region(bcm2835_smi_devid, 1); ++ ++ dev_info(inst->dev, "SMI character dev removed - OK"); ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* Register the driver with device tree ++* ++***************************************************************************/ ++ ++static const struct of_device_id bcm2835_smi_dev_of_match[] = { ++ {.compatible = "brcm,bcm2835-smi-dev",}, ++ { /* sentinel */ }, ++}; ++ ++MODULE_DEVICE_TABLE(of, bcm2835_smi_dev_of_match); ++ ++static struct platform_driver bcm2835_smi_dev_driver = { ++ .probe = bcm2835_smi_dev_probe, ++ .remove = bcm2835_smi_dev_remove, ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = bcm2835_smi_dev_of_match, ++ }, ++}; ++ ++module_platform_driver(bcm2835_smi_dev_driver); ++ ++MODULE_ALIAS("platform:smi-dev-bcm2835"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION( ++ "Character device driver for BCM2835's secondary memory interface"); ++MODULE_AUTHOR("Luke Wren "); +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig +index 4e6f46c3..8b82c9b 100644 +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -10,6 +10,14 @@ config SENSORS_LIS3LV02D + select INPUT_POLLDEV + default n + ++config BCM2835_SMI ++ tristate "Broadcom 283x Secondary Memory Interface driver" ++ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 ++ default m ++ help ++ Driver for enabling and using Broadcom's Secondary/Slow Memory Interface. ++ Appears as /dev/bcm2835_smi. For ioctl interface see drivers/misc/bcm2835_smi.h ++ + config AD525X_DPOT + tristate "Analog Devices Digital Potentiometers" + depends on (I2C || SPI) && SYSFS +diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile +index 43d2ac9..b668a08 100644 +--- a/drivers/misc/Makefile ++++ b/drivers/misc/Makefile +@@ -9,6 +9,7 @@ obj-$(CONFIG_AD525X_DPOT_SPI) += ad525x_dpot-spi.o + obj-$(CONFIG_INTEL_MID_PTI) += pti.o + obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o + obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o ++obj-$(CONFIG_BCM2835_SMI) += bcm2835_smi.o + obj-$(CONFIG_BMP085) += bmp085.o + obj-$(CONFIG_BMP085_I2C) += bmp085-i2c.o + obj-$(CONFIG_BMP085_SPI) += bmp085-spi.o +diff --git a/drivers/misc/bcm2835_smi.c b/drivers/misc/bcm2835_smi.c +new file mode 100644 +index 0000000..63a4ea0 +--- /dev/null ++++ b/drivers/misc/bcm2835_smi.c +@@ -0,0 +1,985 @@ ++/** ++ * Broadcom Secondary Memory Interface driver ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define BCM2835_SMI_IMPLEMENTATION ++#include ++ ++#define DRIVER_NAME "smi-bcm2835" ++ ++#define N_PAGES_FROM_BYTES(n) ((n + PAGE_SIZE-1) / PAGE_SIZE) ++ ++#define DMA_WRITE_TO_MEM true ++#define DMA_READ_FROM_MEM false ++ ++struct bcm2835_smi_instance { ++ struct device *dev; ++ struct smi_settings settings; ++ __iomem void *smi_regs_ptr, *cm_smi_regs_ptr; ++ dma_addr_t smi_regs_busaddr; ++ ++ struct dma_chan *dma_chan; ++ struct dma_slave_config dma_config; ++ ++ struct bcm2835_smi_bounce_info bounce; ++ ++ struct scatterlist buffer_sgl; ++ ++ int clock_source; ++ int clock_divisor; ++ ++ /* Sometimes we are called into in an atomic context (e.g. by ++ JFFS2 + MTD) so we can't use a mutex */ ++ spinlock_t transaction_lock; ++}; ++ ++/**************************************************************************** ++* ++* SMI clock manager setup ++* ++***************************************************************************/ ++ ++static inline void write_smi_cm_reg(struct bcm2835_smi_instance *inst, ++ u32 val, unsigned reg) ++{ ++ writel(CM_PWD | val, inst->cm_smi_regs_ptr + reg); ++} ++ ++static inline u32 read_smi_cm_reg(struct bcm2835_smi_instance *inst, ++ unsigned reg) ++{ ++ return readl(inst->cm_smi_regs_ptr + reg); ++} ++ ++static void smi_setup_clock(struct bcm2835_smi_instance *inst) ++{ ++ dev_dbg(inst->dev, "Setting up clock..."); ++ /* Disable SMI clock and wait for it to stop. */ ++ write_smi_cm_reg(inst, 0, CM_SMI_CTL); ++ while (read_smi_cm_reg(inst, CM_SMI_CTL) & CM_SMI_CTL_BUSY) ++ ; ++ ++ write_smi_cm_reg(inst, (inst->clock_divisor << CM_SMI_DIV_DIVI_OFFS), ++ CM_SMI_DIV); ++ write_smi_cm_reg(inst, (inst->clock_source << CM_SMI_CTL_SRC_OFFS), ++ CM_SMI_CTL); ++ ++ /* Enable the clock */ ++ write_smi_cm_reg(inst, (inst->clock_source << CM_SMI_CTL_SRC_OFFS) | ++ CM_SMI_CTL_ENAB, CM_SMI_CTL); ++} ++ ++/**************************************************************************** ++* ++* SMI peripheral setup ++* ++***************************************************************************/ ++ ++static inline void write_smi_reg(struct bcm2835_smi_instance *inst, ++ u32 val, unsigned reg) ++{ ++ writel(val, inst->smi_regs_ptr + reg); ++} ++ ++static inline u32 read_smi_reg(struct bcm2835_smi_instance *inst, unsigned reg) ++{ ++ return readl(inst->smi_regs_ptr + reg); ++} ++ ++/* Token-paste macro for e.g SMIDSR_RSTROBE -> value of SMIDSR_RSTROBE_MASK */ ++#define _CONCAT(x, y) x##y ++#define CONCAT(x, y) _CONCAT(x, y) ++ ++#define SET_BIT_FIELD(dest, field, bits) ((dest) = \ ++ ((dest) & ~CONCAT(field, _MASK)) | (((bits) << CONCAT(field, _OFFS))& \ ++ CONCAT(field, _MASK))) ++#define GET_BIT_FIELD(src, field) (((src) & \ ++ CONCAT(field, _MASK)) >> CONCAT(field, _OFFS)) ++ ++static void smi_dump_context_labelled(struct bcm2835_smi_instance *inst, ++ const char *label) ++{ ++ dev_err(inst->dev, "SMI context dump: %s", label); ++ dev_err(inst->dev, "SMICS: 0x%08x", read_smi_reg(inst, SMICS)); ++ dev_err(inst->dev, "SMIL: 0x%08x", read_smi_reg(inst, SMIL)); ++ dev_err(inst->dev, "SMIDSR: 0x%08x", read_smi_reg(inst, SMIDSR0)); ++ dev_err(inst->dev, "SMIDSW: 0x%08x", read_smi_reg(inst, SMIDSW0)); ++ dev_err(inst->dev, "SMIDC: 0x%08x", read_smi_reg(inst, SMIDC)); ++ dev_err(inst->dev, "SMIFD: 0x%08x", read_smi_reg(inst, SMIFD)); ++ dev_err(inst->dev, " "); ++} ++ ++static inline void smi_dump_context(struct bcm2835_smi_instance *inst) ++{ ++ smi_dump_context_labelled(inst, ""); ++} ++ ++static void smi_get_default_settings(struct bcm2835_smi_instance *inst) ++{ ++ struct smi_settings *settings = &inst->settings; ++ ++ settings->data_width = SMI_WIDTH_16BIT; ++ settings->pack_data = true; ++ ++ settings->read_setup_time = 1; ++ settings->read_hold_time = 1; ++ settings->read_pace_time = 1; ++ settings->read_strobe_time = 3; ++ ++ settings->write_setup_time = settings->read_setup_time; ++ settings->write_hold_time = settings->read_hold_time; ++ settings->write_pace_time = settings->read_pace_time; ++ settings->write_strobe_time = settings->read_strobe_time; ++ ++ settings->dma_enable = true; ++ settings->dma_passthrough_enable = false; ++ settings->dma_read_thresh = 0x01; ++ settings->dma_write_thresh = 0x3f; ++ settings->dma_panic_read_thresh = 0x20; ++ settings->dma_panic_write_thresh = 0x20; ++} ++ ++void bcm2835_smi_set_regs_from_settings(struct bcm2835_smi_instance *inst) ++{ ++ struct smi_settings *settings = &inst->settings; ++ int smidsr_temp = 0, smidsw_temp = 0, smics_temp, ++ smidcs_temp, smidc_temp = 0; ++ ++ spin_lock(&inst->transaction_lock); ++ ++ /* temporarily disable the peripheral: */ ++ smics_temp = read_smi_reg(inst, SMICS); ++ write_smi_reg(inst, 0, SMICS); ++ smidcs_temp = read_smi_reg(inst, SMIDCS); ++ write_smi_reg(inst, 0, SMIDCS); ++ ++ if (settings->pack_data) ++ smics_temp |= SMICS_PXLDAT; ++ else ++ smics_temp &= ~SMICS_PXLDAT; ++ ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RWIDTH, settings->data_width); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RSETUP, settings->read_setup_time); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RHOLD, settings->read_hold_time); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RPACE, settings->read_pace_time); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RSTROBE, settings->read_strobe_time); ++ write_smi_reg(inst, smidsr_temp, SMIDSR0); ++ ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WWIDTH, settings->data_width); ++ if (settings->data_width == SMI_WIDTH_8BIT) ++ smidsw_temp |= SMIDSW_WSWAP; ++ else ++ smidsw_temp &= ~SMIDSW_WSWAP; ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WSETUP, settings->write_setup_time); ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WHOLD, settings->write_hold_time); ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WPACE, settings->write_pace_time); ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WSTROBE, ++ settings->write_strobe_time); ++ write_smi_reg(inst, smidsw_temp, SMIDSW0); ++ ++ SET_BIT_FIELD(smidc_temp, SMIDC_REQR, settings->dma_read_thresh); ++ SET_BIT_FIELD(smidc_temp, SMIDC_REQW, settings->dma_write_thresh); ++ SET_BIT_FIELD(smidc_temp, SMIDC_PANICR, ++ settings->dma_panic_read_thresh); ++ SET_BIT_FIELD(smidc_temp, SMIDC_PANICW, ++ settings->dma_panic_write_thresh); ++ if (settings->dma_passthrough_enable) { ++ smidc_temp |= SMIDC_DMAP; ++ smidsr_temp |= SMIDSR_RDREQ; ++ write_smi_reg(inst, smidsr_temp, SMIDSR0); ++ smidsw_temp |= SMIDSW_WDREQ; ++ write_smi_reg(inst, smidsw_temp, SMIDSW0); ++ } else ++ smidc_temp &= ~SMIDC_DMAP; ++ if (settings->dma_enable) ++ smidc_temp |= SMIDC_DMAEN; ++ else ++ smidc_temp &= ~SMIDC_DMAEN; ++ ++ write_smi_reg(inst, smidc_temp, SMIDC); ++ ++ /* re-enable (if was previously enabled) */ ++ write_smi_reg(inst, smics_temp, SMICS); ++ write_smi_reg(inst, smidcs_temp, SMIDCS); ++ ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_set_regs_from_settings); ++ ++struct smi_settings *bcm2835_smi_get_settings_from_regs ++ (struct bcm2835_smi_instance *inst) ++{ ++ struct smi_settings *settings = &inst->settings; ++ int smidsr, smidsw, smidc; ++ ++ spin_lock(&inst->transaction_lock); ++ ++ smidsr = read_smi_reg(inst, SMIDSR0); ++ smidsw = read_smi_reg(inst, SMIDSW0); ++ smidc = read_smi_reg(inst, SMIDC); ++ ++ settings->pack_data = (read_smi_reg(inst, SMICS) & SMICS_PXLDAT) ? ++ true : false; ++ ++ settings->data_width = GET_BIT_FIELD(smidsr, SMIDSR_RWIDTH); ++ settings->read_setup_time = GET_BIT_FIELD(smidsr, SMIDSR_RSETUP); ++ settings->read_hold_time = GET_BIT_FIELD(smidsr, SMIDSR_RHOLD); ++ settings->read_pace_time = GET_BIT_FIELD(smidsr, SMIDSR_RPACE); ++ settings->read_strobe_time = GET_BIT_FIELD(smidsr, SMIDSR_RSTROBE); ++ ++ settings->write_setup_time = GET_BIT_FIELD(smidsw, SMIDSW_WSETUP); ++ settings->write_hold_time = GET_BIT_FIELD(smidsw, SMIDSW_WHOLD); ++ settings->write_pace_time = GET_BIT_FIELD(smidsw, SMIDSW_WPACE); ++ settings->write_strobe_time = GET_BIT_FIELD(smidsw, SMIDSW_WSTROBE); ++ ++ settings->dma_read_thresh = GET_BIT_FIELD(smidc, SMIDC_REQR); ++ settings->dma_write_thresh = GET_BIT_FIELD(smidc, SMIDC_REQW); ++ settings->dma_panic_read_thresh = GET_BIT_FIELD(smidc, SMIDC_PANICR); ++ settings->dma_panic_write_thresh = GET_BIT_FIELD(smidc, SMIDC_PANICW); ++ settings->dma_passthrough_enable = (smidc & SMIDC_DMAP) ? true : false; ++ settings->dma_enable = (smidc & SMIDC_DMAEN) ? true : false; ++ ++ spin_unlock(&inst->transaction_lock); ++ ++ return settings; ++} ++EXPORT_SYMBOL(bcm2835_smi_get_settings_from_regs); ++ ++static inline void smi_set_address(struct bcm2835_smi_instance *inst, ++ unsigned int address) ++{ ++ int smia_temp = 0, smida_temp = 0; ++ ++ SET_BIT_FIELD(smia_temp, SMIA_ADDR, address); ++ SET_BIT_FIELD(smida_temp, SMIDA_ADDR, address); ++ ++ /* Write to both address registers - user doesn't care whether we're ++ doing programmed or direct transfers. */ ++ write_smi_reg(inst, smia_temp, SMIA); ++ write_smi_reg(inst, smida_temp, SMIDA); ++} ++ ++static void smi_setup_regs(struct bcm2835_smi_instance *inst) ++{ ++ ++ dev_dbg(inst->dev, "Initialising SMI registers..."); ++ /* Disable the peripheral if already enabled */ ++ write_smi_reg(inst, 0, SMICS); ++ write_smi_reg(inst, 0, SMIDCS); ++ ++ smi_get_default_settings(inst); ++ bcm2835_smi_set_regs_from_settings(inst); ++ smi_set_address(inst, 0); ++ ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_ENABLE, SMICS); ++ write_smi_reg(inst, read_smi_reg(inst, SMIDCS) | SMIDCS_ENABLE, ++ SMIDCS); ++} ++ ++/**************************************************************************** ++* ++* Low-level SMI access functions ++* Other modules should use the exported higher-level functions e.g. ++* bcm2835_smi_write_buf() unless they have a good reason to use these ++* ++***************************************************************************/ ++ ++static inline uint32_t smi_read_single_word(struct bcm2835_smi_instance *inst) ++{ ++ int timeout = 0; ++ ++ write_smi_reg(inst, SMIDCS_ENABLE, SMIDCS); ++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_START, SMIDCS); ++ /* Make sure things happen in the right order...*/ ++ mb(); ++ while (!(read_smi_reg(inst, SMIDCS) & SMIDCS_DONE) && ++ ++timeout < 10000) ++ ; ++ if (timeout < 10000) ++ return read_smi_reg(inst, SMIDD); ++ ++ dev_err(inst->dev, ++ "SMI direct read timed out (is the clock set up correctly?)"); ++ return 0; ++} ++ ++static inline void smi_write_single_word(struct bcm2835_smi_instance *inst, ++ uint32_t data) ++{ ++ int timeout = 0; ++ ++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_WRITE, SMIDCS); ++ write_smi_reg(inst, data, SMIDD); ++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_WRITE | SMIDCS_START, ++ SMIDCS); ++ ++ while (!(read_smi_reg(inst, SMIDCS) & SMIDCS_DONE) && ++ ++timeout < 10000) ++ ; ++ if (timeout >= 10000) ++ dev_err(inst->dev, ++ "SMI direct write timed out (is the clock set up correctly?)"); ++} ++ ++/* Initiates a programmed read into the read FIFO. It is up to the caller to ++ * read data from the FIFO - either via paced DMA transfer, ++ * or polling SMICS_RXD to check whether data is available. ++ * SMICS_ACTIVE will go low upon completion. */ ++static void smi_init_programmed_read(struct bcm2835_smi_instance *inst, ++ int num_transfers) ++{ ++ int smics_temp; ++ ++ /* Disable the peripheral: */ ++ smics_temp = read_smi_reg(inst, SMICS) & ~(SMICS_ENABLE | SMICS_WRITE); ++ write_smi_reg(inst, smics_temp, SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ENABLE) ++ ; ++ ++ /* Program the transfer count: */ ++ write_smi_reg(inst, num_transfers, SMIL); ++ ++ /* re-enable and start: */ ++ smics_temp |= SMICS_ENABLE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ smics_temp |= SMICS_CLEAR; ++ /* Just to be certain: */ ++ mb(); ++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE) ++ ; ++ write_smi_reg(inst, smics_temp, SMICS); ++ smics_temp |= SMICS_START; ++ write_smi_reg(inst, smics_temp, SMICS); ++} ++ ++/* Initiates a programmed write sequence, using data from the write FIFO. ++ * It is up to the caller to initiate a DMA transfer before calling, ++ * or use another method to keep the write FIFO topped up. ++ * SMICS_ACTIVE will go low upon completion. ++ */ ++static void smi_init_programmed_write(struct bcm2835_smi_instance *inst, ++ int num_transfers) ++{ ++ int smics_temp; ++ ++ /* Disable the peripheral: */ ++ smics_temp = read_smi_reg(inst, SMICS) & ~SMICS_ENABLE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ENABLE) ++ ; ++ ++ /* Program the transfer count: */ ++ write_smi_reg(inst, num_transfers, SMIL); ++ ++ /* setup, re-enable and start: */ ++ smics_temp |= SMICS_WRITE | SMICS_ENABLE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ smics_temp |= SMICS_START; ++ write_smi_reg(inst, smics_temp, SMICS); ++} ++ ++/* Initiate a read and then poll FIFO for data, reading out as it appears. */ ++static void smi_read_fifo(struct bcm2835_smi_instance *inst, ++ uint32_t *dest, int n_bytes) ++{ ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) { ++ smi_dump_context_labelled(inst, ++ "WARNING: read FIFO not empty at start of read call."); ++ while (read_smi_reg(inst, SMICS)) ++ ; ++ } ++ ++ /* Dispatch the read: */ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_read(inst, n_bytes); ++ else if (inst->settings.data_width == SMI_WIDTH_16BIT) ++ smi_init_programmed_read(inst, n_bytes / 2); ++ else { ++ dev_err(inst->dev, "Unsupported data width for read."); ++ return; ++ } ++ ++ /* Poll FIFO to keep it empty */ ++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE)) ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) ++ *dest++ = read_smi_reg(inst, SMID); ++ ++ /* Ensure that the FIFO is emptied */ ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) { ++ int fifo_count; ++ ++ fifo_count = GET_BIT_FIELD(read_smi_reg(inst, SMIFD), ++ SMIFD_FCNT); ++ while (fifo_count--) ++ *dest++ = read_smi_reg(inst, SMID); ++ } ++ ++ if (!(read_smi_reg(inst, SMICS) & SMICS_DONE)) ++ smi_dump_context_labelled(inst, ++ "WARNING: transaction finished but done bit not set."); ++ ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) ++ smi_dump_context_labelled(inst, ++ "WARNING: read FIFO not empty at end of read call."); ++ ++} ++ ++/* Initiate a write, and then keep the FIFO topped up. */ ++static void smi_write_fifo(struct bcm2835_smi_instance *inst, ++ uint32_t *src, int n_bytes) ++{ ++ int i, timeout = 0; ++ ++ /* Empty FIFOs if not already so */ ++ if (!(read_smi_reg(inst, SMICS) & SMICS_TXE)) { ++ smi_dump_context_labelled(inst, ++ "WARNING: write fifo not empty at start of write call."); ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_CLEAR, ++ SMICS); ++ } ++ ++ /* Initiate the transfer */ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_write(inst, n_bytes); ++ else if (inst->settings.data_width == SMI_WIDTH_16BIT) ++ smi_init_programmed_write(inst, n_bytes / 2); ++ else { ++ dev_err(inst->dev, "Unsupported data width for write."); ++ return; ++ } ++ /* Fill the FIFO: */ ++ for (i = 0; i < (n_bytes - 1) / 4 + 1; ++i) { ++ while (!(read_smi_reg(inst, SMICS) & SMICS_TXD)) ++ ; ++ write_smi_reg(inst, *src++, SMID); ++ } ++ /* Busy wait... */ ++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE) && ++timeout < ++ 1000000) ++ ; ++ if (timeout >= 1000000) ++ smi_dump_context_labelled(inst, ++ "Timed out on write operation!"); ++ if (!(read_smi_reg(inst, SMICS) & SMICS_TXE)) ++ smi_dump_context_labelled(inst, ++ "WARNING: FIFO not empty at end of write operation."); ++} ++ ++/**************************************************************************** ++* ++* SMI DMA operations ++* ++***************************************************************************/ ++ ++/* Disable SMI and put it into the correct direction before doing DMA setup. ++ Stops spurious DREQs during setup. Peripheral is re-enabled by init_*() */ ++static void smi_disable(struct bcm2835_smi_instance *inst, ++ enum dma_transfer_direction direction) ++{ ++ int smics_temp = read_smi_reg(inst, SMICS) & ~SMICS_ENABLE; ++ ++ if (direction == DMA_DEV_TO_MEM) ++ smics_temp &= ~SMICS_WRITE; ++ else ++ smics_temp |= SMICS_WRITE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE) ++ ; ++} ++ ++static struct scatterlist *smi_scatterlist_from_buffer( ++ struct bcm2835_smi_instance *inst, ++ dma_addr_t buf, ++ size_t len, ++ struct scatterlist *sg) ++{ ++ sg_init_table(sg, 1); ++ sg_dma_address(sg) = buf; ++ sg_dma_len(sg) = len; ++ return sg; ++} ++ ++static void smi_dma_callback_user_copy(void *param) ++{ ++ /* Notify the bottom half that a chunk is ready for user copy */ ++ struct bcm2835_smi_instance *inst = ++ (struct bcm2835_smi_instance *)param; ++ ++ up(&inst->bounce.callback_sem); ++} ++ ++/* Creates a descriptor, assigns the given callback, and submits the ++ descriptor to dmaengine. Does not block - can queue up multiple ++ descriptors and then wait for them all to complete. ++ sg_len is the number of control blocks, NOT the number of bytes. ++ dir can be DMA_MEM_TO_DEV or DMA_DEV_TO_MEM. ++ callback can be NULL - in this case it is not called. */ ++static inline struct dma_async_tx_descriptor *smi_dma_submit_sgl( ++ struct bcm2835_smi_instance *inst, ++ struct scatterlist *sgl, ++ size_t sg_len, ++ enum dma_transfer_direction dir, ++ dma_async_tx_callback callback) ++{ ++ struct dma_async_tx_descriptor *desc; ++ ++ desc = dmaengine_prep_slave_sg(inst->dma_chan, ++ sgl, ++ sg_len, ++ dir, ++ DMA_PREP_INTERRUPT | DMA_CTRL_ACK | ++ DMA_PREP_FENCE); ++ if (!desc) { ++ dev_err(inst->dev, "read_sgl: dma slave preparation failed!"); ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) & ~SMICS_ACTIVE, ++ SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE) ++ cpu_relax(); ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_ACTIVE, ++ SMICS); ++ return NULL; ++ } ++ desc->callback = callback; ++ desc->callback_param = inst; ++ if (dmaengine_submit(desc) < 0) ++ return NULL; ++ return desc; ++} ++ ++/* NB this function blocks until the transfer is complete */ ++static void ++smi_dma_read_sgl(struct bcm2835_smi_instance *inst, ++ struct scatterlist *sgl, size_t sg_len, size_t n_bytes) ++{ ++ struct dma_async_tx_descriptor *desc; ++ ++ /* Disable SMI and set to read before dispatching DMA - if SMI is in ++ * write mode and TX fifo is empty, it will generate a DREQ which may ++ * cause the read DMA to complete before the SMI read command is even ++ * dispatched! We want to dispatch DMA before SMI read so that reading ++ * is gapless, for logic analyser. ++ */ ++ ++ smi_disable(inst, DMA_DEV_TO_MEM); ++ ++ desc = smi_dma_submit_sgl(inst, sgl, sg_len, DMA_DEV_TO_MEM, NULL); ++ dma_async_issue_pending(inst->dma_chan); ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_read(inst, n_bytes); ++ else ++ smi_init_programmed_read(inst, n_bytes / 2); ++ ++ if (dma_wait_for_async_tx(desc) == DMA_ERROR) ++ smi_dump_context_labelled(inst, "DMA timeout!"); ++} ++ ++static void ++smi_dma_write_sgl(struct bcm2835_smi_instance *inst, ++ struct scatterlist *sgl, size_t sg_len, size_t n_bytes) ++{ ++ struct dma_async_tx_descriptor *desc; ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_write(inst, n_bytes); ++ else ++ smi_init_programmed_write(inst, n_bytes / 2); ++ ++ desc = smi_dma_submit_sgl(inst, sgl, sg_len, DMA_MEM_TO_DEV, NULL); ++ dma_async_issue_pending(inst->dma_chan); ++ ++ if (dma_wait_for_async_tx(desc) == DMA_ERROR) ++ smi_dump_context_labelled(inst, "DMA timeout!"); ++ else ++ /* Wait for SMI to finish our writes */ ++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE)) ++ cpu_relax(); ++} ++ ++ssize_t bcm2835_smi_user_dma( ++ struct bcm2835_smi_instance *inst, ++ enum dma_transfer_direction dma_dir, ++ char __user *user_ptr, size_t count, ++ struct bcm2835_smi_bounce_info **bounce) ++{ ++ int chunk_no = 0, chunk_size, count_left = count; ++ struct scatterlist *sgl; ++ void (*init_trans_func)(struct bcm2835_smi_instance *, int); ++ ++ spin_lock(&inst->transaction_lock); ++ ++ if (dma_dir == DMA_DEV_TO_MEM) ++ init_trans_func = smi_init_programmed_read; ++ else ++ init_trans_func = smi_init_programmed_write; ++ ++ smi_disable(inst, dma_dir); ++ ++ sema_init(&inst->bounce.callback_sem, 0); ++ if (bounce) ++ *bounce = &inst->bounce; ++ while (count_left) { ++ chunk_size = count_left > DMA_BOUNCE_BUFFER_SIZE ? ++ DMA_BOUNCE_BUFFER_SIZE : count_left; ++ if (chunk_size == DMA_BOUNCE_BUFFER_SIZE) { ++ sgl = ++ &inst->bounce.sgl[chunk_no % DMA_BOUNCE_BUFFER_COUNT]; ++ } else { ++ sgl = smi_scatterlist_from_buffer( ++ inst, ++ inst->bounce.phys[ ++ chunk_no % DMA_BOUNCE_BUFFER_COUNT], ++ chunk_size, ++ &inst->buffer_sgl); ++ } ++ ++ if (!smi_dma_submit_sgl(inst, sgl, 1, dma_dir, ++ smi_dma_callback_user_copy ++ )) { ++ dev_err(inst->dev, "sgl submit failed"); ++ count = 0; ++ goto out; ++ } ++ count_left -= chunk_size; ++ chunk_no++; ++ } ++ dma_async_issue_pending(inst->dma_chan); ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ init_trans_func(inst, count); ++ else if (inst->settings.data_width == SMI_WIDTH_16BIT) ++ init_trans_func(inst, count / 2); ++out: ++ spin_unlock(&inst->transaction_lock); ++ return count; ++} ++EXPORT_SYMBOL(bcm2835_smi_user_dma); ++ ++ ++/**************************************************************************** ++* ++* High level buffer transfer functions - for use by other drivers ++* ++***************************************************************************/ ++ ++/* Buffer must be physically contiguous - i.e. kmalloc, not vmalloc! */ ++void bcm2835_smi_write_buf( ++ struct bcm2835_smi_instance *inst, ++ const void *buf, size_t n_bytes) ++{ ++ int odd_bytes = n_bytes & 0x3; ++ ++ n_bytes -= odd_bytes; ++ ++ spin_lock(&inst->transaction_lock); ++ ++ if (n_bytes > DMA_THRESHOLD_BYTES) { ++ dma_addr_t phy_addr = dma_map_single( ++ inst->dev, ++ (void *)buf, ++ n_bytes, ++ DMA_MEM_TO_DEV); ++ struct scatterlist *sgl = ++ smi_scatterlist_from_buffer(inst, phy_addr, n_bytes, ++ &inst->buffer_sgl); ++ ++ if (!sgl) { ++ smi_dump_context_labelled(inst, ++ "Error: could not create scatterlist for write!"); ++ goto out; ++ } ++ smi_dma_write_sgl(inst, sgl, 1, n_bytes); ++ ++ dma_unmap_single ++ (inst->dev, phy_addr, n_bytes, DMA_MEM_TO_DEV); ++ } else if (n_bytes) { ++ smi_write_fifo(inst, (uint32_t *) buf, n_bytes); ++ } ++ buf += n_bytes; ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) { ++ while (odd_bytes--) ++ smi_write_single_word(inst, *(uint8_t *) (buf++)); ++ } else { ++ while (odd_bytes >= 2) { ++ smi_write_single_word(inst, *(uint16_t *)buf); ++ buf += 2; ++ odd_bytes -= 2; ++ } ++ if (odd_bytes) { ++ /* Reading an odd number of bytes on a 16 bit bus is ++ a user bug. It's kinder to fail early and tell them ++ than to e.g. transparently give them the bottom byte ++ of a 16 bit transfer. */ ++ dev_err(inst->dev, ++ "WARNING: odd number of bytes specified for wide transfer."); ++ dev_err(inst->dev, ++ "At least one byte dropped as a result."); ++ dump_stack(); ++ } ++ } ++out: ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_write_buf); ++ ++void bcm2835_smi_read_buf(struct bcm2835_smi_instance *inst, ++ void *buf, size_t n_bytes) ++{ ++ ++ /* SMI is inherently 32-bit, which causes surprising amounts of mess ++ for bytes % 4 != 0. Easiest to avoid this mess altogether ++ by handling remainder separately. */ ++ int odd_bytes = n_bytes & 0x3; ++ ++ spin_lock(&inst->transaction_lock); ++ n_bytes -= odd_bytes; ++ if (n_bytes > DMA_THRESHOLD_BYTES) { ++ dma_addr_t phy_addr = dma_map_single(inst->dev, ++ buf, n_bytes, ++ DMA_DEV_TO_MEM); ++ struct scatterlist *sgl = smi_scatterlist_from_buffer( ++ inst, phy_addr, n_bytes, ++ &inst->buffer_sgl); ++ if (!sgl) { ++ smi_dump_context_labelled(inst, ++ "Error: could not create scatterlist for read!"); ++ goto out; ++ } ++ smi_dma_read_sgl(inst, sgl, 1, n_bytes); ++ dma_unmap_single(inst->dev, phy_addr, n_bytes, DMA_DEV_TO_MEM); ++ } else if (n_bytes) { ++ smi_read_fifo(inst, (uint32_t *)buf, n_bytes); ++ } ++ buf += n_bytes; ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) { ++ while (odd_bytes--) ++ *((uint8_t *) (buf++)) = smi_read_single_word(inst); ++ } else { ++ while (odd_bytes >= 2) { ++ *(uint16_t *) buf = smi_read_single_word(inst); ++ buf += 2; ++ odd_bytes -= 2; ++ } ++ if (odd_bytes) { ++ dev_err(inst->dev, ++ "WARNING: odd number of bytes specified for wide transfer."); ++ dev_err(inst->dev, ++ "At least one byte dropped as a result."); ++ dump_stack(); ++ } ++ } ++out: ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_read_buf); ++ ++void bcm2835_smi_set_address(struct bcm2835_smi_instance *inst, ++ unsigned int address) ++{ ++ spin_lock(&inst->transaction_lock); ++ smi_set_address(inst, address); ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_set_address); ++ ++struct bcm2835_smi_instance *bcm2835_smi_get(struct device_node *node) ++{ ++ struct platform_device *pdev; ++ ++ if (!node) ++ return NULL; ++ ++ pdev = of_find_device_by_node(node); ++ if (!pdev) ++ return NULL; ++ ++ return platform_get_drvdata(pdev); ++} ++EXPORT_SYMBOL(bcm2835_smi_get); ++ ++/**************************************************************************** ++* ++* bcm2835_smi_probe - called when the driver is loaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_dma_setup(struct bcm2835_smi_instance *inst) ++{ ++ int i, rv = 0; ++ ++ inst->dma_chan = dma_request_slave_channel(inst->dev, "rx-tx"); ++ ++ inst->dma_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; ++ inst->dma_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; ++ inst->dma_config.src_addr = inst->smi_regs_busaddr + SMID; ++ inst->dma_config.dst_addr = inst->dma_config.src_addr; ++ /* Direction unimportant - always overridden by prep_slave_sg */ ++ inst->dma_config.direction = DMA_DEV_TO_MEM; ++ dmaengine_slave_config(inst->dma_chan, &inst->dma_config); ++ /* Alloc and map bounce buffers */ ++ for (i = 0; i < DMA_BOUNCE_BUFFER_COUNT; ++i) { ++ inst->bounce.buffer[i] = ++ dmam_alloc_coherent(inst->dev, DMA_BOUNCE_BUFFER_SIZE, ++ &inst->bounce.phys[i], ++ GFP_KERNEL); ++ if (!inst->bounce.buffer[i]) { ++ dev_err(inst->dev, "Could not allocate buffer!"); ++ rv = -ENOMEM; ++ break; ++ } ++ smi_scatterlist_from_buffer( ++ inst, ++ inst->bounce.phys[i], ++ DMA_BOUNCE_BUFFER_SIZE, ++ &inst->bounce.sgl[i] ++ ); ++ } ++ ++ return rv; ++} ++ ++static int bcm2835_smi_probe(struct platform_device *pdev) ++{ ++ int err; ++ struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node; ++ struct resource *ioresource; ++ struct bcm2835_smi_instance *inst; ++ ++ /* Allocate buffers and instance data */ ++ ++ inst = devm_kzalloc(dev, sizeof(struct bcm2835_smi_instance), ++ GFP_KERNEL); ++ ++ if (!inst) ++ return -ENOMEM; ++ ++ inst->dev = dev; ++ spin_lock_init(&inst->transaction_lock); ++ ++ /* We require device tree support */ ++ if (!node) ++ return -EINVAL; ++ ++ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ inst->smi_regs_ptr = devm_ioremap_resource(dev, ioresource); ++ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ inst->cm_smi_regs_ptr = devm_ioremap_resource(dev, ioresource); ++ inst->smi_regs_busaddr = be32_to_cpu( ++ *of_get_address(node, 0, NULL, NULL)); ++ of_property_read_u32(node, ++ "brcm,smi-clock-source", ++ &inst->clock_source); ++ of_property_read_u32(node, ++ "brcm,smi-clock-divisor", ++ &inst->clock_divisor); ++ ++ err = bcm2835_smi_dma_setup(inst); ++ if (err) ++ return err; ++ ++ /* Finally, do peripheral setup */ ++ ++ smi_setup_clock(inst); ++ smi_setup_regs(inst); ++ ++ platform_set_drvdata(pdev, inst); ++ ++ dev_info(inst->dev, "initialised"); ++ ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* bcm2835_smi_remove - called when the driver is unloaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_remove(struct platform_device *pdev) ++{ ++ struct bcm2835_smi_instance *inst = platform_get_drvdata(pdev); ++ struct device *dev = inst->dev; ++ ++ dev_info(dev, "SMI device removed - OK"); ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* Register the driver with device tree ++* ++***************************************************************************/ ++ ++static const struct of_device_id bcm2835_smi_of_match[] = { ++ {.compatible = "brcm,bcm2835-smi",}, ++ { /* sentinel */ }, ++}; ++ ++MODULE_DEVICE_TABLE(of, bcm2835_smi_of_match); ++ ++static struct platform_driver bcm2835_smi_driver = { ++ .probe = bcm2835_smi_probe, ++ .remove = bcm2835_smi_remove, ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = bcm2835_smi_of_match, ++ }, ++}; ++ ++module_platform_driver(bcm2835_smi_driver); ++ ++MODULE_ALIAS("platform:smi-bcm2835"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("Device driver for BCM2835's secondary memory interface"); ++MODULE_AUTHOR("Luke Wren "); +diff --git a/include/linux/broadcom/bcm2835_smi.h b/include/linux/broadcom/bcm2835_smi.h +new file mode 100644 +index 0000000..ee3a75e +--- /dev/null ++++ b/include/linux/broadcom/bcm2835_smi.h +@@ -0,0 +1,391 @@ ++/** ++ * Declarations and definitions for Broadcom's Secondary Memory Interface ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * Copyright (c) 2010-2012 Broadcom. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef BCM2835_SMI_H ++#define BCM2835_SMI_H ++ ++#include ++ ++#ifndef __KERNEL__ ++#include ++#include ++#endif ++ ++#define BCM2835_SMI_IOC_MAGIC 0x1 ++#define BCM2835_SMI_INVALID_HANDLE (~0) ++ ++/* IOCTLs 0x100...0x1ff are not device-specific - we can use them */ ++#define BCM2835_SMI_IOC_GET_SETTINGS _IO(BCM2835_SMI_IOC_MAGIC, 0) ++#define BCM2835_SMI_IOC_WRITE_SETTINGS _IO(BCM2835_SMI_IOC_MAGIC, 1) ++#define BCM2835_SMI_IOC_ADDRESS _IO(BCM2835_SMI_IOC_MAGIC, 2) ++#define BCM2835_SMI_IOC_MAX 2 ++ ++#define SMI_WIDTH_8BIT 0 ++#define SMI_WIDTH_16BIT 1 ++#define SMI_WIDTH_9BIT 2 ++#define SMI_WIDTH_18BIT 3 ++ ++/* max number of bytes where DMA will not be used */ ++#define DMA_THRESHOLD_BYTES 128 ++#define DMA_BOUNCE_BUFFER_SIZE (1024 * 1024 / 2) ++#define DMA_BOUNCE_BUFFER_COUNT 3 ++ ++ ++struct smi_settings { ++ int data_width; ++ /* Whether or not to pack multiple SMI transfers into a ++ single 32 bit FIFO word */ ++ bool pack_data; ++ ++ /* Timing for reads (writes the same but for WE) ++ * ++ * OE ----------+ +-------------------- ++ * | | ++ * +----------+ ++ * SD -<==============================>----------- ++ * SA -<=========================================>- ++ * <-setup-> <-strobe -> <-hold -> <- pace -> ++ */ ++ ++ int read_setup_time; ++ int read_hold_time; ++ int read_pace_time; ++ int read_strobe_time; ++ ++ int write_setup_time; ++ int write_hold_time; ++ int write_pace_time; ++ int write_strobe_time; ++ ++ bool dma_enable; /* DREQs */ ++ bool dma_passthrough_enable; /* External DREQs */ ++ int dma_read_thresh; ++ int dma_write_thresh; ++ int dma_panic_read_thresh; ++ int dma_panic_write_thresh; ++}; ++ ++/**************************************************************************** ++* ++* Declare exported SMI functions ++* ++***************************************************************************/ ++ ++#ifdef __KERNEL__ ++ ++#include /* for enum dma_transfer_direction */ ++#include ++#include ++ ++struct bcm2835_smi_instance; ++ ++struct bcm2835_smi_bounce_info { ++ struct semaphore callback_sem; ++ void *buffer[DMA_BOUNCE_BUFFER_COUNT]; ++ dma_addr_t phys[DMA_BOUNCE_BUFFER_COUNT]; ++ struct scatterlist sgl[DMA_BOUNCE_BUFFER_COUNT]; ++}; ++ ++ ++void bcm2835_smi_set_regs_from_settings(struct bcm2835_smi_instance *); ++ ++struct smi_settings *bcm2835_smi_get_settings_from_regs( ++ struct bcm2835_smi_instance *inst); ++ ++void bcm2835_smi_write_buf( ++ struct bcm2835_smi_instance *inst, ++ const void *buf, ++ size_t n_bytes); ++ ++void bcm2835_smi_read_buf( ++ struct bcm2835_smi_instance *inst, ++ void *buf, ++ size_t n_bytes); ++ ++void bcm2835_smi_set_address(struct bcm2835_smi_instance *inst, ++ unsigned int address); ++ ++ssize_t bcm2835_smi_user_dma( ++ struct bcm2835_smi_instance *inst, ++ enum dma_transfer_direction dma_dir, ++ char __user *user_ptr, ++ size_t count, ++ struct bcm2835_smi_bounce_info **bounce); ++ ++struct bcm2835_smi_instance *bcm2835_smi_get(struct device_node *node); ++ ++#endif /* __KERNEL__ */ ++ ++/**************************************************************** ++* ++* Implementation-only declarations ++* ++****************************************************************/ ++ ++#ifdef BCM2835_SMI_IMPLEMENTATION ++ ++/* Clock manager registers for SMI clock: */ ++#define CM_SMI_BASE_ADDRESS ((BCM2708_PERI_BASE) + 0x1010b0) ++/* Clock manager "password" to protect registers from spurious writes */ ++#define CM_PWD (0x5a << 24) ++ ++#define CM_SMI_CTL 0x00 ++#define CM_SMI_DIV 0x04 ++ ++#define CM_SMI_CTL_FLIP (1 << 8) ++#define CM_SMI_CTL_BUSY (1 << 7) ++#define CM_SMI_CTL_KILL (1 << 5) ++#define CM_SMI_CTL_ENAB (1 << 4) ++#define CM_SMI_CTL_SRC_MASK (0xf) ++#define CM_SMI_CTL_SRC_OFFS (0) ++ ++#define CM_SMI_DIV_DIVI_MASK (0xf << 12) ++#define CM_SMI_DIV_DIVI_OFFS (12) ++#define CM_SMI_DIV_DIVF_MASK (0xff << 4) ++#define CM_SMI_DIV_DIVF_OFFS (4) ++ ++/* SMI register mapping:*/ ++#define SMI_BASE_ADDRESS ((BCM2708_PERI_BASE) + 0x600000) ++ ++#define SMICS 0x00 /* control + status register */ ++#define SMIL 0x04 /* length/count (n external txfers) */ ++#define SMIA 0x08 /* address register */ ++#define SMID 0x0c /* data register */ ++#define SMIDSR0 0x10 /* device 0 read settings */ ++#define SMIDSW0 0x14 /* device 0 write settings */ ++#define SMIDSR1 0x18 /* device 1 read settings */ ++#define SMIDSW1 0x1c /* device 1 write settings */ ++#define SMIDSR2 0x20 /* device 2 read settings */ ++#define SMIDSW2 0x24 /* device 2 write settings */ ++#define SMIDSR3 0x28 /* device 3 read settings */ ++#define SMIDSW3 0x2c /* device 3 write settings */ ++#define SMIDC 0x30 /* DMA control registers */ ++#define SMIDCS 0x34 /* direct control/status register */ ++#define SMIDA 0x38 /* direct address register */ ++#define SMIDD 0x3c /* direct data registers */ ++#define SMIFD 0x40 /* FIFO debug register */ ++ ++ ++ ++/* Control and Status register bits: ++ * SMICS_RXF : RX fifo full: 1 when RX fifo is full ++ * SMICS_TXE : TX fifo empty: 1 when empty. ++ * SMICS_RXD : RX fifo contains data: 1 when there is data. ++ * SMICS_TXD : TX fifo can accept data: 1 when true. ++ * SMICS_RXR : RX fifo needs reading: 1 when fifo more than 3/4 full, or ++ * when "DONE" and fifo not emptied. ++ * SMICS_TXW : TX fifo needs writing: 1 when less than 1/4 full. ++ * SMICS_AFERR : AXI FIFO error: 1 when fifo read when empty or written ++ * when full. Write 1 to clear. ++ * SMICS_EDREQ : 1 when external DREQ received. ++ * SMICS_PXLDAT : Pixel data: write 1 to enable pixel transfer modes. ++ * SMICS_SETERR : 1 if there was an error writing to setup regs (e.g. ++ * tx was in progress). Write 1 to clear. ++ * SMICS_PVMODE : Set to 1 to enable pixel valve mode. ++ * SMICS_INTR : Set to 1 to enable interrupt on RX. ++ * SMICS_INTT : Set to 1 to enable interrupt on TX. ++ * SMICS_INTD : Set to 1 to enable interrupt on DONE condition. ++ * SMICS_TEEN : Tear effect mode enabled: Programmed transfers will wait ++ * for a TE trigger before writing. ++ * SMICS_PAD1 : Padding settings for external transfers. For writes: the ++ * number of bytes initially written to the TX fifo that ++ * SMICS_PAD0 : should be ignored. For reads: the number of bytes that will ++ * be read before the data, and should be dropped. ++ * SMICS_WRITE : Transfer direction: 1 = write to external device, 0 = read ++ * SMICS_CLEAR : Write 1 to clear the FIFOs. ++ * SMICS_START : Write 1 to start the programmed transfer. ++ * SMICS_ACTIVE : Reads as 1 when a programmed transfer is underway. ++ * SMICS_DONE : Reads as 1 when transfer finished. For RX, not set until ++ * FIFO emptied. ++ * SMICS_ENABLE : Set to 1 to enable the SMI peripheral, 0 to disable. ++ */ ++ ++#define SMICS_RXF (1 << 31) ++#define SMICS_TXE (1 << 30) ++#define SMICS_RXD (1 << 29) ++#define SMICS_TXD (1 << 28) ++#define SMICS_RXR (1 << 27) ++#define SMICS_TXW (1 << 26) ++#define SMICS_AFERR (1 << 25) ++#define SMICS_EDREQ (1 << 15) ++#define SMICS_PXLDAT (1 << 14) ++#define SMICS_SETERR (1 << 13) ++#define SMICS_PVMODE (1 << 12) ++#define SMICS_INTR (1 << 11) ++#define SMICS_INTT (1 << 10) ++#define SMICS_INTD (1 << 9) ++#define SMICS_TEEN (1 << 8) ++#define SMICS_PAD1 (1 << 7) ++#define SMICS_PAD0 (1 << 6) ++#define SMICS_WRITE (1 << 5) ++#define SMICS_CLEAR (1 << 4) ++#define SMICS_START (1 << 3) ++#define SMICS_ACTIVE (1 << 2) ++#define SMICS_DONE (1 << 1) ++#define SMICS_ENABLE (1 << 0) ++ ++/* Address register bits: */ ++ ++#define SMIA_DEVICE_MASK ((1 << 9) | (1 << 8)) ++#define SMIA_DEVICE_OFFS (8) ++#define SMIA_ADDR_MASK (0x3f) /* bits 5 -> 0 */ ++#define SMIA_ADDR_OFFS (0) ++ ++/* DMA control register bits: ++ * SMIDC_DMAEN : DMA enable: set 1: DMA requests will be issued. ++ * SMIDC_DMAP : DMA passthrough: when set to 0, top two data pins are used by ++ * SMI as usual. When set to 1, the top two pins are used for ++ * external DREQs: pin 16 read request, 17 write. ++ * SMIDC_PANIC* : Threshold at which DMA will panic during read/write. ++ * SMIDC_REQ* : Threshold at which DMA will generate a DREQ. ++ */ ++ ++#define SMIDC_DMAEN (1 << 28) ++#define SMIDC_DMAP (1 << 24) ++#define SMIDC_PANICR_MASK (0x3f << 18) ++#define SMIDC_PANICR_OFFS (18) ++#define SMIDC_PANICW_MASK (0x3f << 12) ++#define SMIDC_PANICW_OFFS (12) ++#define SMIDC_REQR_MASK (0x3f << 6) ++#define SMIDC_REQR_OFFS (6) ++#define SMIDC_REQW_MASK (0x3f) ++#define SMIDC_REQW_OFFS (0) ++ ++/* Device settings register bits: same for all 4 (or 3?) device register sets. ++ * Device read settings: ++ * SMIDSR_RWIDTH : Read transfer width. 00 = 8bit, 01 = 16bit, ++ * 10 = 18bit, 11 = 9bit. ++ * SMIDSR_RSETUP : Read setup time: number of core cycles between chip ++ * select/address and read strobe. Min 1, max 64. ++ * SMIDSR_MODE68 : 1 for System 68 mode (i.e. enable + direction pins, ++ * rather than OE + WE pin) ++ * SMIDSR_FSETUP : If set to 1, setup time only applies to first ++ * transfer after address change. ++ * SMIDSR_RHOLD : Number of core cycles between read strobe going ++ * inactive and CS/address going inactive. Min 1, max 64 ++ * SMIDSR_RPACEALL : When set to 1, this device's RPACE value will always ++ * be used for the next transaction, even if it is not ++ * to this device. ++ * SMIDSR_RPACE : Number of core cycles spent waiting between CS ++ * deassert and start of next transfer. Min 1, max 128 ++ * SMIDSR_RDREQ : 1 = use external DMA request on SD16 to pace reads ++ * from device. Must also set DMAP in SMICS. ++ * SMIDSR_RSTROBE : Number of cycles to assert the read strobe. ++ * min 1, max 128. ++ */ ++#define SMIDSR_RWIDTH_MASK ((1<<31)|(1<<30)) ++#define SMIDSR_RWIDTH_OFFS (30) ++#define SMIDSR_RSETUP_MASK (0x3f << 24) ++#define SMIDSR_RSETUP_OFFS (24) ++#define SMIDSR_MODE68 (1 << 23) ++#define SMIDSR_FSETUP (1 << 22) ++#define SMIDSR_RHOLD_MASK (0x3f << 16) ++#define SMIDSR_RHOLD_OFFS (16) ++#define SMIDSR_RPACEALL (1 << 15) ++#define SMIDSR_RPACE_MASK (0x7f << 8) ++#define SMIDSR_RPACE_OFFS (8) ++#define SMIDSR_RDREQ (1 << 7) ++#define SMIDSR_RSTROBE_MASK (0x7f) ++#define SMIDSR_RSTROBE_OFFS (0) ++ ++/* Device write settings: ++ * SMIDSW_WWIDTH : Write transfer width. 00 = 8bit, 01 = 16bit, ++ * 10= 18bit, 11 = 9bit. ++ * SMIDSW_WSETUP : Number of cycles between CS assert and write strobe. ++ * Min 1, max 64. ++ * SMIDSW_WFORMAT : Pixel format of input. 0 = 16bit RGB 565, ++ * 1 = 32bit RGBA 8888 ++ * SMIDSW_WSWAP : 1 = swap pixel data bits. (Use with SMICS_PXLDAT) ++ * SMIDSW_WHOLD : Time between WE deassert and CS deassert. 1 to 64 ++ * SMIDSW_WPACEALL : 1: this device's WPACE will be used for the next ++ * transfer, regardless of that transfer's device. ++ * SMIDSW_WPACE : Cycles between CS deassert and next CS assert. ++ * Min 1, max 128 ++ * SMIDSW_WDREQ : Use external DREQ on pin 17 to pace writes. DMAP must ++ * be set in SMICS. ++ * SMIDSW_WSTROBE : Number of cycles to assert the write strobe. ++ * Min 1, max 128 ++ */ ++#define SMIDSW_WWIDTH_MASK ((1<<31)|(1<<30)) ++#define SMIDSW_WWIDTH_OFFS (30) ++#define SMIDSW_WSETUP_MASK (0x3f << 24) ++#define SMIDSW_WSETUP_OFFS (24) ++#define SMIDSW_WFORMAT (1 << 23) ++#define SMIDSW_WSWAP (1 << 22) ++#define SMIDSW_WHOLD_MASK (0x3f << 16) ++#define SMIDSW_WHOLD_OFFS (16) ++#define SMIDSW_WPACEALL (1 << 15) ++#define SMIDSW_WPACE_MASK (0x7f << 8) ++#define SMIDSW_WPACE_OFFS (8) ++#define SMIDSW_WDREQ (1 << 7) ++#define SMIDSW_WSTROBE_MASK (0x7f) ++#define SMIDSW_WSTROBE_OFFS (0) ++ ++/* Direct transfer control + status register ++ * SMIDCS_WRITE : Direction of transfer: 1 -> write, 0 -> read ++ * SMIDCS_DONE : 1 when a transfer has finished. Write 1 to clear. ++ * SMIDCS_START : Write 1 to start a transfer, if one is not already underway. ++ * SMIDCE_ENABLE: Write 1 to enable SMI in direct mode. ++ */ ++ ++#define SMIDCS_WRITE (1 << 3) ++#define SMIDCS_DONE (1 << 2) ++#define SMIDCS_START (1 << 1) ++#define SMIDCS_ENABLE (1 << 0) ++ ++/* Direct transfer address register ++ * SMIDA_DEVICE : Indicates which of the device settings banks should be used. ++ * SMIDA_ADDR : The value to be asserted on the address pins. ++ */ ++ ++#define SMIDA_DEVICE_MASK ((1<<9)|(1<<8)) ++#define SMIDA_DEVICE_OFFS (8) ++#define SMIDA_ADDR_MASK (0x3f) ++#define SMIDA_ADDR_OFFS (0) ++ ++/* FIFO debug register ++ * SMIFD_FLVL : The high-tide mark of FIFO count during the most recent txfer ++ * SMIFD_FCNT : The current FIFO count. ++ */ ++#define SMIFD_FLVL_MASK (0x3f << 8) ++#define SMIFD_FLVL_OFFS (8) ++#define SMIFD_FCNT_MASK (0x3f) ++#define SMIFD_FCNT_OFFS (0) ++ ++#endif /* BCM2835_SMI_IMPLEMENTATION */ ++ ++#endif /* BCM2835_SMI_H */ + +From fda45e53b21c5f65e9e161b244b83026cb0fd6f6 Mon Sep 17 00:00:00 2001 +From: Luke Wren +Date: Sat, 5 Sep 2015 01:16:10 +0100 +Subject: [PATCH 183/192] Add SMI NAND driver + +Signed-off-by: Luke Wren +--- + .../bindings/mtd/brcm,bcm2835-smi-nand.txt | 42 ++++ + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/smi-nand-overlay.dts | 69 ++++++ + arch/arm/configs/bcm2709_defconfig | 7 + + arch/arm/configs/bcmrpi_defconfig | 7 + + drivers/mtd/nand/Kconfig | 7 + + drivers/mtd/nand/Makefile | 1 + + drivers/mtd/nand/bcm2835_smi_nand.c | 268 +++++++++++++++++++++ + 8 files changed, 402 insertions(+) + create mode 100644 Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt + create mode 100644 arch/arm/boot/dts/overlays/smi-nand-overlay.dts + create mode 100644 drivers/mtd/nand/bcm2835_smi_nand.c + +diff --git a/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt b/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt +new file mode 100644 +index 0000000..159544d +--- /dev/null ++++ b/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt +@@ -0,0 +1,42 @@ ++* BCM2835 SMI NAND flash ++ ++This driver is a shim between the BCM2835 SMI driver (SMI is a peripheral for ++talking to parallel register interfaces) and Linux's MTD layer. ++ ++Required properties: ++- compatible: "brcm,bcm2835-smi-nand" ++- status: "okay" ++ ++Optional properties: ++- partition@n, where n is an integer from a consecutive sequence starting at 0 ++ - Difficult to store partition table on NAND device - normally put it ++ in the source code, kernel bootparams, or device tree (the best way!) ++ - Sub-properties: ++ - label: the partition name, as shown by mtdinfo /dev/mtd* ++ - reg: the size and offset of this partition. ++ - (optional) read-only: an empty property flagging as read only ++ ++Example: ++ ++nand: flash@0 { ++ compatible = "brcm,bcm2835-smi-nand"; ++ status = "okay"; ++ ++ partition@0 { ++ label = "stage2"; ++ // 128k ++ reg = <0 0x20000>; ++ read-only; ++ }; ++ partition@1 { ++ label = "firmware"; ++ // 16M ++ reg = <0x20000 0x1000000>; ++ read-only; ++ }; ++ partition@2 { ++ label = "root"; ++ // 2G ++ reg = <0x1020000 0x80000000>; ++ }; ++}; +\ No newline at end of file +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index f8f2c034..dfd23a1 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -15,6 +15,7 @@ endif + dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/smi-nand-overlay.dts b/arch/arm/boot/dts/overlays/smi-nand-overlay.dts +new file mode 100644 +index 0000000..13ce0b7 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/smi-nand-overlay.dts +@@ -0,0 +1,69 @@ ++// Description: Overlay to enable NAND flash through ++// the secondary memory interface ++// Author: Luke Wren ++ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&smi>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smi_pins>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&soc>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ nand: flash@0 { ++ compatible = "brcm,bcm2835-smi-nand"; ++ smi_handle = <&smi>; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ status = "okay"; ++ ++ partition@0 { ++ label = "stage2"; ++ // 128k ++ reg = <0 0x20000>; ++ read-only; ++ }; ++ partition@1 { ++ label = "firmware"; ++ // 16M ++ reg = <0x20000 0x1000000>; ++ read-only; ++ }; ++ partition@2 { ++ label = "root"; ++ // 2G (will need to use 64 bit for >=4G) ++ reg = <0x1020000 0x80000000>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&gpio>; ++ __overlay__ { ++ smi_pins: smi_pins { ++ brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11 ++ 12 13 14 15>; ++ /* Alt 1: SMI */ ++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 ++ 5 5 5 5 5>; ++ /* /CS, /WE and /OE are pulled high, as they are ++ generally active low signals */ ++ brcm,pull = <2 2 2 2 2 2 2 2 0 0 0 0 0 0 0 0>; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 16a8354..c7671bf 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -392,6 +392,10 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_MTD=m ++CONFIG_MTD_BLOCK=m ++CONFIG_MTD_NAND=m ++CONFIG_MTD_UBI=m + CONFIG_ZRAM=m + CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y +@@ -1142,6 +1146,9 @@ CONFIG_CONFIGFS_FS=y + CONFIG_ECRYPT_FS=m + CONFIG_HFS_FS=m + CONFIG_HFSPLUS_FS=m ++CONFIG_JFFS2_FS=m ++CONFIG_JFFS2_SUMMARY=y ++CONFIG_UBIFS_FS=m + CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 7dd4fd4..75fa1d0 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -385,6 +385,10 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_MTD=m ++CONFIG_MTD_BLOCK=m ++CONFIG_MTD_NAND=m ++CONFIG_MTD_UBI=m + CONFIG_ZRAM=m + CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y +@@ -1135,6 +1139,9 @@ CONFIG_CONFIGFS_FS=y + CONFIG_ECRYPT_FS=m + CONFIG_HFS_FS=m + CONFIG_HFSPLUS_FS=m ++CONFIG_JFFS2_FS=m ++CONFIG_JFFS2_SUMMARY=y ++CONFIG_UBIFS_FS=m + CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y +diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig +index 5897d8d..82c4b4b 100644 +--- a/drivers/mtd/nand/Kconfig ++++ b/drivers/mtd/nand/Kconfig +@@ -41,6 +41,13 @@ config MTD_SM_COMMON + tristate + default n + ++config MTD_NAND_BCM2835_SMI ++ tristate "Use Broadcom's Secondary Memory Interface as a NAND controller (BCM283x)" ++ depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI && MTD_NAND ++ default m ++ help ++ Uses the BCM2835's SMI peripheral as a NAND controller. ++ + config MTD_NAND_DENALI + tristate "Support Denali NAND controller" + depends on HAS_DMA +diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile +index 582bbd05..f1393b0 100644 +--- a/drivers/mtd/nand/Makefile ++++ b/drivers/mtd/nand/Makefile +@@ -14,6 +14,7 @@ obj-$(CONFIG_MTD_NAND_DENALI) += denali.o + obj-$(CONFIG_MTD_NAND_DENALI_PCI) += denali_pci.o + obj-$(CONFIG_MTD_NAND_DENALI_DT) += denali_dt.o + obj-$(CONFIG_MTD_NAND_AU1550) += au1550nd.o ++obj-$(CONFIG_MTD_NAND_BCM2835_SMI) += bcm2835_smi_nand.o + obj-$(CONFIG_MTD_NAND_BF5XX) += bf5xx_nand.o + obj-$(CONFIG_MTD_NAND_S3C2410) += s3c2410.o + obj-$(CONFIG_MTD_NAND_DAVINCI) += davinci_nand.o +diff --git a/drivers/mtd/nand/bcm2835_smi_nand.c b/drivers/mtd/nand/bcm2835_smi_nand.c +new file mode 100644 +index 0000000..b747326 +--- /dev/null ++++ b/drivers/mtd/nand/bcm2835_smi_nand.c +@@ -0,0 +1,268 @@ ++/** ++ * NAND flash driver for Broadcom Secondary Memory Interface ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define DEVICE_NAME "bcm2835-smi-nand" ++#define DRIVER_NAME "smi-nand-bcm2835" ++ ++struct bcm2835_smi_nand_host { ++ struct bcm2835_smi_instance *smi_inst; ++ struct nand_chip nand_chip; ++ struct mtd_info mtd; ++ struct device *dev; ++}; ++ ++/**************************************************************************** ++* ++* NAND functionality implementation ++* ++****************************************************************************/ ++ ++#define SMI_NAND_CLE_PIN 0x01 ++#define SMI_NAND_ALE_PIN 0x02 ++ ++static inline void bcm2835_smi_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, ++ unsigned int ctrl) ++{ ++ uint32_t cmd32 = cmd; ++ uint32_t addr = ~(SMI_NAND_CLE_PIN | SMI_NAND_ALE_PIN); ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ if (ctrl & NAND_CLE) ++ addr |= SMI_NAND_CLE_PIN; ++ if (ctrl & NAND_ALE) ++ addr |= SMI_NAND_ALE_PIN; ++ /* Lower ALL the CS pins! */ ++ if (ctrl & NAND_NCE) ++ addr &= (SMI_NAND_CLE_PIN | SMI_NAND_ALE_PIN); ++ ++ bcm2835_smi_set_address(inst, addr); ++ ++ if (cmd != NAND_CMD_NONE) ++ bcm2835_smi_write_buf(inst, &cmd32, 1); ++} ++ ++static inline uint8_t bcm2835_smi_nand_read_byte(struct mtd_info *mtd) ++{ ++ uint8_t byte; ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_read_buf(inst, &byte, 1); ++ return byte; ++} ++ ++static inline void bcm2835_smi_nand_write_byte(struct mtd_info *mtd, ++ uint8_t byte) ++{ ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_write_buf(inst, &byte, 1); ++} ++ ++static inline void bcm2835_smi_nand_write_buf(struct mtd_info *mtd, ++ const uint8_t *buf, int len) ++{ ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_write_buf(inst, buf, len); ++} ++ ++static inline void bcm2835_smi_nand_read_buf(struct mtd_info *mtd, ++ uint8_t *buf, int len) ++{ ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_read_buf(inst, buf, len); ++} ++ ++/**************************************************************************** ++* ++* Probe and remove functions ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_nand_probe(struct platform_device *pdev) ++{ ++ struct bcm2835_smi_nand_host *host; ++ struct nand_chip *this; ++ struct mtd_info *mtd; ++ struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node, *smi_node; ++ struct mtd_part_parser_data ppdata; ++ struct smi_settings *smi_settings; ++ struct bcm2835_smi_instance *smi_inst; ++ int ret = -ENXIO; ++ ++ if (!node) { ++ dev_err(dev, "No device tree node supplied!"); ++ return -EINVAL; ++ } ++ ++ smi_node = of_parse_phandle(node, "smi_handle", 0); ++ ++ /* Request use of SMI peripheral: */ ++ smi_inst = bcm2835_smi_get(smi_node); ++ ++ if (!smi_inst) { ++ dev_err(dev, "Could not register with SMI."); ++ return -EPROBE_DEFER; ++ } ++ ++ /* Set SMI timing and bus width */ ++ ++ smi_settings = bcm2835_smi_get_settings_from_regs(smi_inst); ++ ++ smi_settings->data_width = SMI_WIDTH_8BIT; ++ smi_settings->read_setup_time = 2; ++ smi_settings->read_hold_time = 1; ++ smi_settings->read_pace_time = 1; ++ smi_settings->read_strobe_time = 3; ++ ++ smi_settings->write_setup_time = 2; ++ smi_settings->write_hold_time = 1; ++ smi_settings->write_pace_time = 1; ++ smi_settings->write_strobe_time = 3; ++ ++ bcm2835_smi_set_regs_from_settings(smi_inst); ++ ++ host = devm_kzalloc(dev, sizeof(struct bcm2835_smi_nand_host), ++ GFP_KERNEL); ++ if (!host) ++ return -ENOMEM; ++ ++ host->dev = dev; ++ host->smi_inst = smi_inst; ++ ++ platform_set_drvdata(pdev, host); ++ ++ /* Link the structures together */ ++ ++ this = &host->nand_chip; ++ mtd = &host->mtd; ++ mtd->priv = this; ++ mtd->owner = THIS_MODULE; ++ mtd->dev.parent = dev; ++ mtd->name = DRIVER_NAME; ++ ppdata.of_node = node; ++ ++ /* 20 us command delay time... */ ++ this->chip_delay = 20; ++ ++ this->priv = host; ++ this->cmd_ctrl = bcm2835_smi_nand_cmd_ctrl; ++ this->read_byte = bcm2835_smi_nand_read_byte; ++ this->write_byte = bcm2835_smi_nand_write_byte; ++ this->write_buf = bcm2835_smi_nand_write_buf; ++ this->read_buf = bcm2835_smi_nand_read_buf; ++ ++ this->ecc.mode = NAND_ECC_SOFT; ++ ++ /* Should never be accessed directly: */ ++ ++ this->IO_ADDR_R = (void *)0xdeadbeef; ++ this->IO_ADDR_W = (void *)0xdeadbeef; ++ ++ /* First scan to find the device and get the page size */ ++ ++ if (nand_scan_ident(mtd, 1, NULL)) ++ return -ENXIO; ++ ++ /* Second phase scan */ ++ ++ if (nand_scan_tail(mtd)) ++ return -ENXIO; ++ ++ ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0); ++ if (!ret) ++ return 0; ++ ++ nand_release(mtd); ++ return -EINVAL; ++} ++ ++static int bcm2835_smi_nand_remove(struct platform_device *pdev) ++{ ++ struct bcm2835_smi_nand_host *host = platform_get_drvdata(pdev); ++ ++ nand_release(&host->mtd); ++ ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* Register the driver with device tree ++* ++***************************************************************************/ ++ ++static const struct of_device_id bcm2835_smi_nand_of_match[] = { ++ {.compatible = "brcm,bcm2835-smi-nand",}, ++ { /* sentinel */ } ++}; ++ ++MODULE_DEVICE_TABLE(of, bcm2835_smi_nand_of_match); ++ ++static struct platform_driver bcm2835_smi_nand_driver = { ++ .probe = bcm2835_smi_nand_probe, ++ .remove = bcm2835_smi_nand_remove, ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = bcm2835_smi_nand_of_match, ++ }, ++}; ++ ++module_platform_driver(bcm2835_smi_nand_driver); ++ ++MODULE_ALIAS("platform:smi-nand-bcm2835"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION ++ ("Driver for NAND chips using Broadcom Secondary Memory Interface"); ++MODULE_AUTHOR("Luke Wren "); + +From 491ad52f804ba93327361dc6803d9599c78dee93 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 16 Sep 2015 17:28:41 +0100 +Subject: [PATCH 184/192] BCM270X_DT: Document SMI overlay + +--- + arch/arm/boot/dts/overlays/Makefile | 6 +++--- + arch/arm/boot/dts/overlays/README | 18 ++++++++++++++++++ + 2 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index dfd23a1..192bda7 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -13,9 +13,6 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) + endif + + dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb +-dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb +-dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb +-dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb +@@ -48,6 +45,9 @@ dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += sdio-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-dma-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 0aa5aa1..4ab4c695 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -530,6 +530,24 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework + debug Enable debug output (default off) + + ++Name: smi ++Info: Enables the Secondary Memory Interface peripheral. Uses GPIOs 2-25! ++Load: dtoverlay=smi ++Params: ++ ++ ++Name: smi-dev ++Info: Enables the userspace interface for the SMI driver ++Load: dtoverlay=smi-dev ++Params: ++ ++ ++Name: smi-nand ++Info: Enables access to NAND flash via the SMI interface ++Load: dtoverlay=smi-nand ++Params: ++ ++ + Name: spi-bcm2708 + Info: Selects the bcm2708-spi SPI driver + Load: dtoverlay=spi-bcm2708 + +From e18520ad8e421cf2592b9bf4e97e98ab3269884d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 17 Sep 2015 17:13:42 +0100 +Subject: [PATCH 185/192] dwc_otg: Force host mode to fix incorrect compute + module boards + +--- + drivers/usb/host/dwc_otg/dwc_otg_cil.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil.c b/drivers/usb/host/dwc_otg/dwc_otg_cil.c +index e40060f..beaa8b3 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_cil.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cil.c +@@ -192,7 +192,7 @@ dwc_otg_core_if_t *dwc_otg_cil_init(const uint32_t * reg_base_addr) + core_if->hptxfsiz.d32 = + DWC_READ_REG32(&core_if->core_global_regs->hptxfsiz); + gusbcfg.d32 = DWC_READ_REG32(&core_if->core_global_regs->gusbcfg); +- gusbcfg.b.force_host_mode = 0; ++ gusbcfg.b.force_host_mode = 1; + DWC_WRITE_REG32(&core_if->core_global_regs->gusbcfg, gusbcfg.d32); + dwc_mdelay(100); + } + +From 06fa410863c6bd9771bce0b2991f4faa17e0f223 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 15 Sep 2015 15:16:24 +0100 +Subject: [PATCH 186/192] config: Add CIFS_DFS_UPCALL, CIFS_ACL, CIFS_SMB2, + CIFS_FSCACHE + +--- + arch/arm/configs/bcm2709_defconfig | 4 ++++ + arch/arm/configs/bcmrpi_defconfig | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index c7671bf..60f8357 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1167,6 +1167,10 @@ CONFIG_CIFS_WEAK_PW_HASH=y + CONFIG_CIFS_UPCALL=y + CONFIG_CIFS_XATTR=y + CONFIG_CIFS_POSIX=y ++CONFIG_CIFS_ACL=y ++CONFIG_CIFS_DFS_UPCALL=y ++CONFIG_CIFS_SMB2=y ++CONFIG_CIFS_FSCACHE=y + CONFIG_9P_FS=m + CONFIG_9P_FS_POSIX_ACL=y + CONFIG_NLS_DEFAULT="utf8" +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 75fa1d0..8ebc8d5 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1160,6 +1160,10 @@ CONFIG_CIFS_WEAK_PW_HASH=y + CONFIG_CIFS_UPCALL=y + CONFIG_CIFS_XATTR=y + CONFIG_CIFS_POSIX=y ++CONFIG_CIFS_ACL=y ++CONFIG_CIFS_DFS_UPCALL=y ++CONFIG_CIFS_SMB2=y ++CONFIG_CIFS_FSCACHE=y + CONFIG_9P_FS=m + CONFIG_9P_FS_POSIX_ACL=y + CONFIG_NLS_DEFAULT="utf8" + +From 1ce910a90e75d8315b40ee57f2ab168822fc4e79 Mon Sep 17 00:00:00 2001 +From: David Lechner +Date: Mon, 14 Sep 2015 19:08:36 -0500 +Subject: [PATCH 187/192] Use dts-dirs feature for overlays. + +The kernel makefiles have a dts-dirs target that is for vendor subdirectories. + +Using this fixes the install_dtbs target, which previously did not install the overlays. +--- + arch/arm/boot/dts/Makefile | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 12de305..faf293f 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -15,6 +15,9 @@ endif + ifeq ($(CONFIG_ARCH_BCM2835),y) + RPI_DT_OVERLAYS=y + endif ++ifeq ($(RPI_DT_OVERLAYS),y) ++ dts-dirs += overlays ++endif + + dtb-$(CONFIG_ARCH_ALPINE) += \ + alpine-db.dtb +@@ -683,11 +686,10 @@ targets += $(dtb-y) + endif + + always := $(dtb-y) ++subdir-y := $(dts-dirs) + clean-files := *.dtb + + # Enable fixups to support overlays on BCM2708 platforms + ifeq ($(RPI_DT_OVERLAYS),y) + DTC_FLAGS ?= -@ + endif +- +-subdir-y += overlays + +From 44533175243d215fa6104520e1ab3df56e11ca2a Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Thu, 10 Sep 2015 09:32:14 +0000 +Subject: [PATCH 192/192] backport: spi: bcm2835: BUG: fix wrong use of + PAGE_MASK + +There is a bug in the alignment checking of transfers, +that results in DMA not being used for un-aligned +transfers that do not cross page-boundries, which is valid. + +This is due to a missconception of the meaning PAGE_MASK +when implementing that check originally - (PAGE_SIZE - 1) +should have been used instead. + +Also fixes a copy/paste error. + +Reported-by: +Signed-off-by: Martin Sperl +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +--- + drivers/spi/spi-bcm2835.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c +index b68991c..3835332 100644 +--- a/drivers/spi/spi-bcm2835.c ++++ b/drivers/spi/spi-bcm2835.c +@@ -386,14 +386,14 @@ static bool bcm2835_spi_can_dma(struct spi_master *master, + /* otherwise we only allow transfers within the same page + * to avoid wasting time on dma_mapping when it is not practical + */ +- if (((size_t)tfr->tx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) { ++ if (((size_t)tfr->tx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) { + dev_warn_once(&spi->dev, + "Unaligned spi tx-transfer bridging page\n"); + return false; + } +- if (((size_t)tfr->rx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) { ++ if (((size_t)tfr->rx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) { + dev_warn_once(&spi->dev, +- "Unaligned spi tx-transfer bridging page\n"); ++ "Unaligned spi rx-transfer bridging page\n"); + return false; + } + diff --git a/projects/RPi2/linux/linux.arm.conf b/projects/RPi2/linux/linux.arm.conf index 0434f25a8d..4515d35ac5 100644 --- a/projects/RPi2/linux/linux.arm.conf +++ b/projects/RPi2/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.1.6 Kernel Configuration +# Linux/arm 4.1.8 Kernel Configuration # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -992,6 +992,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096 # Misc devices # # CONFIG_SENSORS_LIS3LV02D is not set +CONFIG_BCM2835_SMI=m # CONFIG_AD525X_DPOT is not set # CONFIG_DUMMY_IRQ is not set # CONFIG_ICS932S401 is not set @@ -1439,6 +1440,7 @@ CONFIG_BCM2708_VCMEM=y CONFIG_BCM_VCIO=y CONFIG_BCM_VC_SM=y CONFIG_BCM2835_DEVGPIOMEM=m +CONFIG_BCM2835_SMI_DEV=m # CONFIG_XILLYBUS is not set # diff --git a/projects/RPi2/patches/linux/linux-01-RPi_support.patch b/projects/RPi2/patches/linux/linux-01-RPi_support.patch index 8bef3a7273..dfccd7cdaa 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 bc7d015ceaa36adc088675b0cdd3a7df05dfd9ed Mon Sep 17 00:00:00 2001 +From 609529b2f8865f8ad63cf2bc3be48a009c8e6f9d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 001/184] Main bcm2708/bcm2709 linux port +Subject: [PATCH 001/192] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124,7 +124,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 arch/arm/mach-bcm2709/vc_support.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 45df48b..bd9b2f3 100644 +index 19f4cc6..3ec1319 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -314,6 +314,42 @@ choice @@ -170,7 +170,7 @@ index 45df48b..bd9b2f3 100644 config ARCH_MULTIPLATFORM bool "Allow multiple platforms to be selected" depends on MMU -@@ -823,6 +859,9 @@ config ARCH_VIRT +@@ -824,6 +860,9 @@ config ARCH_VIRT # Kconfigs may be included either alphabetically (according to the # plat- suffix) or along side the corresponding mach-* source. # @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From 52397f48b515f888ad61b3bfb16fea22e5b83cad Mon Sep 17 00:00:00 2001 +From b13e8a3ef8cefa74548308f24bcdfc341aca70ee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 002/184] Add bcm2708_gpio driver +Subject: [PATCH 002/192] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7635,10 +7635,10 @@ index 0000000..fb69624 + +#endif -From 4e831e4d013b83364e41b463cf77c7acf4b454b3 Mon Sep 17 00:00:00 2001 +From 3b96584732e783101c33b3f93685fdb9c29f2f56 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/184] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 003/192] 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 7429b1db539759f0586f7e12c9332915477faf86 Mon Sep 17 00:00:00 2001 +From 1682b073c4ee65bbad4d422dc7e1e4335fb7520f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 004/184] Add dwc_otg driver +Subject: [PATCH 004/192] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69546,10 +69546,10 @@ index 0000000..cdc9963 +test_main(); +0; -From fbad81377923fa23914e15a8bab283b79293618f Mon Sep 17 00:00:00 2001 +From 5aad6d9cc7a07fab68fa8a809d1ef68227815b4e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 005/184] bcm2708 watchdog driver +Subject: [PATCH 005/192] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -69986,10 +69986,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 59bf8fe3c21caf11d56af182811b7f954c5ac1fb Mon Sep 17 00:00:00 2001 +From 0d7d0291c377904694bb5b28fee22c47c8842d88 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 006/184] bcm2708 framebuffer driver +Subject: [PATCH 006/192] 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 8533ef2eaa41d422d0fb87b60f6f3378b29a5b64 Mon Sep 17 00:00:00 2001 +From 8f7071a6b7d56dcacdb37d4dd106344b083275b6 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 007/184] dmaengine: Add support for BCM2708 +Subject: [PATCH 007/192] 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 d1f7e6f8f55a509533ac7468aa2bcb7608bfc1bb Mon Sep 17 00:00:00 2001 +From e07323745508bb0f376e4d459a54480fd3e31d44 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 008/184] MMC: added alternative MMC driver +Subject: [PATCH 008/192] 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 b66971c49c262d192b95882baa1d331f2863e6a8 Mon Sep 17 00:00:00 2001 +From dc41079232e59b916ca82d40e4e7206d4ab62aaa Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 009/184] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 009/192] 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 b6f82e619a4f4cb01f5916daea7e2dd9d3bbd743 Mon Sep 17 00:00:00 2001 +From 9377edd0d7701aaeeabb96cafd00c0716e34c571 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 010/184] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 010/192] 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 2a35225a6b978ed75d0ddb8137fbc63b8ef54a91 Mon Sep 17 00:00:00 2001 +From c19f082a656bb2d1d95030a5950c505ea48489b3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 011/184] bcm2708: alsa sound driver +Subject: [PATCH 011/192] 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 dfbd0d5b4ac667a5bba7dd9cfae952c1560e6e3a Mon Sep 17 00:00:00 2001 +From 1576308395a8e3ae6a6f8f9777929618ef427c89 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 012/184] bcm2708 vchiq driver +Subject: [PATCH 012/192] 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 272ac55666b71fbf9071d39d40a8fe9a7019b31e Mon Sep 17 00:00:00 2001 +From f17e4badf3975d0a1b7b1c20b524f2ef4a21571b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 013/184] vc_mem: Add vc_mem driver +Subject: [PATCH 013/192] 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 face5c60abadb506a565165e62898c31285daf6f Mon Sep 17 00:00:00 2001 +From 6f96fdd646856cefb12b44e5f08ece670f0181c2 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 014/184] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 014/192] 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 c359129bff7af01a9c405b65c23f337e0860fd4b Mon Sep 17 00:00:00 2001 +From 8ced4cc73e1a9ea263ac6fd724bd8959879b3da0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 015/184] Add hwrng (hardware random number generator) driver +Subject: [PATCH 015/192] 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 8999a27eaf7185af1543fbabc7b1125ed4d100d7 Mon Sep 17 00:00:00 2001 +From b669c0907ef1104dd084fea17c12650131eca5e5 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 016/184] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 016/192] 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 f11d95b418dbf7cbe56a115b38cf4f92ac3ad449 Mon Sep 17 00:00:00 2001 +From 557f263ec0d9a8c0ac86327ee6f82fb430321138 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 017/184] Add cpufreq driver +Subject: [PATCH 017/192] 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 64161aa8d6162ad77539322657cfbebb0501afe7 Mon Sep 17 00:00:00 2001 +From 9bcee345f285fc890d89c13ab810e00011c746e0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 018/184] Added hwmon/thermal driver for reporting core +Subject: [PATCH 018/192] 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 0829e2506b76ae45cd2b10cf87b9eb482038b1ea Mon Sep 17 00:00:00 2001 +From 400a88cfab32bbc52f75adf0383dc1b0894e7c3f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 019/184] Add Chris Boot's spi driver. +Subject: [PATCH 019/192] 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 1f7bcb7ddfa9650775d711f80f2e560bafaec33e Mon Sep 17 00:00:00 2001 +From d5c4f6a12d0593030ea5a934fb2c83f45298f412 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 020/184] Add Chris Boot's i2c driver +Subject: [PATCH 020/192] 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 0be494d1b3e0a66d2a0429097e31eb5f8bd8fa7a Mon Sep 17 00:00:00 2001 +From c3abf3ec4df5a8aaf4b5772ab69636734d87997b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 021/184] bcm2835: add v4l2 camera device +Subject: [PATCH 021/192] 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 e00c0af8fa949c4a76e6ff3b58c51fff83957933 Mon Sep 17 00:00:00 2001 +From 7b9ed5d65c02cce23d54b30c3e51ae404d2a7f48 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 022/184] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 022/192] 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 5a3fb4b186514770f97fc5f4a75cbd82ab12a762 Mon Sep 17 00:00:00 2001 +From 032973fcd78ccde1187013067269944722eaed55 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 023/184] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 023/192] 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 c368aad99d0aaf23d962631c7ede7c64cb7df083 Mon Sep 17 00:00:00 2001 +From 0f413a81d7dcf73f80a51b348cff64341dee7eb4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 024/184] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 024/192] 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 bc87493bc445a355c39d8a27aae1f23667fb7497 Mon Sep 17 00:00:00 2001 +From 33131a27961d07a2a612c9e8d3c7a1133e08f4e1 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 025/184] BCM2708: Add core Device Tree support +Subject: [PATCH 025/192] 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 1874c77dceab6b0805da4a330a46d2b2d6dc1afd Mon Sep 17 00:00:00 2001 +From 3ad1dddd91565b7f8246685072c5a7582c4c1030 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 026/184] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 026/192] 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 63c5fbdc6e2770243abb05c5ee78c74c80c8f9d3 Mon Sep 17 00:00:00 2001 +From cedcba17d7d61f257782b8a27d476207d9013699 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 029/184] Speed up console framebuffer imageblit function +Subject: [PATCH 029/192] 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 f870ef6cde2474f86c12f0bc4d0c3f773e5f85ef Mon Sep 17 00:00:00 2001 +From 1b61dd3ec17ab86f48f36710318c26bae5ee1acc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 030/184] Allow mac address to be set in smsc95xx +Subject: [PATCH 030/192] 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 ef1520a1e31048375d37fdd2bd5f5a1d199b0b3e Mon Sep 17 00:00:00 2001 +From 875b987168c33dbd9e3ffb259277d62a535970ab Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 031/184] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 031/192] 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 235c37961456b4c334680ed4c25c5a96ab00abda Mon Sep 17 00:00:00 2001 +From a7a7923fb977c1511cca7992d36d70c2c5b304d4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 033/184] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 033/192] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -122761,10 +122761,10 @@ Subject: [PATCH 033/184] config: Enable CONFIG_MEMCG, but leave it disabled 2 files changed, 24 insertions(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c -index e8a5491..2428355 100644 +index 4d65b66..dd258ff 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c -@@ -5393,6 +5393,29 @@ static int __init cgroup_disable(char *str) +@@ -5394,6 +5394,29 @@ static int __init cgroup_disable(char *str) } __setup("cgroup_disable=", cgroup_disable); @@ -122807,10 +122807,10 @@ index a04225d..a2ef8af 100644 /** -From 913dab2ce61697ccf445a510795adcf8a52c66da Mon Sep 17 00:00:00 2001 +From 0e5e372ca2240e9d70ae4c52662a49c3e16f7ba9 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 034/184] ASoC: Add support for BCM2708 +Subject: [PATCH 034/192] 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 e502c438fcd082ccf630a4d509588fda0905ac52 Mon Sep 17 00:00:00 2001 +From b2e44c6378b2db6d65be04c95ab877b91b8d9f1e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 035/184] ASoC: Add support for PCM5102A codec +Subject: [PATCH 035/192] 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 335030fdfe2302fa65d841e1b450d1b1741b11cf Mon Sep 17 00:00:00 2001 +From 7d8babed7b82e7e0288b21e4e7230cf6afe60c8d Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 036/184] BCM2708: Add I2S support to board file +Subject: [PATCH 036/192] 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 b7c72ec1c00a776d4e47eaf7e584c6fbdf99876c Mon Sep 17 00:00:00 2001 +From 5ac22a8bd8d72cdd0943c5253f69246a9f67d809 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 037/184] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 037/192] 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 74faf52e4cd92d9b20ee66c7139b4bbaa041b103 Mon Sep 17 00:00:00 2001 +From 20d20b334afca6fd5e71e036285f542a74375d16 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 038/184] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 038/192] 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 86435cf0c576f7cec47ee95722502c94fc61f181 Mon Sep 17 00:00:00 2001 +From cad54b0a9c94257e08529fc9d2e673543851e817 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 039/184] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 039/192] 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 2e2e77e106ca29d0bafa7e0b2d69375f472fcf15 Mon Sep 17 00:00:00 2001 +From 2efb8725682fe9c9997677ce267f795db66b220e Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 040/184] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 040/192] 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 a67cb15ccb58a4156c5a01e3fe0ad1e6b1a599aa Mon Sep 17 00:00:00 2001 +From 575c0192a56f9b78175226f441dac7f850d5570a Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 041/184] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 041/192] 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 1a9fc6343d77113ca453ee67243581a044a6a636 Mon Sep 17 00:00:00 2001 +From 7be683eb602b189605fd7fc7c0871ff69ba60319 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 042/184] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 042/192] 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 798b0abaaa050086db1269ef60e16f14f5d81f3a Mon Sep 17 00:00:00 2001 +From f65b15497d822d0ee124653988e1c1a77d7e1c39 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 043/184] ASoC: wm8804: Set idle_bias_off to false Idle bias +Subject: [PATCH 043/192] 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 4459cf8e37437ea463683b47c7ade1234d23576e Mon Sep 17 00:00:00 2001 +From a3a8607f21c913660338ecfeab3e8f09e6f46a7e Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 044/184] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 044/192] 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 51bee497636d074c655c3a43023de3bdf7d91acd Mon Sep 17 00:00:00 2001 +From a83f2448dd653557e1532d92b581c56e4dc471c2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 045/184] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 045/192] 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 bd40c05a978de0af53014919088688d79be28f0c Mon Sep 17 00:00:00 2001 +From 4678e30fad78c70aa9fb1489c2c585e74d308973 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 046/184] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 046/192] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125312,7 +125312,7 @@ Reduces overhead when using X 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c -index bfbe1be..a738b25 100644 +index eab5bd6..ca47de9 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -49,7 +49,7 @@ @@ -125340,10 +125340,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From bb5991f459cc07182237b7fce76f7badf8a05056 Mon Sep 17 00:00:00 2001 +From e00dd94e1cf5cf4f7c9c49271d624695acfe2e6a Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 047/184] Added support for HiFiBerry DAC+ +Subject: [PATCH 047/192] 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 6f59fa3f213e8f4c1e86c7bdb5b4621153e0968d Mon Sep 17 00:00:00 2001 +From 169fecad9b21239bfa863add3a28c2b28c0771d5 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 048/184] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 048/192] 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 450553c3330e2f5b190cbdb561a0140ba3831af6 Mon Sep 17 00:00:00 2001 +From bfaa96ef753c4e4b8bd6fa32d98dec3d29a27828 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 049/184] bcm2708: Allow option card devices to be configured +Subject: [PATCH 049/192] 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 11037211a5e9c0063842ab8e6c66bb27de44883c Mon Sep 17 00:00:00 2001 +From 004ae70ecd0ba75f44339b5ecd4e1741051ac6fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 050/184] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 050/192] 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 feb1cc5051d14d50af22f923fb5c4540792d8cd5 Mon Sep 17 00:00:00 2001 +From 9ec5f902ca815afa5ad61c4820b16e7bfe6e8497 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 051/184] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 051/192] 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 59e0365feeea7499c0c4d1ceff5ca41fed4ef1bc Mon Sep 17 00:00:00 2001 +From 48370c036cd319379aba97fb3b5b0bc5a476c34d Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 052/184] Update ds1307 driver for device-tree support +Subject: [PATCH 052/192] 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 482c49893aaac62f57fa40b6f9edebd408820b79 Mon Sep 17 00:00:00 2001 +From 55ac310dca9f3610902db3937ebf301b18b3f6ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 053/184] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 053/192] 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 9590c4e749ca71df812a8d9bd5eece4346f058fc Mon Sep 17 00:00:00 2001 +From 022a8e47780f3e5077d6b2710734b6603c44952b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 054/184] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 054/192] 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 a216c02ac5863401ae356b2acf713e65ec2219f1 Mon Sep 17 00:00:00 2001 +From 0583ae47b0a83f3e8ace8bf7c5d0da6de8efe28e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 055/184] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 055/192] 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 6cf3b859717b84122aa78dca571787c56733d6a8 Mon Sep 17 00:00:00 2001 +From 7c65cd90b282b3ed93ad70f855db6131db3a265d Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 056/184] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 056/192] 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 21f644aed21c73b9723a75a747f0faf42674131e Mon Sep 17 00:00:00 2001 +From a5aa225de371133af222f8cc2d64cca5845f245f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 057/184] pinctrl-bcm2835: bcm2835_gpio_direction_output must +Subject: [PATCH 057/192] 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 b8404e667d8682395bc3bfcc9110f8fcd73f8b81 Mon Sep 17 00:00:00 2001 +From 93528a99004c5273cfbacbd3efa439f919f35126 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 058/184] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 058/192] 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 68072d1daec97449eecf6955dc3430f6b8b8d60e Mon Sep 17 00:00:00 2001 +From 350a32f43794babaedca70c9686bf91a4d76ec79 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 059/184] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 059/192] 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 0d70a95f8103110191c97ca8d4d19407c707c1a5 Mon Sep 17 00:00:00 2001 +From 002d8609b029cb3240dfeb872587427d8ad7cfa8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 060/184] enc28j60: Add device tree compatible string and an +Subject: [PATCH 060/192] enc28j60: Add device tree compatible string and an overlay --- @@ -127687,10 +127687,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From a0f1d5f050c95dcde0eb503ce0612892c5f15ac7 Mon Sep 17 00:00:00 2001 +From 9a7f2623274c034d489d2bde8479050ab7e8c00a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 061/184] Add driver for rpi-proto +Subject: [PATCH 061/192] 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 818086dcc405fe6ead7fd0dbf15e8dc80d7a9286 Mon Sep 17 00:00:00 2001 +From 8372895d37d8430a0ebd1a6ecaac2e1c5a3b812d Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 062/184] Add Device Tree support for RPi-DAC. +Subject: [PATCH 062/192] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -127983,10 +127983,10 @@ index b4eaa44..afe1b41 100644 }; -From 00fc3532672cd1626453f564d33144b6845e86b8 Mon Sep 17 00:00:00 2001 +From 583994e31e3e463163484a0d4b5ca4fb6249c014 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 063/184] config: Add default configs +Subject: [PATCH 063/192] 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 2cb806ce2289c605ed171074fd9b72847bac0ec9 Mon Sep 17 00:00:00 2001 +From 1f4b5f09c42a0cffa2cb1edb046b40c3edf0876d Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 064/184] smsx95xx: fix crimes against truesize +Subject: [PATCH 064/192] 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 7fd399f9583dc5f88f15a6c19e3d91696d45ee6f Mon Sep 17 00:00:00 2001 +From 0b6139e6075209396b47af33509cec1a78cc9fcb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 065/184] smsc95xx: Disable turbo mode by default +Subject: [PATCH 065/192] 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 30ee1f5b151b91c2df6f0206add7e39e7f503ca0 Mon Sep 17 00:00:00 2001 +From 2334df3103a87c0f035438ae4965e9068439bdf3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 066/184] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 066/192] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130558,10 +130558,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From e16b2fa757a4ea5b1d11a870b905a774421a73fa Mon Sep 17 00:00:00 2001 +From b4681b0522340cc6b5437ed1c0599b8fd90a6f6a 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/184] bcm2835: bcm2835_defconfig +Subject: [PATCH 067/192] 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 b934d0040c1e6cfc9921a68c48f064d63f642055 Mon Sep 17 00:00:00 2001 +From 2a9988d49a89b6decd3594930753f2a26f65bd24 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/184] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 068/192] 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 418832e4df7a8218f1b09f72304c3c6cf2b51234 Mon Sep 17 00:00:00 2001 +From ae4cde25a8fb5a195befa3b731b5a66e324a23e2 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 069/184] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 069/192] 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 67f08cf63765e86662a352a8fb557d9e4faa97c3 Mon Sep 17 00:00:00 2001 +From d22a193b895ee5d962c1ca9af1da96f1b6390c04 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 070/184] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 070/192] 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 0efe8388b6c12c59896db65f13c181d95987fb7c Mon Sep 17 00:00:00 2001 +From 9873c8a1e6a5a473081af4cc91d7de1a05d1f7ca Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 071/184] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 071/192] 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 3a007cbf03ab806c16be135da50f9115425dff36 Mon Sep 17 00:00:00 2001 +From 428c15e2c44134e3965874ea636ff17b1f30647e 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/184] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 072/192] 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 56b59b9109aade207c33d7d9fece724d89edb0e7 Mon Sep 17 00:00:00 2001 +From 0dfd9537626392726c642be4349428c2c9ff30cc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 073/184] platform: Add force_core command line setting to boot +Subject: [PATCH 073/192] 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 3d3b2dae4acf7b1ef7e6e33dfa3421add05af5a2 Mon Sep 17 00:00:00 2001 +From bd76380d909bf43f5b0e58ba97cac4de78ed112f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 074/184] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 074/192] 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 59de23cd60ae9def330db5eb018cecd113c47525 Mon Sep 17 00:00:00 2001 +From 540db38d70932afa9082b471b8e0cef881ee9c93 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 19 Jun 2015 16:41:39 +0100 -Subject: [PATCH 075/184] BCM270X_DT: Document the i2s-mmap overlay +Subject: [PATCH 075/192] 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 529b778be78beef39f873c952e3e2f47b32cfffa Mon Sep 17 00:00:00 2001 +From 777f50046b3972b9adbb72dcf0e8a6222295d021 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 11:36:53 +0100 -Subject: [PATCH 076/184] bcm2835-sdhost: Improve error handling and recovery +Subject: [PATCH 076/192] 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 3f34f98a2708c28689e290b115b35d3714215069 Mon Sep 17 00:00:00 2001 +From 5129948c33f7747e199f35cfc4b800a14bb60874 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:46 -0700 -Subject: [PATCH 077/184] ARM: bcm2835: Add the Raspberry Pi firmware driver +Subject: [PATCH 077/192] 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 8cad06720e98df848427e6335567887f7040a6b8 Mon Sep 17 00:00:00 2001 +From db77f4974bcf574c2e8171752cb1e5c4aa57e367 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 22 Mar 2015 13:33:23 +0000 -Subject: [PATCH 078/184] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING +Subject: [PATCH 078/192] 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 2561ea7629a48c6876bcb049912b4145914189a7 Mon Sep 17 00:00:00 2001 +From 13fe405dc46bf5fbc787303ea266ac5f8968e367 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Mon, 22 Jun 2015 16:27:07 +0100 -Subject: [PATCH 079/184] Add rpi-ft5406 overlay Add rpi-ft5406 driver as +Subject: [PATCH 079/192] 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 087cdcdd8bd7d5c78758cdb5903230f58c9cc9a7 Mon Sep 17 00:00:00 2001 +From c2187533e3a163020c2fa5f93a307c8f009a9beb Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 23 Jun 2015 09:53:40 +0100 -Subject: [PATCH 080/184] Fix driver detection failure Check that the buffer +Subject: [PATCH 080/192] 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 7426319a8035baf3a38be576d1723dc1758d0ffe Mon Sep 17 00:00:00 2001 +From 14882c1c06a7fc116a527c56939d624a3ff31a93 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 13:24:01 +0100 -Subject: [PATCH 081/184] config: Enable 8250 serial port +Subject: [PATCH 081/192] 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 5eaee11e5c9f4b5ca5aa478d9d392a0c058fb4a9 Mon Sep 17 00:00:00 2001 +From 3a51951e18f4346bcf8297e5c14f8ff26d8c2ecb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Jun 2015 14:10:58 +0100 -Subject: [PATCH 082/184] config: Enable POWER_RESET_GPIO +Subject: [PATCH 082/192] 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 594144c43882d4f1cb7d00ec6ebb7d31b40a9c87 Mon Sep 17 00:00:00 2001 +From cfdf9d309e1e63e88876aa12a7e9579bebfae6de Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Jun 2015 17:37:38 +0100 -Subject: [PATCH 083/184] bcm2708-vcio: Remove restriction of only a single +Subject: [PATCH 083/192] 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 a352664afb3a70c30f22c5216fc6fe235aea3d51 Mon Sep 17 00:00:00 2001 +From 8d9f0a812d37b52a72dd33b082c5681efb72c539 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:39:19 +0100 -Subject: [PATCH 084/184] BCM270X_DT: Create a "core" clock, use it for SPI and +Subject: [PATCH 084/192] BCM270X_DT: Create a "core" clock, use it for SPI and sdhost --- @@ -136016,10 +136016,10 @@ index b408ab4..897204a 100644 }; }; -From 6ecb561eee8e124283009a79872823feb0ba06ec Mon Sep 17 00:00:00 2001 +From 7903edbb124634b2f953e9573d0a8995212a229f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 09:24:31 +0100 -Subject: [PATCH 085/184] BCM270X_DT: Add MCP7941X to i2c-rtc overlay +Subject: [PATCH 085/192] 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 8c0f34fca8a1509cc4f176d8e1e80f8a3678547f Mon Sep 17 00:00:00 2001 +From a0ec918bcbee508aa2225dcbe1661082cc84339c Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 24 Jun 2015 11:23:06 +0100 -Subject: [PATCH 086/184] dts/overlays: document DHT11 overlay +Subject: [PATCH 086/192] dts/overlays: document DHT11 overlay --- arch/arm/boot/dts/overlays/README | 8 ++++++++ @@ -136101,10 +136101,10 @@ index 425eb19..9406cf3 100644 -From 62a764969502398f404c9af8a01a9dc1c32ff498 Mon Sep 17 00:00:00 2001 +From cb0cf2cf18e4f6a672bcb7cd5c36d8b7c29fb4c3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 087/184] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 087/192] 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 aa912e8fc6344ed58355709e9e6722247c62fe7d Mon Sep 17 00:00:00 2001 +From 422f627455cd585e82251a4980509b58b8a24bdc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 17 Jun 2015 17:10:40 +0100 -Subject: [PATCH 088/184] BCM270x_DT: Default Compute Module i2c, i2s and spi +Subject: [PATCH 088/192] BCM270x_DT: Default Compute Module i2c, i2s and spi support --- @@ -136312,10 +136312,10 @@ index e82fcb2..af252bd 100755 }; }; -From c2c12dc7820ce23316226277a090372d285f8d71 Mon Sep 17 00:00:00 2001 +From 0b3f2c73d03ef9541e05e35ccd69b6731a1e44f1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:21:55 +0100 -Subject: [PATCH 089/184] BCM270X_DT: Sort nodes by bus address, and +Subject: [PATCH 089/192] BCM270X_DT: Sort nodes by bus address, and consolidate aliases --- @@ -136557,10 +136557,10 @@ index 24fa849..ccb9c31 100644 &gpio { -From d07909257b284c7e672acb3f2f3d10463d36efb4 Mon Sep 17 00:00:00 2001 +From 596aae25defa66a027ff755bfbaa4927b4069ea5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 22 Jun 2015 14:23:03 +0100 -Subject: [PATCH 090/184] i2c-bcm2708/BCM270X_DT: Add support for I2C2 +Subject: [PATCH 090/192] 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 279cb2310d229572ad89ca72c8827a6ee3eeca84 Mon Sep 17 00:00:00 2001 +From 6b690b074fef2a156777f6cfe4b039be5f750580 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 29 Jun 2015 12:14:02 +0100 -Subject: [PATCH 091/184] BCM270X_DT: Correct the lirc-rpi overlay +Subject: [PATCH 091/192] 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 728c39dd915bab8db237206508db61f2b54ef031 Mon Sep 17 00:00:00 2001 +From d4e71046e5780edf317b9f46339ac4806ea523ef Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 08:47:09 +0100 -Subject: [PATCH 092/184] bcm2835-sdhost: Further improve overclock back-off +Subject: [PATCH 092/192] 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 26e7a55831a1753aad02313f1773d9ce6d54da07 Mon Sep 17 00:00:00 2001 +From b6a92ce71483993af45e67ea6f36169a0f830345 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:28:59 +0100 -Subject: [PATCH 093/184] i2c-bcm2708: Increase timeouts to allow larger +Subject: [PATCH 093/192] 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 eeb5edf190d6e60cde7cbb207528711ada055049 Mon Sep 17 00:00:00 2001 +From 06903fef22d5a4aa1d01d074ace7525b08700de6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 10:33:52 +0100 -Subject: [PATCH 094/184] spi-bcm2708: Increase timeout from 150ms to 1s +Subject: [PATCH 094/192] 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 b30d2301dbba44c13d59a7db5bbccad352a404aa Mon Sep 17 00:00:00 2001 +From 407ee1c2c3e70a2aefc441582e65e84ed89fc157 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 09:59:38 +0100 -Subject: [PATCH 095/184] bcm2708-spi: Don't use static pin configuration with +Subject: [PATCH 095/192] 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 b4f34ab5ffaf7fe832808f3c07facaf8d7f23fbe Mon Sep 17 00:00:00 2001 +From 72fd701def8bc905196e699d8dc7920145920985 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 15 Jun 2015 10:10:59 +0100 -Subject: [PATCH 096/184] bcm2708-i2s: Don't use static pin configuration with +Subject: [PATCH 096/192] 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 1a19fc07ad65550b059cd965c31c6d7d97aaafc2 Mon Sep 17 00:00:00 2001 +From bb84c0676d675942bba9b1028e58558525aa1555 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 097/184] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 097/192] 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 4eee95c676b8cf9d802fbfa060eb4baadd6a6d7a Mon Sep 17 00:00:00 2001 +From 815181f5a9b19b78999ab59ddcf633e5a7109eaf Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 26 Jun 2015 08:50:11 +0100 -Subject: [PATCH 098/184] BCM270X_DT: Add overlay to enable uart1 +Subject: [PATCH 098/192] 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 e47856fbd3512bf40fb11102e4af60187eaf0d15 Mon Sep 17 00:00:00 2001 +From e61326ded97b93b02072eb60490487fb0082a819 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 099/184] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 099/192] 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 @@ -137408,10 +137408,10 @@ Signed-off-by: Phil Elwell 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 37875cf..55e81c2 100644 +index a506773..cf3190f 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c -@@ -359,6 +359,8 @@ static int bcm2835_spi_setup(struct spi_device *spi) +@@ -376,6 +376,8 @@ static int bcm2835_spi_setup(struct spi_device *spi) { int err; struct gpio_chip *chip; @@ -137420,7 +137420,7 @@ index 37875cf..55e81c2 100644 /* * sanity checking the native-chipselects */ -@@ -375,15 +377,42 @@ static int bcm2835_spi_setup(struct spi_device *spi) +@@ -392,15 +394,42 @@ static int bcm2835_spi_setup(struct spi_device *spi) "setup: only two native chip-selects are supported\n"); return -EINVAL; } @@ -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 7b9d931331e58ba7ffc0d41a9584d69e7984101c Mon Sep 17 00:00:00 2001 +From 716af635225849cc0b689e794e0ce5174d5a2218 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 17:37:38 +0100 -Subject: [PATCH 100/184] BCM270X_DT: Change pio_limit of sdhost driver to 1 +Subject: [PATCH 100/192] 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 b812ac14b8bcf869d1c83126317632f93e3ebc57 Mon Sep 17 00:00:00 2001 +From 11f29a2e4b02f7a16b50e4aec2491fbfee5048ae Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Jul 2015 12:51:52 +0100 -Subject: [PATCH 101/184] bcm2835-sdhost: Clear HBLC for PIO mode +Subject: [PATCH 101/192] 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 584bac220641fdc6f55b37941a4bd86e1d1cadac Mon Sep 17 00:00:00 2001 +From 9b4922dff10f1ca81cdc0d4074beeb7a3ad59850 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 12:21:01 +0100 -Subject: [PATCH 102/184] BCM270X_DT: I2S needs function Alt2 +Subject: [PATCH 102/192] 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 50930aa3c01d78a30f5950d425d4fa06a0ad5449 Mon Sep 17 00:00:00 2001 +From 50fd96b5cb84dc39a0f4c1901230338822b99000 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/184] configs: Incorporate v4.1 dependency changes +Subject: [PATCH 103/192] 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 40a66a1d7396779f489655073ab662e68ac027d7 Mon Sep 17 00:00:00 2001 +From bee1ff8246521c98c30d45c8b6b443ae10312d49 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Jul 2015 15:47:33 +0100 -Subject: [PATCH 104/184] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for +Subject: [PATCH 104/192] 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 bd98cb1eea3040c796e3c0242c26256fa20c0e8d Mon Sep 17 00:00:00 2001 +From 8309bfc0b04c5c60f2f65398d6691829dccb3841 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sat, 4 Jul 2015 19:55:23 +0100 -Subject: [PATCH 105/184] squash: BCM270X_DT: I2S only needs Alt2 on 28-31 +Subject: [PATCH 105/192] 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 51ed3e44eb5905dad99bc6ce5d30057cca2b32c2 Mon Sep 17 00:00:00 2001 +From 172aff3948311932c95b7a2e211df26638e3a07e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 8 Jul 2015 14:48:57 +0100 -Subject: [PATCH 106/184] vchiq_arm: Two cacheing fixes +Subject: [PATCH 106/192] 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 94a4064adc9600f4693325b4088cf2f6f0c53797 Mon Sep 17 00:00:00 2001 +From 607d6a667b81d12a1acd00e847769fcbae5fdc06 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 09:10:36 +0100 -Subject: [PATCH 107/184] BCM270X_DT: Overlay for the Fen Logic VGA666 board +Subject: [PATCH 107/192] 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 3111035f87ebd8678da3bf5dfd87391015b14bf7 Mon Sep 17 00:00:00 2001 +From 79d8c2b5d515b281a7edb90d131ffb5b40abe175 Mon Sep 17 00:00:00 2001 From: petit-miner Date: Fri, 10 Jul 2015 13:59:18 +0200 -Subject: [PATCH 108/184] Added support for 2 mcp2515 CAN Bus IC +Subject: [PATCH 108/192] 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 70652d81539d3b880e133879bca441066310aa5d Mon Sep 17 00:00:00 2001 +From 0e7e559458e0ac6cd98e31d22bdec517d4fbc5ac Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 5 May 2015 13:27:45 -0700 -Subject: [PATCH 109/184] mailbox: Enable BCM2835 mailbox support +Subject: [PATCH 109/192] 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 e243b106d74d3a80c384195435b6bbd8f3b33147 Mon Sep 17 00:00:00 2001 +From 895893101b62145fbbf31701d8d21b5ed1b388b5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 13 May 2015 13:10:32 -0700 -Subject: [PATCH 110/184] mailbox/bcm2835: Fix mailbox full detection. +Subject: [PATCH 110/192] 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 f8eebe64090e66b29cab0d3618f7146daf825019 Mon Sep 17 00:00:00 2001 +From 06b12346293fb13dc45bb7fcc7a66abd1358e881 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/184] mailbox: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 111/192] 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 fc2520b79dcb97dedc70c566306fd41002c97efe Mon Sep 17 00:00:00 2001 +From b1528cb117ad1b7245dd08e1169b3a6763ca2fc3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Jun 2015 13:11:47 -0700 -Subject: [PATCH 112/184] ARM: bcm2835: Add the firmware driver information to +Subject: [PATCH 112/192] 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 1a6e34aa4c859a11bb2f5e43bc0608694251c2a0 Mon Sep 17 00:00:00 2001 +From a598409cb3143b78a7b7d14af0013c8ef23360c2 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/184] firmware: bcm2835: Add missing property tags +Subject: [PATCH 113/192] 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 c35d120d66f971a95785b212d1377f738e2b7d48 Mon Sep 17 00:00:00 2001 +From 053d4a654a4c93a03673b75558096a71a96188b6 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/184] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 114/192] 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 37dfa9878eb3ccb0163f4b480e6082984d873d3d Mon Sep 17 00:00:00 2001 +From c283182d1690a0cc5425276386eaa259af64cc25 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/184] firmware: bcm2835: Support legacy mailbox API +Subject: [PATCH 115/192] 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 debef1395e6c969933b6315f4a32cd93767d635c Mon Sep 17 00:00:00 2001 +From 5f8125ffe004ab3feac693049b27054aa421f751 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/184] char: broadcom: Add vcio module +Subject: [PATCH 116/192] 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 f52d69c675780db112e1f93dc5ce66e0bd65b1a4 Mon Sep 17 00:00:00 2001 +From 1d303f5e9c3ec0dbc6f8486e334dd4c9943142c8 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/184] BCM270x: Switch to firmware driver +Subject: [PATCH 117/192] 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 995c9559c468fe0f7ecca47d2c9bb0d0932468a5 Mon Sep 17 00:00:00 2001 +From ce2bb52fb7a2cd00f96c4977e00fa0a6fd3993a6 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/184] bcm2835: Switch to firmware driver +Subject: [PATCH 118/192] bcm2835: Switch to firmware driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -139990,10 +139990,10 @@ index 47f2a6a..c284414 100644 CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y -From 01f938b9ed2c6b5b5ca16a070be8f2c87a4bc9e7 Mon Sep 17 00:00:00 2001 +From 8539add30257919e1313ca766c63f715b0f3337b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Jul 2015 13:25:31 +0100 -Subject: [PATCH 119/184] Merge pull request #1059 from pelwell/rpi-4.0.y +Subject: [PATCH 119/192] Merge pull request #1059 from pelwell/rpi-4.0.y w1_therm: Back-port locking improvements from 4.2-rc1 --- @@ -140188,10 +140188,10 @@ index 55eb86c..2f029e8 100644 { int err, i; -From ef190db16a7945f6549271142039b59c39f23c09 Mon Sep 17 00:00:00 2001 +From 42d3e810841a1f6e2076f30aa7dcb436f7dd6165 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 11:11:51 +0100 -Subject: [PATCH 120/184] vchiq_arm: Sort out the vmalloc case +Subject: [PATCH 120/192] vchiq_arm: Sort out the vmalloc case See: https://github.com/raspberrypi/linux/issues/1055 --- @@ -140230,10 +140230,10 @@ index 5edba23..56bff05 100644 *need_release = 0; /* do not try and release vmalloc pages */ } else { -From 944d0bd0ccd1a3bb898758ad10330705edfa66bf Mon Sep 17 00:00:00 2001 +From 368b0be0685c3adf312bc6db8a8f37e19ece8a57 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 121/184] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 121/192] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -140254,10 +140254,10 @@ index 92c909e..0535375 100644 }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 1f8e0c611125001bed1e1160e6618ae9a3c1ee3f Mon Sep 17 00:00:00 2001 +From 99061bbd52c6b72e32b65c8c1e7b8b315cf242eb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 122/184] Merge pull request #1043 from XECDesign/sense-4.0 +Subject: [PATCH 122/192] Merge pull request #1043 from XECDesign/sense-4.0 mfd: Add Raspberry Pi Sense HAT core driver --- @@ -141190,10 +141190,10 @@ index 0000000..56196dc + +#endif -From 442e27bafaa6a4cbc19783fc86a93b46805cabf6 Mon Sep 17 00:00:00 2001 +From fe5f9d51a9a506546fd4eed8c2df8ed86eba938e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jul 2015 13:46:08 +0100 -Subject: [PATCH 123/184] leds-gpio: Implement the brightness_get method +Subject: [PATCH 123/192] 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 @@ -141236,10 +141236,10 @@ index 3cfbd6a..4e4e132 100644 state = !!gpiod_get_value_cansleep(led_dat->gpiod); else -From e022aeef3a53e5f201d387daf974288e5c2df29f Mon Sep 17 00:00:00 2001 +From 660e3b8498bc3069ea74571f87a937ec0e9719e6 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Fri, 17 Jul 2015 09:50:55 +0200 -Subject: [PATCH 124/184] dmaengine: bcm2708-dmaengine: Fix memory leak when +Subject: [PATCH 124/192] dmaengine: bcm2708-dmaengine: Fix memory leak when stopping a running transfer --- @@ -141259,10 +141259,10 @@ index 987ed53..73c6c00 100644 bcm2835_dma_abort(c->chan_base); -From 5864bb774fb11a9bba6a1c10791894e393a18984 Mon Sep 17 00:00:00 2001 +From fbb4e35f5138fcf615dafdad6c560b285e30d30c Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:13 +0200 -Subject: [PATCH 125/184] BCM270X_DT: Fix I2S register map +Subject: [PATCH 125/192] BCM270X_DT: Fix I2S register map --- arch/arm/boot/dts/bcm2708_common.dtsi | 4 ++-- @@ -141284,10 +141284,10 @@ index 2dd25f7..728e14a 100644 //dmas = <&dma 2>, // <&dma 3>; -From 8ecc196ee828c68cadd7ade3759032a9947023ea Mon Sep 17 00:00:00 2001 +From 0e979a30a41088e31e6f364afb962a92dece990f Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 126/184] BCM2835_DT: Fix I2S register map +Subject: [PATCH 126/192] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -141341,10 +141341,10 @@ index 4a63704..1135120 100644 dmas = <&dma 2>, <&dma 3>; -From c8ab3e3f25614623c45c149ed34bc7475bc2ed83 Mon Sep 17 00:00:00 2001 +From 5f2426c4b7a9043f0390d1b4268ef4b4a83a2e3d Mon Sep 17 00:00:00 2001 From: David Frey Date: Tue, 14 Jul 2015 15:57:36 +0200 -Subject: [PATCH 127/184] config: Enable SHT drivers for raspberry pi +Subject: [PATCH 127/192] config: Enable SHT drivers for raspberry pi The SHT temperature and humidity sensors are often used in weather station projects. @@ -141386,10 +141386,10 @@ index b9b5bdf..7b24274 100644 CONFIG_THERMAL_BCM2835=y CONFIG_WATCHDOG=y -From ec4ad86b999bd1ba27313547604aa485664e6811 Mon Sep 17 00:00:00 2001 +From d0b201bfe2ca24227632e744c06e6612e4a52de4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:07:14 +0100 -Subject: [PATCH 128/184] BCM270X_DT: Correct typo in overlays/README +Subject: [PATCH 128/192] BCM270X_DT: Correct typo in overlays/README --- arch/arm/boot/dts/overlays/README | 2 +- @@ -141409,10 +141409,10 @@ index 8792f98..ed484ae 100644 i2c_arm Set to "on" to enable the ARM's i2c interface -From 25121f1d38b2cb6ce9997ea5207b315bc003ad37 Mon Sep 17 00:00:00 2001 +From a13b6ec4c9d17246df1a3cb7b4e4ce5f1c62ec32 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 10:53:26 +0100 -Subject: [PATCH 129/184] bcm2835-sdhost: Add the ERASE capability +Subject: [PATCH 129/192] bcm2835-sdhost: Add the ERASE capability See: https://github.com/raspberrypi/linux/issues/1076 --- @@ -141433,10 +141433,10 @@ index d65870a..57a6ad3 100644 spin_lock_init(&host->lock); -From fa3e5a05ccb81804a480e083b0dd835e538549c0 Mon Sep 17 00:00:00 2001 +From d619c2d2963b97eea071434b0ba4f2da88bb8e8d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 17:32:18 +0100 -Subject: [PATCH 130/184] bcm2835-sdhost: Ignore CRC7 for MMC CMD1 +Subject: [PATCH 130/192] 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 @@ -141500,10 +141500,10 @@ index 57a6ad3..84f645f 100644 if (host->cmd->flags & MMC_RSP_PRESENT) { -From 462a5895b5d87b1af87fd19a37f60e22d4b3c0df Mon Sep 17 00:00:00 2001 +From a308ade267a5e55f928258def08529290cf3c66e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jul 2015 14:48:21 +0100 -Subject: [PATCH 131/184] BCM270X_DT: Add unit address to gpio node name +Subject: [PATCH 131/192] BCM270X_DT: Add unit address to gpio node name --- arch/arm/boot/dts/bcm2708_common.dtsi | 2 +- @@ -141523,10 +141523,10 @@ index 728e14a..cb608df 100644 reg = <0x7e200000 0xb4>; interrupts = <2 17>, <2 18>; -From 758d28781ebe88535099cf422f601d9f144aab9e Mon Sep 17 00:00:00 2001 +From 2e0f8d9d1cb87fea0a6e0cb3c8736d067d594e15 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 24 Jul 2015 10:36:32 +0100 -Subject: [PATCH 132/184] BCM270X_DT: Use i2c_arm for rtc and bmp085 overlays +Subject: [PATCH 132/192] BCM270X_DT: Use i2c_arm for rtc and bmp085 overlays --- arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts | 2 +- @@ -141560,10 +141560,10 @@ index 7052c71..fed4bd8 100644 #address-cells = <1>; #size-cells = <0>; -From e735b74604fbb8c87e6203a81e07213dfd3ca6e0 Mon Sep 17 00:00:00 2001 +From db8ee9703f6dcf58156f1154468f761d4a2aaf27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 24 Jul 2015 12:11:31 +0100 -Subject: [PATCH 133/184] BCM2708_DT: CM dtparams for audio, watchdog and RNG +Subject: [PATCH 133/192] BCM2708_DT: CM dtparams for audio, watchdog and RNG --- arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 8 ++++---- @@ -141593,10 +141593,10 @@ index 34d4bc6..713e5a2 100644 }; }; -From 6163a630fcf3c74fd23fcc85862c5eebc870038d Mon Sep 17 00:00:00 2001 +From 5ee323dd815f9a10b56ccb79f9db3b03cb10a957 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/184] vchiq: Use firmware API +Subject: [PATCH 134/192] vchiq: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -141712,10 +141712,10 @@ index 31e2cba..e11c0e0 100644 err = vchiq_debugfs_init(); if (err != 0) -From eadb752bb2b90fc4181f512f697c131d32e4ab10 Mon Sep 17 00:00:00 2001 +From c8494b6d8b9c4a09d5802c5bd214b81abb24076e 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/184] thermal: bcm2835: Use firmware API +Subject: [PATCH 135/192] thermal: bcm2835: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -141998,10 +141998,10 @@ index 3bc80f1..c1d8f1b 100644 -module_platform_driver(bcm2835_thermal_driver); +MODULE_LICENSE("GPL"); -From cf6eb4ad6dad593e7e6c528c6d86b015acf91c0f Mon Sep 17 00:00:00 2001 +From 80165470382ba4f58bb1c15abfae346681424e73 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/184] cpufreq: bcm2835: Use firmware API +Subject: [PATCH 136/192] cpufreq: bcm2835: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142185,10 +142185,10 @@ index 6735da9..3eb9e93 100644 } -From 00a5e22858cc58fa8ac1eacd335d25287366ddae Mon Sep 17 00:00:00 2001 +From 0c0902575883dcd51e97c4aed67a9854688046d1 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/184] fbdev: bcm2708: Use firmware API +Subject: [PATCH 137/192] fbdev: bcm2708: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142604,10 +142604,10 @@ index f6ac7da..06a96d16 100644 free_irq(fb->dma_irq, fb); -From 1448227b91675fd216387c85bc2014ff4d135ac2 Mon Sep 17 00:00:00 2001 +From 1d8059b467a053294c0d09d77ed8b327bec980f8 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/184] bcm2835: Add firmware property to affected devices +Subject: [PATCH 138/192] bcm2835: Add firmware property to affected devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142688,10 +142688,10 @@ index 1135120..807264d 100644 clocks { -From 62c08611186b6182c89b69284adc6f4d00380903 Mon Sep 17 00:00:00 2001 +From 0b404a0bb7397a70fda6917887baf12d3d1738b8 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/184] rpi-ft5406: Use firmware API +Subject: [PATCH 139/192] rpi-ft5406: Use firmware API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142831,10 +142831,10 @@ index d41851d..c08817e 100644 ts->regs = (struct ft5406_regs *) ts->ts_base; -From 49911adc1dccdd0cd478596656d44276a49f410c Mon Sep 17 00:00:00 2001 +From 84575dc4faf5752d6799114c23523d21f79185b8 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/184] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 140/192] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -142966,10 +142966,10 @@ index 5916d6c..db66246 100644 } -From 9f64e381e13c68b6f872f1d07021cee23c15e5e7 Mon Sep 17 00:00:00 2001 +From 739f93ecccd3dab84ea01874f11c318342cabc6b 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/184] dwc_otg: Add ARCH_BCM2835 support +Subject: [PATCH 141/192] dwc_otg: Add ARCH_BCM2835 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143022,10 +143022,10 @@ index 0f4ebcd..5c83309 100644 } -From 5797256945e9317e7e1d440865b24cf4784601e4 Mon Sep 17 00:00:00 2001 +From 09a1b81021504e4ca5b46e5fdb93acd917c7f0b7 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/184] bcm2835: Use DWC_OTG +Subject: [PATCH 142/192] bcm2835: Use DWC_OTG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143068,10 +143068,10 @@ index c284414..14ef294 100644 CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From e33c0a84c836ef521623cc9172ee1620941242e3 Mon Sep 17 00:00:00 2001 +From 909ccc236c5073e67181862026b117415c5508ec 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/184] Fix RASPBERRYPI_FIRMWARE dependents +Subject: [PATCH 143/192] Fix RASPBERRYPI_FIRMWARE dependents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143152,10 +143152,10 @@ index 3444a4c..c073d55 100644 select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT -From 3e31ca6b4b24f3838db543f90f32f5f201ba4edf Mon Sep 17 00:00:00 2001 +From a8a882bd995ade6396b700e9fa50d52e14c2d773 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/184] vc_mem: Remove unnecessary include +Subject: [PATCH 144/192] vc_mem: Remove unnecessary include MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143178,10 +143178,10 @@ index fcde6b1..be64f23 100644 #define DRIVER_NAME "vc-mem" -From c9653a1d393f156fb669497270e6b5ca610b9583 Mon Sep 17 00:00:00 2001 +From 2915e91353123b4e57a9b7fea529e76733fa804d 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/184] configs: Remove BCM2708_MBOX +Subject: [PATCH 145/192] configs: Remove BCM2708_MBOX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143230,10 +143230,10 @@ index 7b24274..0859113 100644 # CONFIG_IOMMU_SUPPORT is not set CONFIG_EXTCON=m -From 1da6dd03e494645777be455c30eb1e04edaf4f88 Mon Sep 17 00:00:00 2001 +From edfc6b5684eb61ca1c7bb8d726a876b3510c7967 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/184] bcm2708-vcio: Remove module +Subject: [PATCH 146/192] bcm2708-vcio: Remove module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -143507,10 +143507,10 @@ index d3ea839..0000000 - -#endif -From 550768460da9842305ce282bb40810efedc40b5e Mon Sep 17 00:00:00 2001 +From b50a77017186456a6eac9f5879527011ad639735 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/184] Revert "firmware: bcm2835: Support legacy mailbox +Subject: [PATCH 147/192] Revert "firmware: bcm2835: Support legacy mailbox API" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -143601,10 +143601,10 @@ index 9a08cf1..d3933af 100644 u32 tag, void *data, size_t len); int rpi_firmware_property_list(struct rpi_firmware *fw, -From dc27d5306bfcdfcaf7b2cf8866a5219b061a66ae Mon Sep 17 00:00:00 2001 +From 6a216d3e39f569440e30e699ce0c937d5bb18f8f Mon Sep 17 00:00:00 2001 From: Jonathan Bell Date: Tue, 30 Jun 2015 12:35:39 +0100 -Subject: [PATCH 148/184] pinctrl: bcm2835: Clear the event latch register when +Subject: [PATCH 148/192] 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 @@ -143641,10 +143641,10 @@ index 986779a..61ef002 100644 spin_unlock_irqrestore(&pc->irq_lock[bank], flags); } -From 27cf775aec3d94076f68a6e736ff493bed02609a Mon Sep 17 00:00:00 2001 +From c3ad1ccc7ba3cef5f36c1919b05c9cb1b43c7d41 Mon Sep 17 00:00:00 2001 From: P33M Date: Tue, 4 Aug 2015 01:15:20 +0100 -Subject: [PATCH 149/184] dwc_otg: fiq_fsm: Make high-speed isochronous strided +Subject: [PATCH 149/192] dwc_otg: fiq_fsm: Make high-speed isochronous strided transfers work properly Certain low-bandwidth high-speed USB devices (specialist audio devices, @@ -143784,10 +143784,10 @@ index 3f71f29..8db3dfc 100644 case FIQ_PER_SPLIT_LS_ABORTED: -From 5fe40f23b4f9dd3bb73240c0be25e1d4a410db51 Mon Sep 17 00:00:00 2001 +From d713fd8a8c98886c4965393cb35351eec484ecb6 Mon Sep 17 00:00:00 2001 From: Uli Middelberg Date: Wed, 17 Jun 2015 10:36:56 +0200 -Subject: [PATCH 150/184] added basic docker support +Subject: [PATCH 150/192] added basic docker support --- arch/arm/configs/bcm2709_defconfig | 3 +++ @@ -143851,10 +143851,10 @@ index 0859113..06e7529 100644 CONFIG_FSCACHE_STATS=y CONFIG_FSCACHE_HISTOGRAM=y -From 6abbb618faa7ffbba07dec6282ce0da316b47db6 Mon Sep 17 00:00:00 2001 +From d0f6349262824e0c97c3348203fe38c98acb559b Mon Sep 17 00:00:00 2001 From: Garrett Date: Thu, 2 Jul 2015 19:32:04 -0500 -Subject: [PATCH 151/184] bcm2835 camera planar/packed stride length +Subject: [PATCH 151/192] bcm2835 camera planar/packed stride length Added a field to the mmal_fmt struct used to compute the bytes per line when using a particular format. This results in the correct stride being @@ -144026,10 +144026,10 @@ index 35698c8..15788a1 100644 /* buffer for one video frame */ -From 00ecf7f3a41aa6c99de8e6bf805ed77b08ade2a8 Mon Sep 17 00:00:00 2001 +From c6586122744f32872b423f29cd60f80bc9ec817c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 28 Jul 2015 13:55:04 +0100 -Subject: [PATCH 153/184] config: Add Mediatek mt7601u wifi driver +Subject: [PATCH 153/192] config: Add Mediatek mt7601u wifi driver --- arch/arm/configs/bcm2709_defconfig | 2 ++ @@ -144063,10 +144063,10 @@ index 06e7529..a377222 100644 CONFIG_ZD1211RW=m CONFIG_MWIFIEX=m -From 85b039dbb91fdbb7e053db80f31c401c3e259b3f Mon Sep 17 00:00:00 2001 +From 9ade15dfc93bc7c34e6e48a4dc061eaa70f54b41 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 17 Aug 2015 10:49:44 +0100 -Subject: [PATCH 154/184] BCM270X_DT: Add pwm and pwm-2chan overlays +Subject: [PATCH 154/192] BCM270X_DT: Add pwm and pwm-2chan overlays From the README entries: Legal pin,function combinations for each channel: @@ -144332,10 +144332,10 @@ index b1541f4..90591a9 100644 PWM framework driver for BCM2835 controller (Raspberry Pi) -From 3700467492f28ee6e89677b0b5cd5752b68c649e Mon Sep 17 00:00:00 2001 +From c2159b8e35da50b260b86b2752c369262f03e5aa Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 22 Apr 2015 07:33:03 +0000 -Subject: [PATCH 155/184] spi: bcm2835: fallback to interrupt for polling +Subject: [PATCH 155/192] spi: bcm2835: fallback to interrupt for polling timeouts exceeding 2 jiffies The polling mode of the driver is designed for transfers that run @@ -144359,7 +144359,7 @@ Signed-off-by: Mark Brown 1 file changed, 50 insertions(+), 37 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 55e81c2..fc3c6f7 100644 +index cf3190f..505a993 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -69,7 +69,7 @@ @@ -144471,10 +144471,10 @@ index 55e81c2..fc3c6f7 100644 struct spi_device *spi, struct spi_transfer *tfr) -From d9065397f6cf6d9de56617eb1b912b94ae1a165d Mon Sep 17 00:00:00 2001 +From ca6851997c29f85cb1965470c3c649cb04c83e04 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Sun, 10 May 2015 20:47:28 +0000 -Subject: [PATCH 156/184] spi: bcm2835: enable dma modes for transfers meeting +Subject: [PATCH 156/192] spi: bcm2835: enable dma modes for transfers meeting certain conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -144514,7 +144514,7 @@ Signed-off-by: Mark Brown 1 file changed, 301 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index fc3c6f7..7af0fb2 100644 +index 505a993..27fb5b0 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -23,15 +23,18 @@ @@ -144850,7 +144850,7 @@ index fc3c6f7..7af0fb2 100644 static int bcm2835_spi_transfer_one_poll(struct spi_master *master, struct spi_device *spi, struct spi_transfer *tfr, -@@ -301,12 +582,26 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, +@@ -299,6 +580,11 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, return bcm2835_spi_transfer_one_poll(master, spi, tfr, cs, xfer_time_us); @@ -144862,6 +144862,7 @@ index fc3c6f7..7af0fb2 100644 return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); } +@@ -324,6 +610,15 @@ static int bcm2835_spi_prepare_message(struct spi_master *master, static void bcm2835_spi_handle_err(struct spi_master *master, struct spi_message *msg) { @@ -144877,7 +144878,7 @@ index fc3c6f7..7af0fb2 100644 bcm2835_spi_reset_hw(master); } -@@ -505,6 +800,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) +@@ -523,6 +818,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) goto out_clk_disable; } @@ -144886,7 +144887,7 @@ index fc3c6f7..7af0fb2 100644 /* initialise the hardware with the default polarities */ bcm2835_wr(bs, BCM2835_SPI_CS, BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); -@@ -535,6 +832,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev) +@@ -553,6 +850,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev) clk_disable_unprepare(bs->clk); @@ -144896,10 +144897,10 @@ index fc3c6f7..7af0fb2 100644 } -From af1af3ed6685094dce51d4effb48bac98b624218 Mon Sep 17 00:00:00 2001 +From 37c41ffd1ccf9a9051b461f2786a988a1d4f9f5f Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 12 May 2015 10:32:08 +0000 -Subject: [PATCH 157/184] spi: bcm2835: fix kbuild compile warnings/errors and +Subject: [PATCH 157/192] spi: bcm2835: fix kbuild compile warnings/errors and a typo fixes several warnings/error emmitted by the kbuild system: @@ -144920,7 +144921,7 @@ Signed-off-by: Mark Brown 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 7af0fb2..9d80cea 100644 +index 27fb5b0..52aaf2d 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -20,6 +20,7 @@ @@ -144955,10 +144956,10 @@ index 7af0fb2..9d80cea 100644 "Unaligned spi tx-transfer bridging page\n"); return false; -From c4805d933460e5d8a588d19725d2e06123000c3c Mon Sep 17 00:00:00 2001 +From 4fa31f69b2b08f8b6b57ac80664efd3bfb510532 Mon Sep 17 00:00:00 2001 From: kbuild test robot Date: Tue, 12 May 2015 19:43:59 +0800 -Subject: [PATCH 158/184] spi: bcm2835: bcm2835_dma_release() can be static +Subject: [PATCH 158/192] spi: bcm2835: bcm2835_dma_release() can be static Signed-off-by: Fengguang Wu Signed-off-by: Mark Brown @@ -144968,7 +144969,7 @@ Signed-off-by: Mark Brown 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 9d80cea..338babc3 100644 +index 52aaf2d..bad36c5 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -401,7 +401,7 @@ static bool bcm2835_spi_can_dma(struct spi_master *master, @@ -144990,42 +144991,10 @@ index 9d80cea..338babc3 100644 struct dma_slave_config slave_config; const __be32 *addr; -From 3c527383f8c3db402df3888563ceca7f6c62577d Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Wed, 22 Jul 2015 07:43:28 +0000 -Subject: [PATCH 159/184] spi: bcm2835: fixed compile issues due to embedded - comments... replaced with #if to avoid issues in the future. - -Signed-off-by: Martin Sperl ---- - drivers/spi/spi-bcm2835.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 338babc3..cedffe1 100644 ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -592,6 +592,7 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); - } - -+#if 0 - static void bcm2835_spi_handle_err(struct spi_master *master, - struct spi_message *msg) - { -@@ -606,6 +607,7 @@ static void bcm2835_spi_handle_err(struct spi_master *master, - /* and reset */ - bcm2835_spi_reset_hw(master); - } -+#endif - - static void bcm2835_spi_set_cs(struct spi_device *spi, bool gpio_level) - { - -From e3c37563e0a076f89ca9bd275d1c5280565f4ae4 Mon Sep 17 00:00:00 2001 +From 0281d714a74623919046ec0a7871cbfffaa129fa Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 22 Jul 2015 08:34:41 +0000 -Subject: [PATCH 160/184] dt-overlay to enable dma for spi driver +Subject: [PATCH 159/192] dt-overlay to enable dma for spi driver Signed-off-by: Martin Sperl --- @@ -145073,10 +145042,10 @@ index 0000000..266cf9d + }; + }; -From 8223ed39177c0808f6cb2a5fd118f44a4ce064a5 Mon Sep 17 00:00:00 2001 +From 5601dff1bc5af8007e0cd741e6314777dcc26950 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 22 Jul 2015 12:41:54 +0000 -Subject: [PATCH 161/184] dt: overlay: added documentation of spi-dma overlay +Subject: [PATCH 160/192] dt: overlay: added documentation of spi-dma overlay Signed-off-by: Martin Sperl --- @@ -145101,10 +145070,10 @@ index 1cd2140..bda8c14 100644 Info: 3.5" Color TFT Display by www.tinylcd.com Options: Touch, RTC, keypad -From 9b8ee6a132dd2d50bd3a0b7c0b1b842e3071873f Mon Sep 17 00:00:00 2001 +From a0f798dc95f6e80210560c2f539531ac8cd727ba Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Mon, 17 Aug 2015 18:06:16 +0100 -Subject: [PATCH 162/184] rpisense-fb: add low-light mode and gamma control +Subject: [PATCH 161/192] rpisense-fb: add low-light mode and gamma control --- drivers/video/fbdev/rpisense-fb.c | 68 +++++++++++++++++++++++++++++--- @@ -145247,40 +145216,10 @@ index c4c1118..2ba95d7 100644 struct rpisense; -From 54e2f2668f26d946d63f2df69c5fd7229c502a6c Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 18 Aug 2015 11:50:03 +0100 -Subject: [PATCH 163/184] spi: bcm2835: Fix buld error from previous commit - ---- - drivers/spi/spi-bcm2835.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index cedffe1..338babc3 100644 ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -592,7 +592,6 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); - } - --#if 0 - static void bcm2835_spi_handle_err(struct spi_master *master, - struct spi_message *msg) - { -@@ -607,7 +606,6 @@ static void bcm2835_spi_handle_err(struct spi_master *master, - /* and reset */ - bcm2835_spi_reset_hw(master); - } --#endif - - static void bcm2835_spi_set_cs(struct spi_device *spi, bool gpio_level) - { - -From ca899b2fc8a14bcb38849829add2d1734e30ca15 Mon Sep 17 00:00:00 2001 +From ae6f1c2b07d663f56d74520dd112e70fb0a345da Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 19 Aug 2015 11:38:10 +0100 -Subject: [PATCH 164/184] BCM270X_DT: README - add note on indentation +Subject: [PATCH 162/192] BCM270X_DT: README - add note on indentation --- arch/arm/boot/dts/overlays/README | 4 ++++ @@ -145302,10 +145241,10 @@ index bda8c14..ac9c427 100644 Info: Configures the base Raspberry Pi hardware Load: -From 6fd290129689eee60f1e88e938e5259eddd63e9f Mon Sep 17 00:00:00 2001 +From 533a2295a023e63baa2da24f7ceb464f50481e86 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 20 Aug 2015 13:50:18 +0100 -Subject: [PATCH 165/184] bcm2708-dmaengine: Use more DMA channels (but not 12) +Subject: [PATCH 163/192] bcm2708-dmaengine: Use more DMA channels (but not 12) 1) Only the bcm2708_fb drivers uses the legacy DMA API, and it requires a BULK-capable channel, so all other types @@ -145479,10 +145418,10 @@ index 73c6c00..85ce18b 100644 rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); if (rc) -From 1f776a2e469043351fc5f16bc3ea95dd8d926983 Mon Sep 17 00:00:00 2001 +From 2565daf4ff590ea8bfff9242920b7046855f8c14 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 166/184] RaspiDAC3 support +Subject: [PATCH 164/192] RaspiDAC3 support Signed-off-by: Jan Grulich --- @@ -145833,10 +145772,10 @@ index 0000000..fddaeec +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From e61d2a8fffe86ed426657867e092b062fff16ea3 Mon Sep 17 00:00:00 2001 +From e07994e21afdb0689e92735f5251fb32c781dead Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Jul 2015 16:55:02 +0100 -Subject: [PATCH 167/184] config: Add SND_SOC_ADAU1701 module +Subject: [PATCH 165/192] config: Add SND_SOC_ADAU1701 module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -145868,98 +145807,10 @@ index 8979f23..7dd4fd4 100644 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From 06f3b6b14af2f66eff3787372ca44210368eb7d7 Mon Sep 17 00:00:00 2001 -From: Martin Sperl -Date: Tue, 28 Jul 2015 14:03:12 +0000 -Subject: [PATCH 168/184] spi: bcm2835: set up spi-mode before asserting - cs-gpio - -When using reverse polarity for clock (spi-cpol) on a device -the clock line gets altered after chip-select has been asserted -resulting in an additional clock beat, which confuses hardware. - -This did not show when using native-CS, as the same register -is used to control cs as well as polarity, so the changes came -into effect at the same time. Unfortunately this is not true -with gpio-cs. - -To avoid this situation this patch moves the setup of polarity -(spi-cpol and spi-cpha) outside of the chip-select into -prepare_message, which is run prior to asserting chip-select. - -Also fixes resetting 3-wire mode after use of rx-mode, so that -a 3-Wire sequence TX, RX, TX works as well (right now it runs -TX, RX, RX instead) - -Reported-by: Noralf Tronnes -Signed-off-by: Martin Sperl -Signed-off-by: Mark Brown -Cc: stable@vger.kernel.org -(cherry picked from commit acace73df2c1913a526c1b41e4741a4a6704c863) ---- - drivers/spi/spi-bcm2835.c | 28 +++++++++++++++++++++++----- - 1 file changed, 23 insertions(+), 5 deletions(-) - -diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c -index 338babc3..bad36c5 100644 ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -553,13 +553,11 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - spi_used_hz = cdiv ? (clk_hz / cdiv) : (clk_hz / 65536); - bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv); - -- /* handle all the modes */ -+ /* handle all the 3-wire mode */ - if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf)) - cs |= BCM2835_SPI_CS_REN; -- if (spi->mode & SPI_CPOL) -- cs |= BCM2835_SPI_CS_CPOL; -- if (spi->mode & SPI_CPHA) -- cs |= BCM2835_SPI_CS_CPHA; -+ else -+ cs &= ~BCM2835_SPI_CS_REN; - - /* for gpio_cs set dummy CS so that no HW-CS get changed - * we can not run this in bcm2835_spi_set_cs, as it does -@@ -592,6 +590,25 @@ static int bcm2835_spi_transfer_one(struct spi_master *master, - return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs); - } - -+static int bcm2835_spi_prepare_message(struct spi_master *master, -+ struct spi_message *msg) -+{ -+ struct spi_device *spi = msg->spi; -+ struct bcm2835_spi *bs = spi_master_get_devdata(master); -+ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); -+ -+ cs &= ~(BCM2835_SPI_CS_CPOL | BCM2835_SPI_CS_CPHA); -+ -+ if (spi->mode & SPI_CPOL) -+ cs |= BCM2835_SPI_CS_CPOL; -+ if (spi->mode & SPI_CPHA) -+ cs |= BCM2835_SPI_CS_CPHA; -+ -+ bcm2835_wr(bs, BCM2835_SPI_CS, cs); -+ -+ return 0; -+} -+ - static void bcm2835_spi_handle_err(struct spi_master *master, - struct spi_message *msg) - { -@@ -768,6 +785,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev) - master->set_cs = bcm2835_spi_set_cs; - master->transfer_one = bcm2835_spi_transfer_one; - master->handle_err = bcm2835_spi_handle_err; -+ master->prepare_message = bcm2835_spi_prepare_message; - master->dev.of_node = pdev->dev.of_node; - - bs = spi_master_get_devdata(master); - -From e1b011f11feef5876783d9ff54997f9cda9e72a7 Mon Sep 17 00:00:00 2001 +From 8673fd1c1cdf2581b8e55049850feb454641c833 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Wed, 29 Jul 2015 07:34:10 +0000 -Subject: [PATCH 169/184] spi: bcm2835: fix overflow in calculation of transfer +Subject: [PATCH 166/192] spi: bcm2835: fix overflow in calculation of transfer time This resulted in the use of polling mode when other approaches @@ -146012,10 +145863,10 @@ index bad36c5..b68991c 100644 /* for short requests run polling*/ if (xfer_time_us <= BCM2835_SPI_POLLING_LIMIT_US) -From ced8015657540a68001e6bdb303beb3d1754e4c5 Mon Sep 17 00:00:00 2001 +From 0cbc260f0615a727118bf81a0a96f1a943ea1496 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Sep 2015 15:14:50 +0100 -Subject: [PATCH 170/184] BCM270X_DT: Add SDIO overlay +Subject: [PATCH 167/192] BCM270X_DT: Add SDIO overlay Enable SDIO from MMC interface via GPIOs 22-27. Includes the sdhost overlay to free up the MMC interface. @@ -146100,10 +145951,10 @@ index 0000000..164f269 + }; +}; -From b0ff905303eb5003d3725a7fbfa90d3077d1301b Mon Sep 17 00:00:00 2001 +From 744173c6e20ce4939cb0df99b5a413badcc9b0be Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 171/184] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 168/192] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren --- @@ -146448,10 +146299,10 @@ index 0000000..0085e13 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From f329efa3857552cca450f708fbd7ff1527a20358 Mon Sep 17 00:00:00 2001 +From b716c7690be5dca3f1329bd3bcb6468033bb1696 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:02:34 +0100 -Subject: [PATCH 172/184] tpa6130a2: Add headphone switch control +Subject: [PATCH 169/192] tpa6130a2: Add headphone switch control Signed-off-by: Jan Grulich --- @@ -146542,10 +146393,10 @@ index 6fac9e0..f60ebe1c 100644 /* -From 64c5d9fb0fc6960c05d92ec1131d54db465646db Mon Sep 17 00:00:00 2001 +From dec2eb1d6594733d66a5f2da0e2e59f21e8cad90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 11 Jul 2015 18:48:10 +0200 -Subject: [PATCH 173/184] staging: fbtft: Add reset to fbtft_init_display_dt() +Subject: [PATCH 170/192] staging: fbtft: Add reset to fbtft_init_display_dt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146577,10 +146428,10 @@ index 53b748b..4f165d3 100644 if (val & FBTFT_OF_INIT_CMD) { val &= 0xFFFF; -From 9ee9c962e47ace5c2d3114eba2e9fb7f9380a70c Mon Sep 17 00:00:00 2001 +From 0f1a50554d440626c49ba73113efbad679ca1fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 19 Jul 2015 18:57:06 +0200 -Subject: [PATCH 174/184] BCM270X_DT: mz61581: Revert to spi-bcm2708 +Subject: [PATCH 171/192] BCM270X_DT: mz61581: Revert to spi-bcm2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146611,10 +146462,10 @@ index c06fe12..f674a66 100644 spidev@0{ -From 20833437fd604e72ba715d51c11dd6de8b8fef52 Mon Sep 17 00:00:00 2001 +From 7dabf2942aac0a52a59e429e992b58d1213c7024 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 1 Sep 2015 16:52:34 +0000 -Subject: [PATCH 175/184] vchiq: fix NULL pointer dereference when closing +Subject: [PATCH 172/192] vchiq: fix NULL pointer dereference when closing driver The following code run as root will cause a null pointer dereference oops: @@ -146714,10 +146565,10 @@ index f4d0b66..4055d4b 100644 struct semaphore pop; struct semaphore push; -From 020b3c7b02ec04895dc499d6b6851e7d4ba92194 Mon Sep 17 00:00:00 2001 +From b6bed67a8b4fc7ac46554940153aa550f889f08c Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:13:17 -0400 -Subject: [PATCH 176/184] bcm2708_fb: remove redundant code as detected by +Subject: [PATCH 173/192] bcm2708_fb: remove redundant code as detected by static analysis static analysis with cppcheck detected some redundant code which @@ -146749,10 +146600,10 @@ index 06a96d16..fed0672 100644 } -From 51a3a0c4969b782510a42c15d326b622174f171b Mon Sep 17 00:00:00 2001 +From 3277fb201dd353df15a0181afefbc966d1700b93 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:15:38 -0400 -Subject: [PATCH 177/184] bcm2708_fb: remove unnecessary initialization of +Subject: [PATCH 174/192] bcm2708_fb: remove unnecessary initialization of result static analysis by cppcheck detected an unnecessary initialization @@ -146781,10 +146632,10 @@ index fed0672..0f62d76 100644 info->var.yoffset = var->yoffset; result = bcm2708_fb_set_par(info); -From 1026505b7b2b504815271e8808a47ebb41fe48c3 Mon Sep 17 00:00:00 2001 +From 3a8c5b7cd8499af8718d1628646c1704a38b6cec Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:27:36 -0400 -Subject: [PATCH 178/184] vcsm: increment res_stats MAP_FAIL stats before we +Subject: [PATCH 175/192] vcsm: increment res_stats MAP_FAIL stats before we potentially release the resource resource can be kfree'd when the reference count is zero, so we should @@ -146818,10 +146669,10 @@ index 0bfb42e..b62a3b2 100644 } -From 005154797ae52cc7503554b8d35d156eefded00c Mon Sep 17 00:00:00 2001 +From f4b1401d6a2bd32b7bdc1ea5bba49ba45923f34e Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:33:39 -0400 -Subject: [PATCH 179/184] bcm2835: camera: check for scene not being found +Subject: [PATCH 176/192] bcm2835: camera: check for scene not being found static analysis by cppcheck detected some potential NULL pointer dereference issues: @@ -146852,10 +146703,10 @@ index 3017b94..f9f903f 100644 return -EINVAL; -From 7b88107888ad75072ded5ec3dfbf0cb6ceec1c1d Mon Sep 17 00:00:00 2001 +From e9bce32c5fdf1d19f499fd4a3acb518df5eddda8 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 2 Sep 2015 07:47:51 -0400 -Subject: [PATCH 180/184] bcm2835: memcpy port data to m rather than rmsg +Subject: [PATCH 177/192] bcm2835: memcpy port data to m rather than rmsg static analysis by cppcheck detected a memcpy to rmsg which is not actually initialized at that point. The memcpy should be copying @@ -146880,10 +146731,10 @@ index 76f249e..7813225 100644 ret = send_synchronous_mmal_msg(instance, &m, -From 2a8c0025020895de45b699178d09d7dd3987f694 Mon Sep 17 00:00:00 2001 +From f37b5b98c6a1dd867fe57768347d4099c8c350a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 13 Sep 2015 15:54:28 +0200 -Subject: [PATCH 181/184] Revert "BCM270X_DT: mz61581: Revert to spi-bcm2708" +Subject: [PATCH 178/192] Revert "BCM270X_DT: mz61581: Revert to spi-bcm2708" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146911,10 +146762,10 @@ index f674a66..c06fe12 100644 spidev@0{ -From 5893b0be5d790411fbc1afc16b92bc9be59144a1 Mon Sep 17 00:00:00 2001 +From 6d02ee2eb00466bcf8485620de01dc4f0354a901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 13 Sep 2015 17:17:14 +0200 -Subject: [PATCH 182/184] BCM270X_DT: mz61581: Set txbuflen to 32k +Subject: [PATCH 179/192] BCM270X_DT: mz61581: Set txbuflen to 32k MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -146963,10 +146814,10 @@ index c06fe12..9242a6e 100644 xohms = <&mz61581_ts>,"ti,x-plate-ohms;0"; }; -From a137fc76d8742832a01e087f05115811727d310b Mon Sep 17 00:00:00 2001 +From 3e8afc7044965075d11b52c83ad0bd0584bbd15d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 11 Sep 2015 12:10:15 +0100 -Subject: [PATCH 183/184] bcm2835-mmc: Don't overwrite MMC capabilities from DT +Subject: [PATCH 180/192] bcm2835-mmc: Don't overwrite MMC capabilities from DT --- drivers/mmc/host/bcm2835-mmc.c | 5 +++-- @@ -146989,10 +146840,10 @@ index b7c4883..164bfad 100644 host->flags = SDHCI_AUTO_CMD23; -From 48dfdc5eae4b84ea43ae068a733313a5f557a70b Mon Sep 17 00:00:00 2001 +From fbe9273f1ed02f6d6e0c01add59bc9d85a2748a8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 11 Sep 2015 09:14:01 +0100 -Subject: [PATCH 184/184] BCM270X_DT: Use fixed-factor-clock for uart1 +Subject: [PATCH 181/192] BCM270X_DT: Use fixed-factor-clock for uart1 The BCM2835 mini-UART is almost 8250-compatible, but there is a factor-of-two difference in the clock divider for the baud rate. @@ -147091,3 +146942,2793 @@ index f25f0a2..76d44a2 100644 i2s = <&i2s>,"status"; spi = <&spi0>,"status"; i2c0 = <&i2c0>,"status"; + +From 08152264f7564a5bd77ae9a58a34309f6ab9a5fc Mon Sep 17 00:00:00 2001 +From: Luke Wren +Date: Sat, 5 Sep 2015 01:14:45 +0100 +Subject: [PATCH 182/192] Add SMI driver + +Signed-off-by: Luke Wren +--- + .../bindings/misc/brcm,bcm2835-smi-dev.txt | 17 + + .../devicetree/bindings/misc/brcm,bcm2835-smi.txt | 48 + + arch/arm/boot/dts/bcm2708_common.dtsi | 11 + + arch/arm/boot/dts/overlays/Makefile | 2 + + arch/arm/boot/dts/overlays/smi-dev-overlay.dts | 18 + + arch/arm/boot/dts/overlays/smi-overlay.dts | 37 + + drivers/char/broadcom/Kconfig | 8 + + drivers/char/broadcom/Makefile | 2 +- + drivers/char/broadcom/bcm2835_smi_dev.c | 402 +++++++++ + drivers/misc/Kconfig | 8 + + drivers/misc/Makefile | 1 + + drivers/misc/bcm2835_smi.c | 985 +++++++++++++++++++++ + include/linux/broadcom/bcm2835_smi.h | 391 ++++++++ + 13 files changed, 1929 insertions(+), 1 deletion(-) + create mode 100644 Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt + create mode 100644 Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt + create mode 100644 arch/arm/boot/dts/overlays/smi-dev-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/smi-overlay.dts + create mode 100644 drivers/char/broadcom/bcm2835_smi_dev.c + create mode 100644 drivers/misc/bcm2835_smi.c + create mode 100644 include/linux/broadcom/bcm2835_smi.h + +diff --git a/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt +new file mode 100644 +index 0000000..68cc8eb +--- /dev/null ++++ b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt +@@ -0,0 +1,17 @@ ++* Broadcom BCM2835 SMI character device driver. ++ ++SMI or secondary memory interface is a peripheral specific to certain Broadcom ++SOCs, and is helpful for talking to things like parallel-interface displays ++and NAND flashes (in fact, most things with a parallel register interface). ++ ++This driver adds a character device which provides a user-space interface to ++an instance of the SMI driver. ++ ++Required properties: ++- compatible: "brcm,bcm2835-smi-dev" ++- smi_handle: a phandle to the smi node. ++ ++Optional properties: ++- None. ++ ++ +diff --git a/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt +new file mode 100644 +index 0000000..b76dc69 +--- /dev/null ++++ b/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt +@@ -0,0 +1,48 @@ ++* Broadcom BCM2835 SMI driver. ++ ++SMI or secondary memory interface is a peripheral specific to certain Broadcom ++SOCs, and is helpful for talking to things like parallel-interface displays ++and NAND flashes (in fact, most things with a parallel register interface). ++ ++Required properties: ++- compatible: "brcm,bcm2835-smi" ++- reg: Should contain location and length of SMI registers and SMI clkman regs ++- interrupts: *the* SMI interrupt. ++- pinctrl-names: should be "default". ++- pinctrl-0: the phandle of the gpio pin node. ++- brcm,smi-clock-source: the clock source for clkman ++- brcm,smi-clock-divisor: the integer clock divisor for clkman ++- dmas: the dma controller phandle and the DREQ number (4 on a 2835) ++- dma-names: the name used by the driver to request its channel. ++ Should be "rx-tx". ++ ++Optional properties: ++- None. ++ ++Examples: ++ ++8 data pin configuration: ++ ++smi: smi@7e600000 { ++ compatible = "brcm,bcm2835-smi"; ++ reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>; ++ interrupts = <2 16>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smi_pins>; ++ brcm,smi-clock-source = <6>; ++ brcm,smi-clock-divisor = <4>; ++ dmas = <&dma 4>; ++ dma-names = "rx-tx"; ++ ++ status = "okay"; ++}; ++ ++smi_pins: smi_pins { ++ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12 13 14 15>; ++ /* Alt 1: SMI */ ++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 5 5 5>; ++ /* /CS, /WE and /OE are pulled high, as they are ++ generally active low signals */ ++ brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0>; ++}; ++ +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index 4d1cc67..933711e 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -205,6 +205,17 @@ + status = "disabled"; + }; + ++ smi: smi@7e600000 { ++ compatible = "brcm,bcm2835-smi"; ++ reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>; ++ interrupts = <2 16>; ++ brcm,smi-clock-source = <6>; ++ brcm,smi-clock-divisor = <4>; ++ dmas = <&dma 4>; ++ dma-names = "rx-tx"; ++ status = "disabled"; ++ }; ++ + usb: usb@7e980000 { + compatible = "brcm,bcm2708-usb"; + reg = <0x7e980000 0x10000>, +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 43e9c96..f8f2c034 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -13,6 +13,8 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) + endif + + dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/smi-dev-overlay.dts b/arch/arm/boot/dts/overlays/smi-dev-overlay.dts +new file mode 100644 +index 0000000..b610d82 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/smi-dev-overlay.dts +@@ -0,0 +1,18 @@ ++// Description: Overlay to enable character device interface for SMI. ++// Author: Luke Wren ++ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ fragment@0 { ++ target = <&soc>; ++ __overlay__ { ++ smi_dev { ++ compatible = "brcm,bcm2835-smi-dev"; ++ smi_handle = <&smi>; ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlays/smi-overlay.dts b/arch/arm/boot/dts/overlays/smi-overlay.dts +new file mode 100644 +index 0000000..095f52c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/smi-overlay.dts +@@ -0,0 +1,37 @@ ++// Description: Overlay to enable the secondary memory interface peripheral ++// Author: Luke Wren ++ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&smi>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smi_pins>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ smi_pins: smi_pins { ++ /* Don't configure the top two address bits, as ++ these are already used as ID_SD and ID_SC */ ++ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12 13 14 15 ++ 16 17 18 19 20 21 22 23 24 25>; ++ /* Alt 0: SMI */ ++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ++ 5 5 5 5 5 5 5 5 5>; ++ /* /CS, /WE and /OE are pulled high, as they are ++ generally active low signals */ ++ brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 ++ 0 0 0 0 0 0 0>; ++ }; ++ }; ++ }; ++}; +diff --git a/drivers/char/broadcom/Kconfig b/drivers/char/broadcom/Kconfig +index bc2eb1e..5489f19 100644 +--- a/drivers/char/broadcom/Kconfig ++++ b/drivers/char/broadcom/Kconfig +@@ -47,3 +47,11 @@ config BCM2835_DEVGPIOMEM + on the 2835. Calling mmap(/dev/gpiomem) will map the GPIO + register page to the user's pointer. + ++config BCM2835_SMI_DEV ++ tristate "Character device driver for BCM2835 Secondary Memory Interface" ++ depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI ++ default m ++ help ++ This driver provides a character device interface (ioctl + read/write) to ++ Broadcom's Secondary Memory interface. The low-level functionality is provided ++ by the SMI driver itself. +diff --git a/drivers/char/broadcom/Makefile b/drivers/char/broadcom/Makefile +index 664e2c4..14775c9 100644 +--- a/drivers/char/broadcom/Makefile ++++ b/drivers/char/broadcom/Makefile +@@ -4,4 +4,4 @@ obj-$(CONFIG_BCM_VCIO) += vcio.o + obj-$(CONFIG_BCM_VC_SM) += vc_sm/ + + obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o +- ++obj-$(CONFIG_BCM2835_SMI_DEV) += bcm2835_smi_dev.o +diff --git a/drivers/char/broadcom/bcm2835_smi_dev.c b/drivers/char/broadcom/bcm2835_smi_dev.c +new file mode 100644 +index 0000000..d6efd92 +--- /dev/null ++++ b/drivers/char/broadcom/bcm2835_smi_dev.c +@@ -0,0 +1,402 @@ ++/** ++ * Character device driver for Broadcom Secondary Memory Interface ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define DEVICE_NAME "bcm2835-smi-dev" ++#define DRIVER_NAME "smi-dev-bcm2835" ++#define DEVICE_MINOR 0 ++ ++static struct cdev bcm2835_smi_cdev; ++static dev_t bcm2835_smi_devid; ++static struct class *bcm2835_smi_class; ++static struct device *bcm2835_smi_dev; ++ ++struct bcm2835_smi_dev_instance { ++ struct device *dev; ++}; ++ ++static struct bcm2835_smi_instance *smi_inst; ++static struct bcm2835_smi_dev_instance *inst; ++ ++static const char *const ioctl_names[] = { ++ "READ_SETTINGS", ++ "WRITE_SETTINGS", ++ "ADDRESS" ++}; ++ ++/**************************************************************************** ++* ++* SMI chardev file ops ++* ++***************************************************************************/ ++static long ++bcm2835_smi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ long ret = 0; ++ ++ dev_info(inst->dev, "serving ioctl..."); ++ ++ switch (cmd) { ++ case BCM2835_SMI_IOC_GET_SETTINGS:{ ++ struct smi_settings *settings; ++ ++ dev_info(inst->dev, "Reading SMI settings to user."); ++ settings = bcm2835_smi_get_settings_from_regs(smi_inst); ++ if (copy_to_user((void *)arg, settings, ++ sizeof(struct smi_settings))) ++ dev_err(inst->dev, "settings copy failed."); ++ break; ++ } ++ case BCM2835_SMI_IOC_WRITE_SETTINGS:{ ++ struct smi_settings *settings; ++ ++ dev_info(inst->dev, "Setting user's SMI settings."); ++ settings = bcm2835_smi_get_settings_from_regs(smi_inst); ++ if (copy_from_user(settings, (void *)arg, ++ sizeof(struct smi_settings))) ++ dev_err(inst->dev, "settings copy failed."); ++ else ++ bcm2835_smi_set_regs_from_settings(smi_inst); ++ break; ++ } ++ case BCM2835_SMI_IOC_ADDRESS: ++ dev_info(inst->dev, "SMI address set: 0x%02x", (int)arg); ++ bcm2835_smi_set_address(smi_inst, arg); ++ break; ++ default: ++ dev_err(inst->dev, "invalid ioctl cmd: %d", cmd); ++ ret = -ENOTTY; ++ break; ++ } ++ ++ return ret; ++} ++ ++static int bcm2835_smi_open(struct inode *inode, struct file *file) ++{ ++ int dev = iminor(inode); ++ ++ dev_dbg(inst->dev, "SMI device opened."); ++ ++ if (dev != DEVICE_MINOR) { ++ dev_err(inst->dev, ++ "bcm2835_smi_release: Unknown minor device: %d", ++ dev); ++ return -ENXIO; ++ } ++ ++ return 0; ++} ++ ++static int bcm2835_smi_release(struct inode *inode, struct file *file) ++{ ++ int dev = iminor(inode); ++ ++ if (dev != DEVICE_MINOR) { ++ dev_err(inst->dev, ++ "bcm2835_smi_release: Unknown minor device %d", dev); ++ return -ENXIO; ++ } ++ ++ return 0; ++} ++ ++static ssize_t dma_bounce_user( ++ enum dma_transfer_direction dma_dir, ++ char __user *user_ptr, ++ size_t count, ++ struct bcm2835_smi_bounce_info *bounce) ++{ ++ int chunk_size; ++ int chunk_no = 0; ++ int count_left = count; ++ ++ while (count_left) { ++ int rv; ++ void *buf; ++ ++ /* Wait for current chunk to complete: */ ++ if (down_timeout(&bounce->callback_sem, ++ msecs_to_jiffies(1000))) { ++ dev_err(inst->dev, "DMA bounce timed out"); ++ count -= (count_left); ++ break; ++ } ++ ++ if (bounce->callback_sem.count >= DMA_BOUNCE_BUFFER_COUNT - 1) ++ dev_err(inst->dev, "WARNING: Ring buffer overflow"); ++ chunk_size = count_left > DMA_BOUNCE_BUFFER_SIZE ? ++ DMA_BOUNCE_BUFFER_SIZE : count_left; ++ buf = bounce->buffer[chunk_no % DMA_BOUNCE_BUFFER_COUNT]; ++ if (dma_dir == DMA_DEV_TO_MEM) ++ rv = copy_to_user(user_ptr, buf, chunk_size); ++ else ++ rv = copy_from_user(buf, user_ptr, chunk_size); ++ if (rv) ++ dev_err(inst->dev, "copy_*_user() failed!: %d", rv); ++ user_ptr += chunk_size; ++ count_left -= chunk_size; ++ chunk_no++; ++ } ++ return count; ++} ++ ++static ssize_t ++bcm2835_read_file(struct file *f, char __user *user_ptr, ++ size_t count, loff_t *offs) ++{ ++ int odd_bytes; ++ ++ dev_dbg(inst->dev, "User reading %d bytes from SMI.", count); ++ /* We don't want to DMA a number of bytes % 4 != 0 (32 bit FIFO) */ ++ if (count > DMA_THRESHOLD_BYTES) ++ odd_bytes = count & 0x3; ++ else ++ odd_bytes = count; ++ count -= odd_bytes; ++ if (count) { ++ struct bcm2835_smi_bounce_info *bounce; ++ ++ count = bcm2835_smi_user_dma(smi_inst, ++ DMA_DEV_TO_MEM, user_ptr, count, ++ &bounce); ++ if (count) ++ count = dma_bounce_user(DMA_DEV_TO_MEM, user_ptr, ++ count, bounce); ++ } ++ if (odd_bytes) { ++ /* Read from FIFO directly if not using DMA */ ++ uint8_t buf[DMA_THRESHOLD_BYTES]; ++ ++ bcm2835_smi_read_buf(smi_inst, buf, odd_bytes); ++ if (copy_to_user(user_ptr, buf, odd_bytes)) ++ dev_err(inst->dev, "copy_to_user() failed."); ++ count += odd_bytes; ++ ++ } ++ return count; ++} ++ ++static ssize_t ++bcm2835_write_file(struct file *f, const char __user *user_ptr, ++ size_t count, loff_t *offs) ++{ ++ int odd_bytes; ++ ++ dev_dbg(inst->dev, "User writing %d bytes to SMI.", count); ++ if (count > DMA_THRESHOLD_BYTES) ++ odd_bytes = count & 0x3; ++ else ++ odd_bytes = count; ++ count -= odd_bytes; ++ if (count) { ++ struct bcm2835_smi_bounce_info *bounce; ++ ++ count = bcm2835_smi_user_dma(smi_inst, ++ DMA_MEM_TO_DEV, (char __user *)user_ptr, count, ++ &bounce); ++ if (count) ++ count = dma_bounce_user(DMA_MEM_TO_DEV, ++ (char __user *)user_ptr, ++ count, bounce); ++ } ++ if (odd_bytes) { ++ uint8_t buf[DMA_THRESHOLD_BYTES]; ++ ++ if (copy_from_user(buf, user_ptr, odd_bytes)) ++ dev_err(inst->dev, "copy_from_user() failed."); ++ else ++ bcm2835_smi_write_buf(smi_inst, buf, odd_bytes); ++ count += odd_bytes; ++ } ++ return count; ++} ++ ++static const struct file_operations ++bcm2835_smi_fops = { ++ .owner = THIS_MODULE, ++ .unlocked_ioctl = bcm2835_smi_ioctl, ++ .open = bcm2835_smi_open, ++ .release = bcm2835_smi_release, ++ .read = bcm2835_read_file, ++ .write = bcm2835_write_file, ++}; ++ ++ ++/**************************************************************************** ++* ++* bcm2835_smi_probe - called when the driver is loaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_dev_probe(struct platform_device *pdev) ++{ ++ int err; ++ void *ptr_err; ++ struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node, *smi_node; ++ ++ if (!node) { ++ dev_err(dev, "No device tree node supplied!"); ++ return -EINVAL; ++ } ++ ++ smi_node = of_parse_phandle(node, "smi_handle", 0); ++ ++ if (!smi_node) { ++ dev_err(dev, "No such property: smi_handle"); ++ return -ENXIO; ++ } ++ ++ smi_inst = bcm2835_smi_get(smi_node); ++ ++ if (!smi_inst) ++ return -EPROBE_DEFER; ++ ++ /* Allocate buffers and instance data */ ++ ++ inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL); ++ ++ if (!inst) ++ return -ENOMEM; ++ ++ inst->dev = dev; ++ ++ /* Create character device entries */ ++ ++ err = alloc_chrdev_region(&bcm2835_smi_devid, ++ DEVICE_MINOR, 1, DEVICE_NAME); ++ if (err != 0) { ++ dev_err(inst->dev, "unable to allocate device number"); ++ return -ENOMEM; ++ } ++ cdev_init(&bcm2835_smi_cdev, &bcm2835_smi_fops); ++ bcm2835_smi_cdev.owner = THIS_MODULE; ++ err = cdev_add(&bcm2835_smi_cdev, bcm2835_smi_devid, 1); ++ if (err != 0) { ++ dev_err(inst->dev, "unable to register device"); ++ err = -ENOMEM; ++ goto failed_cdev_add; ++ } ++ ++ /* Create sysfs entries */ ++ ++ bcm2835_smi_class = class_create(THIS_MODULE, DEVICE_NAME); ++ ptr_err = bcm2835_smi_class; ++ if (IS_ERR(ptr_err)) ++ goto failed_class_create; ++ ++ bcm2835_smi_dev = device_create(bcm2835_smi_class, NULL, ++ bcm2835_smi_devid, NULL, ++ "smi"); ++ ptr_err = bcm2835_smi_dev; ++ if (IS_ERR(ptr_err)) ++ goto failed_device_create; ++ ++ dev_info(inst->dev, "initialised"); ++ ++ return 0; ++ ++failed_device_create: ++ class_destroy(bcm2835_smi_class); ++failed_class_create: ++ cdev_del(&bcm2835_smi_cdev); ++ err = PTR_ERR(ptr_err); ++failed_cdev_add: ++ unregister_chrdev_region(bcm2835_smi_devid, 1); ++ dev_err(dev, "could not load bcm2835_smi_dev"); ++ return err; ++} ++ ++/**************************************************************************** ++* ++* bcm2835_smi_remove - called when the driver is unloaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_dev_remove(struct platform_device *pdev) ++{ ++ device_destroy(bcm2835_smi_class, bcm2835_smi_devid); ++ class_destroy(bcm2835_smi_class); ++ cdev_del(&bcm2835_smi_cdev); ++ unregister_chrdev_region(bcm2835_smi_devid, 1); ++ ++ dev_info(inst->dev, "SMI character dev removed - OK"); ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* Register the driver with device tree ++* ++***************************************************************************/ ++ ++static const struct of_device_id bcm2835_smi_dev_of_match[] = { ++ {.compatible = "brcm,bcm2835-smi-dev",}, ++ { /* sentinel */ }, ++}; ++ ++MODULE_DEVICE_TABLE(of, bcm2835_smi_dev_of_match); ++ ++static struct platform_driver bcm2835_smi_dev_driver = { ++ .probe = bcm2835_smi_dev_probe, ++ .remove = bcm2835_smi_dev_remove, ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = bcm2835_smi_dev_of_match, ++ }, ++}; ++ ++module_platform_driver(bcm2835_smi_dev_driver); ++ ++MODULE_ALIAS("platform:smi-dev-bcm2835"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION( ++ "Character device driver for BCM2835's secondary memory interface"); ++MODULE_AUTHOR("Luke Wren "); +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig +index 4e6f46c3..8b82c9b 100644 +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -10,6 +10,14 @@ config SENSORS_LIS3LV02D + select INPUT_POLLDEV + default n + ++config BCM2835_SMI ++ tristate "Broadcom 283x Secondary Memory Interface driver" ++ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 ++ default m ++ help ++ Driver for enabling and using Broadcom's Secondary/Slow Memory Interface. ++ Appears as /dev/bcm2835_smi. For ioctl interface see drivers/misc/bcm2835_smi.h ++ + config AD525X_DPOT + tristate "Analog Devices Digital Potentiometers" + depends on (I2C || SPI) && SYSFS +diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile +index 43d2ac9..b668a08 100644 +--- a/drivers/misc/Makefile ++++ b/drivers/misc/Makefile +@@ -9,6 +9,7 @@ obj-$(CONFIG_AD525X_DPOT_SPI) += ad525x_dpot-spi.o + obj-$(CONFIG_INTEL_MID_PTI) += pti.o + obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o + obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o ++obj-$(CONFIG_BCM2835_SMI) += bcm2835_smi.o + obj-$(CONFIG_BMP085) += bmp085.o + obj-$(CONFIG_BMP085_I2C) += bmp085-i2c.o + obj-$(CONFIG_BMP085_SPI) += bmp085-spi.o +diff --git a/drivers/misc/bcm2835_smi.c b/drivers/misc/bcm2835_smi.c +new file mode 100644 +index 0000000..63a4ea0 +--- /dev/null ++++ b/drivers/misc/bcm2835_smi.c +@@ -0,0 +1,985 @@ ++/** ++ * Broadcom Secondary Memory Interface driver ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define BCM2835_SMI_IMPLEMENTATION ++#include ++ ++#define DRIVER_NAME "smi-bcm2835" ++ ++#define N_PAGES_FROM_BYTES(n) ((n + PAGE_SIZE-1) / PAGE_SIZE) ++ ++#define DMA_WRITE_TO_MEM true ++#define DMA_READ_FROM_MEM false ++ ++struct bcm2835_smi_instance { ++ struct device *dev; ++ struct smi_settings settings; ++ __iomem void *smi_regs_ptr, *cm_smi_regs_ptr; ++ dma_addr_t smi_regs_busaddr; ++ ++ struct dma_chan *dma_chan; ++ struct dma_slave_config dma_config; ++ ++ struct bcm2835_smi_bounce_info bounce; ++ ++ struct scatterlist buffer_sgl; ++ ++ int clock_source; ++ int clock_divisor; ++ ++ /* Sometimes we are called into in an atomic context (e.g. by ++ JFFS2 + MTD) so we can't use a mutex */ ++ spinlock_t transaction_lock; ++}; ++ ++/**************************************************************************** ++* ++* SMI clock manager setup ++* ++***************************************************************************/ ++ ++static inline void write_smi_cm_reg(struct bcm2835_smi_instance *inst, ++ u32 val, unsigned reg) ++{ ++ writel(CM_PWD | val, inst->cm_smi_regs_ptr + reg); ++} ++ ++static inline u32 read_smi_cm_reg(struct bcm2835_smi_instance *inst, ++ unsigned reg) ++{ ++ return readl(inst->cm_smi_regs_ptr + reg); ++} ++ ++static void smi_setup_clock(struct bcm2835_smi_instance *inst) ++{ ++ dev_dbg(inst->dev, "Setting up clock..."); ++ /* Disable SMI clock and wait for it to stop. */ ++ write_smi_cm_reg(inst, 0, CM_SMI_CTL); ++ while (read_smi_cm_reg(inst, CM_SMI_CTL) & CM_SMI_CTL_BUSY) ++ ; ++ ++ write_smi_cm_reg(inst, (inst->clock_divisor << CM_SMI_DIV_DIVI_OFFS), ++ CM_SMI_DIV); ++ write_smi_cm_reg(inst, (inst->clock_source << CM_SMI_CTL_SRC_OFFS), ++ CM_SMI_CTL); ++ ++ /* Enable the clock */ ++ write_smi_cm_reg(inst, (inst->clock_source << CM_SMI_CTL_SRC_OFFS) | ++ CM_SMI_CTL_ENAB, CM_SMI_CTL); ++} ++ ++/**************************************************************************** ++* ++* SMI peripheral setup ++* ++***************************************************************************/ ++ ++static inline void write_smi_reg(struct bcm2835_smi_instance *inst, ++ u32 val, unsigned reg) ++{ ++ writel(val, inst->smi_regs_ptr + reg); ++} ++ ++static inline u32 read_smi_reg(struct bcm2835_smi_instance *inst, unsigned reg) ++{ ++ return readl(inst->smi_regs_ptr + reg); ++} ++ ++/* Token-paste macro for e.g SMIDSR_RSTROBE -> value of SMIDSR_RSTROBE_MASK */ ++#define _CONCAT(x, y) x##y ++#define CONCAT(x, y) _CONCAT(x, y) ++ ++#define SET_BIT_FIELD(dest, field, bits) ((dest) = \ ++ ((dest) & ~CONCAT(field, _MASK)) | (((bits) << CONCAT(field, _OFFS))& \ ++ CONCAT(field, _MASK))) ++#define GET_BIT_FIELD(src, field) (((src) & \ ++ CONCAT(field, _MASK)) >> CONCAT(field, _OFFS)) ++ ++static void smi_dump_context_labelled(struct bcm2835_smi_instance *inst, ++ const char *label) ++{ ++ dev_err(inst->dev, "SMI context dump: %s", label); ++ dev_err(inst->dev, "SMICS: 0x%08x", read_smi_reg(inst, SMICS)); ++ dev_err(inst->dev, "SMIL: 0x%08x", read_smi_reg(inst, SMIL)); ++ dev_err(inst->dev, "SMIDSR: 0x%08x", read_smi_reg(inst, SMIDSR0)); ++ dev_err(inst->dev, "SMIDSW: 0x%08x", read_smi_reg(inst, SMIDSW0)); ++ dev_err(inst->dev, "SMIDC: 0x%08x", read_smi_reg(inst, SMIDC)); ++ dev_err(inst->dev, "SMIFD: 0x%08x", read_smi_reg(inst, SMIFD)); ++ dev_err(inst->dev, " "); ++} ++ ++static inline void smi_dump_context(struct bcm2835_smi_instance *inst) ++{ ++ smi_dump_context_labelled(inst, ""); ++} ++ ++static void smi_get_default_settings(struct bcm2835_smi_instance *inst) ++{ ++ struct smi_settings *settings = &inst->settings; ++ ++ settings->data_width = SMI_WIDTH_16BIT; ++ settings->pack_data = true; ++ ++ settings->read_setup_time = 1; ++ settings->read_hold_time = 1; ++ settings->read_pace_time = 1; ++ settings->read_strobe_time = 3; ++ ++ settings->write_setup_time = settings->read_setup_time; ++ settings->write_hold_time = settings->read_hold_time; ++ settings->write_pace_time = settings->read_pace_time; ++ settings->write_strobe_time = settings->read_strobe_time; ++ ++ settings->dma_enable = true; ++ settings->dma_passthrough_enable = false; ++ settings->dma_read_thresh = 0x01; ++ settings->dma_write_thresh = 0x3f; ++ settings->dma_panic_read_thresh = 0x20; ++ settings->dma_panic_write_thresh = 0x20; ++} ++ ++void bcm2835_smi_set_regs_from_settings(struct bcm2835_smi_instance *inst) ++{ ++ struct smi_settings *settings = &inst->settings; ++ int smidsr_temp = 0, smidsw_temp = 0, smics_temp, ++ smidcs_temp, smidc_temp = 0; ++ ++ spin_lock(&inst->transaction_lock); ++ ++ /* temporarily disable the peripheral: */ ++ smics_temp = read_smi_reg(inst, SMICS); ++ write_smi_reg(inst, 0, SMICS); ++ smidcs_temp = read_smi_reg(inst, SMIDCS); ++ write_smi_reg(inst, 0, SMIDCS); ++ ++ if (settings->pack_data) ++ smics_temp |= SMICS_PXLDAT; ++ else ++ smics_temp &= ~SMICS_PXLDAT; ++ ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RWIDTH, settings->data_width); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RSETUP, settings->read_setup_time); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RHOLD, settings->read_hold_time); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RPACE, settings->read_pace_time); ++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RSTROBE, settings->read_strobe_time); ++ write_smi_reg(inst, smidsr_temp, SMIDSR0); ++ ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WWIDTH, settings->data_width); ++ if (settings->data_width == SMI_WIDTH_8BIT) ++ smidsw_temp |= SMIDSW_WSWAP; ++ else ++ smidsw_temp &= ~SMIDSW_WSWAP; ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WSETUP, settings->write_setup_time); ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WHOLD, settings->write_hold_time); ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WPACE, settings->write_pace_time); ++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WSTROBE, ++ settings->write_strobe_time); ++ write_smi_reg(inst, smidsw_temp, SMIDSW0); ++ ++ SET_BIT_FIELD(smidc_temp, SMIDC_REQR, settings->dma_read_thresh); ++ SET_BIT_FIELD(smidc_temp, SMIDC_REQW, settings->dma_write_thresh); ++ SET_BIT_FIELD(smidc_temp, SMIDC_PANICR, ++ settings->dma_panic_read_thresh); ++ SET_BIT_FIELD(smidc_temp, SMIDC_PANICW, ++ settings->dma_panic_write_thresh); ++ if (settings->dma_passthrough_enable) { ++ smidc_temp |= SMIDC_DMAP; ++ smidsr_temp |= SMIDSR_RDREQ; ++ write_smi_reg(inst, smidsr_temp, SMIDSR0); ++ smidsw_temp |= SMIDSW_WDREQ; ++ write_smi_reg(inst, smidsw_temp, SMIDSW0); ++ } else ++ smidc_temp &= ~SMIDC_DMAP; ++ if (settings->dma_enable) ++ smidc_temp |= SMIDC_DMAEN; ++ else ++ smidc_temp &= ~SMIDC_DMAEN; ++ ++ write_smi_reg(inst, smidc_temp, SMIDC); ++ ++ /* re-enable (if was previously enabled) */ ++ write_smi_reg(inst, smics_temp, SMICS); ++ write_smi_reg(inst, smidcs_temp, SMIDCS); ++ ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_set_regs_from_settings); ++ ++struct smi_settings *bcm2835_smi_get_settings_from_regs ++ (struct bcm2835_smi_instance *inst) ++{ ++ struct smi_settings *settings = &inst->settings; ++ int smidsr, smidsw, smidc; ++ ++ spin_lock(&inst->transaction_lock); ++ ++ smidsr = read_smi_reg(inst, SMIDSR0); ++ smidsw = read_smi_reg(inst, SMIDSW0); ++ smidc = read_smi_reg(inst, SMIDC); ++ ++ settings->pack_data = (read_smi_reg(inst, SMICS) & SMICS_PXLDAT) ? ++ true : false; ++ ++ settings->data_width = GET_BIT_FIELD(smidsr, SMIDSR_RWIDTH); ++ settings->read_setup_time = GET_BIT_FIELD(smidsr, SMIDSR_RSETUP); ++ settings->read_hold_time = GET_BIT_FIELD(smidsr, SMIDSR_RHOLD); ++ settings->read_pace_time = GET_BIT_FIELD(smidsr, SMIDSR_RPACE); ++ settings->read_strobe_time = GET_BIT_FIELD(smidsr, SMIDSR_RSTROBE); ++ ++ settings->write_setup_time = GET_BIT_FIELD(smidsw, SMIDSW_WSETUP); ++ settings->write_hold_time = GET_BIT_FIELD(smidsw, SMIDSW_WHOLD); ++ settings->write_pace_time = GET_BIT_FIELD(smidsw, SMIDSW_WPACE); ++ settings->write_strobe_time = GET_BIT_FIELD(smidsw, SMIDSW_WSTROBE); ++ ++ settings->dma_read_thresh = GET_BIT_FIELD(smidc, SMIDC_REQR); ++ settings->dma_write_thresh = GET_BIT_FIELD(smidc, SMIDC_REQW); ++ settings->dma_panic_read_thresh = GET_BIT_FIELD(smidc, SMIDC_PANICR); ++ settings->dma_panic_write_thresh = GET_BIT_FIELD(smidc, SMIDC_PANICW); ++ settings->dma_passthrough_enable = (smidc & SMIDC_DMAP) ? true : false; ++ settings->dma_enable = (smidc & SMIDC_DMAEN) ? true : false; ++ ++ spin_unlock(&inst->transaction_lock); ++ ++ return settings; ++} ++EXPORT_SYMBOL(bcm2835_smi_get_settings_from_regs); ++ ++static inline void smi_set_address(struct bcm2835_smi_instance *inst, ++ unsigned int address) ++{ ++ int smia_temp = 0, smida_temp = 0; ++ ++ SET_BIT_FIELD(smia_temp, SMIA_ADDR, address); ++ SET_BIT_FIELD(smida_temp, SMIDA_ADDR, address); ++ ++ /* Write to both address registers - user doesn't care whether we're ++ doing programmed or direct transfers. */ ++ write_smi_reg(inst, smia_temp, SMIA); ++ write_smi_reg(inst, smida_temp, SMIDA); ++} ++ ++static void smi_setup_regs(struct bcm2835_smi_instance *inst) ++{ ++ ++ dev_dbg(inst->dev, "Initialising SMI registers..."); ++ /* Disable the peripheral if already enabled */ ++ write_smi_reg(inst, 0, SMICS); ++ write_smi_reg(inst, 0, SMIDCS); ++ ++ smi_get_default_settings(inst); ++ bcm2835_smi_set_regs_from_settings(inst); ++ smi_set_address(inst, 0); ++ ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_ENABLE, SMICS); ++ write_smi_reg(inst, read_smi_reg(inst, SMIDCS) | SMIDCS_ENABLE, ++ SMIDCS); ++} ++ ++/**************************************************************************** ++* ++* Low-level SMI access functions ++* Other modules should use the exported higher-level functions e.g. ++* bcm2835_smi_write_buf() unless they have a good reason to use these ++* ++***************************************************************************/ ++ ++static inline uint32_t smi_read_single_word(struct bcm2835_smi_instance *inst) ++{ ++ int timeout = 0; ++ ++ write_smi_reg(inst, SMIDCS_ENABLE, SMIDCS); ++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_START, SMIDCS); ++ /* Make sure things happen in the right order...*/ ++ mb(); ++ while (!(read_smi_reg(inst, SMIDCS) & SMIDCS_DONE) && ++ ++timeout < 10000) ++ ; ++ if (timeout < 10000) ++ return read_smi_reg(inst, SMIDD); ++ ++ dev_err(inst->dev, ++ "SMI direct read timed out (is the clock set up correctly?)"); ++ return 0; ++} ++ ++static inline void smi_write_single_word(struct bcm2835_smi_instance *inst, ++ uint32_t data) ++{ ++ int timeout = 0; ++ ++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_WRITE, SMIDCS); ++ write_smi_reg(inst, data, SMIDD); ++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_WRITE | SMIDCS_START, ++ SMIDCS); ++ ++ while (!(read_smi_reg(inst, SMIDCS) & SMIDCS_DONE) && ++ ++timeout < 10000) ++ ; ++ if (timeout >= 10000) ++ dev_err(inst->dev, ++ "SMI direct write timed out (is the clock set up correctly?)"); ++} ++ ++/* Initiates a programmed read into the read FIFO. It is up to the caller to ++ * read data from the FIFO - either via paced DMA transfer, ++ * or polling SMICS_RXD to check whether data is available. ++ * SMICS_ACTIVE will go low upon completion. */ ++static void smi_init_programmed_read(struct bcm2835_smi_instance *inst, ++ int num_transfers) ++{ ++ int smics_temp; ++ ++ /* Disable the peripheral: */ ++ smics_temp = read_smi_reg(inst, SMICS) & ~(SMICS_ENABLE | SMICS_WRITE); ++ write_smi_reg(inst, smics_temp, SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ENABLE) ++ ; ++ ++ /* Program the transfer count: */ ++ write_smi_reg(inst, num_transfers, SMIL); ++ ++ /* re-enable and start: */ ++ smics_temp |= SMICS_ENABLE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ smics_temp |= SMICS_CLEAR; ++ /* Just to be certain: */ ++ mb(); ++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE) ++ ; ++ write_smi_reg(inst, smics_temp, SMICS); ++ smics_temp |= SMICS_START; ++ write_smi_reg(inst, smics_temp, SMICS); ++} ++ ++/* Initiates a programmed write sequence, using data from the write FIFO. ++ * It is up to the caller to initiate a DMA transfer before calling, ++ * or use another method to keep the write FIFO topped up. ++ * SMICS_ACTIVE will go low upon completion. ++ */ ++static void smi_init_programmed_write(struct bcm2835_smi_instance *inst, ++ int num_transfers) ++{ ++ int smics_temp; ++ ++ /* Disable the peripheral: */ ++ smics_temp = read_smi_reg(inst, SMICS) & ~SMICS_ENABLE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ENABLE) ++ ; ++ ++ /* Program the transfer count: */ ++ write_smi_reg(inst, num_transfers, SMIL); ++ ++ /* setup, re-enable and start: */ ++ smics_temp |= SMICS_WRITE | SMICS_ENABLE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ smics_temp |= SMICS_START; ++ write_smi_reg(inst, smics_temp, SMICS); ++} ++ ++/* Initiate a read and then poll FIFO for data, reading out as it appears. */ ++static void smi_read_fifo(struct bcm2835_smi_instance *inst, ++ uint32_t *dest, int n_bytes) ++{ ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) { ++ smi_dump_context_labelled(inst, ++ "WARNING: read FIFO not empty at start of read call."); ++ while (read_smi_reg(inst, SMICS)) ++ ; ++ } ++ ++ /* Dispatch the read: */ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_read(inst, n_bytes); ++ else if (inst->settings.data_width == SMI_WIDTH_16BIT) ++ smi_init_programmed_read(inst, n_bytes / 2); ++ else { ++ dev_err(inst->dev, "Unsupported data width for read."); ++ return; ++ } ++ ++ /* Poll FIFO to keep it empty */ ++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE)) ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) ++ *dest++ = read_smi_reg(inst, SMID); ++ ++ /* Ensure that the FIFO is emptied */ ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) { ++ int fifo_count; ++ ++ fifo_count = GET_BIT_FIELD(read_smi_reg(inst, SMIFD), ++ SMIFD_FCNT); ++ while (fifo_count--) ++ *dest++ = read_smi_reg(inst, SMID); ++ } ++ ++ if (!(read_smi_reg(inst, SMICS) & SMICS_DONE)) ++ smi_dump_context_labelled(inst, ++ "WARNING: transaction finished but done bit not set."); ++ ++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) ++ smi_dump_context_labelled(inst, ++ "WARNING: read FIFO not empty at end of read call."); ++ ++} ++ ++/* Initiate a write, and then keep the FIFO topped up. */ ++static void smi_write_fifo(struct bcm2835_smi_instance *inst, ++ uint32_t *src, int n_bytes) ++{ ++ int i, timeout = 0; ++ ++ /* Empty FIFOs if not already so */ ++ if (!(read_smi_reg(inst, SMICS) & SMICS_TXE)) { ++ smi_dump_context_labelled(inst, ++ "WARNING: write fifo not empty at start of write call."); ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_CLEAR, ++ SMICS); ++ } ++ ++ /* Initiate the transfer */ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_write(inst, n_bytes); ++ else if (inst->settings.data_width == SMI_WIDTH_16BIT) ++ smi_init_programmed_write(inst, n_bytes / 2); ++ else { ++ dev_err(inst->dev, "Unsupported data width for write."); ++ return; ++ } ++ /* Fill the FIFO: */ ++ for (i = 0; i < (n_bytes - 1) / 4 + 1; ++i) { ++ while (!(read_smi_reg(inst, SMICS) & SMICS_TXD)) ++ ; ++ write_smi_reg(inst, *src++, SMID); ++ } ++ /* Busy wait... */ ++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE) && ++timeout < ++ 1000000) ++ ; ++ if (timeout >= 1000000) ++ smi_dump_context_labelled(inst, ++ "Timed out on write operation!"); ++ if (!(read_smi_reg(inst, SMICS) & SMICS_TXE)) ++ smi_dump_context_labelled(inst, ++ "WARNING: FIFO not empty at end of write operation."); ++} ++ ++/**************************************************************************** ++* ++* SMI DMA operations ++* ++***************************************************************************/ ++ ++/* Disable SMI and put it into the correct direction before doing DMA setup. ++ Stops spurious DREQs during setup. Peripheral is re-enabled by init_*() */ ++static void smi_disable(struct bcm2835_smi_instance *inst, ++ enum dma_transfer_direction direction) ++{ ++ int smics_temp = read_smi_reg(inst, SMICS) & ~SMICS_ENABLE; ++ ++ if (direction == DMA_DEV_TO_MEM) ++ smics_temp &= ~SMICS_WRITE; ++ else ++ smics_temp |= SMICS_WRITE; ++ write_smi_reg(inst, smics_temp, SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE) ++ ; ++} ++ ++static struct scatterlist *smi_scatterlist_from_buffer( ++ struct bcm2835_smi_instance *inst, ++ dma_addr_t buf, ++ size_t len, ++ struct scatterlist *sg) ++{ ++ sg_init_table(sg, 1); ++ sg_dma_address(sg) = buf; ++ sg_dma_len(sg) = len; ++ return sg; ++} ++ ++static void smi_dma_callback_user_copy(void *param) ++{ ++ /* Notify the bottom half that a chunk is ready for user copy */ ++ struct bcm2835_smi_instance *inst = ++ (struct bcm2835_smi_instance *)param; ++ ++ up(&inst->bounce.callback_sem); ++} ++ ++/* Creates a descriptor, assigns the given callback, and submits the ++ descriptor to dmaengine. Does not block - can queue up multiple ++ descriptors and then wait for them all to complete. ++ sg_len is the number of control blocks, NOT the number of bytes. ++ dir can be DMA_MEM_TO_DEV or DMA_DEV_TO_MEM. ++ callback can be NULL - in this case it is not called. */ ++static inline struct dma_async_tx_descriptor *smi_dma_submit_sgl( ++ struct bcm2835_smi_instance *inst, ++ struct scatterlist *sgl, ++ size_t sg_len, ++ enum dma_transfer_direction dir, ++ dma_async_tx_callback callback) ++{ ++ struct dma_async_tx_descriptor *desc; ++ ++ desc = dmaengine_prep_slave_sg(inst->dma_chan, ++ sgl, ++ sg_len, ++ dir, ++ DMA_PREP_INTERRUPT | DMA_CTRL_ACK | ++ DMA_PREP_FENCE); ++ if (!desc) { ++ dev_err(inst->dev, "read_sgl: dma slave preparation failed!"); ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) & ~SMICS_ACTIVE, ++ SMICS); ++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE) ++ cpu_relax(); ++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_ACTIVE, ++ SMICS); ++ return NULL; ++ } ++ desc->callback = callback; ++ desc->callback_param = inst; ++ if (dmaengine_submit(desc) < 0) ++ return NULL; ++ return desc; ++} ++ ++/* NB this function blocks until the transfer is complete */ ++static void ++smi_dma_read_sgl(struct bcm2835_smi_instance *inst, ++ struct scatterlist *sgl, size_t sg_len, size_t n_bytes) ++{ ++ struct dma_async_tx_descriptor *desc; ++ ++ /* Disable SMI and set to read before dispatching DMA - if SMI is in ++ * write mode and TX fifo is empty, it will generate a DREQ which may ++ * cause the read DMA to complete before the SMI read command is even ++ * dispatched! We want to dispatch DMA before SMI read so that reading ++ * is gapless, for logic analyser. ++ */ ++ ++ smi_disable(inst, DMA_DEV_TO_MEM); ++ ++ desc = smi_dma_submit_sgl(inst, sgl, sg_len, DMA_DEV_TO_MEM, NULL); ++ dma_async_issue_pending(inst->dma_chan); ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_read(inst, n_bytes); ++ else ++ smi_init_programmed_read(inst, n_bytes / 2); ++ ++ if (dma_wait_for_async_tx(desc) == DMA_ERROR) ++ smi_dump_context_labelled(inst, "DMA timeout!"); ++} ++ ++static void ++smi_dma_write_sgl(struct bcm2835_smi_instance *inst, ++ struct scatterlist *sgl, size_t sg_len, size_t n_bytes) ++{ ++ struct dma_async_tx_descriptor *desc; ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ smi_init_programmed_write(inst, n_bytes); ++ else ++ smi_init_programmed_write(inst, n_bytes / 2); ++ ++ desc = smi_dma_submit_sgl(inst, sgl, sg_len, DMA_MEM_TO_DEV, NULL); ++ dma_async_issue_pending(inst->dma_chan); ++ ++ if (dma_wait_for_async_tx(desc) == DMA_ERROR) ++ smi_dump_context_labelled(inst, "DMA timeout!"); ++ else ++ /* Wait for SMI to finish our writes */ ++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE)) ++ cpu_relax(); ++} ++ ++ssize_t bcm2835_smi_user_dma( ++ struct bcm2835_smi_instance *inst, ++ enum dma_transfer_direction dma_dir, ++ char __user *user_ptr, size_t count, ++ struct bcm2835_smi_bounce_info **bounce) ++{ ++ int chunk_no = 0, chunk_size, count_left = count; ++ struct scatterlist *sgl; ++ void (*init_trans_func)(struct bcm2835_smi_instance *, int); ++ ++ spin_lock(&inst->transaction_lock); ++ ++ if (dma_dir == DMA_DEV_TO_MEM) ++ init_trans_func = smi_init_programmed_read; ++ else ++ init_trans_func = smi_init_programmed_write; ++ ++ smi_disable(inst, dma_dir); ++ ++ sema_init(&inst->bounce.callback_sem, 0); ++ if (bounce) ++ *bounce = &inst->bounce; ++ while (count_left) { ++ chunk_size = count_left > DMA_BOUNCE_BUFFER_SIZE ? ++ DMA_BOUNCE_BUFFER_SIZE : count_left; ++ if (chunk_size == DMA_BOUNCE_BUFFER_SIZE) { ++ sgl = ++ &inst->bounce.sgl[chunk_no % DMA_BOUNCE_BUFFER_COUNT]; ++ } else { ++ sgl = smi_scatterlist_from_buffer( ++ inst, ++ inst->bounce.phys[ ++ chunk_no % DMA_BOUNCE_BUFFER_COUNT], ++ chunk_size, ++ &inst->buffer_sgl); ++ } ++ ++ if (!smi_dma_submit_sgl(inst, sgl, 1, dma_dir, ++ smi_dma_callback_user_copy ++ )) { ++ dev_err(inst->dev, "sgl submit failed"); ++ count = 0; ++ goto out; ++ } ++ count_left -= chunk_size; ++ chunk_no++; ++ } ++ dma_async_issue_pending(inst->dma_chan); ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) ++ init_trans_func(inst, count); ++ else if (inst->settings.data_width == SMI_WIDTH_16BIT) ++ init_trans_func(inst, count / 2); ++out: ++ spin_unlock(&inst->transaction_lock); ++ return count; ++} ++EXPORT_SYMBOL(bcm2835_smi_user_dma); ++ ++ ++/**************************************************************************** ++* ++* High level buffer transfer functions - for use by other drivers ++* ++***************************************************************************/ ++ ++/* Buffer must be physically contiguous - i.e. kmalloc, not vmalloc! */ ++void bcm2835_smi_write_buf( ++ struct bcm2835_smi_instance *inst, ++ const void *buf, size_t n_bytes) ++{ ++ int odd_bytes = n_bytes & 0x3; ++ ++ n_bytes -= odd_bytes; ++ ++ spin_lock(&inst->transaction_lock); ++ ++ if (n_bytes > DMA_THRESHOLD_BYTES) { ++ dma_addr_t phy_addr = dma_map_single( ++ inst->dev, ++ (void *)buf, ++ n_bytes, ++ DMA_MEM_TO_DEV); ++ struct scatterlist *sgl = ++ smi_scatterlist_from_buffer(inst, phy_addr, n_bytes, ++ &inst->buffer_sgl); ++ ++ if (!sgl) { ++ smi_dump_context_labelled(inst, ++ "Error: could not create scatterlist for write!"); ++ goto out; ++ } ++ smi_dma_write_sgl(inst, sgl, 1, n_bytes); ++ ++ dma_unmap_single ++ (inst->dev, phy_addr, n_bytes, DMA_MEM_TO_DEV); ++ } else if (n_bytes) { ++ smi_write_fifo(inst, (uint32_t *) buf, n_bytes); ++ } ++ buf += n_bytes; ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) { ++ while (odd_bytes--) ++ smi_write_single_word(inst, *(uint8_t *) (buf++)); ++ } else { ++ while (odd_bytes >= 2) { ++ smi_write_single_word(inst, *(uint16_t *)buf); ++ buf += 2; ++ odd_bytes -= 2; ++ } ++ if (odd_bytes) { ++ /* Reading an odd number of bytes on a 16 bit bus is ++ a user bug. It's kinder to fail early and tell them ++ than to e.g. transparently give them the bottom byte ++ of a 16 bit transfer. */ ++ dev_err(inst->dev, ++ "WARNING: odd number of bytes specified for wide transfer."); ++ dev_err(inst->dev, ++ "At least one byte dropped as a result."); ++ dump_stack(); ++ } ++ } ++out: ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_write_buf); ++ ++void bcm2835_smi_read_buf(struct bcm2835_smi_instance *inst, ++ void *buf, size_t n_bytes) ++{ ++ ++ /* SMI is inherently 32-bit, which causes surprising amounts of mess ++ for bytes % 4 != 0. Easiest to avoid this mess altogether ++ by handling remainder separately. */ ++ int odd_bytes = n_bytes & 0x3; ++ ++ spin_lock(&inst->transaction_lock); ++ n_bytes -= odd_bytes; ++ if (n_bytes > DMA_THRESHOLD_BYTES) { ++ dma_addr_t phy_addr = dma_map_single(inst->dev, ++ buf, n_bytes, ++ DMA_DEV_TO_MEM); ++ struct scatterlist *sgl = smi_scatterlist_from_buffer( ++ inst, phy_addr, n_bytes, ++ &inst->buffer_sgl); ++ if (!sgl) { ++ smi_dump_context_labelled(inst, ++ "Error: could not create scatterlist for read!"); ++ goto out; ++ } ++ smi_dma_read_sgl(inst, sgl, 1, n_bytes); ++ dma_unmap_single(inst->dev, phy_addr, n_bytes, DMA_DEV_TO_MEM); ++ } else if (n_bytes) { ++ smi_read_fifo(inst, (uint32_t *)buf, n_bytes); ++ } ++ buf += n_bytes; ++ ++ if (inst->settings.data_width == SMI_WIDTH_8BIT) { ++ while (odd_bytes--) ++ *((uint8_t *) (buf++)) = smi_read_single_word(inst); ++ } else { ++ while (odd_bytes >= 2) { ++ *(uint16_t *) buf = smi_read_single_word(inst); ++ buf += 2; ++ odd_bytes -= 2; ++ } ++ if (odd_bytes) { ++ dev_err(inst->dev, ++ "WARNING: odd number of bytes specified for wide transfer."); ++ dev_err(inst->dev, ++ "At least one byte dropped as a result."); ++ dump_stack(); ++ } ++ } ++out: ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_read_buf); ++ ++void bcm2835_smi_set_address(struct bcm2835_smi_instance *inst, ++ unsigned int address) ++{ ++ spin_lock(&inst->transaction_lock); ++ smi_set_address(inst, address); ++ spin_unlock(&inst->transaction_lock); ++} ++EXPORT_SYMBOL(bcm2835_smi_set_address); ++ ++struct bcm2835_smi_instance *bcm2835_smi_get(struct device_node *node) ++{ ++ struct platform_device *pdev; ++ ++ if (!node) ++ return NULL; ++ ++ pdev = of_find_device_by_node(node); ++ if (!pdev) ++ return NULL; ++ ++ return platform_get_drvdata(pdev); ++} ++EXPORT_SYMBOL(bcm2835_smi_get); ++ ++/**************************************************************************** ++* ++* bcm2835_smi_probe - called when the driver is loaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_dma_setup(struct bcm2835_smi_instance *inst) ++{ ++ int i, rv = 0; ++ ++ inst->dma_chan = dma_request_slave_channel(inst->dev, "rx-tx"); ++ ++ inst->dma_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; ++ inst->dma_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; ++ inst->dma_config.src_addr = inst->smi_regs_busaddr + SMID; ++ inst->dma_config.dst_addr = inst->dma_config.src_addr; ++ /* Direction unimportant - always overridden by prep_slave_sg */ ++ inst->dma_config.direction = DMA_DEV_TO_MEM; ++ dmaengine_slave_config(inst->dma_chan, &inst->dma_config); ++ /* Alloc and map bounce buffers */ ++ for (i = 0; i < DMA_BOUNCE_BUFFER_COUNT; ++i) { ++ inst->bounce.buffer[i] = ++ dmam_alloc_coherent(inst->dev, DMA_BOUNCE_BUFFER_SIZE, ++ &inst->bounce.phys[i], ++ GFP_KERNEL); ++ if (!inst->bounce.buffer[i]) { ++ dev_err(inst->dev, "Could not allocate buffer!"); ++ rv = -ENOMEM; ++ break; ++ } ++ smi_scatterlist_from_buffer( ++ inst, ++ inst->bounce.phys[i], ++ DMA_BOUNCE_BUFFER_SIZE, ++ &inst->bounce.sgl[i] ++ ); ++ } ++ ++ return rv; ++} ++ ++static int bcm2835_smi_probe(struct platform_device *pdev) ++{ ++ int err; ++ struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node; ++ struct resource *ioresource; ++ struct bcm2835_smi_instance *inst; ++ ++ /* Allocate buffers and instance data */ ++ ++ inst = devm_kzalloc(dev, sizeof(struct bcm2835_smi_instance), ++ GFP_KERNEL); ++ ++ if (!inst) ++ return -ENOMEM; ++ ++ inst->dev = dev; ++ spin_lock_init(&inst->transaction_lock); ++ ++ /* We require device tree support */ ++ if (!node) ++ return -EINVAL; ++ ++ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ inst->smi_regs_ptr = devm_ioremap_resource(dev, ioresource); ++ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ inst->cm_smi_regs_ptr = devm_ioremap_resource(dev, ioresource); ++ inst->smi_regs_busaddr = be32_to_cpu( ++ *of_get_address(node, 0, NULL, NULL)); ++ of_property_read_u32(node, ++ "brcm,smi-clock-source", ++ &inst->clock_source); ++ of_property_read_u32(node, ++ "brcm,smi-clock-divisor", ++ &inst->clock_divisor); ++ ++ err = bcm2835_smi_dma_setup(inst); ++ if (err) ++ return err; ++ ++ /* Finally, do peripheral setup */ ++ ++ smi_setup_clock(inst); ++ smi_setup_regs(inst); ++ ++ platform_set_drvdata(pdev, inst); ++ ++ dev_info(inst->dev, "initialised"); ++ ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* bcm2835_smi_remove - called when the driver is unloaded. ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_remove(struct platform_device *pdev) ++{ ++ struct bcm2835_smi_instance *inst = platform_get_drvdata(pdev); ++ struct device *dev = inst->dev; ++ ++ dev_info(dev, "SMI device removed - OK"); ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* Register the driver with device tree ++* ++***************************************************************************/ ++ ++static const struct of_device_id bcm2835_smi_of_match[] = { ++ {.compatible = "brcm,bcm2835-smi",}, ++ { /* sentinel */ }, ++}; ++ ++MODULE_DEVICE_TABLE(of, bcm2835_smi_of_match); ++ ++static struct platform_driver bcm2835_smi_driver = { ++ .probe = bcm2835_smi_probe, ++ .remove = bcm2835_smi_remove, ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = bcm2835_smi_of_match, ++ }, ++}; ++ ++module_platform_driver(bcm2835_smi_driver); ++ ++MODULE_ALIAS("platform:smi-bcm2835"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("Device driver for BCM2835's secondary memory interface"); ++MODULE_AUTHOR("Luke Wren "); +diff --git a/include/linux/broadcom/bcm2835_smi.h b/include/linux/broadcom/bcm2835_smi.h +new file mode 100644 +index 0000000..ee3a75e +--- /dev/null ++++ b/include/linux/broadcom/bcm2835_smi.h +@@ -0,0 +1,391 @@ ++/** ++ * Declarations and definitions for Broadcom's Secondary Memory Interface ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * Copyright (c) 2010-2012 Broadcom. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef BCM2835_SMI_H ++#define BCM2835_SMI_H ++ ++#include ++ ++#ifndef __KERNEL__ ++#include ++#include ++#endif ++ ++#define BCM2835_SMI_IOC_MAGIC 0x1 ++#define BCM2835_SMI_INVALID_HANDLE (~0) ++ ++/* IOCTLs 0x100...0x1ff are not device-specific - we can use them */ ++#define BCM2835_SMI_IOC_GET_SETTINGS _IO(BCM2835_SMI_IOC_MAGIC, 0) ++#define BCM2835_SMI_IOC_WRITE_SETTINGS _IO(BCM2835_SMI_IOC_MAGIC, 1) ++#define BCM2835_SMI_IOC_ADDRESS _IO(BCM2835_SMI_IOC_MAGIC, 2) ++#define BCM2835_SMI_IOC_MAX 2 ++ ++#define SMI_WIDTH_8BIT 0 ++#define SMI_WIDTH_16BIT 1 ++#define SMI_WIDTH_9BIT 2 ++#define SMI_WIDTH_18BIT 3 ++ ++/* max number of bytes where DMA will not be used */ ++#define DMA_THRESHOLD_BYTES 128 ++#define DMA_BOUNCE_BUFFER_SIZE (1024 * 1024 / 2) ++#define DMA_BOUNCE_BUFFER_COUNT 3 ++ ++ ++struct smi_settings { ++ int data_width; ++ /* Whether or not to pack multiple SMI transfers into a ++ single 32 bit FIFO word */ ++ bool pack_data; ++ ++ /* Timing for reads (writes the same but for WE) ++ * ++ * OE ----------+ +-------------------- ++ * | | ++ * +----------+ ++ * SD -<==============================>----------- ++ * SA -<=========================================>- ++ * <-setup-> <-strobe -> <-hold -> <- pace -> ++ */ ++ ++ int read_setup_time; ++ int read_hold_time; ++ int read_pace_time; ++ int read_strobe_time; ++ ++ int write_setup_time; ++ int write_hold_time; ++ int write_pace_time; ++ int write_strobe_time; ++ ++ bool dma_enable; /* DREQs */ ++ bool dma_passthrough_enable; /* External DREQs */ ++ int dma_read_thresh; ++ int dma_write_thresh; ++ int dma_panic_read_thresh; ++ int dma_panic_write_thresh; ++}; ++ ++/**************************************************************************** ++* ++* Declare exported SMI functions ++* ++***************************************************************************/ ++ ++#ifdef __KERNEL__ ++ ++#include /* for enum dma_transfer_direction */ ++#include ++#include ++ ++struct bcm2835_smi_instance; ++ ++struct bcm2835_smi_bounce_info { ++ struct semaphore callback_sem; ++ void *buffer[DMA_BOUNCE_BUFFER_COUNT]; ++ dma_addr_t phys[DMA_BOUNCE_BUFFER_COUNT]; ++ struct scatterlist sgl[DMA_BOUNCE_BUFFER_COUNT]; ++}; ++ ++ ++void bcm2835_smi_set_regs_from_settings(struct bcm2835_smi_instance *); ++ ++struct smi_settings *bcm2835_smi_get_settings_from_regs( ++ struct bcm2835_smi_instance *inst); ++ ++void bcm2835_smi_write_buf( ++ struct bcm2835_smi_instance *inst, ++ const void *buf, ++ size_t n_bytes); ++ ++void bcm2835_smi_read_buf( ++ struct bcm2835_smi_instance *inst, ++ void *buf, ++ size_t n_bytes); ++ ++void bcm2835_smi_set_address(struct bcm2835_smi_instance *inst, ++ unsigned int address); ++ ++ssize_t bcm2835_smi_user_dma( ++ struct bcm2835_smi_instance *inst, ++ enum dma_transfer_direction dma_dir, ++ char __user *user_ptr, ++ size_t count, ++ struct bcm2835_smi_bounce_info **bounce); ++ ++struct bcm2835_smi_instance *bcm2835_smi_get(struct device_node *node); ++ ++#endif /* __KERNEL__ */ ++ ++/**************************************************************** ++* ++* Implementation-only declarations ++* ++****************************************************************/ ++ ++#ifdef BCM2835_SMI_IMPLEMENTATION ++ ++/* Clock manager registers for SMI clock: */ ++#define CM_SMI_BASE_ADDRESS ((BCM2708_PERI_BASE) + 0x1010b0) ++/* Clock manager "password" to protect registers from spurious writes */ ++#define CM_PWD (0x5a << 24) ++ ++#define CM_SMI_CTL 0x00 ++#define CM_SMI_DIV 0x04 ++ ++#define CM_SMI_CTL_FLIP (1 << 8) ++#define CM_SMI_CTL_BUSY (1 << 7) ++#define CM_SMI_CTL_KILL (1 << 5) ++#define CM_SMI_CTL_ENAB (1 << 4) ++#define CM_SMI_CTL_SRC_MASK (0xf) ++#define CM_SMI_CTL_SRC_OFFS (0) ++ ++#define CM_SMI_DIV_DIVI_MASK (0xf << 12) ++#define CM_SMI_DIV_DIVI_OFFS (12) ++#define CM_SMI_DIV_DIVF_MASK (0xff << 4) ++#define CM_SMI_DIV_DIVF_OFFS (4) ++ ++/* SMI register mapping:*/ ++#define SMI_BASE_ADDRESS ((BCM2708_PERI_BASE) + 0x600000) ++ ++#define SMICS 0x00 /* control + status register */ ++#define SMIL 0x04 /* length/count (n external txfers) */ ++#define SMIA 0x08 /* address register */ ++#define SMID 0x0c /* data register */ ++#define SMIDSR0 0x10 /* device 0 read settings */ ++#define SMIDSW0 0x14 /* device 0 write settings */ ++#define SMIDSR1 0x18 /* device 1 read settings */ ++#define SMIDSW1 0x1c /* device 1 write settings */ ++#define SMIDSR2 0x20 /* device 2 read settings */ ++#define SMIDSW2 0x24 /* device 2 write settings */ ++#define SMIDSR3 0x28 /* device 3 read settings */ ++#define SMIDSW3 0x2c /* device 3 write settings */ ++#define SMIDC 0x30 /* DMA control registers */ ++#define SMIDCS 0x34 /* direct control/status register */ ++#define SMIDA 0x38 /* direct address register */ ++#define SMIDD 0x3c /* direct data registers */ ++#define SMIFD 0x40 /* FIFO debug register */ ++ ++ ++ ++/* Control and Status register bits: ++ * SMICS_RXF : RX fifo full: 1 when RX fifo is full ++ * SMICS_TXE : TX fifo empty: 1 when empty. ++ * SMICS_RXD : RX fifo contains data: 1 when there is data. ++ * SMICS_TXD : TX fifo can accept data: 1 when true. ++ * SMICS_RXR : RX fifo needs reading: 1 when fifo more than 3/4 full, or ++ * when "DONE" and fifo not emptied. ++ * SMICS_TXW : TX fifo needs writing: 1 when less than 1/4 full. ++ * SMICS_AFERR : AXI FIFO error: 1 when fifo read when empty or written ++ * when full. Write 1 to clear. ++ * SMICS_EDREQ : 1 when external DREQ received. ++ * SMICS_PXLDAT : Pixel data: write 1 to enable pixel transfer modes. ++ * SMICS_SETERR : 1 if there was an error writing to setup regs (e.g. ++ * tx was in progress). Write 1 to clear. ++ * SMICS_PVMODE : Set to 1 to enable pixel valve mode. ++ * SMICS_INTR : Set to 1 to enable interrupt on RX. ++ * SMICS_INTT : Set to 1 to enable interrupt on TX. ++ * SMICS_INTD : Set to 1 to enable interrupt on DONE condition. ++ * SMICS_TEEN : Tear effect mode enabled: Programmed transfers will wait ++ * for a TE trigger before writing. ++ * SMICS_PAD1 : Padding settings for external transfers. For writes: the ++ * number of bytes initially written to the TX fifo that ++ * SMICS_PAD0 : should be ignored. For reads: the number of bytes that will ++ * be read before the data, and should be dropped. ++ * SMICS_WRITE : Transfer direction: 1 = write to external device, 0 = read ++ * SMICS_CLEAR : Write 1 to clear the FIFOs. ++ * SMICS_START : Write 1 to start the programmed transfer. ++ * SMICS_ACTIVE : Reads as 1 when a programmed transfer is underway. ++ * SMICS_DONE : Reads as 1 when transfer finished. For RX, not set until ++ * FIFO emptied. ++ * SMICS_ENABLE : Set to 1 to enable the SMI peripheral, 0 to disable. ++ */ ++ ++#define SMICS_RXF (1 << 31) ++#define SMICS_TXE (1 << 30) ++#define SMICS_RXD (1 << 29) ++#define SMICS_TXD (1 << 28) ++#define SMICS_RXR (1 << 27) ++#define SMICS_TXW (1 << 26) ++#define SMICS_AFERR (1 << 25) ++#define SMICS_EDREQ (1 << 15) ++#define SMICS_PXLDAT (1 << 14) ++#define SMICS_SETERR (1 << 13) ++#define SMICS_PVMODE (1 << 12) ++#define SMICS_INTR (1 << 11) ++#define SMICS_INTT (1 << 10) ++#define SMICS_INTD (1 << 9) ++#define SMICS_TEEN (1 << 8) ++#define SMICS_PAD1 (1 << 7) ++#define SMICS_PAD0 (1 << 6) ++#define SMICS_WRITE (1 << 5) ++#define SMICS_CLEAR (1 << 4) ++#define SMICS_START (1 << 3) ++#define SMICS_ACTIVE (1 << 2) ++#define SMICS_DONE (1 << 1) ++#define SMICS_ENABLE (1 << 0) ++ ++/* Address register bits: */ ++ ++#define SMIA_DEVICE_MASK ((1 << 9) | (1 << 8)) ++#define SMIA_DEVICE_OFFS (8) ++#define SMIA_ADDR_MASK (0x3f) /* bits 5 -> 0 */ ++#define SMIA_ADDR_OFFS (0) ++ ++/* DMA control register bits: ++ * SMIDC_DMAEN : DMA enable: set 1: DMA requests will be issued. ++ * SMIDC_DMAP : DMA passthrough: when set to 0, top two data pins are used by ++ * SMI as usual. When set to 1, the top two pins are used for ++ * external DREQs: pin 16 read request, 17 write. ++ * SMIDC_PANIC* : Threshold at which DMA will panic during read/write. ++ * SMIDC_REQ* : Threshold at which DMA will generate a DREQ. ++ */ ++ ++#define SMIDC_DMAEN (1 << 28) ++#define SMIDC_DMAP (1 << 24) ++#define SMIDC_PANICR_MASK (0x3f << 18) ++#define SMIDC_PANICR_OFFS (18) ++#define SMIDC_PANICW_MASK (0x3f << 12) ++#define SMIDC_PANICW_OFFS (12) ++#define SMIDC_REQR_MASK (0x3f << 6) ++#define SMIDC_REQR_OFFS (6) ++#define SMIDC_REQW_MASK (0x3f) ++#define SMIDC_REQW_OFFS (0) ++ ++/* Device settings register bits: same for all 4 (or 3?) device register sets. ++ * Device read settings: ++ * SMIDSR_RWIDTH : Read transfer width. 00 = 8bit, 01 = 16bit, ++ * 10 = 18bit, 11 = 9bit. ++ * SMIDSR_RSETUP : Read setup time: number of core cycles between chip ++ * select/address and read strobe. Min 1, max 64. ++ * SMIDSR_MODE68 : 1 for System 68 mode (i.e. enable + direction pins, ++ * rather than OE + WE pin) ++ * SMIDSR_FSETUP : If set to 1, setup time only applies to first ++ * transfer after address change. ++ * SMIDSR_RHOLD : Number of core cycles between read strobe going ++ * inactive and CS/address going inactive. Min 1, max 64 ++ * SMIDSR_RPACEALL : When set to 1, this device's RPACE value will always ++ * be used for the next transaction, even if it is not ++ * to this device. ++ * SMIDSR_RPACE : Number of core cycles spent waiting between CS ++ * deassert and start of next transfer. Min 1, max 128 ++ * SMIDSR_RDREQ : 1 = use external DMA request on SD16 to pace reads ++ * from device. Must also set DMAP in SMICS. ++ * SMIDSR_RSTROBE : Number of cycles to assert the read strobe. ++ * min 1, max 128. ++ */ ++#define SMIDSR_RWIDTH_MASK ((1<<31)|(1<<30)) ++#define SMIDSR_RWIDTH_OFFS (30) ++#define SMIDSR_RSETUP_MASK (0x3f << 24) ++#define SMIDSR_RSETUP_OFFS (24) ++#define SMIDSR_MODE68 (1 << 23) ++#define SMIDSR_FSETUP (1 << 22) ++#define SMIDSR_RHOLD_MASK (0x3f << 16) ++#define SMIDSR_RHOLD_OFFS (16) ++#define SMIDSR_RPACEALL (1 << 15) ++#define SMIDSR_RPACE_MASK (0x7f << 8) ++#define SMIDSR_RPACE_OFFS (8) ++#define SMIDSR_RDREQ (1 << 7) ++#define SMIDSR_RSTROBE_MASK (0x7f) ++#define SMIDSR_RSTROBE_OFFS (0) ++ ++/* Device write settings: ++ * SMIDSW_WWIDTH : Write transfer width. 00 = 8bit, 01 = 16bit, ++ * 10= 18bit, 11 = 9bit. ++ * SMIDSW_WSETUP : Number of cycles between CS assert and write strobe. ++ * Min 1, max 64. ++ * SMIDSW_WFORMAT : Pixel format of input. 0 = 16bit RGB 565, ++ * 1 = 32bit RGBA 8888 ++ * SMIDSW_WSWAP : 1 = swap pixel data bits. (Use with SMICS_PXLDAT) ++ * SMIDSW_WHOLD : Time between WE deassert and CS deassert. 1 to 64 ++ * SMIDSW_WPACEALL : 1: this device's WPACE will be used for the next ++ * transfer, regardless of that transfer's device. ++ * SMIDSW_WPACE : Cycles between CS deassert and next CS assert. ++ * Min 1, max 128 ++ * SMIDSW_WDREQ : Use external DREQ on pin 17 to pace writes. DMAP must ++ * be set in SMICS. ++ * SMIDSW_WSTROBE : Number of cycles to assert the write strobe. ++ * Min 1, max 128 ++ */ ++#define SMIDSW_WWIDTH_MASK ((1<<31)|(1<<30)) ++#define SMIDSW_WWIDTH_OFFS (30) ++#define SMIDSW_WSETUP_MASK (0x3f << 24) ++#define SMIDSW_WSETUP_OFFS (24) ++#define SMIDSW_WFORMAT (1 << 23) ++#define SMIDSW_WSWAP (1 << 22) ++#define SMIDSW_WHOLD_MASK (0x3f << 16) ++#define SMIDSW_WHOLD_OFFS (16) ++#define SMIDSW_WPACEALL (1 << 15) ++#define SMIDSW_WPACE_MASK (0x7f << 8) ++#define SMIDSW_WPACE_OFFS (8) ++#define SMIDSW_WDREQ (1 << 7) ++#define SMIDSW_WSTROBE_MASK (0x7f) ++#define SMIDSW_WSTROBE_OFFS (0) ++ ++/* Direct transfer control + status register ++ * SMIDCS_WRITE : Direction of transfer: 1 -> write, 0 -> read ++ * SMIDCS_DONE : 1 when a transfer has finished. Write 1 to clear. ++ * SMIDCS_START : Write 1 to start a transfer, if one is not already underway. ++ * SMIDCE_ENABLE: Write 1 to enable SMI in direct mode. ++ */ ++ ++#define SMIDCS_WRITE (1 << 3) ++#define SMIDCS_DONE (1 << 2) ++#define SMIDCS_START (1 << 1) ++#define SMIDCS_ENABLE (1 << 0) ++ ++/* Direct transfer address register ++ * SMIDA_DEVICE : Indicates which of the device settings banks should be used. ++ * SMIDA_ADDR : The value to be asserted on the address pins. ++ */ ++ ++#define SMIDA_DEVICE_MASK ((1<<9)|(1<<8)) ++#define SMIDA_DEVICE_OFFS (8) ++#define SMIDA_ADDR_MASK (0x3f) ++#define SMIDA_ADDR_OFFS (0) ++ ++/* FIFO debug register ++ * SMIFD_FLVL : The high-tide mark of FIFO count during the most recent txfer ++ * SMIFD_FCNT : The current FIFO count. ++ */ ++#define SMIFD_FLVL_MASK (0x3f << 8) ++#define SMIFD_FLVL_OFFS (8) ++#define SMIFD_FCNT_MASK (0x3f) ++#define SMIFD_FCNT_OFFS (0) ++ ++#endif /* BCM2835_SMI_IMPLEMENTATION */ ++ ++#endif /* BCM2835_SMI_H */ + +From fda45e53b21c5f65e9e161b244b83026cb0fd6f6 Mon Sep 17 00:00:00 2001 +From: Luke Wren +Date: Sat, 5 Sep 2015 01:16:10 +0100 +Subject: [PATCH 183/192] Add SMI NAND driver + +Signed-off-by: Luke Wren +--- + .../bindings/mtd/brcm,bcm2835-smi-nand.txt | 42 ++++ + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/smi-nand-overlay.dts | 69 ++++++ + arch/arm/configs/bcm2709_defconfig | 7 + + arch/arm/configs/bcmrpi_defconfig | 7 + + drivers/mtd/nand/Kconfig | 7 + + drivers/mtd/nand/Makefile | 1 + + drivers/mtd/nand/bcm2835_smi_nand.c | 268 +++++++++++++++++++++ + 8 files changed, 402 insertions(+) + create mode 100644 Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt + create mode 100644 arch/arm/boot/dts/overlays/smi-nand-overlay.dts + create mode 100644 drivers/mtd/nand/bcm2835_smi_nand.c + +diff --git a/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt b/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt +new file mode 100644 +index 0000000..159544d +--- /dev/null ++++ b/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt +@@ -0,0 +1,42 @@ ++* BCM2835 SMI NAND flash ++ ++This driver is a shim between the BCM2835 SMI driver (SMI is a peripheral for ++talking to parallel register interfaces) and Linux's MTD layer. ++ ++Required properties: ++- compatible: "brcm,bcm2835-smi-nand" ++- status: "okay" ++ ++Optional properties: ++- partition@n, where n is an integer from a consecutive sequence starting at 0 ++ - Difficult to store partition table on NAND device - normally put it ++ in the source code, kernel bootparams, or device tree (the best way!) ++ - Sub-properties: ++ - label: the partition name, as shown by mtdinfo /dev/mtd* ++ - reg: the size and offset of this partition. ++ - (optional) read-only: an empty property flagging as read only ++ ++Example: ++ ++nand: flash@0 { ++ compatible = "brcm,bcm2835-smi-nand"; ++ status = "okay"; ++ ++ partition@0 { ++ label = "stage2"; ++ // 128k ++ reg = <0 0x20000>; ++ read-only; ++ }; ++ partition@1 { ++ label = "firmware"; ++ // 16M ++ reg = <0x20000 0x1000000>; ++ read-only; ++ }; ++ partition@2 { ++ label = "root"; ++ // 2G ++ reg = <0x1020000 0x80000000>; ++ }; ++}; +\ No newline at end of file +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index f8f2c034..dfd23a1 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -15,6 +15,7 @@ endif + dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/smi-nand-overlay.dts b/arch/arm/boot/dts/overlays/smi-nand-overlay.dts +new file mode 100644 +index 0000000..13ce0b7 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/smi-nand-overlay.dts +@@ -0,0 +1,69 @@ ++// Description: Overlay to enable NAND flash through ++// the secondary memory interface ++// Author: Luke Wren ++ ++/dts-v1/; ++/plugin/; ++ ++/{ ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&smi>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smi_pins>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&soc>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ nand: flash@0 { ++ compatible = "brcm,bcm2835-smi-nand"; ++ smi_handle = <&smi>; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ status = "okay"; ++ ++ partition@0 { ++ label = "stage2"; ++ // 128k ++ reg = <0 0x20000>; ++ read-only; ++ }; ++ partition@1 { ++ label = "firmware"; ++ // 16M ++ reg = <0x20000 0x1000000>; ++ read-only; ++ }; ++ partition@2 { ++ label = "root"; ++ // 2G (will need to use 64 bit for >=4G) ++ reg = <0x1020000 0x80000000>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&gpio>; ++ __overlay__ { ++ smi_pins: smi_pins { ++ brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11 ++ 12 13 14 15>; ++ /* Alt 1: SMI */ ++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 ++ 5 5 5 5 5>; ++ /* /CS, /WE and /OE are pulled high, as they are ++ generally active low signals */ ++ brcm,pull = <2 2 2 2 2 2 2 2 0 0 0 0 0 0 0 0>; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 16a8354..c7671bf 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -392,6 +392,10 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_MTD=m ++CONFIG_MTD_BLOCK=m ++CONFIG_MTD_NAND=m ++CONFIG_MTD_UBI=m + CONFIG_ZRAM=m + CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y +@@ -1142,6 +1146,9 @@ CONFIG_CONFIGFS_FS=y + CONFIG_ECRYPT_FS=m + CONFIG_HFS_FS=m + CONFIG_HFSPLUS_FS=m ++CONFIG_JFFS2_FS=m ++CONFIG_JFFS2_SUMMARY=y ++CONFIG_UBIFS_FS=m + CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 7dd4fd4..75fa1d0 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -385,6 +385,10 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_MTD=m ++CONFIG_MTD_BLOCK=m ++CONFIG_MTD_NAND=m ++CONFIG_MTD_UBI=m + CONFIG_ZRAM=m + CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y +@@ -1135,6 +1139,9 @@ CONFIG_CONFIGFS_FS=y + CONFIG_ECRYPT_FS=m + CONFIG_HFS_FS=m + CONFIG_HFSPLUS_FS=m ++CONFIG_JFFS2_FS=m ++CONFIG_JFFS2_SUMMARY=y ++CONFIG_UBIFS_FS=m + CONFIG_SQUASHFS=m + CONFIG_SQUASHFS_XATTR=y + CONFIG_SQUASHFS_LZO=y +diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig +index 5897d8d..82c4b4b 100644 +--- a/drivers/mtd/nand/Kconfig ++++ b/drivers/mtd/nand/Kconfig +@@ -41,6 +41,13 @@ config MTD_SM_COMMON + tristate + default n + ++config MTD_NAND_BCM2835_SMI ++ tristate "Use Broadcom's Secondary Memory Interface as a NAND controller (BCM283x)" ++ depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI && MTD_NAND ++ default m ++ help ++ Uses the BCM2835's SMI peripheral as a NAND controller. ++ + config MTD_NAND_DENALI + tristate "Support Denali NAND controller" + depends on HAS_DMA +diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile +index 582bbd05..f1393b0 100644 +--- a/drivers/mtd/nand/Makefile ++++ b/drivers/mtd/nand/Makefile +@@ -14,6 +14,7 @@ obj-$(CONFIG_MTD_NAND_DENALI) += denali.o + obj-$(CONFIG_MTD_NAND_DENALI_PCI) += denali_pci.o + obj-$(CONFIG_MTD_NAND_DENALI_DT) += denali_dt.o + obj-$(CONFIG_MTD_NAND_AU1550) += au1550nd.o ++obj-$(CONFIG_MTD_NAND_BCM2835_SMI) += bcm2835_smi_nand.o + obj-$(CONFIG_MTD_NAND_BF5XX) += bf5xx_nand.o + obj-$(CONFIG_MTD_NAND_S3C2410) += s3c2410.o + obj-$(CONFIG_MTD_NAND_DAVINCI) += davinci_nand.o +diff --git a/drivers/mtd/nand/bcm2835_smi_nand.c b/drivers/mtd/nand/bcm2835_smi_nand.c +new file mode 100644 +index 0000000..b747326 +--- /dev/null ++++ b/drivers/mtd/nand/bcm2835_smi_nand.c +@@ -0,0 +1,268 @@ ++/** ++ * NAND flash driver for Broadcom Secondary Memory Interface ++ * ++ * Written by Luke Wren ++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions, and the following disclaimer, ++ * without modification. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The names of the above-listed copyright holders may not be used ++ * to endorse or promote products derived from this software without ++ * specific prior written permission. ++ * ++ * ALTERNATIVELY, this software may be distributed under the terms of the ++ * GNU General Public License ("GPL") version 2, as published by the Free ++ * Software Foundation. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS ++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, ++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define DEVICE_NAME "bcm2835-smi-nand" ++#define DRIVER_NAME "smi-nand-bcm2835" ++ ++struct bcm2835_smi_nand_host { ++ struct bcm2835_smi_instance *smi_inst; ++ struct nand_chip nand_chip; ++ struct mtd_info mtd; ++ struct device *dev; ++}; ++ ++/**************************************************************************** ++* ++* NAND functionality implementation ++* ++****************************************************************************/ ++ ++#define SMI_NAND_CLE_PIN 0x01 ++#define SMI_NAND_ALE_PIN 0x02 ++ ++static inline void bcm2835_smi_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, ++ unsigned int ctrl) ++{ ++ uint32_t cmd32 = cmd; ++ uint32_t addr = ~(SMI_NAND_CLE_PIN | SMI_NAND_ALE_PIN); ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ if (ctrl & NAND_CLE) ++ addr |= SMI_NAND_CLE_PIN; ++ if (ctrl & NAND_ALE) ++ addr |= SMI_NAND_ALE_PIN; ++ /* Lower ALL the CS pins! */ ++ if (ctrl & NAND_NCE) ++ addr &= (SMI_NAND_CLE_PIN | SMI_NAND_ALE_PIN); ++ ++ bcm2835_smi_set_address(inst, addr); ++ ++ if (cmd != NAND_CMD_NONE) ++ bcm2835_smi_write_buf(inst, &cmd32, 1); ++} ++ ++static inline uint8_t bcm2835_smi_nand_read_byte(struct mtd_info *mtd) ++{ ++ uint8_t byte; ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_read_buf(inst, &byte, 1); ++ return byte; ++} ++ ++static inline void bcm2835_smi_nand_write_byte(struct mtd_info *mtd, ++ uint8_t byte) ++{ ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_write_buf(inst, &byte, 1); ++} ++ ++static inline void bcm2835_smi_nand_write_buf(struct mtd_info *mtd, ++ const uint8_t *buf, int len) ++{ ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_write_buf(inst, buf, len); ++} ++ ++static inline void bcm2835_smi_nand_read_buf(struct mtd_info *mtd, ++ uint8_t *buf, int len) ++{ ++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent); ++ struct bcm2835_smi_instance *inst = host->smi_inst; ++ ++ bcm2835_smi_read_buf(inst, buf, len); ++} ++ ++/**************************************************************************** ++* ++* Probe and remove functions ++* ++***************************************************************************/ ++ ++static int bcm2835_smi_nand_probe(struct platform_device *pdev) ++{ ++ struct bcm2835_smi_nand_host *host; ++ struct nand_chip *this; ++ struct mtd_info *mtd; ++ struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node, *smi_node; ++ struct mtd_part_parser_data ppdata; ++ struct smi_settings *smi_settings; ++ struct bcm2835_smi_instance *smi_inst; ++ int ret = -ENXIO; ++ ++ if (!node) { ++ dev_err(dev, "No device tree node supplied!"); ++ return -EINVAL; ++ } ++ ++ smi_node = of_parse_phandle(node, "smi_handle", 0); ++ ++ /* Request use of SMI peripheral: */ ++ smi_inst = bcm2835_smi_get(smi_node); ++ ++ if (!smi_inst) { ++ dev_err(dev, "Could not register with SMI."); ++ return -EPROBE_DEFER; ++ } ++ ++ /* Set SMI timing and bus width */ ++ ++ smi_settings = bcm2835_smi_get_settings_from_regs(smi_inst); ++ ++ smi_settings->data_width = SMI_WIDTH_8BIT; ++ smi_settings->read_setup_time = 2; ++ smi_settings->read_hold_time = 1; ++ smi_settings->read_pace_time = 1; ++ smi_settings->read_strobe_time = 3; ++ ++ smi_settings->write_setup_time = 2; ++ smi_settings->write_hold_time = 1; ++ smi_settings->write_pace_time = 1; ++ smi_settings->write_strobe_time = 3; ++ ++ bcm2835_smi_set_regs_from_settings(smi_inst); ++ ++ host = devm_kzalloc(dev, sizeof(struct bcm2835_smi_nand_host), ++ GFP_KERNEL); ++ if (!host) ++ return -ENOMEM; ++ ++ host->dev = dev; ++ host->smi_inst = smi_inst; ++ ++ platform_set_drvdata(pdev, host); ++ ++ /* Link the structures together */ ++ ++ this = &host->nand_chip; ++ mtd = &host->mtd; ++ mtd->priv = this; ++ mtd->owner = THIS_MODULE; ++ mtd->dev.parent = dev; ++ mtd->name = DRIVER_NAME; ++ ppdata.of_node = node; ++ ++ /* 20 us command delay time... */ ++ this->chip_delay = 20; ++ ++ this->priv = host; ++ this->cmd_ctrl = bcm2835_smi_nand_cmd_ctrl; ++ this->read_byte = bcm2835_smi_nand_read_byte; ++ this->write_byte = bcm2835_smi_nand_write_byte; ++ this->write_buf = bcm2835_smi_nand_write_buf; ++ this->read_buf = bcm2835_smi_nand_read_buf; ++ ++ this->ecc.mode = NAND_ECC_SOFT; ++ ++ /* Should never be accessed directly: */ ++ ++ this->IO_ADDR_R = (void *)0xdeadbeef; ++ this->IO_ADDR_W = (void *)0xdeadbeef; ++ ++ /* First scan to find the device and get the page size */ ++ ++ if (nand_scan_ident(mtd, 1, NULL)) ++ return -ENXIO; ++ ++ /* Second phase scan */ ++ ++ if (nand_scan_tail(mtd)) ++ return -ENXIO; ++ ++ ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0); ++ if (!ret) ++ return 0; ++ ++ nand_release(mtd); ++ return -EINVAL; ++} ++ ++static int bcm2835_smi_nand_remove(struct platform_device *pdev) ++{ ++ struct bcm2835_smi_nand_host *host = platform_get_drvdata(pdev); ++ ++ nand_release(&host->mtd); ++ ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* Register the driver with device tree ++* ++***************************************************************************/ ++ ++static const struct of_device_id bcm2835_smi_nand_of_match[] = { ++ {.compatible = "brcm,bcm2835-smi-nand",}, ++ { /* sentinel */ } ++}; ++ ++MODULE_DEVICE_TABLE(of, bcm2835_smi_nand_of_match); ++ ++static struct platform_driver bcm2835_smi_nand_driver = { ++ .probe = bcm2835_smi_nand_probe, ++ .remove = bcm2835_smi_nand_remove, ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ .of_match_table = bcm2835_smi_nand_of_match, ++ }, ++}; ++ ++module_platform_driver(bcm2835_smi_nand_driver); ++ ++MODULE_ALIAS("platform:smi-nand-bcm2835"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION ++ ("Driver for NAND chips using Broadcom Secondary Memory Interface"); ++MODULE_AUTHOR("Luke Wren "); + +From 491ad52f804ba93327361dc6803d9599c78dee93 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 16 Sep 2015 17:28:41 +0100 +Subject: [PATCH 184/192] BCM270X_DT: Document SMI overlay + +--- + arch/arm/boot/dts/overlays/Makefile | 6 +++--- + arch/arm/boot/dts/overlays/README | 18 ++++++++++++++++++ + 2 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index dfd23a1..192bda7 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -13,9 +13,6 @@ ifeq ($(CONFIG_ARCH_BCM2835),y) + endif + + dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb +-dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb +-dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb +-dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb +@@ -48,6 +45,9 @@ dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += sdio-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-dma-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 0aa5aa1..4ab4c695 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -530,6 +530,24 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework + debug Enable debug output (default off) + + ++Name: smi ++Info: Enables the Secondary Memory Interface peripheral. Uses GPIOs 2-25! ++Load: dtoverlay=smi ++Params: ++ ++ ++Name: smi-dev ++Info: Enables the userspace interface for the SMI driver ++Load: dtoverlay=smi-dev ++Params: ++ ++ ++Name: smi-nand ++Info: Enables access to NAND flash via the SMI interface ++Load: dtoverlay=smi-nand ++Params: ++ ++ + Name: spi-bcm2708 + Info: Selects the bcm2708-spi SPI driver + Load: dtoverlay=spi-bcm2708 + +From e18520ad8e421cf2592b9bf4e97e98ab3269884d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 17 Sep 2015 17:13:42 +0100 +Subject: [PATCH 185/192] dwc_otg: Force host mode to fix incorrect compute + module boards + +--- + drivers/usb/host/dwc_otg/dwc_otg_cil.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil.c b/drivers/usb/host/dwc_otg/dwc_otg_cil.c +index e40060f..beaa8b3 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_cil.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cil.c +@@ -192,7 +192,7 @@ dwc_otg_core_if_t *dwc_otg_cil_init(const uint32_t * reg_base_addr) + core_if->hptxfsiz.d32 = + DWC_READ_REG32(&core_if->core_global_regs->hptxfsiz); + gusbcfg.d32 = DWC_READ_REG32(&core_if->core_global_regs->gusbcfg); +- gusbcfg.b.force_host_mode = 0; ++ gusbcfg.b.force_host_mode = 1; + DWC_WRITE_REG32(&core_if->core_global_regs->gusbcfg, gusbcfg.d32); + dwc_mdelay(100); + } + +From 06fa410863c6bd9771bce0b2991f4faa17e0f223 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 15 Sep 2015 15:16:24 +0100 +Subject: [PATCH 186/192] config: Add CIFS_DFS_UPCALL, CIFS_ACL, CIFS_SMB2, + CIFS_FSCACHE + +--- + arch/arm/configs/bcm2709_defconfig | 4 ++++ + arch/arm/configs/bcmrpi_defconfig | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index c7671bf..60f8357 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1167,6 +1167,10 @@ CONFIG_CIFS_WEAK_PW_HASH=y + CONFIG_CIFS_UPCALL=y + CONFIG_CIFS_XATTR=y + CONFIG_CIFS_POSIX=y ++CONFIG_CIFS_ACL=y ++CONFIG_CIFS_DFS_UPCALL=y ++CONFIG_CIFS_SMB2=y ++CONFIG_CIFS_FSCACHE=y + CONFIG_9P_FS=m + CONFIG_9P_FS_POSIX_ACL=y + CONFIG_NLS_DEFAULT="utf8" +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 75fa1d0..8ebc8d5 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1160,6 +1160,10 @@ CONFIG_CIFS_WEAK_PW_HASH=y + CONFIG_CIFS_UPCALL=y + CONFIG_CIFS_XATTR=y + CONFIG_CIFS_POSIX=y ++CONFIG_CIFS_ACL=y ++CONFIG_CIFS_DFS_UPCALL=y ++CONFIG_CIFS_SMB2=y ++CONFIG_CIFS_FSCACHE=y + CONFIG_9P_FS=m + CONFIG_9P_FS_POSIX_ACL=y + CONFIG_NLS_DEFAULT="utf8" + +From 1ce910a90e75d8315b40ee57f2ab168822fc4e79 Mon Sep 17 00:00:00 2001 +From: David Lechner +Date: Mon, 14 Sep 2015 19:08:36 -0500 +Subject: [PATCH 187/192] Use dts-dirs feature for overlays. + +The kernel makefiles have a dts-dirs target that is for vendor subdirectories. + +Using this fixes the install_dtbs target, which previously did not install the overlays. +--- + arch/arm/boot/dts/Makefile | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 12de305..faf293f 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -15,6 +15,9 @@ endif + ifeq ($(CONFIG_ARCH_BCM2835),y) + RPI_DT_OVERLAYS=y + endif ++ifeq ($(RPI_DT_OVERLAYS),y) ++ dts-dirs += overlays ++endif + + dtb-$(CONFIG_ARCH_ALPINE) += \ + alpine-db.dtb +@@ -683,11 +686,10 @@ targets += $(dtb-y) + endif + + always := $(dtb-y) ++subdir-y := $(dts-dirs) + clean-files := *.dtb + + # Enable fixups to support overlays on BCM2708 platforms + ifeq ($(RPI_DT_OVERLAYS),y) + DTC_FLAGS ?= -@ + endif +- +-subdir-y += overlays + +From 44533175243d215fa6104520e1ab3df56e11ca2a Mon Sep 17 00:00:00 2001 +From: Martin Sperl +Date: Thu, 10 Sep 2015 09:32:14 +0000 +Subject: [PATCH 192/192] backport: spi: bcm2835: BUG: fix wrong use of + PAGE_MASK + +There is a bug in the alignment checking of transfers, +that results in DMA not being used for un-aligned +transfers that do not cross page-boundries, which is valid. + +This is due to a missconception of the meaning PAGE_MASK +when implementing that check originally - (PAGE_SIZE - 1) +should have been used instead. + +Also fixes a copy/paste error. + +Reported-by: +Signed-off-by: Martin Sperl +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org +--- + drivers/spi/spi-bcm2835.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c +index b68991c..3835332 100644 +--- a/drivers/spi/spi-bcm2835.c ++++ b/drivers/spi/spi-bcm2835.c +@@ -386,14 +386,14 @@ static bool bcm2835_spi_can_dma(struct spi_master *master, + /* otherwise we only allow transfers within the same page + * to avoid wasting time on dma_mapping when it is not practical + */ +- if (((size_t)tfr->tx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) { ++ if (((size_t)tfr->tx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) { + dev_warn_once(&spi->dev, + "Unaligned spi tx-transfer bridging page\n"); + return false; + } +- if (((size_t)tfr->rx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) { ++ if (((size_t)tfr->rx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) { + dev_warn_once(&spi->dev, +- "Unaligned spi tx-transfer bridging page\n"); ++ "Unaligned spi rx-transfer bridging page\n"); + return false; + } +