From 863604e24143bfc2b344026fe65ec1b5aeac8c63 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 28 Jun 2015 13:56:10 +0200 Subject: [PATCH] projects/RPi*/patches/linux: update RPi support patches Signed-off-by: Stephan Raue --- .../patches/linux/linux-01-RPi_support.patch | 2453 +++++++++++++++-- .../patches/linux/linux-01-RPi_support.patch | 2453 +++++++++++++++-- 2 files changed, 4382 insertions(+), 524 deletions(-) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index 0008aa8b30..a35c13d26b 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 8e2bdce040b3459de0954cb2f212dea47549131c Mon Sep 17 00:00:00 2001 +From e9ee97a62574359de01411f0c74e23856e359952 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 01/77] Main bcm2708/bcm2709 linux port +Subject: [PATCH 01/85] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -310,7 +310,7 @@ index 0000000..67039c3 +initrd_phys-y := 0x00800000 diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c new file mode 100644 -index 0000000..cd252fa +index 0000000..4868cd37 --- /dev/null +++ b/arch/arm/mach-bcm2708/armctrl.c @@ -0,0 +1,304 @@ @@ -611,7 +611,7 @@ index 0000000..cd252fa + irq_set_chip(irq, &armctrl_chip); + irq_set_chip_data(irq, (void *)data); + irq_set_handler(irq, handle_level_irq); -+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_DISABLED); ++ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); + } + + armctrl_pm_register(base, irq_start, resume_sources); @@ -653,7 +653,7 @@ index 0000000..0aa916e +#endif diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c new file mode 100644 -index 0000000..d6659b0 +index 0000000..a209c58 --- /dev/null +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -0,0 +1,622 @@ @@ -1164,7 +1164,7 @@ index 0000000..d6659b0 + +static struct irqaction bcm2708_timer_irq = { + .name = "BCM2708 Timer Tick", -+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, ++ .flags = IRQF_TIMER | IRQF_IRQPOLL, + .handler = bcm2708_timer_interrupt, +}; + @@ -3577,7 +3577,7 @@ index 0000000..e33265d +MODULE_LICENSE("GPL"); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c new file mode 100644 -index 0000000..19d0601 +index 0000000..d135620 --- /dev/null +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -0,0 +1,801 @@ @@ -4120,7 +4120,7 @@ index 0000000..19d0601 + +static struct irqaction bcm2709_timer_irq = { + .name = "BCM2709 Timer Tick", -+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, ++ .flags = IRQF_TIMER | IRQF_IRQPOLL, + .handler = bcm2709_timer_interrupt, +}; + @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From aa090a771afa15310eb10d3209c190441f3ecefd Mon Sep 17 00:00:00 2001 +From 081ebd4ba394a354c03f7800b8d14519f165a0f9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 23:48:09 +0100 -Subject: [PATCH 02/77] power: Add power driver +Subject: [PATCH 02/85] power: Add power driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7362,10 +7362,10 @@ index 0000000..bf22b26 + +#endif -From 9409d45ef7d82d4f0677ea1a16bb6e87d41ed8de Mon Sep 17 00:00:00 2001 +From ddd21104179e4df6cf77762b1a7f4dabe65cc808 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 03/77] Add bcm2708_gpio driver +Subject: [PATCH 03/85] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7439,7 +7439,7 @@ index e7d5a29..5120994 100644 obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o +obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index d6659b0..c606853 100644 +index a209c58..6c1c616 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -298,6 +298,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -7476,7 +7476,7 @@ index d6659b0..c606853 100644 int ret; diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c new file mode 100644 -index 0000000..c1e9254 +index 0000000..e33265d --- /dev/null +++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -0,0 +1,426 @@ @@ -7788,7 +7788,7 @@ index 0000000..c1e9254 + +static struct irqaction bcm2708_gpio_irq = { + .name = "BCM2708 GPIO catchall handler", -+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, ++ .flags = IRQF_TIMER | IRQF_IRQPOLL, + .handler = bcm2708_gpio_interrupt, +}; + @@ -7930,7 +7930,7 @@ index 0000000..7965a97 + +#endif diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 19d0601..6060a0d 100644 +index d135620..b173422 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -329,6 +329,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -7995,10 +7995,10 @@ index 0000000..fb69624 + +#endif -From 4b9ec02bb6738a9c29f6308c55cbcab58c2c88a3 Mon Sep 17 00:00:00 2001 +From 8957f79b301a70ab625baa2f9a4c613f871c3f22 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 04/77] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 04/85] mailbox: bcm2708: Add bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -8629,10 +8629,10 @@ index 0000000..cc284ed + +#endif -From c921ec1cd21e8a8eb4e453834a205e9da5dff30a Mon Sep 17 00:00:00 2001 +From c1a8c5708161961f248f228d25da578e90fe127f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 05/77] Add dwc_otg driver +Subject: [PATCH 05/85] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -9253,7 +9253,7 @@ index 8dd26e1..eef4847 100644 + mov pc, r8 +ENDPROC(__FIQ_Branch) diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c -index cd252fa..74bacb3 100644 +index 4868cd37..0429225 100644 --- a/arch/arm/mach-bcm2708/armctrl.c +++ b/arch/arm/mach-bcm2708/armctrl.c @@ -54,8 +54,12 @@ static void armctrl_mask_irq(struct irq_data *d) @@ -9297,7 +9297,7 @@ index cd252fa..74bacb3 100644 return 0; } diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index c606853..4455f34 100644 +index 6c1c616..1735b72 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -254,12 +254,23 @@ static struct resource bcm2708_usb_resources[] = { @@ -69906,10 +69906,10 @@ index 0000000..cdc9963 +test_main(); +0; -From 560486db654a651cebb107628426d1705ef4cc20 Mon Sep 17 00:00:00 2001 +From 2aced0ae5562b3dc60806a3ba2799af134732bdb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 06/77] bcm2708 watchdog driver +Subject: [PATCH 06/85] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -70346,10 +70346,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 7014dbd386a6ce510bd6b9fa3a3fcfc2bd89d237 Mon Sep 17 00:00:00 2001 +From 4a64377d42fac96be299fd210b0eb0bc3ba159b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 07/77] bcm2708 framebuffer driver +Subject: [PATCH 07/85] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73788,10 +73788,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 5efe288a95d60bd10a162be79442d04b6f1d4079 Mon Sep 17 00:00:00 2001 +From b04b39dfe4cb2a287062d3b81287d9a9bf80e91a Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 08/77] dmaengine: Add support for BCM2708 +Subject: [PATCH 08/85] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73907,7 +73907,7 @@ Without this field set properly we get playback issues with I2S cards. create mode 100644 include/linux/platform_data/dma-bcm2708.h diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 4455f34..6b0b6c4 100644 +index 1735b72..1622300 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -234,6 +234,73 @@ static struct amba_device *amba_devs[] __initdata = { @@ -73993,7 +73993,7 @@ index 4455f34..6b0b6c4 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 6060a0d..86ebfbe 100644 +index b173422..fee17e2 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -244,6 +244,73 @@ static struct amba_device *amba_devs[] __initdata = { @@ -75559,10 +75559,10 @@ index 0000000..2310e34 + +#endif /* _PLAT_BCM2708_DMA_H */ -From be30ad8849aa9fd6ffbe6f8198a5af4bb62c465f Mon Sep 17 00:00:00 2001 +From 34e4aa2e25b49261e2aa9d17a1ce767a3dfb90cf Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 09/77] MMC: added alternative MMC driver +Subject: [PATCH 09/85] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75637,7 +75637,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 drivers/mmc/host/bcm2835-mmc.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 6b0b6c4..5b10802 100644 +index 1622300..6257407 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -401,6 +401,34 @@ static struct platform_device bcm2708_gpio_device = { @@ -75686,7 +75686,7 @@ index 6b0b6c4..5b10802 100644 bcm2708_init_uart1(); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 86ebfbe..54c5444 100644 +index fee17e2..07750ed 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -421,6 +421,34 @@ static struct platform_device bcm2708_gpio_device = { @@ -77378,10 +77378,10 @@ index 0000000..b7c4883 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 81cff325dce6ba8765e23e542a219d3c9103a70b Mon Sep 17 00:00:00 2001 +From f1a7eefd17fbaf9335a5fdf6215d319b4042bb55 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 10/77] Adding bcm2835-sdhost driver, and an overlay to enable +Subject: [PATCH 10/85] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -79151,10 +79151,10 @@ index 0000000..eef8a24 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 34fb9ba0190b9f9e18e6c136c64af8dcea23376d Mon Sep 17 00:00:00 2001 +From effb9e4dd94cc200500fb22061ede69047cceea7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 11/77] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 11/85] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix @@ -80479,10 +80479,10 @@ index 0000000..5325832 + +#endif /* VC_CMA_H */ -From 0e6896e85bf10d584b555ecae4b55f066a774b54 Mon Sep 17 00:00:00 2001 +From d83761e1a337d8eee9e9a196e23ceeefe51fff1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 12/77] bcm2708: alsa sound driver +Subject: [PATCH 12/85] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -80539,7 +80539,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 sound/arm/vc_vchi_audioserv_defs.h diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 5b10802..06271df 100644 +index 6257407..df32241 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -429,6 +429,57 @@ struct platform_device bcm2835_emmc_device = { @@ -80610,7 +80610,7 @@ index 5b10802..06271df 100644 if (!use_dt) { for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 54c5444..0f875ff 100644 +index 07750ed..62c95cb 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -449,6 +449,57 @@ struct platform_device bcm2835_emmc_device = { @@ -83324,10 +83324,10 @@ index 0000000..af3e6eb + +#endif // _VC_AUDIO_DEFS_H_ -From b2b5ab24c875e79e1fbb55ae76dc5a914fe301d0 Mon Sep 17 00:00:00 2001 +From 53e9a31fe01ae9460b2361ec93a54bac888d8f5f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 13/77] bcm2708 vchiq driver +Subject: [PATCH 13/85] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -83493,7 +83493,7 @@ vchiq: Change logging level for inbound data create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 06271df..86011af 100644 +index df32241..ecf0524 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -376,6 +376,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -83550,7 +83550,7 @@ index 2e7e1bb..69674e9 100644 /* diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 0f875ff..bc1ee1c 100644 +index 62c95cb..de9feaa 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -396,6 +396,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -96581,10 +96581,10 @@ index 0000000..b6bfa21 + return vchiq_build_time; +} -From 6290b45c0e5fa71d2131718d1b5770e7849aedeb Mon Sep 17 00:00:00 2001 +From 3f8c3cd61c11d730699b14ee1d64db95215487e8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 14/77] vc_mem: Add vc_mem driver +Subject: [PATCH 14/85] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -97590,10 +97590,10 @@ index 0000000..20a4753 + +#endif /* _VC_MEM_H */ -From e9ebded52208b6164753a82d268cd80e833e2737 Mon Sep 17 00:00:00 2001 +From 138483d8fb3cbfcad83b0c450e3c3eb2fca5a8de Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 15/77] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 15/85] 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 @@ -102003,10 +102003,10 @@ index 0000000..0bfb42e +MODULE_DESCRIPTION("VideoCore SharedMemory Driver"); +MODULE_LICENSE("GPL v2"); -From 7f769de038003dcf3f6eff180e2e295888789dc2 Mon Sep 17 00:00:00 2001 +From 3b4d6cc19851307c0426fe31be9627558bb1b2cf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 16/77] Add hwrng (hardware random number generator) driver +Subject: [PATCH 16/85] Add hwrng (hardware random number generator) driver --- drivers/char/hw_random/Kconfig | 13 +++- @@ -102183,10 +102183,10 @@ index 0000000..340f004 +MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver"); +MODULE_LICENSE("GPL and additional rights"); -From 68990b28334ea63cdc56bfe9663025dade9d7822 Mon Sep 17 00:00:00 2001 +From 8312a7efc6b5c8fe996e41f62adf6e9c71f7a5f8 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 17/77] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 17/85] 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 @@ -103039,10 +103039,10 @@ index 0000000..24563ec +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Enable debugging messages"); -From b359d4ff9144f1ee3f333eee7b49bab1c6d92c1f Mon Sep 17 00:00:00 2001 +From 4905ceea875bf96a9dbf4989347ed1d5e4e3875b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 18/77] Add cpufreq driver +Subject: [PATCH 18/85] Add cpufreq driver Signed-off-by: popcornmix --- @@ -103315,10 +103315,10 @@ index 0000000..6735da9 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 37e551cc949ea14042539b089e08df475bab0f59 Mon Sep 17 00:00:00 2001 +From 50ef992dbbc2e7e1c1a87a61b540c0b84f7cb3ee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 19/77] Added hwmon/thermal driver for reporting core +Subject: [PATCH 19/85] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -103341,7 +103341,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 drivers/thermal/bcm2835-thermal.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 86011af..f2d9b03 100644 +index ecf0524..978aaff 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -505,6 +505,10 @@ static struct platform_device bcm2708_alsa_devices[] = { @@ -103365,7 +103365,7 @@ index 86011af..f2d9b03 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index bc1ee1c..9631bdb 100644 +index de9feaa..0e5c8e3 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -525,6 +525,10 @@ static struct platform_device bcm2708_alsa_devices[] = { @@ -103615,10 +103615,10 @@ index 0000000..3bc80f1 + +module_platform_driver(bcm2835_thermal_driver); -From 4d5da3fa21e1d94e38644bf9a5493bb677854e42 Mon Sep 17 00:00:00 2001 +From 0e6c5417c62642c7481e57ce937007277fe31cfd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 20/77] Add Chris Boot's spi driver. +Subject: [PATCH 20/85] Add Chris Boot's spi driver. spi: bcm2708: add device tree support @@ -103679,7 +103679,7 @@ index 4cbda0c..68e3706 100644 + Binds spidev driver to the SPI0 master endmenu diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index f2d9b03..e3aa6fc 100644 +index 978aaff..31ad9da 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -34,6 +34,7 @@ @@ -103764,7 +103764,7 @@ index f2d9b03..e3aa6fc 100644 static void timer_set_mode(enum clock_event_mode mode, diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 9631bdb..5fb99b6 100644 +index 0e5c8e3..6874633 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -34,6 +34,7 @@ @@ -104530,10 +104530,10 @@ index 0000000..041b5e2 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 75d6625177ee7e4746baf70b60380069d58231ba Mon Sep 17 00:00:00 2001 +From 68bec2f411f5f7ea1720f555cadc7a5c6c214934 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 21/77] Add Chris Boot's i2c driver +Subject: [PATCH 21/85] Add Chris Boot's i2c driver i2c-bcm2708: fixed baudrate @@ -104594,7 +104594,7 @@ i2c-bcm2708: When using DT, leave the GPIO setup to pinctrl create mode 100644 drivers/i2c/busses/i2c-bcm2708.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index e3aa6fc..efb3544 100644 +index 31ad9da..26be516 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -83,6 +83,7 @@ static unsigned uart_clock = UART0_CLOCK; @@ -104674,7 +104674,7 @@ index e3aa6fc..efb3544 100644 +module_param(vc_i2c_override, bool, 0644); +MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral."); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 5fb99b6..8017c50 100644 +index 6874633..50843df 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -85,6 +85,7 @@ static unsigned uart_clock = UART0_CLOCK; @@ -105334,10 +105334,10 @@ index 0000000..8773203 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 87711afd62feac0850e063b279057c91fe0aabbf Mon Sep 17 00:00:00 2001 +From f039d3ed041c0fd3267b149ef476638142535ef3 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 22/77] bcm2835: add v4l2 camera device +Subject: [PATCH 22/85] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -112664,10 +112664,10 @@ index 0000000..9d1d11e + +#endif /* MMAL_VCHIQ_H */ -From 0ecc87e37d9107eb533346a4a482bbf78920d16c Mon Sep 17 00:00:00 2001 +From 35af37046308a29d529e83d908c1fea9cd01a8a2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 23/77] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 23/85] scripts/dtc: Update to upstream version with overlay patches --- @@ -117880,10 +117880,10 @@ index 54d4e904..d644002 100644 -#define DTC_VERSION "DTC 1.4.0-dirty" +#define DTC_VERSION "DTC 1.4.1-g36c70742" -From 4cccd63c16e3ef4e2a35144e2806d1d1c56bc381 Mon Sep 17 00:00:00 2001 +From 7b42e6d4640654b00e46f0b14a2f4d4f9979610e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 24/77] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 24/85] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -118368,10 +118368,10 @@ index 0000000..3dff948 + return (($val eq 'y') || ($val eq '1')); +} -From 780d72c0e43679ff58f9f3f005ef17a5fa79ee9f Mon Sep 17 00:00:00 2001 +From 23bd48a5f3cae21a2074ef421a675dfba54866de Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 25/77] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 25/85] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- @@ -118426,10 +118426,10 @@ index cde35c5d01..dd7fbfe 100644 pr_debug("Command line is: %s\n", (char*)data); -From 7ff1afbc6732a16d87c5640be8fec1de73a39770 Mon Sep 17 00:00:00 2001 +From 4c4001e3bc03206e4d87273ac410a719c7a128b4 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 26/77] BCM2708: Add core Device Tree support +Subject: [PATCH 26/85] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -122306,10 +122306,10 @@ index 0000000..66a98f6 + }; +}; -From 4bd17cf8893beb8fb36fe6e321abfe2bc091eb17 Mon Sep 17 00:00:00 2001 +From 5cbd38e967d11494dbf7d401bfcce0240a176f1f Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 27/77] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 27/85] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -122402,10 +122402,10 @@ index fb795c3..fa72af0 100644 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From 54459bf0dcbd9019a1bc98cdc77a5c37811c1be5 Mon Sep 17 00:00:00 2001 +From 9907bcbcbae0e355d82cbc29e4f9667fb6fadfac Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 30/77] Speed up console framebuffer imageblit function +Subject: [PATCH 30/85] 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 @@ -122614,10 +122614,10 @@ index a2bb276..436494f 100644 start_index, pitch_index); } else -From b78abfc78e582f82fda5e69816eaa97b1097c853 Mon Sep 17 00:00:00 2001 +From c50184c27d8c47aa92288d11c79ccbc193f91a74 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 31/77] Allow mac address to be set in smsc95xx +Subject: [PATCH 31/85] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -122708,10 +122708,10 @@ index 26423ad..e29a323 100644 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -From 468a5ebe451a5e3bc693fdbd67173f2fadb7d217 Mon Sep 17 00:00:00 2001 +From b579f8fd561c7347d6354d3f7fc6880ac6b49e7f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 32/77] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 32/85] 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 @@ -122741,7 +122741,7 @@ w1-gpio: Sort out the pullup/parasitic power tangle 7 files changed, 157 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index efb3544..c7b4b61 100644 +index 26be516..55d2889 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -36,6 +36,7 @@ @@ -122814,7 +122814,7 @@ index efb3544..c7b4b61 100644 module_param(vc_i2c_override, bool, 0644); MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral."); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 8017c50..03e208b 100644 +index 50843df..0a5e4188 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -36,6 +36,7 @@ @@ -123109,10 +123109,10 @@ index d58594a..feae942 100644 unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 00d8013737c9e736f70e04e07b761517559e495e Mon Sep 17 00:00:00 2001 +From 8828223a011c97121c5824e4a9056ebfdb178612 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 34/77] config: Enable CONFIG_MEMCG, but leave it disabled (due +Subject: [PATCH 34/85] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -123167,10 +123167,10 @@ index a04225d..a2ef8af 100644 /** -From 5e192d7296061c5d70da39b3fbd1eeedef467923 Mon Sep 17 00:00:00 2001 +From 9028029fe919c229779c848fd2a645bf02d2d959 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 35/77] ASoC: Add support for BCM2708 +Subject: [PATCH 35/85] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -124313,10 +124313,10 @@ index 0000000..6fdcbc1 + +#endif -From 355253cae3f2e9200926bfeb8d21646600d0768e Mon Sep 17 00:00:00 2001 +From 2cd4bdd8e03b8a9ce11d39741d5670d10b58f13e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 36/77] ASoC: Add support for PCM5102A codec +Subject: [PATCH 36/85] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -124441,10 +124441,10 @@ index 0000000..126f1e9 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 49e137bd21361ad8f4439f35956ceab424013411 Mon Sep 17 00:00:00 2001 +From 214e3f42b42cc6512664e15c2e6d48c44397ff30 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 37/77] BCM2708: Add I2S support to board file +Subject: [PATCH 37/85] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -124464,7 +124464,7 @@ See: #1004 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index c7b4b61..dc57983 100644 +index 55d2889..01f2de7 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -616,6 +616,28 @@ static struct platform_device bcm2835_thermal_device = { @@ -124533,10 +124533,10 @@ index a3b65dc..a515992 100644 for (i = 0; i <= 1; i++) { void __iomem *base; -From 5786483930fcb7863012d8bb81d1f73a67b258da Mon Sep 17 00:00:00 2001 +From 7cf3e108eda83b02d6dcf336c5e1842b36fab753 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 38/77] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 38/85] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -124685,10 +124685,10 @@ index 0000000..4b70b45 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 47d7a2a48fd4b2da2f9400de4307febe755b2ef2 Mon Sep 17 00:00:00 2001 +From 895fd13e0cf6dc5febf489837d068825db70d7ac Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 39/77] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 39/85] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -124699,7 +124699,7 @@ Signed-off-by: Florian Meier 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index dc57983..ef7c48d 100644 +index 01f2de7..1d9b788 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -638,6 +638,20 @@ static struct platform_device bcm2708_i2s_device = { @@ -124736,10 +124736,10 @@ index dc57983..ef7c48d 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; -From 403dc5c76505dd5813174532b2f032e52cbe06b8 Mon Sep 17 00:00:00 2001 +From e01a75a2784a659fbd297dc849a2e25ae120e35c Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 40/77] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 40/85] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -124757,7 +124757,7 @@ Signed-off-by: Florian Meier create mode 100644 sound/soc/codecs/pcm1794a.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index ef7c48d..be27073 100644 +index 1d9b788..6d53beb 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -652,6 +652,20 @@ static struct platform_device snd_pcm5102a_codec_device = { @@ -125034,10 +125034,10 @@ index 0000000..b4eaa44 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 0418e9bd3eab8e21b5d69ed0b7899dd5a80263f1 Mon Sep 17 00:00:00 2001 +From 4250d743113025b72b841b0b801aee698d8761ef Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 41/77] ASoC: wm8804: Implement MCLK configuration options, add +Subject: [PATCH 41/85] 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 @@ -125077,10 +125077,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 82c2f5a297701240bf5a77611d2d93c041497246 Mon Sep 17 00:00:00 2001 +From bb771a22197d65ccab827fe36a8699d18b961693 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 42/77] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 42/85] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -125345,10 +125345,10 @@ index 0000000..92e9e46 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From df14e52cd5e411324c58e28ec158f503d4905dbb Mon Sep 17 00:00:00 2001 +From 6081cb2ed879b4e99cd91a36331460bf6ec2e3f0 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 43/77] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 43/85] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -125357,7 +125357,7 @@ Signed-off-by: Daniel Matuschek 1 file changed, 20 insertions(+) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index be27073..2a33663 100644 +index 6d53beb..a062d7f 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -652,6 +652,21 @@ static struct platform_device snd_pcm5102a_codec_device = { @@ -125395,10 +125395,10 @@ index be27073..2a33663 100644 bcm_register_device_dt(&snd_rpi_dac_device); bcm_register_device_dt(&snd_pcm1794a_codec_device); -From d8de9644604c68b7148b023608d70d8ac3bf466f Mon Sep 17 00:00:00 2001 +From 6d26e73e4afc0f00e514498776ff0e24d595f919 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 44/77] ASoC: wm8804: Set idle_bias_off to false Idle bias has +Subject: [PATCH 44/85] ASoC: wm8804: Set idle_bias_off to false Idle bias has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek @@ -125420,10 +125420,10 @@ index d4efa85..f3f26a2 100644 .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From 40f01186460630fa704c88adbefbc347e5e402e4 Mon Sep 17 00:00:00 2001 +From 76c18d6844de1ab292a34baf6c96566ba05db024 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 45/77] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 45/85] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -125440,7 +125440,7 @@ limit of 0dB for this control. create mode 100644 sound/soc/bcm/iqaudio-dac.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 2a33663..957504e 100644 +index a062d7f..a51a6168 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -681,6 +681,22 @@ static struct platform_device snd_pcm1794a_codec_device = { @@ -125631,10 +125631,10 @@ index 0000000..aff7377 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 5d1014e6dfa91f7f4b07851eefaa0a8bc544fda8 Mon Sep 17 00:00:00 2001 +From 712b1f5ed46d64ace42306b175e84247ad466a86 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 46/77] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 46/85] vmstat: Workaround for issue where dirty page count goes negative See: @@ -125661,10 +125661,10 @@ index 82e7db7..f87d16d 100644 static inline void __inc_zone_page_state(struct page *page, -From 462ac627ee409f190f5519727c80942afafd0d6d Mon Sep 17 00:00:00 2001 +From 8fe8c0d0126e286164be182add69b996012753b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 47/77] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 47/85] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125700,10 +125700,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From 6a68d9854eed6f1c5741aff8466cb5877deecd54 Mon Sep 17 00:00:00 2001 +From db5d9cfda38672c42a52574924297223f44ab568 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 48/77] Added support for HiFiBerry DAC+ +Subject: [PATCH 48/85] 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. @@ -125716,7 +125716,7 @@ a different codec chip (PCM5122), therefore a new driver is necessary. create mode 100644 sound/soc/bcm/hifiberry_dacplus.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 957504e..90459b8 100644 +index a51a6168..d421a89 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -652,6 +652,20 @@ static struct platform_device snd_pcm5102a_codec_device = { @@ -125914,10 +125914,10 @@ index 0000000..c63387b +MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+"); +MODULE_LICENSE("GPL v2"); -From 1ca3777a5f3e17847136937e1bab1717281c73ca Mon Sep 17 00:00:00 2001 +From f929e0ea9b902ca56a57439ad326a7fe1bc190d2 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 49/77] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 49/85] 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. @@ -125947,7 +125947,7 @@ Some code to load the driver based on device-tree-overlays was missing. This is create mode 100644 sound/soc/codecs/tas5713.h diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 90459b8..785cf1a 100644 +index d421a89..363b9c5 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -681,6 +681,20 @@ static struct i2c_board_info __initdata snd_wm8804_i2c_devices[] = { @@ -126786,10 +126786,10 @@ index 0000000..8f019e0 + +#endif /* _TAS5713_H */ -From 06c9b132b1340b495048f8814be13fe71b5cd77e Mon Sep 17 00:00:00 2001 +From 0d10a0439bbde5d1bf74427cb93a55a29ea7ec12 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 50/77] bcm2708: Allow option card devices to be configured via +Subject: [PATCH 50/85] bcm2708: Allow option card devices to be configured via DT If the kernel is built with Device Tree support, and if a DT blob @@ -126814,10 +126814,10 @@ index 03fa1cb..c816526 100644 static struct platform_driver bcm2835_i2s_driver = { .probe = bcm2835_i2s_probe, -From a9fff3c9005e6658977bd5e7df92114e70e1f813 Mon Sep 17 00:00:00 2001 +From 8eaeacdeca7966b710fbdefad07bd3f0de14447c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 51/77] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 51/85] Adding Device Tree support for some RPi audio cards --- arch/arm/mach-bcm2709/bcm2709.c | 143 ++++++++++++++++++++++++++++++++++++++ @@ -126829,7 +126829,7 @@ Subject: [PATCH 51/77] Adding Device Tree support for some RPi audio cards 6 files changed, 232 insertions(+) diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 03e208b..2ae79d9 100644 +index 0a5e4188..57e1f3d 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -636,6 +636,115 @@ static struct platform_device bcm2835_thermal_device = { @@ -127180,10 +127180,10 @@ index 126f1e9..7c6598e 100644 }; -From 9518bd237c4fb516a0ec78f7ec81e5784f8425e0 Mon Sep 17 00:00:00 2001 +From 7dfce43c57cc203535e6098fcc1e8977d85ddeac Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 52/77] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 52/85] Added support to reserve/enable a GPIO pin to be used from pps-gpio module (LinuxPPS). Enable PPS modules in default config for RPi. @@ -127193,7 +127193,7 @@ Subject: [PATCH 52/77] Added support to reserve/enable a GPIO pin to be used 2 files changed, 54 insertions(+) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 785cf1a..e42f5a5 100644 +index 363b9c5..74ec578 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -37,6 +37,7 @@ @@ -127256,7 +127256,7 @@ index 785cf1a..e42f5a5 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 2ae79d9..95223ff 100644 +index 57e1f3d..721559b 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -37,6 +37,7 @@ @@ -127319,10 +127319,10 @@ index 2ae79d9..95223ff 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); -From 6831eded602a01774036cb24d3195dbbd51f9135 Mon Sep 17 00:00:00 2001 +From a3936496fcb450e52716292427b60570447b6b03 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 53/77] Update ds1307 driver for device-tree support +Subject: [PATCH 53/85] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -127349,10 +127349,10 @@ index 4ffabb3..c6789a7 100644 .driver = { .name = "rtc-ds1307", -From 47ca2482bc03a888435d35139cd2f5989354ee1b Mon Sep 17 00:00:00 2001 +From eed1565f9cb449204057486a48c39f917c269fa1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 54/77] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 54/85] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -127463,10 +127463,10 @@ index 0000000..2ca2b98 +MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); +MODULE_LICENSE("GPL"); -From 38c278bba1388423ba1508d0712babb717685530 Mon Sep 17 00:00:00 2001 +From 494f12e28e415f895a337fcfcfe45cd530c1cc99 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 55/77] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 55/85] bcm2709: Simplify and strip down IRQ handler --- arch/arm/include/asm/entry-macro-multi.S | 2 + @@ -127685,10 +127685,10 @@ index d08591b..08d184c 100644 +1: get_irqnr_and_base r0, r2, r6, lr + .endm -From a69146643bae1215ab2860b9646f0f380bd3c50f Mon Sep 17 00:00:00 2001 +From 3e2b399180b8f5a0090134ba1889443945a13cf6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 56/77] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 56/85] Fix LED "input" trigger implementation for 3.19 --- drivers/leds/leds-gpio.c | 10 +++++++++- @@ -127775,10 +127775,10 @@ index 9a2b000..60accc5 100644 /* Set LED brightness level */ /* Must not sleep, use a workqueue if needed */ -From d8f6c527b14c125e58173e8bd0e7c6c59bab4919 Mon Sep 17 00:00:00 2001 +From 5c958120f03edcedf40ff2d07b825229d348d26b Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 57/77] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 57/85] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -127800,10 +127800,10 @@ index 8d908e3..7a1900d 100644 .can_sleep = false, }; -From bf8c97c74733237b219a22da649cb6cb7029615d Mon Sep 17 00:00:00 2001 +From 784bb9af1427a9b17cd6894cff2dc3c2eb8c4735 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 58/77] pinctrl-bcm2835: bcm2835_gpio_direction_output must set +Subject: [PATCH 58/85] pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value --- @@ -127831,10 +127831,10 @@ index 7a1900d..62f85aa 100644 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) -From 1262602778ac5adbe798e7ace41b22262a578fcf Mon Sep 17 00:00:00 2001 +From c885a17c2aee5d4f00b2dc950bcdadd3ed7bd7cb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 59/77] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 +Subject: [PATCH 59/85] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -127980,10 +127980,10 @@ index 62f85aa..c7cf266 100644 }, }; -From fd7e740e1c83bd550444192a8beff54ea5291c50 Mon Sep 17 00:00:00 2001 +From ead5cb2483b2fb0943121dfb69786e6ec1c20ced Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 60/77] pinctrl-bcm2835: Only request the interrupts listed in +Subject: [PATCH 60/85] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -128010,10 +128010,10 @@ index c7cf266..986779a 100644 pc->irq_data[i].irqgroup = i; -From c24fbfc7a5bc3c7cb35f51d0a40ad25b98a8a422 Mon Sep 17 00:00:00 2001 +From 15eff0b34d5eba282dfa1fc0303bb66f08d237ad Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 61/77] enc28j60: Add device tree compatible string and an +Subject: [PATCH 61/85] enc28j60: Add device tree compatible string and an overlay --- @@ -128047,10 +128047,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From 331cdec0de30933d5e7839f0e3def9b98d3fa968 Mon Sep 17 00:00:00 2001 +From 4c1fa7e5d19f7f006576def6cdf591c325d9a167 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 62/77] Add driver for rpi-proto +Subject: [PATCH 62/85] 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 @@ -128265,10 +128265,10 @@ index 0000000..c6e45a0 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 2079392f1bde4f50d8c1ad65c2f7b52a6ff34848 Mon Sep 17 00:00:00 2001 +From 3a796c13d6cf8d6cd51170b34944b18d50f30bba Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 63/77] Add Device Tree support for RPi-DAC. +Subject: [PATCH 63/85] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -128343,10 +128343,10 @@ index b4eaa44..afe1b41 100644 }; -From 4725644a3f7c09811486c1324f9653e79ecbdcb7 Mon Sep 17 00:00:00 2001 +From 69754b2aaecf3eb2dd3bef6f68d7e7787a9dc6cc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 64/77] config: Add default configs +Subject: [PATCH 64/85] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1204 ++++++++++++++++++++++++++++++++++++ @@ -130771,10 +130771,10 @@ index 0000000..6a41231 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 7de29243d1ac891a526c77e17129d6e2d547361d Mon Sep 17 00:00:00 2001 +From c6ed3e60b55412cdf8e130053f600c05c3e1460a Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 65/77] smsx95xx: fix crimes against truesize +Subject: [PATCH 65/85] 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. @@ -130809,10 +130809,10 @@ index e29a323..aff63dc usbnet_skb_return(dev, ax_skb); } -From 4772a6e4cc3921cb41515b7b0a91ad646d1491aa Mon Sep 17 00:00:00 2001 +From ef3796d3a8cdb18963e2eeb04fa493abca03af14 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 66/77] smsc95xx: Disable turbo mode by default +Subject: [PATCH 66/85] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -130832,10 +130832,10 @@ index aff63dc..08a8a8c 100755 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 9d1fbb7b2dbe16c506f54984c361a55d1b2603fb Mon Sep 17 00:00:00 2001 +From 831d4392562d46f0d9a55c755c1363b84832af2a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 67/77] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 67/85] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130918,10 +130918,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From d8492b31751e7eda1b9b2c92dd381b5d7df1679d Mon Sep 17 00:00:00 2001 +From a20e01130fd949a90e5e91821edd63581e95cc1e 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 68/77] bcm2835: bcm2835_defconfig +Subject: [PATCH 68/85] bcm2835: bcm2835_defconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132251,10 +132251,10 @@ index 31cb073..2e8a95a 100644 # CONFIG_XZ_DEC_ARM is not set # CONFIG_XZ_DEC_ARMTHUMB is not set -From 4e2ed4a7a7971ea763017bc6234d30cdc5bfb984 Mon Sep 17 00:00:00 2001 +From f06ed380a59b6b336820510c6716db5bd9928e66 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 69/77] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 69/85] BCM270x_DT: Add mailbox bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132269,7 +132269,7 @@ Signed-off-by: Noralf Trønnes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index e42f5a5..de2f93a 100644 +index 74ec578..5527d5c 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -870,7 +870,7 @@ void __init bcm2708_init(void) @@ -132282,7 +132282,7 @@ index e42f5a5..de2f93a 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 95223ff..350647a 100644 +index 721559b..4a00561 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -890,7 +890,7 @@ void __init bcm2709_init(void) @@ -132295,10 +132295,10 @@ index 95223ff..350647a 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); -From 2867da0a54803e6eb8e748b63a474877e16899b0 Mon Sep 17 00:00:00 2001 +From ad4a25a7e27ffac5b4f5b9eba60c8588ec2e04c1 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 70/77] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 70/85] rpi-ft5406: Add touchscreen driver for pi LCD display --- drivers/input/touchscreen/Kconfig | 7 + @@ -132615,10 +132615,10 @@ index cc284ed..d3ea839 100644 VCMSG_SET_CURSOR_STATE = 0x00008011, }; -From f794a0549b3a54cbe6dcfef3b37c421dda92d13a Mon Sep 17 00:00:00 2001 +From 4d11ea5e022aa484a8884a54d08bb5d3f26bed0b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 71/77] Improve __copy_to_user and __copy_from_user performance +Subject: [PATCH 71/85] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use optimised memcpy/memmove/memcmp/memset implementations. @@ -134142,10 +134142,10 @@ index 3e58d71..0622891 100644 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 5787d557e062cdac5f3e19ccd60394dc6df38aab Mon Sep 17 00:00:00 2001 +From 961d37927bd0de6c86334892d19341f427a6d543 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 72/77] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 72/85] bcm2835-audio: Create the platform device if the DT node is disabled For backwards compatibility, allow the built-in ALSA driver to be enabled @@ -134157,7 +134157,7 @@ node in DT. 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index de2f93a..cfc4f13 100644 +index 5527d5c..937c2d3 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -898,8 +898,14 @@ void __init bcm2708_init(void) @@ -134178,7 +134178,7 @@ index de2f93a..cfc4f13 100644 bcm_register_device_dt(&bcm2708_spi_device); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 350647a..507ff52 100644 +index 4a00561..dec8043 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -918,8 +918,14 @@ void __init bcm2709_init(void) @@ -134199,10 +134199,10 @@ index 350647a..507ff52 100644 bcm_register_device_dt(&bcm2708_spi_device); -From 070a6f51cd5f81f635cfcccd3452ee5f252a7ee4 Mon Sep 17 00:00:00 2001 +From 729ca6d5fc85ce618d61af67f400d1f20ddd2fbd 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 73/77] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 73/85] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -134261,10 +134261,10 @@ index 70f2f39..f7fdacd 100644 static const char * const bcm2835_compat[] = { -From 3add74da14e27d18ef276f66c55a69e6dc014216 Mon Sep 17 00:00:00 2001 +From 9a645229a554cd9b0f211bd15310ceb4c61f32b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 74/77] platform: Add force_core command line setting to boot +Subject: [PATCH 74/85] platform: Add force_core command line setting to boot from a different core number --- @@ -134315,7 +134315,7 @@ index a366275..90805a6 100644 writel(1 << (data & 0x1f), __io_address(enables[(data >> 5) & 0x3])); } else if (d->irq == INTERRUPT_ARM_LOCAL_PMU_FAST) { diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 507ff52..c5e51e8 100644 +index dec8043..fe71c50 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -96,6 +96,7 @@ static unsigned w1_gpio_pin = W1_GPIO; @@ -134335,112 +134335,2041 @@ index 507ff52..c5e51e8 100644 module_param(serial, uint, 0644); module_param(uart_clock, uint, 0644); -From a283be0c98260b1f29c8c46df7e8fb2a9cdaf5a8 Mon Sep 17 00:00:00 2001 +From 0733a658a5b233abd9da4157ab2bfd52ceebf404 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 75/77] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 75/85] mach-bcm270x: Enable the building of pinctrl-bcm2835 --- drivers/pinctrl/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile -index 6eadf04..ca6e1be 100644 +index 6eadf04..9119513 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o -+obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_MACH_BCM2709) += bcm/ - obj-$(CONFIG_ARCH_BCM) += bcm/ - obj-$(CONFIG_ARCH_BERLIN) += berlin/ - obj-y += freescale/ - -From fd08db11f15960c30449a5a2cb14d3ab7fd470ea Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 18 Jun 2015 18:06:28 +0100 -Subject: [PATCH 76/77] squash: Fix inconsistency in pinctrl Makefile patch - ---- - drivers/pinctrl/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile -index ca6e1be..9119513 100644 ---- a/drivers/pinctrl/Makefile -+++ b/drivers/pinctrl/Makefile -@@ -38,7 +38,7 @@ obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o - obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o - obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o - --obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_MACH_BCM2709) += bcm/ +obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_ARCH_BCM2709) += bcm/ obj-$(CONFIG_ARCH_BCM) += bcm/ obj-$(CONFIG_ARCH_BERLIN) += berlin/ obj-y += freescale/ -From 05376fce25aaab4f47182a5af04928bfa06f30d6 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 18 Jun 2015 19:53:58 +0100 -Subject: [PATCH 77/77] platform: squash: Remove IRQF_DISABLED +From 3c7dc45eee7c0339b72469bf6674e842385b7ab9 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 19 Jun 2015 16:41:39 +0100 +Subject: [PATCH 76/85] BCM270X_DT: Document the i2s-mmap overlay --- - arch/arm/mach-bcm2708/armctrl.c | 2 +- - arch/arm/mach-bcm2708/bcm2708.c | 2 +- - arch/arm/mach-bcm2708/bcm2708_gpio.c | 2 +- - arch/arm/mach-bcm2709/bcm2709.c | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) + arch/arm/boot/dts/overlays/README | 6 ++++++ + 1 file changed, 6 insertions(+) -diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c -index 74bacb3..0429225 100644 ---- a/arch/arm/mach-bcm2708/armctrl.c -+++ b/arch/arm/mach-bcm2708/armctrl.c -@@ -305,7 +305,7 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start, - irq_set_chip(irq, &armctrl_chip); - irq_set_chip_data(irq, (void *)data); - irq_set_handler(irq, handle_level_irq); -- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_DISABLED); -+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 3e08f98..7fa6d33 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -260,6 +260,12 @@ Params: ds1307 Select the DS1307 device + pcf8563 Select the PCF8563 device + + ++Name: i2s-mmap ++Info: Enables mmap support in the bcm2708-i2s driver ++Load: dtoverlay=i2s-mmap ++Params: ++ ++ + Name: iqaudio-dac + Info: Configures the IQaudio DAC audio card + Load: dtoverlay=iqaudio-dac + +From d9fa11803a0d2e3b1eaf4041ddd0ca5651300d96 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 17 Jun 2015 11:36:53 +0100 +Subject: [PATCH 77/85] bcm2835-sdhost: Improve error handling and recovery + +1) Expose the hw_reset method to the MMC framework, removing many + internal calls by the driver. + +2) Reduce overclock setting on error. + +3) Increase timeout to cope with high capacity cards. + +4) Add properties and parameters to control pio_limit and debug. + +5) Reduce messages at probe time. +--- + arch/arm/boot/dts/overlays/README | 8 +- + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 4 +- + drivers/mmc/host/bcm2835-sdhost.c | 578 ++++++++++++++++++-------- + 3 files changed, 404 insertions(+), 186 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 7fa6d33..63da266 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -408,7 +408,13 @@ Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock + Load: dtoverlay=sdhost,= + Params: overclock_50 Clock (in MHz) to use when the MMC framework + requests 50MHz +- force_pio Disable DMA support ++ ++ force_pio Disable DMA support (default off) ++ ++ pio_limit Number of blocks above which to use DMA ++ (default 2) ++ ++ debug Enable debug output (default off) + + + Name: spi-bcm2708 +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index 8fb28e9..b408ab4 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -22,6 +22,7 @@ + dma-names = "tx", "rx"; + brcm,delay-after-stop = <0>; + brcm,overclock-50 = <0>; ++ brcm,pio-limit = <2>; + status = "okay"; + }; + }; +@@ -70,9 +71,10 @@ + }; + + __overrides__ { +- delay_after_stop = <&sdhost>,"brcm,delay-after-stop:0"; + overclock_50 = <&sdhost>,"brcm,overclock-50:0"; + force_pio = <&sdhost>,"brcm,force-pio?"; ++ pio_limit = <&sdhost>,"brcm,pio-limit:0"; ++ debug = <&sdhost>,"brcm,debug?"; + sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; + }; + }; +diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c +index eef8a24..6277e43 100644 +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -90,9 +90,8 @@ + /* Reserved */ + #define SDHSTS_DATA_FLAG 0x01 + +-#define SDHSTS_TRANSFER_ERROR_MASK (SDHSTS_CRC16_ERROR|SDHSTS_REW_TIME_OUT|SDHSTS_FIFO_ERROR) ++#define SDHSTS_TRANSFER_ERROR_MASK (SDHSTS_CRC7_ERROR|SDHSTS_CRC16_ERROR|SDHSTS_REW_TIME_OUT|SDHSTS_FIFO_ERROR) + #define SDHSTS_ERROR_MASK (SDHSTS_CMD_TIME_OUT|SDHSTS_TRANSFER_ERROR_MASK) +-/* SDHSTS_CRC7_ERROR - ignore this as MMC cards generate this spuriously */ + + #define SDHCFG_BUSY_IRPT_EN (1<<10) + #define SDHCFG_BLOCK_IRPT_EN (1<<8) +@@ -111,16 +110,7 @@ + #define SDEDM_READ_THRESHOLD_SHIFT 14 + #define SDEDM_THRESHOLD_MASK 0x1f + +-/* the inclusive limit in bytes under which PIO will be used instead of DMA */ +-#ifdef CONFIG_MMC_BCM2835_SDHOST_PIO_DMA_BARRIER +-#define PIO_DMA_BARRIER CONFIG_MMC_BCM2835_SDHOST_PIO_DMA_BARRIER +-#else +-#define PIO_DMA_BARRIER 0 +-#endif +- +-#define MIN_FREQ 400000 +-#define TIMEOUT_VAL 0xE +-#define BCM2835_SDHOST_WRITE_DELAY(f) (((2 * 1000000) / f) + 1) ++#define MHZ 1000000 + + #ifndef BCM2708_PERI_BASE + #define BCM2708_PERI_BASE 0x20000000 +@@ -138,19 +128,20 @@ struct bcm2835_host { + + struct mmc_host *mmc; + +- u32 timeout; ++ u32 pio_timeout; /* In jiffies */ + + int clock; /* Current clock speed */ + + bool slow_card; /* Force 11-bit divisor */ + + unsigned int max_clk; /* Max possible freq */ +- unsigned int timeout_clk; /* Timeout freq (KHz) */ + + struct tasklet_struct finish_tasklet; /* Tasklet structures */ + + struct timer_list timer; /* Timer for timeouts */ + ++ struct timer_list pio_timer; /* PIO error detection timer */ ++ + struct sg_mapping_iter sg_miter; /* SG state for PIO */ + unsigned int blocks; /* remaining PIO blocks */ + +@@ -170,6 +161,10 @@ struct bcm2835_host { + + unsigned int use_busy:1; /* Wait for busy interrupt */ + ++ unsigned int reduce_overclock:1; /* ...at the next opportunity */ ++ ++ unsigned int debug:1; /* Enable debug output */ ++ + u32 thread_isr; + + /*DMA part*/ +@@ -185,7 +180,8 @@ struct bcm2835_host { + struct timeval stop_time; /* when the last stop was issued */ + u32 delay_after_stop; /* minimum time between stop and subsequent data transfer */ + u32 overclock_50; /* frequency to use when 50MHz is requested (in MHz) */ +- u32 max_overclock; /* Highest reported */ ++ u32 overclock; /* Current frequency if overclocked, else zero */ ++ u32 pio_limit; /* Maximum block count for PIO (0 = always DMA) */ + }; + + +@@ -204,41 +200,79 @@ static inline u32 bcm2835_sdhost_read_relaxed(struct bcm2835_host *host, int reg + return readl_relaxed(host->ioaddr + reg); + } + ++static void bcm2835_sdhost_dumpcmd(struct bcm2835_host *host, ++ struct mmc_command *cmd, ++ const char *label) ++{ ++ if (cmd) ++ pr_info("%s:%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", ++ mmc_hostname(host->mmc), ++ (cmd == host->cmd) ? '>' : ' ', ++ label, cmd->opcode, cmd->arg, cmd->flags, ++ cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3], ++ cmd->error); ++} ++ + static void bcm2835_sdhost_dumpregs(struct bcm2835_host *host) + { +- pr_info(DRIVER_NAME ": =========== REGISTER DUMP (%s)===========\n", ++ bcm2835_sdhost_dumpcmd(host, host->mrq->sbc, "sbc"); ++ bcm2835_sdhost_dumpcmd(host, host->mrq->cmd, "cmd"); ++ if (host->mrq->data) ++ pr_err("%s: data blocks %x blksz %x - err %d\n", ++ mmc_hostname(host->mmc), ++ host->mrq->data->blocks, ++ host->mrq->data->blksz, ++ host->mrq->data->error); ++ bcm2835_sdhost_dumpcmd(host, host->mrq->stop, "stop"); ++ ++ pr_info("%s: =========== REGISTER DUMP ===========\n", + mmc_hostname(host->mmc)); + +- pr_info(DRIVER_NAME ": SDCMD 0x%08x\n", ++ pr_info("%s: SDCMD 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCMD)); +- pr_info(DRIVER_NAME ": SDARG 0x%08x\n", ++ pr_info("%s: SDARG 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDARG)); +- pr_info(DRIVER_NAME ": SDTOUT 0x%08x\n", ++ pr_info("%s: SDTOUT 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDTOUT)); +- pr_info(DRIVER_NAME ": SDCDIV 0x%08x\n", ++ pr_info("%s: SDCDIV 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCDIV)); +- pr_info(DRIVER_NAME ": SDRSP0 0x%08x\n", ++ pr_info("%s: SDRSP0 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP0)); +- pr_info(DRIVER_NAME ": SDRSP1 0x%08x\n", ++ pr_info("%s: SDRSP1 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP1)); +- pr_info(DRIVER_NAME ": SDRSP2 0x%08x\n", ++ pr_info("%s: SDRSP2 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP2)); +- pr_info(DRIVER_NAME ": SDRSP3 0x%08x\n", ++ pr_info("%s: SDRSP3 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP3)); +- pr_info(DRIVER_NAME ": SDHSTS 0x%08x\n", ++ pr_info("%s: SDHSTS 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHSTS)); +- pr_info(DRIVER_NAME ": SDVDD 0x%08x\n", ++ pr_info("%s: SDVDD 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDVDD)); +- pr_info(DRIVER_NAME ": SDEDM 0x%08x\n", ++ pr_info("%s: SDEDM 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDEDM)); +- pr_info(DRIVER_NAME ": SDHCFG 0x%08x\n", ++ pr_info("%s: SDHCFG 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHCFG)); +- pr_info(DRIVER_NAME ": SDHBCT 0x%08x\n", ++ pr_info("%s: SDHBCT 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBCT)); +- pr_info(DRIVER_NAME ": SDHBLC 0x%08x\n", ++ pr_info("%s: SDHBLC 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBLC)); + +- pr_debug(DRIVER_NAME ": ===========================================\n"); ++ pr_info("%s: ===========================================\n", ++ mmc_hostname(host->mmc)); + } + + +@@ -248,12 +282,10 @@ static void bcm2835_sdhost_set_power(struct bcm2835_host *host, bool on) + } + + +-static void bcm2835_sdhost_reset(struct bcm2835_host *host) ++static void bcm2835_sdhost_reset_internal(struct bcm2835_host *host) + { + u32 temp; + +- pr_debug("bcm2835_sdhost_reset\n"); +- + bcm2835_sdhost_set_power(host, false); + + bcm2835_sdhost_write(host, 0, SDCMD); +@@ -281,6 +313,20 @@ static void bcm2835_sdhost_reset(struct bcm2835_host *host) + mmiowb(); + } + ++ ++static void bcm2835_sdhost_reset(struct mmc_host *mmc) ++{ ++ struct bcm2835_host *host = mmc_priv(mmc); ++ unsigned long flags; ++ if (host->debug) ++ pr_info("%s: reset\n", mmc_hostname(mmc)); ++ spin_lock_irqsave(&host->lock, flags); ++ ++ bcm2835_sdhost_reset_internal(host); ++ ++ spin_unlock_irqrestore(&host->lock, flags); ++} ++ + static void bcm2835_sdhost_set_ios(struct mmc_host *mmc, struct mmc_ios *ios); + + static void bcm2835_sdhost_init(struct bcm2835_host *host, int soft) +@@ -290,7 +336,7 @@ static void bcm2835_sdhost_init(struct bcm2835_host *host, int soft) + /* Set interrupt enables */ + host->hcfg = SDHCFG_BUSY_IRPT_EN; + +- bcm2835_sdhost_reset(host); ++ bcm2835_sdhost_reset_internal(host); + + if (soft) { + /* force clock reconfiguration */ +@@ -420,6 +466,40 @@ static void bcm2835_sdhost_dma_complete(void *param) + spin_unlock_irqrestore(&host->lock, flags); + } + ++static bool data_transfer_wait(struct bcm2835_host *host, const char *caller) ++{ ++ unsigned long timeout = 1000000; ++ u32 hsts; ++ while (timeout) ++ { ++ hsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (hsts & (SDHSTS_TRANSFER_ERROR_MASK | ++ SDHSTS_DATA_FLAG)) { ++ bcm2835_sdhost_write(host, SDHSTS_TRANSFER_ERROR_MASK, ++ SDHSTS); ++ break; ++ } ++ timeout--; ++ } ++ ++ if (hsts & (SDHSTS_CRC16_ERROR | ++ SDHSTS_CRC7_ERROR | ++ SDHSTS_FIFO_ERROR)) { ++ pr_err("%s: data error in %s - HSTS %x\n", ++ mmc_hostname(host->mmc), caller, hsts); ++ host->data->error = -EILSEQ; ++ return false; ++ } else if ((timeout == 0) || ++ (hsts & (SDHSTS_CMD_TIME_OUT | ++ SDHSTS_REW_TIME_OUT))) { ++ pr_err("%s: timeout in %s - HSTS %x\n", ++ mmc_hostname(host->mmc), caller, hsts); ++ host->data->error = -ETIMEDOUT; ++ return false; ++ } ++ return true; ++} ++ + static void bcm2835_sdhost_read_block_pio(struct bcm2835_host *host) + { + unsigned long flags; +@@ -443,35 +523,15 @@ static void bcm2835_sdhost_read_block_pio(struct bcm2835_host *host) + buf = (u32 *)host->sg_miter.addr; + + while (len) { +- while (1) { +- u32 hsts; +- hsts = bcm2835_sdhost_read(host, SDHSTS); +- if (hsts & SDHSTS_DATA_FLAG) +- break; +- +- if (hsts & SDHSTS_ERROR_MASK) { +- pr_err("%s: Transfer error - HSTS %x, HBCT %x - %x left\n", +- mmc_hostname(host->mmc), +- hsts, +- bcm2835_sdhost_read(host, SDHBCT), +- blksize + len); +- if (hsts & SDHSTS_REW_TIME_OUT) +- host->data->error = -ETIMEDOUT; +- else if (hsts & (SDHSTS_CRC16_ERROR || +- SDHSTS_CRC7_ERROR)) +- host->data->error = -EILSEQ; +- else { +- pr_err("%s: unexpected data error\n", +- mmc_hostname(host->mmc)); +- bcm2835_sdhost_dumpregs(host); +- host->cmd->error = -EIO; +- } +- } +- } ++ if (!data_transfer_wait(host, "read_block_pio")) ++ break; + + *(buf++) = bcm2835_sdhost_read(host, SDDATA); + len -= 4; + } ++ ++ if (host->data->error) ++ break; } - armctrl_pm_register(base, irq_start, resume_sources); -diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index cfc4f13..937c2d3 100644 ---- a/arch/arm/mach-bcm2708/bcm2708.c -+++ b/arch/arm/mach-bcm2708/bcm2708.c -@@ -1028,7 +1028,7 @@ static irqreturn_t bcm2708_timer_interrupt(int irq, void *dev_id) + sg_miter_stop(&host->sg_miter); +@@ -502,11 +562,15 @@ static void bcm2835_sdhost_write_block_pio(struct bcm2835_host *host) + buf = host->sg_miter.addr; - static struct irqaction bcm2708_timer_irq = { - .name = "BCM2708 Timer Tick", -- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, -+ .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = bcm2708_timer_interrupt, + while (len) { +- while (!(bcm2835_sdhost_read(host, SDHSTS) & SDHSTS_DATA_FLAG)) +- continue; ++ if (!data_transfer_wait(host, "write_block_pio")) ++ break; ++ + bcm2835_sdhost_write(host, *(buf++), SDDATA); + len -= 4; + } ++ ++ if (host->data->error) ++ break; + } + + sg_miter_stop(&host->sg_miter); +@@ -519,10 +583,15 @@ static void bcm2835_sdhost_transfer_pio(struct bcm2835_host *host) + { + BUG_ON(!host->data); + +- if (host->data->flags & MMC_DATA_READ) ++ if (host->data->flags & MMC_DATA_READ) { + bcm2835_sdhost_read_block_pio(host); +- else ++ } else { + bcm2835_sdhost_write_block_pio(host); ++ ++ /* Start a timer in case a transfer error occurs because ++ there is no error interrupt */ ++ mod_timer(&host->pio_timer, jiffies + host->pio_timeout); ++ } + } + + +@@ -607,6 +676,7 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + host->flush_fifo = 0; + host->data->bytes_xfered = 0; + ++ host->use_dma = host->have_dma && (data->blocks > host->pio_limit); + if (!host->use_dma) { + int flags; + +@@ -619,8 +689,6 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + host->blocks = data->blocks; + } + +- host->use_dma = host->have_dma && data->blocks > PIO_DMA_BARRIER; +- + bcm2835_sdhost_set_transfer_irqs(host); + + bcm2835_sdhost_write(host, data->blksz, SDHBCT); +@@ -638,22 +706,25 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + + WARN_ON(host->cmd); + +- if (1) { +- pr_debug("bcm2835_sdhost_send_command: %08x %08x (flags %x)\n", +- cmd->opcode, cmd->arg, (cmd->flags & 0xff) | (cmd->data ? cmd->data->flags : 0)); +- if (cmd->data) +- pr_debug("bcm2835_sdhost_send_command: %s %d*%x\n", +- (cmd->data->flags & MMC_DATA_READ) ? +- "read" : "write", cmd->data->blocks, +- cmd->data->blksz); +- } ++ if (cmd->data) ++ pr_debug("%s: send_command %d 0x%x " ++ "(flags 0x%x) - %s %d*%d\n", ++ mmc_hostname(host->mmc), ++ cmd->opcode, cmd->arg, cmd->flags, ++ (cmd->data->flags & MMC_DATA_READ) ? ++ "read" : "write", cmd->data->blocks, ++ cmd->data->blksz); ++ else ++ pr_debug("%s: send_command %d 0x%x (flags 0x%x)\n", ++ mmc_hostname(host->mmc), ++ cmd->opcode, cmd->arg, cmd->flags); + + /* Wait max 10 ms */ + timeout = 1000; + + while (bcm2835_sdhost_read(host, SDCMD) & SDCMD_NEW_FLAG) { + if (timeout == 0) { +- pr_err("%s: Previous command never completed.\n", ++ pr_err("%s: previous command never completed.\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); + cmd->error = -EIO; +@@ -666,16 +737,16 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + + if ((1000-timeout)/100 > 1 && (1000-timeout)/100 > host->max_delay) { + host->max_delay = (1000-timeout)/100; +- pr_warning("Warning: SDHost controller hung for %d ms\n", host->max_delay); ++ pr_warning("%s: controller hung for %d ms\n", ++ mmc_hostname(host->mmc), ++ host->max_delay); + } + + timeout = jiffies; +-#ifdef CONFIG_ARCH_BCM2835 + if (!cmd->data && cmd->busy_timeout > 9000) + timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ; + else +-#endif +- timeout += 10 * HZ; ++ timeout += 10 * HZ; + mod_timer(&host->timer, timeout); + + host->cmd = cmd; +@@ -685,7 +756,7 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + bcm2835_sdhost_write(host, cmd->arg, SDARG); + + if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { +- pr_err("%s: Unsupported response type!\n", ++ pr_err("%s: unsupported response type!\n", + mmc_hostname(host->mmc)); + cmd->error = -EINVAL; + tasklet_schedule(&host->finish_tasklet); +@@ -783,13 +854,6 @@ static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host) + pr_debug("transfer_complete(error %d, stop %d)\n", + data->error, data->stop ? 1 : 0); + +- if (data->error) +- /* +- * The controller needs a reset of internal state machines +- * upon error conditions. +- */ +- bcm2835_sdhost_reset(host); +- + /* + * Need to send CMD12 if - + * a) open-ended multiblock transfer (no CMD23) +@@ -845,7 +909,7 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + #endif + + if (timeout == 0) { +- pr_err("%s: Command never completed.\n", ++ pr_err("%s: command never completed.\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); + host->cmd->error = -EIO; +@@ -875,14 +939,23 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + { + u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); + +- pr_debug("%s: error detected - CMD %x, HSTS %03x, EDM %x\n", +- mmc_hostname(host->mmc), sdcmd, sdhsts, +- bcm2835_sdhost_read(host, SDEDM)); +- +- if (sdhsts & SDHSTS_CMD_TIME_OUT) ++ if (host->debug) ++ pr_info("%s: error detected - CMD %x, HSTS %03x, EDM %x\n", ++ mmc_hostname(host->mmc), sdcmd, sdhsts, ++ bcm2835_sdhost_read(host, SDEDM)); ++ ++ if (sdhsts & SDHSTS_CMD_TIME_OUT) { ++ switch (host->cmd->opcode) { ++ case 5: case 52: case 53: ++ /* Don't warn about SDIO commands */ ++ break; ++ default: ++ pr_err("%s: command timeout\n", ++ mmc_hostname(host->mmc)); ++ break; ++ } + host->cmd->error = -ETIMEDOUT; +- else +- { ++ } else { + pr_err("%s: unexpected command error\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); +@@ -897,11 +970,13 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + int i; + for (i = 0; i < 4; i++) + host->cmd->resp[3 - i] = bcm2835_sdhost_read(host, SDRSP0 + i*4); +- pr_debug("bcm2835_sdhost_finish_command: %08x %08x %08x %08x\n", ++ pr_debug("%s: finish_command %08x %08x %08x %08x\n", ++ mmc_hostname(host->mmc), + host->cmd->resp[0], host->cmd->resp[1], host->cmd->resp[2], host->cmd->resp[3]); + } else { + host->cmd->resp[0] = bcm2835_sdhost_read(host, SDRSP0); +- pr_debug("bcm2835_sdhost_finish_command: %08x\n", ++ pr_debug("%s: finish_command %08x\n", ++ mmc_hostname(host->mmc), + host->cmd->resp[0]); + } + } +@@ -932,7 +1007,7 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + } + } + +-static void bcm2835_sdhost_timeout_timer(unsigned long data) ++static void bcm2835_sdhost_timeout(unsigned long data) + { + struct bcm2835_host *host; + unsigned long flags; +@@ -942,7 +1017,7 @@ static void bcm2835_sdhost_timeout_timer(unsigned long data) + spin_lock_irqsave(&host->lock, flags); + + if (host->mrq) { +- pr_err("%s: Timeout waiting for hardware interrupt.\n", ++ pr_err("%s: timeout waiting for hardware interrupt.\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); + +@@ -964,6 +1039,41 @@ static void bcm2835_sdhost_timeout_timer(unsigned long data) + spin_unlock_irqrestore(&host->lock, flags); + } + ++static void bcm2835_sdhost_pio_timeout(unsigned long data) ++{ ++ struct bcm2835_host *host; ++ unsigned long flags; ++ ++ host = (struct bcm2835_host *)data; ++ ++ spin_lock_irqsave(&host->lock, flags); ++ ++ if (host->data) { ++ u32 hsts = bcm2835_sdhost_read(host, SDHSTS); ++ ++ if (hsts & SDHSTS_REW_TIME_OUT) { ++ pr_err("%s: transfer timeout\n", ++ mmc_hostname(host->mmc)); ++ if (host->debug) ++ bcm2835_sdhost_dumpregs(host); ++ } else { ++ pr_err("%s: unexpected transfer timeout\n", ++ mmc_hostname(host->mmc)); ++ bcm2835_sdhost_dumpregs(host); ++ } ++ ++ bcm2835_sdhost_write(host, SDHSTS_TRANSFER_ERROR_MASK, ++ SDHSTS); ++ ++ host->data->error = -ETIMEDOUT; ++ ++ bcm2835_sdhost_finish_data(host); ++ } ++ ++ mmiowb(); ++ spin_unlock_irqrestore(&host->lock, flags); ++} ++ + static void bcm2835_sdhost_enable_sdio_irq_nolock(struct bcm2835_host *host, int enable) + { + if (enable) +@@ -979,7 +1089,7 @@ static void bcm2835_sdhost_enable_sdio_irq(struct mmc_host *mmc, int enable) + struct bcm2835_host *host = mmc_priv(mmc); + unsigned long flags; + +- pr_debug("bcm2835_sdhost_enable_sdio_irq(%d)\n", enable); ++ pr_debug("%s: enable_sdio_irq(%d)\n", mmc_hostname(mmc), enable); + spin_lock_irqsave(&host->lock, flags); + bcm2835_sdhost_enable_sdio_irq_nolock(host, enable); + spin_unlock_irqrestore(&host->lock, flags); +@@ -987,11 +1097,12 @@ static void bcm2835_sdhost_enable_sdio_irq(struct mmc_host *mmc, int enable) + + static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + { +- const u32 handled = (SDHSTS_CMD_TIME_OUT | SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | SDHSTS_FIFO_ERROR); ++ const u32 handled = (SDHSTS_REW_TIME_OUT | SDHSTS_CMD_TIME_OUT | ++ SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR | ++ SDHSTS_FIFO_ERROR); + + if (!host->cmd) { +- pr_err("%s: Got command busy interrupt 0x%08x even " ++ pr_err("%s: got command busy interrupt 0x%08x even " + "though no command operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); +@@ -999,7 +1110,7 @@ static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + } + + if (!host->use_busy) { +- pr_err("%s: Got command busy interrupt 0x%08x even " ++ pr_err("%s: got command busy interrupt 0x%08x even " + "though not expecting one.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); +@@ -1007,14 +1118,28 @@ static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + } + host->use_busy = 0; + +- if (intmask & SDHSTS_CMD_TIME_OUT) +- host->cmd->error = -ETIMEDOUT; +- else if (intmask & (SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR | +- SDHSTS_FIFO_ERROR)) +- host->cmd->error = -EILSEQ; ++ if (intmask & SDHSTS_ERROR_MASK) ++ { ++ pr_err("sdhost_busy_irq: intmask %x, data %p\n", intmask, host->mrq->data); ++ if (intmask & SDHSTS_CRC7_ERROR) ++ host->cmd->error = -EILSEQ; ++ else if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR)) { ++ if (host->mrq->data) ++ host->mrq->data->error = -EILSEQ; ++ else ++ host->cmd->error = -EILSEQ; ++ } else if (intmask & SDHSTS_REW_TIME_OUT) { ++ if (host->mrq->data) ++ host->mrq->data->error = -ETIMEDOUT; ++ else ++ host->cmd->error = -ETIMEDOUT; ++ } else if (intmask & SDHSTS_CMD_TIME_OUT) ++ host->cmd->error = -ETIMEDOUT; + +- if (host->cmd->error) ++ bcm2835_sdhost_dumpregs(host); + tasklet_schedule(&host->finish_tasklet); ++ } + else + bcm2835_sdhost_finish_command(host); + +@@ -1023,8 +1148,9 @@ static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + + static u32 bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask) + { +- const u32 handled = (SDHSTS_CMD_TIME_OUT | SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | SDHSTS_FIFO_ERROR); ++ const u32 handled = (SDHSTS_REW_TIME_OUT | ++ SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR); + + /* There are no dedicated data/space available interrupt + status bits, so it is necessary to use the single shared +@@ -1034,13 +1160,19 @@ static u32 bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask) + if (!host->data) + return 0; + +- // XXX FIFO_ERROR +- if (intmask & SDHSTS_CMD_TIME_OUT) +- host->cmd->error = -ETIMEDOUT; +- else if ((intmask & (SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR)) && +- ((bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK) +- != MMC_BUS_TEST_R)) +- host->cmd->error = -EILSEQ; ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR | ++ SDHSTS_REW_TIME_OUT)) { ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR)) ++ host->data->error = -EILSEQ; ++ else ++ host->data->error = -ETIMEDOUT; ++ ++ bcm2835_sdhost_dumpregs(host); ++ tasklet_schedule(&host->finish_tasklet); ++ return handled; ++ } + + /* Use the block interrupt for writes after the first block */ + if (host->data->flags & MMC_DATA_WRITE) { +@@ -1067,31 +1199,48 @@ static u32 bcm2835_sdhost_block_irq(struct bcm2835_host *host, u32 intmask) + { + struct dma_chan *dma_chan; + u32 dir_data; +- const u32 handled = (SDHSTS_CMD_TIME_OUT | SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | SDHSTS_FIFO_ERROR); ++ const u32 handled = (SDHSTS_REW_TIME_OUT | ++ SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR); + + if (!host->data) { +- pr_err("%s: Got block interrupt 0x%08x even " ++ pr_err("%s: got block interrupt 0x%08x even " + "though no data operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); + return handled; + } + +- if (intmask & SDHSTS_CMD_TIME_OUT) +- host->cmd->error = -ETIMEDOUT; +- else if ((intmask & (SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR)) && +- ((bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK) +- != MMC_BUS_TEST_R)) +- host->cmd->error = -EILSEQ; ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR | ++ SDHSTS_REW_TIME_OUT)) { ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR)) ++ host->data->error = -EILSEQ; ++ else ++ host->data->error = -ETIMEDOUT; ++ ++ if (host->debug) ++ bcm2835_sdhost_dumpregs(host); ++ tasklet_schedule(&host->finish_tasklet); ++ return handled; ++ } + + if (!host->use_dma) { + BUG_ON(!host->blocks); + host->blocks--; +- if ((host->blocks == 0) || host->data->error) ++ if ((host->blocks == 0) || host->data->error) { ++ /* Cancel the timer */ ++ del_timer(&host->pio_timer); ++ + bcm2835_sdhost_finish_data(host); +- else ++ } else { + bcm2835_sdhost_transfer_pio(host); ++ ++ /* Reset the timer */ ++ mod_timer(&host->pio_timer, ++ jiffies + host->pio_timeout); ++ } + } else if (host->data->flags & MMC_DATA_WRITE) { + dma_chan = host->dma_chan_tx; + dir_data = DMA_TO_DEVICE; +@@ -1125,7 +1274,7 @@ static irqreturn_t bcm2835_sdhost_irq(int irq, void *dev_id) + SDHSTS_BLOCK_IRPT | + SDHSTS_SDIO_IRPT | + SDHSTS_DATA_FLAG); +- if ((handled == SDHSTS_DATA_FLAG) && // XXX ++ if ((handled == SDHSTS_DATA_FLAG) && + (loops == 0) && !host->data) { + pr_err("%s: sdhost_irq data interrupt 0x%08x even " + "though no data operation was in progress.\n", +@@ -1177,10 +1326,11 @@ static irqreturn_t bcm2835_sdhost_irq(int irq, void *dev_id) + spin_unlock(&host->lock); + + if (early) +- pr_debug("%s: early %x (loops %d)\n", mmc_hostname(host->mmc), early, loops); ++ pr_debug("%s: early %x (loops %d)\n", ++ mmc_hostname(host->mmc), early, loops); + + if (unexpected) { +- pr_err("%s: Unexpected interrupt 0x%08x.\n", ++ pr_err("%s: unexpected interrupt 0x%08x.\n", + mmc_hostname(host->mmc), unexpected); + bcm2835_sdhost_dumpregs(host); + } +@@ -1227,8 +1377,22 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + int div = 0; /* Initialized for compiler warning */ + unsigned int input_clock = clock; + +- if (host->overclock_50 && (clock == 50000000)) +- clock = host->overclock_50 * 1000000 + 999999; ++ if (host->debug) ++ pr_info("%s: set_clock(%d)\n", mmc_hostname(host->mmc), clock); ++ ++ if ((clock == 0) && host->reduce_overclock) { ++ /* This is a reset following data corruption - reduce any ++ overclock */ ++ host->reduce_overclock = 0; ++ if (host->overclock_50 > 50) { ++ pr_warn("%s: reducing overclock due to errors\n", ++ mmc_hostname(host->mmc)); ++ host->overclock_50--; ++ } ++ } ++ ++ if (host->overclock_50 && (clock == 50*MHZ)) ++ clock = host->overclock_50 * MHZ + (MHZ - 1); + + /* The SDCDIV register has 11 bits, and holds (div - 2). + But in data mode the max is 50MHz wihout a minimum, and only the +@@ -1275,17 +1439,34 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + clock = host->max_clk / (div + 2); + host->mmc->actual_clock = clock; + +- if ((clock > input_clock) && (clock > host->max_overclock)) { +- pr_warn("%s: Overclocking to %dHz\n", +- mmc_hostname(host->mmc), clock); +- host->max_overclock = clock; ++ if (clock > input_clock) { ++ /* Save the closest value, to make it easier ++ to reduce in the event of error */ ++ host->overclock_50 = (clock/MHZ); ++ ++ if (clock != host->overclock) { ++ pr_warn("%s: overclocking to %dHz\n", ++ mmc_hostname(host->mmc), clock); ++ host->overclock = clock; ++ } ++ } ++ else if ((clock == 50 * MHZ) && host->overclock) ++ { ++ pr_warn("%s: cancelling overclock\n", ++ mmc_hostname(host->mmc)); ++ host->overclock = 0; + } + + host->cdiv = div; + bcm2835_sdhost_write(host, host->cdiv, SDCDIV); + +- pr_debug(DRIVER_NAME ": clock=%d -> max_clk=%d, cdiv=%x (actual clock %d)\n", +- input_clock, host->max_clk, host->cdiv, host->mmc->actual_clock); ++ /* Set the timeout to 500ms */ ++ bcm2835_sdhost_write(host, host->mmc->actual_clock/2, SDTOUT); ++ ++ if (host->debug) ++ pr_info("%s: clock=%d -> max_clk=%d, cdiv=%x (actual clock %d)\n", ++ mmc_hostname(host->mmc), input_clock, ++ host->max_clk, host->cdiv, host->mmc->actual_clock); + } + + static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1293,29 +1474,32 @@ static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq + struct bcm2835_host *host; + unsigned long flags; + +- if (1) { ++ host = mmc_priv(mmc); ++ ++ if (host->debug) { + struct mmc_command *cmd = mrq->cmd; +- const char *src = "cmd"; + BUG_ON(!cmd); +- pr_debug("bcm2835_sdhost_request: %s %08x %08x (flags %x)\n", +- src, cmd->opcode, cmd->arg, cmd->flags); + if (cmd->data) +- pr_debug("bcm2835_sdhost_request: %s %d*%d\n", +- (cmd->data->flags & MMC_DATA_READ) ? +- "read" : "write", cmd->data->blocks, +- cmd->data->blksz); ++ pr_info("%s: cmd %d 0x%x (flags 0x%x) - %s %d*%d\n", ++ mmc_hostname(mmc), ++ cmd->opcode, cmd->arg, cmd->flags, ++ (cmd->data->flags & MMC_DATA_READ) ? ++ "read" : "write", cmd->data->blocks, ++ cmd->data->blksz); ++ else ++ pr_info("%s: cmd %d 0x%x (flags 0x%x)\n", ++ mmc_hostname(mmc), ++ cmd->opcode, cmd->arg, cmd->flags); + } + + if (mrq->data && !is_power_of_2(mrq->data->blksz)) { +- pr_err("%s: Unsupported block size (%d bytes)\n", ++ pr_err("%s: unsupported block size (%d bytes)\n", + mmc_hostname(mmc), mrq->data->blksz); + mrq->cmd->error = -EINVAL; + mmc_request_done(mmc, mrq); + return; + } + +- host = mmc_priv(mmc); +- + spin_lock_irqsave(&host->lock, flags); + + WARN_ON(host->mrq != NULL); +@@ -1345,9 +1529,12 @@ static void bcm2835_sdhost_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) + struct bcm2835_host *host = mmc_priv(mmc); + unsigned long flags; + +- pr_debug("bcm2835_sdhost_set_ios: clock %d, pwr %d, bus_width %d, timing %d, vdd %d, drv_type %d\n", +- ios->clock, ios->power_mode, ios->bus_width, +- ios->timing, ios->signal_voltage, ios->drv_type); ++ if (host->debug) ++ pr_info("%s: ios clock %d, pwr %d, bus_width %d, " ++ "timing %d, vdd %d, drv_type %d\n", ++ mmc_hostname(mmc), ++ ios->clock, ios->power_mode, ios->bus_width, ++ ios->timing, ios->signal_voltage, ios->drv_type); + + spin_lock_irqsave(&host->lock, flags); + +@@ -1396,6 +1583,7 @@ static struct mmc_host_ops bcm2835_sdhost_ops = { + .request = bcm2835_sdhost_request, + .set_ios = bcm2835_sdhost_set_ios, + .enable_sdio_irq = bcm2835_sdhost_enable_sdio_irq, ++ .hw_reset = bcm2835_sdhost_reset, + .multi_io_quirk = bcm2835_sdhost_multi_io_quirk, }; -diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c -index c1e9254..e33265d 100644 ---- a/arch/arm/mach-bcm2708/bcm2708_gpio.c -+++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c -@@ -306,7 +306,7 @@ static irqreturn_t bcm2708_gpio_interrupt(int irq, void *dev_id) +@@ -1423,15 +1611,24 @@ static void bcm2835_sdhost_tasklet_finish(unsigned long param) - static struct irqaction bcm2708_gpio_irq = { - .name = "BCM2708 GPIO catchall handler", -- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, -+ .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = bcm2708_gpio_interrupt, + mrq = host->mrq; + +- /* +- * The controller needs a reset of internal state machines +- * upon error conditions. +- */ +- if (((mrq->cmd && mrq->cmd->error) || +- (mrq->data && (mrq->data->error || +- (mrq->data->stop && mrq->data->stop->error))))) { ++ /* Drop the overclock after any data corruption, or after any ++ error overclocked */ ++ if (mrq->data && (mrq->data->error == -EILSEQ)) ++ host->reduce_overclock = 1; ++ else if (host->overclock) { ++ /* Convert timeout errors while overclocked to data errors, ++ because the system recovers better. */ ++ if (mrq->cmd && mrq->cmd->error) { ++ host->reduce_overclock = 1; ++ if (mrq->cmd->error == -ETIMEDOUT) ++ mrq->cmd->error = -EILSEQ; ++ } + +- bcm2835_sdhost_reset(host); ++ if (mrq->data && mrq->data->error) { ++ host->reduce_overclock = 1; ++ if (mrq->data->error == -ETIMEDOUT) ++ mrq->data->error = -EILSEQ; ++ } + } + + host->mrq = NULL; +@@ -1450,35 +1647,37 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + { + struct mmc_host *mmc; + struct dma_slave_config cfg; ++ char pio_limit_string[20]; + int ret; + + mmc = host->mmc; + +- bcm2835_sdhost_reset(host); ++ bcm2835_sdhost_reset_internal(host); + + mmc->f_max = host->max_clk; + mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV; + +- /* SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK */ +- host->timeout_clk = mmc->f_max / 1000; +-#ifdef CONFIG_ARCH_BCM2835 +- mmc->max_busy_timeout = (1 << 27) / host->timeout_clk; +-#endif ++ mmc->max_busy_timeout = (~(unsigned int)0)/(mmc->f_max/1000); ++ ++ pr_debug("f_max %d, f_min %d, max_busy_timeout %d\n", ++ mmc->f_max, mmc->f_min, mmc->max_busy_timeout); ++ + /* host controller capabilities */ + mmc->caps |= /* MMC_CAP_SDIO_IRQ |*/ MMC_CAP_4_BIT_DATA | + MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | +- MMC_CAP_NEEDS_POLL | ++ MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET | + (ALLOW_CMD23 * MMC_CAP_CMD23); + + spin_lock_init(&host->lock); + + if (host->allow_dma) { +- if (!host->dma_chan_tx || !host->dma_chan_rx || +- IS_ERR(host->dma_chan_tx) || IS_ERR(host->dma_chan_rx)) { +- pr_err("%s: Unable to initialise DMA channels. Falling back to PIO\n", DRIVER_NAME); ++ if (IS_ERR_OR_NULL(host->dma_chan_tx) || ++ IS_ERR_OR_NULL(host->dma_chan_rx)) { ++ pr_err("%s: unable to initialise DMA channels. " ++ "Falling back to PIO\n", ++ mmc_hostname(mmc)); + host->have_dma = false; + } else { +- pr_info("DMA channels allocated for the SDHost driver"); + host->have_dma = true; + + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; +@@ -1496,7 +1695,6 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + ret = dmaengine_slave_config(host->dma_chan_rx, &cfg); + } + } else { +- pr_info("Forcing PIO mode\n"); + host->have_dma = false; + } + +@@ -1512,18 +1710,23 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + tasklet_init(&host->finish_tasklet, + bcm2835_sdhost_tasklet_finish, (unsigned long)host); + +- setup_timer(&host->timer, bcm2835_sdhost_timeout_timer, (unsigned long)host); ++ setup_timer(&host->timer, bcm2835_sdhost_timeout, ++ (unsigned long)host); ++ ++ setup_timer(&host->pio_timer, bcm2835_sdhost_pio_timeout, ++ (unsigned long)host); + + bcm2835_sdhost_init(host, 0); + #ifndef CONFIG_ARCH_BCM2835 + ret = request_irq(host->irq, bcm2835_sdhost_irq, 0 /*IRQF_SHARED*/, + mmc_hostname(mmc), host); + #else +- ret = request_threaded_irq(host->irq, bcm2835_sdhost_irq, bcm2835_sdhost_thread_irq, ++ ret = request_threaded_irq(host->irq, bcm2835_sdhost_irq, ++ bcm2835_sdhost_thread_irq, + IRQF_SHARED, mmc_hostname(mmc), host); + #endif + if (ret) { +- pr_err("%s: Failed to request IRQ %d: %d\n", ++ pr_err("%s: failed to request IRQ %d: %d\n", + mmc_hostname(mmc), host->irq, ret); + goto untasklet; + } +@@ -1531,10 +1734,13 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + mmiowb(); + mmc_add_host(mmc); + +- pr_info("Load BCM2835 SDHost driver\n"); +- if (host->delay_after_stop) +- pr_info("BCM2835 SDHost: delay_after_stop=%dus\n", +- host->delay_after_stop); ++ pio_limit_string[0] = '\0'; ++ if (host->have_dma && (host->pio_limit > 0)) ++ sprintf(pio_limit_string, " (>%d)", host->pio_limit); ++ pr_info("%s: %s loaded - DMA %s%s\n", ++ mmc_hostname(mmc), DRIVER_NAME, ++ host->have_dma ? "enabled" : "disabled", ++ pio_limit_string); + + return 0; + +@@ -1562,7 +1768,7 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + mmc->ops = &bcm2835_sdhost_ops; + host = mmc_priv(mmc); + host->mmc = mmc; +- host->timeout = msecs_to_jiffies(1000); ++ host->pio_timeout = msecs_to_jiffies(500); + spin_lock_init(&host->lock); + + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); +@@ -1588,8 +1794,12 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + of_property_read_u32(node, + "brcm,overclock-50", + &host->overclock_50); ++ of_property_read_u32(node, ++ "brcm,pio-limit", ++ &host->pio_limit); + host->allow_dma = ALLOW_DMA && + !of_property_read_bool(node, "brcm,force-pio"); ++ host->debug = of_property_read_bool(node, "brcm,debug"); + } + + if (host->allow_dma) { + +From 5920303037d30f0ecee57f83015cd8838ba1f77e Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 4 Jun 2015 13:11:46 -0700 +Subject: [PATCH 78/85] 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 +set clock rates. + +Signed-off-by: Eric Anholt +--- + drivers/firmware/Kconfig | 7 + + drivers/firmware/Makefile | 1 + + drivers/firmware/raspberrypi.c | 260 +++++++++++++++++++++++++++++ + include/soc/bcm2835/raspberrypi-firmware.h | 115 +++++++++++++ + 4 files changed, 383 insertions(+) + create mode 100644 drivers/firmware/raspberrypi.c + create mode 100644 include/soc/bcm2835/raspberrypi-firmware.h + +diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig +index 6517132..564aa5b 100644 +--- a/drivers/firmware/Kconfig ++++ b/drivers/firmware/Kconfig +@@ -136,6 +136,13 @@ config QCOM_SCM + bool + depends on ARM || ARM64 + ++config RASPBERRYPI_FIRMWARE ++ tristate "Raspberry Pi Firmware Driver" ++ depends on BCM2835_MBOX ++ help ++ This option enables support for communicating with the firmware on the ++ Raspberry Pi. ++ + source "drivers/firmware/google/Kconfig" + source "drivers/firmware/efi/Kconfig" + +diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile +index 3fdd391..ee101a2 100644 +--- a/drivers/firmware/Makefile ++++ b/drivers/firmware/Makefile +@@ -13,6 +13,7 @@ obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o + obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o + obj-$(CONFIG_QCOM_SCM) += qcom_scm.o + CFLAGS_qcom_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) ++obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o + + obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ + obj-$(CONFIG_EFI) += efi/ +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +new file mode 100644 +index 0000000..dd506cd +--- /dev/null ++++ b/drivers/firmware/raspberrypi.c +@@ -0,0 +1,260 @@ ++/* ++ * Defines interfaces for interacting wtih the Raspberry Pi firmware's ++ * property channel. ++ * ++ * Copyright © 2015 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) ++#define MBOX_CHAN(msg) ((msg) & 0xf) ++#define MBOX_DATA28(msg) ((msg) & ~0xf) ++#define MBOX_CHAN_PROPERTY 8 ++ ++struct rpi_firmware { ++ struct mbox_client cl; ++ struct mbox_chan *chan; /* The property channel. */ ++ struct completion c; ++ u32 enabled; ++}; ++ ++static DEFINE_MUTEX(transaction_lock); ++ ++static void response_callback(struct mbox_client *cl, void *msg) ++{ ++ struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl); ++ complete(&fw->c); ++} ++ ++/* ++ * Sends a request to the firmware through the BCM2835 mailbox driver, ++ * and synchronously waits for the reply. ++ */ ++static int ++rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) ++{ ++ u32 message = MBOX_MSG(chan, data); ++ int ret; ++ ++ WARN_ON(data & 0xf); ++ ++ mutex_lock(&transaction_lock); ++ reinit_completion(&fw->c); ++ ret = mbox_send_message(fw->chan, &message); ++ if (ret >= 0) { ++ wait_for_completion(&fw->c); ++ ret = 0; ++ } else { ++ dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret); ++ } ++ mutex_unlock(&transaction_lock); ++ ++ return ret; ++} ++ ++/** ++ * rpi_firmware_property_list - Submit firmware property list ++ * @fw: Pointer to firmware structure from rpi_firmware_get(). ++ * @data: Buffer holding tags. ++ * @tag_size: Size of tags buffer. ++ * ++ * Submits a set of concatenated tags to the VPU firmware through the ++ * mailbox property interface. ++ * ++ * The buffer header and the ending tag are added by this function and ++ * don't need to be supplied, just the actual tags for your operation. ++ * See struct rpi_firmware_property_tag_header for the per-tag ++ * structure. ++ */ ++int rpi_firmware_property_list(struct rpi_firmware *fw, ++ void *data, size_t tag_size) ++{ ++ size_t size = tag_size + 12; ++ u32 *buf; ++ dma_addr_t bus_addr; ++ int ret; ++ ++ /* Packets are processed a dword at a time. */ ++ if (size & 3) ++ return -EINVAL; ++ ++ buf = dma_alloc_coherent(fw->cl.dev, PAGE_ALIGN(size), &bus_addr, ++ GFP_ATOMIC); ++ if (!buf) ++ return -ENOMEM; ++ ++ /* The firmware will error out without parsing in this case. */ ++ WARN_ON(size >= 1024 * 1024); ++ ++ buf[0] = size; ++ buf[1] = RPI_FIRMWARE_STATUS_REQUEST; ++ memcpy(&buf[2], data, tag_size); ++ buf[size / 4 - 1] = RPI_FIRMWARE_PROPERTY_END; ++ wmb(); ++ ++ ret = rpi_firmware_transaction(fw, MBOX_CHAN_PROPERTY, bus_addr); ++ ++ rmb(); ++ memcpy(data, &buf[2], tag_size); ++ if (ret == 0 && buf[1] != RPI_FIRMWARE_STATUS_SUCCESS) { ++ /* ++ * The tag name here might not be the one causing the ++ * error, if there were multiple tags in the request. ++ * But single-tag is the most common, so go with it. ++ */ ++ dev_err(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n", ++ buf[2], buf[1]); ++ ret = -EINVAL; ++ } ++ ++ dma_free_coherent(fw->cl.dev, PAGE_ALIGN(size), buf, bus_addr); ++ ++ return ret; ++} ++EXPORT_SYMBOL_GPL(rpi_firmware_property_list); ++ ++/** ++ * rpi_firmware_property - Submit single firmware property ++ * @fw: Pointer to firmware structure from rpi_firmware_get(). ++ * @tag: One of enum_mbox_property_tag. ++ * @tag_data: Tag data buffer. ++ * @buf_size: Buffer size. ++ * ++ * Submits a single tag to the VPU firmware through the mailbox ++ * property interface. ++ * ++ * This is a convenience wrapper around ++ * rpi_firmware_property_list() to avoid some of the ++ * boilerplate in property calls. ++ */ ++int rpi_firmware_property(struct rpi_firmware *fw, ++ u32 tag, void *tag_data, size_t buf_size) ++{ ++ /* Single tags are very small (generally 8 bytes), so the ++ * stack should be safe. ++ */ ++ u8 data[buf_size + sizeof(struct rpi_firmware_property_tag_header)]; ++ struct rpi_firmware_property_tag_header *header = ++ (struct rpi_firmware_property_tag_header *)data; ++ int ret; ++ ++ header->tag = tag; ++ header->buf_size = buf_size; ++ header->req_resp_size = 0; ++ memcpy(data + sizeof(struct rpi_firmware_property_tag_header), ++ tag_data, buf_size); ++ ++ ret = rpi_firmware_property_list(fw, &data, sizeof(data)); ++ memcpy(tag_data, ++ data + sizeof(struct rpi_firmware_property_tag_header), ++ buf_size); ++ ++ return ret; ++} ++EXPORT_SYMBOL_GPL(rpi_firmware_property); ++ ++static void ++rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) ++{ ++ u32 packet; ++ int ret = rpi_firmware_property(fw, ++ RPI_FIRMWARE_GET_FIRMWARE_REVISION, ++ &packet, sizeof(packet)); ++ ++ if (ret == 0) { ++ struct tm tm; ++ ++ time_to_tm(packet, 0, &tm); ++ ++ dev_info(fw->cl.dev, ++ "Attached to firmware from %04ld-%02d-%02d %02d:%02d\n", ++ tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, ++ tm.tm_hour, tm.tm_min); ++ } ++} ++ ++static int rpi_firmware_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct rpi_firmware *fw; ++ ++ fw = devm_kzalloc(dev, sizeof(*fw), GFP_KERNEL); ++ if (!fw) ++ return -ENOMEM; ++ ++ fw->cl.dev = dev; ++ fw->cl.rx_callback = response_callback; ++ fw->cl.tx_block = true; ++ ++ fw->chan = mbox_request_channel(&fw->cl, 0); ++ if (IS_ERR(fw->chan)) { ++ int ret = PTR_ERR(fw->chan); ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "Failed to get mbox channel: %d\n", ret); ++ return ret; ++ } ++ ++ init_completion(&fw->c); ++ ++ platform_set_drvdata(pdev, fw); ++ ++ rpi_firmware_print_firmware_revision(fw); ++ ++ return 0; ++} ++ ++static int rpi_firmware_remove(struct platform_device *pdev) ++{ ++ struct rpi_firmware *fw = platform_get_drvdata(pdev); ++ ++ mbox_free_channel(fw->chan); ++ ++ return 0; ++} ++ ++/** ++ * rpi_firmware_get - Get pointer to rpi_firmware structure. ++ * @firmware_node: Pointer to the firmware Device Tree node. ++ * ++ * Returns NULL is the firmware device is not ready. ++ */ ++struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node) ++{ ++ struct platform_device *pdev = of_find_device_by_node(firmware_node); ++ ++ if (!pdev) ++ return NULL; ++ ++ return platform_get_drvdata(pdev); ++} ++EXPORT_SYMBOL_GPL(rpi_firmware_get); ++ ++static const struct of_device_id rpi_firmware_of_match[] = { ++ { .compatible = "raspberrypi,bcm2835-firmware", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, rpi_firmware_of_match); ++ ++static struct platform_driver rpi_firmware_driver = { ++ .driver = { ++ .name = "raspberrypi-firmware", ++ .of_match_table = rpi_firmware_of_match, ++ }, ++ .probe = rpi_firmware_probe, ++ .remove = rpi_firmware_remove, ++}; ++module_platform_driver(rpi_firmware_driver); ++ ++MODULE_AUTHOR("Eric Anholt "); ++MODULE_DESCRIPTION("Raspberry Pi firmware driver"); ++MODULE_LICENSE("GPL v2"); +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +new file mode 100644 +index 0000000..9d9efb7 +--- /dev/null ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -0,0 +1,115 @@ ++/* ++ * Copyright © 2015 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++ ++struct rpi_firmware; ++ ++enum rpi_firmware_property_status { ++ RPI_FIRMWARE_STATUS_REQUEST = 0, ++ RPI_FIRMWARE_STATUS_SUCCESS = 0x80000000, ++ RPI_FIRMWARE_STATUS_ERROR = 0x80000001, ++}; ++ ++/** ++ * struct rpi_firmware_property_tag_header - Firmware property tag header ++ * @tag: One of enum_mbox_property_tag. ++ * @buf_size: The number of bytes in the value buffer following this ++ * struct. ++ * @req_resp_size: On submit, the length of the request (though it doesn't ++ * appear to be currently used by the firmware). On return, ++ * the length of the response (always 4 byte aligned), with ++ * the low bit set. ++ */ ++struct rpi_firmware_property_tag_header { ++ u32 tag; ++ u32 buf_size; ++ u32 req_resp_size; ++}; ++ ++enum rpi_firmware_property_tag { ++ RPI_FIRMWARE_PROPERTY_END = 0, ++ RPI_FIRMWARE_GET_FIRMWARE_REVISION = 0x00000001, ++ ++ RPI_FIRMWARE_SET_CURSOR_INFO = 0x00008010, ++ RPI_FIRMWARE_SET_CURSOR_STATE = 0x00008011, ++ ++ RPI_FIRMWARE_GET_BOARD_MODEL = 0x00010001, ++ RPI_FIRMWARE_GET_BOARD_REVISION = 0x00010002, ++ RPI_FIRMWARE_GET_BOARD_MAC_ADDRESS = 0x00010003, ++ RPI_FIRMWARE_GET_BOARD_SERIAL = 0x00010004, ++ RPI_FIRMWARE_GET_ARM_MEMORY = 0x00010005, ++ RPI_FIRMWARE_GET_VC_MEMORY = 0x00010006, ++ RPI_FIRMWARE_GET_CLOCKS = 0x00010007, ++ RPI_FIRMWARE_GET_POWER_STATE = 0x00020001, ++ RPI_FIRMWARE_GET_TIMING = 0x00020002, ++ RPI_FIRMWARE_SET_POWER_STATE = 0x00028001, ++ RPI_FIRMWARE_GET_CLOCK_STATE = 0x00030001, ++ RPI_FIRMWARE_GET_CLOCK_RATE = 0x00030002, ++ RPI_FIRMWARE_GET_VOLTAGE = 0x00030003, ++ RPI_FIRMWARE_GET_MAX_CLOCK_RATE = 0x00030004, ++ RPI_FIRMWARE_GET_MAX_VOLTAGE = 0x00030005, ++ RPI_FIRMWARE_GET_TEMPERATURE = 0x00030006, ++ RPI_FIRMWARE_GET_MIN_CLOCK_RATE = 0x00030007, ++ RPI_FIRMWARE_GET_MIN_VOLTAGE = 0x00030008, ++ RPI_FIRMWARE_GET_TURBO = 0x00030009, ++ RPI_FIRMWARE_GET_MAX_TEMPERATURE = 0x0003000a, ++ RPI_FIRMWARE_ALLOCATE_MEMORY = 0x0003000c, ++ RPI_FIRMWARE_LOCK_MEMORY = 0x0003000d, ++ RPI_FIRMWARE_UNLOCK_MEMORY = 0x0003000e, ++ RPI_FIRMWARE_RELEASE_MEMORY = 0x0003000f, ++ RPI_FIRMWARE_EXECUTE_CODE = 0x00030010, ++ RPI_FIRMWARE_EXECUTE_QPU = 0x00030011, ++ RPI_FIRMWARE_SET_ENABLE_QPU = 0x00030012, ++ RPI_FIRMWARE_GET_DISPMANX_RESOURCE_MEM_HANDLE = 0x00030014, ++ RPI_FIRMWARE_GET_EDID_BLOCK = 0x00030020, ++ RPI_FIRMWARE_SET_CLOCK_STATE = 0x00038001, ++ RPI_FIRMWARE_SET_CLOCK_RATE = 0x00038002, ++ RPI_FIRMWARE_SET_VOLTAGE = 0x00038003, ++ RPI_FIRMWARE_SET_TURBO = 0x00038009, ++ ++ /* Dispmanx TAGS */ ++ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, ++ RPI_FIRMWARE_FRAMEBUFFER_BLANK = 0x00040002, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT = 0x00040003, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT = 0x00040004, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_DEPTH = 0x00040005, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PIXEL_ORDER = 0x00040006, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_ALPHA_MODE = 0x00040007, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH = 0x00040008, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_VIRTUAL_OFFSET = 0x00040009, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_OVERSCAN = 0x0004000a, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PALETTE = 0x0004000b, ++ RPI_FIRMWARE_FRAMEBUFFER_RELEASE = 0x00048001, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT = 0x00044003, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT = 0x00044004, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_DEPTH = 0x00044005, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_PIXEL_ORDER = 0x00044006, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_ALPHA_MODE = 0x00044007, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_OFFSET = 0x00044009, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_OVERSCAN = 0x0004400a, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_PALETTE = 0x0004400b, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT = 0x00048003, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT = 0x00048004, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH = 0x00048005, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_PIXEL_ORDER = 0x00048006, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_ALPHA_MODE = 0x00048007, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET = 0x00048009, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_OVERSCAN = 0x0004800a, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_PALETTE = 0x0004800b, ++ ++ RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, ++ RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, ++}; ++ ++int rpi_firmware_property(struct rpi_firmware *fw, ++ u32 tag, void *data, size_t len); ++int rpi_firmware_property_list(struct rpi_firmware *fw, ++ void *data, size_t tag_size); ++struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); + +From c97b07c0494073a69820a78b6012dc62cb902144 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 22 Mar 2015 13:33:23 +0000 +Subject: [PATCH 79/85] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING + +--- + 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 a3067bf..7ef615c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -49,6 +49,8 @@ CONFIG_OABI_COMPAT=y + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y + CONFIG_CMA=y ++CONFIG_ZSMALLOC=m ++CONFIG_PGTABLE_MAPPING=y + CONFIG_UACCESS_WITH_MEMCPY=y + CONFIG_SECCOMP=y + CONFIG_ZBOOT_ROM_TEXT=0x0 +@@ -389,6 +391,8 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_ZRAM=m ++CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y + CONFIG_BLK_DEV_CRYPTOLOOP=m + CONFIG_BLK_DEV_DRBD=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 6a41231..cacde14 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -44,6 +44,8 @@ CONFIG_OABI_COMPAT=y + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y + CONFIG_CMA=y ++CONFIG_ZSMALLOC=m ++CONFIG_PGTABLE_MAPPING=y + CONFIG_UACCESS_WITH_MEMCPY=y + CONFIG_SECCOMP=y + CONFIG_ZBOOT_ROM_TEXT=0x0 +@@ -382,6 +384,8 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_ZRAM=m ++CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y + CONFIG_BLK_DEV_CRYPTOLOOP=m + CONFIG_BLK_DEV_DRBD=m + +From e547d7e94a85179d7ff7787eb95e29f0b0b657f4 Mon Sep 17 00:00:00 2001 +From: Gordon Hollingworth +Date: Mon, 22 Jun 2015 16:27:07 +0100 +Subject: [PATCH 80/85] Add rpi-ft5406 overlay Add rpi-ft5406 driver as module + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 5 +++++ + arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts | 16 ++++++++++++++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 5 files changed, 24 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 6947556..19eef3c 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -35,6 +35,7 @@ dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += rpi-ft5406-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 63da266..aa09b6c 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -396,6 +396,11 @@ Params: speed Display SPI bus speed + + xohms Touchpanel sensitivity (X-plate resistance) + ++Name: rpi-ft5406 ++Info: Official Raspberry Pi display touchscreen ++Load: dtoverlay=rpi-ft5406 ++Params: ++ + + Name: rpi-proto + Info: Configures the RPi Proto audio card +diff --git a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +new file mode 100644 +index 0000000..40deab5 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +@@ -0,0 +1,16 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ rpi_ft5406: rpi_ft5406 { ++ compatible = "rpi,rpi-ft5406"; ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 7ef615c..7469d07 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -535,6 +535,7 @@ CONFIG_JOYSTICK_XPAD_FF=y + CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m ++CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + CONFIG_INPUT_MISC=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index cacde14..f952ff2 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -528,6 +528,7 @@ CONFIG_JOYSTICK_XPAD_FF=y + CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m ++CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + CONFIG_INPUT_MISC=y + +From 9dea271e610d0524fad677b9cccdd3be84ab25da Mon Sep 17 00:00:00 2001 +From: Gordon Hollingworth +Date: Tue, 23 Jun 2015 09:53:40 +0100 +Subject: [PATCH 81/85] Fix driver detection failure Check that the buffer + response is non-zero meaning the touchscreen was detected + +--- + drivers/input/touchscreen/rpi-ft5406.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c +index f55151b..d41851d 100644 +--- a/drivers/input/touchscreen/rpi-ft5406.c ++++ b/drivers/input/touchscreen/rpi-ft5406.c +@@ -184,7 +184,7 @@ static int ft5406_probe(struct platform_device *pdev) + + bcm_mailbox_property(&request, sizeof(request)); + +- if(request.request_code == VCMSG_REQUEST_SUCCESSFUL) ++ if(request.request_code == VCMSG_REQUEST_SUCCESSFUL && request.tag.val != 0) + { + dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); + } + +From 8ad2b6ac33fca9a40238c42fdd2b5ed840c2fc8d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 23 Jun 2015 13:24:01 +0100 +Subject: [PATCH 82/85] config: Enable 8250 serial port + +--- + arch/arm/configs/bcm2709_defconfig | 7 +++++++ + arch/arm/configs/bcmrpi_defconfig | 7 +++++++ + 2 files changed, 14 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 7469d07..7e8643c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -557,8 +557,15 @@ CONFIG_GAMEPORT_L4=m + CONFIG_DEVPTS_MULTIPLE_INSTANCES=y + # CONFIG_LEGACY_PTYS is not set + # CONFIG_DEVKMEM is not set ++CONFIG_SERIAL_8250=y ++# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set ++CONFIG_SERIAL_8250_CONSOLE=y ++# CONFIG_SERIAL_8250_DMA is not set ++CONFIG_SERIAL_8250_NR_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=1 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y ++CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_HW_RANDOM_BCM2835=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index f952ff2..0c25d8b 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -550,8 +550,15 @@ CONFIG_GAMEPORT_L4=m + CONFIG_DEVPTS_MULTIPLE_INSTANCES=y + # CONFIG_LEGACY_PTYS is not set + # CONFIG_DEVKMEM is not set ++CONFIG_SERIAL_8250=y ++# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set ++CONFIG_SERIAL_8250_CONSOLE=y ++# CONFIG_SERIAL_8250_DMA is not set ++CONFIG_SERIAL_8250_NR_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=1 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y ++CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_HW_RANDOM_BCM2835=m + +From cc78a5ef74fc67465fdacffe452a5fab5848b33c Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 23 Jun 2015 14:10:58 +0100 +Subject: [PATCH 83/85] config: Enable POWER_RESET_GPIO + +--- + arch/arm/configs/bcm2709_defconfig | 2 ++ + arch/arm/configs/bcmrpi_defconfig | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 7e8643c..46d56d7 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -606,6 +606,8 @@ CONFIG_W1_SLAVE_DS2781=m + CONFIG_W1_SLAVE_DS28E04=m + CONFIG_W1_SLAVE_BQ27000=m + CONFIG_BATTERY_DS2760=m ++CONFIG_POWER_RESET=y ++CONFIG_POWER_RESET_GPIO=y + # CONFIG_HWMON is not set + CONFIG_THERMAL=y + CONFIG_THERMAL_BCM2835=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 0c25d8b..e757db6 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -599,6 +599,8 @@ CONFIG_W1_SLAVE_DS2781=m + CONFIG_W1_SLAVE_DS28E04=m + CONFIG_W1_SLAVE_BQ27000=m + CONFIG_BATTERY_DS2760=m ++CONFIG_POWER_RESET=y ++CONFIG_POWER_RESET_GPIO=y + # CONFIG_HWMON is not set + CONFIG_THERMAL=y + CONFIG_THERMAL_BCM2835=y + +From 01f5e319010c90770e0c8a87656c360a18a35208 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 26 Jun 2015 17:37:38 +0100 +Subject: [PATCH 84/85] 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). +Locking should be handled on each mailbox access +--- + drivers/mailbox/bcm2708-vcio.c | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/drivers/mailbox/bcm2708-vcio.c b/drivers/mailbox/bcm2708-vcio.c +index d91672b..06fb2c2f 100644 +--- a/drivers/mailbox/bcm2708-vcio.c ++++ b/drivers/mailbox/bcm2708-vcio.c +@@ -242,20 +242,9 @@ EXPORT_SYMBOL_GPL(bcm_mailbox_property); + + /* Platform Device for Mailbox */ + +-/* +- * Is the device open right now? Used to prevent +- * concurent access into the same device +- */ +-static bool device_is_open; +- + /* This is called whenever a process attempts to open the device file */ + static int device_open(struct inode *inode, struct file *file) + { +- /* We don't want to talk to two processes at the same time */ +- if (device_is_open) +- return -EBUSY; +- +- device_is_open = true; + try_module_get(THIS_MODULE); + + return 0; +@@ -263,9 +252,6 @@ static int device_open(struct inode *inode, struct file *file) + + static int device_release(struct inode *inode, struct file *file) + { +- /* We're now ready for our next caller */ +- device_is_open = false; +- + module_put(THIS_MODULE); + + return 0; + +From 2cdae3dcbcca3d818f64d14580f22c67e32d851c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 Jun 2015 08:39:19 +0100 +Subject: [PATCH 85/85] BCM270X_DT: Create a "core" clock, use it for SPI and + sdhost + +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-b.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 1 + + arch/arm/boot/dts/bcm2708_common.dtsi | 6 +++--- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 1 + + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 28 ++------------------------- + 6 files changed, 9 insertions(+), 29 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 0fa2210..3b252dc 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -124,6 +124,7 @@ + i2c1 = <&i2c1>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 3fd49d0..40fded1 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -118,6 +118,7 @@ + i2c1 = <&i2c1>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index 238bd65..e82fcb2 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -14,5 +14,6 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + }; }; +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index 8caa234..4a975dfd 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -110,7 +110,7 @@ + compatible = "brcm,bcm2835-spi"; + reg = <0x7e204000 0x1000>; + interrupts = <2 22>; +- clocks = <&clk_spi>; ++ clocks = <&clk_core>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; +@@ -203,11 +203,11 @@ + clock-frequency = <250000000>; + }; -diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index c5e51e8..fe71c50 100644 ---- a/arch/arm/mach-bcm2709/bcm2709.c -+++ b/arch/arm/mach-bcm2709/bcm2709.c -@@ -1050,7 +1050,7 @@ static irqreturn_t bcm2709_timer_interrupt(int irq, void *dev_id) +- clk_spi: clock@2 { ++ clk_core: clock@2 { + compatible = "fixed-clock"; + reg = <2>; + #clock-cells = <0>; +- clock-output-names = "spi"; ++ clock-output-names = "core"; + clock-frequency = <250000000>; + }; - static struct irqaction bcm2709_timer_irq = { - .name = "BCM2709 Timer Tick", -- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, -+ .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = bcm2709_timer_interrupt, +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index 8aaaf1f..24fa849 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -124,6 +124,7 @@ + i2c1 = <&i2c1>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index b408ab4..897204a 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -16,7 +16,7 @@ + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_pins>; + interrupts = <2 24>; +- clocks = <&clk_sdhost>; ++ clocks = <&clk_core>; + dmas = <&dma 13>, + <&dma 13>; + dma-names = "tx", "rx"; +@@ -29,22 +29,6 @@ + }; + + fragment@1 { +- target = <&clocks>; +- __overlay__ { +- #address-cells = <1>; +- #size-cells = <0>; +- +- clk_sdhost: sdhost { +- compatible = "fixed-clock"; +- reg = <0>; +- #clock-cells = <0>; +- clock-output-names = "sdhost"; +- clock-frequency = <250000000>; +- }; +- }; +- }; +- +- fragment@2 { + target = <&gpio>; + __overlay__ { + sdhost_pins: sdhost_pins { +@@ -54,7 +38,7 @@ + }; + }; + +- fragment@3 { ++ fragment@2 { + target = <&mmc>; + __overlay__ { + /* Find a way to disable the other driver */ +@@ -63,18 +47,10 @@ + }; + }; + +- fragment@4 { +- target-path = "/__overrides__"; +- __overlay__ { +- sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; +- }; +- }; +- + __overrides__ { + overclock_50 = <&sdhost>,"brcm,overclock-50:0"; + force_pio = <&sdhost>,"brcm,force-pio?"; + pio_limit = <&sdhost>,"brcm,pio-limit:0"; + debug = <&sdhost>,"brcm,debug?"; +- sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; + }; }; - diff --git a/projects/RPi2/patches/linux/linux-01-RPi_support.patch b/projects/RPi2/patches/linux/linux-01-RPi_support.patch index 0008aa8b30..a35c13d26b 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 8e2bdce040b3459de0954cb2f212dea47549131c Mon Sep 17 00:00:00 2001 +From e9ee97a62574359de01411f0c74e23856e359952 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 01/77] Main bcm2708/bcm2709 linux port +Subject: [PATCH 01/85] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -310,7 +310,7 @@ index 0000000..67039c3 +initrd_phys-y := 0x00800000 diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c new file mode 100644 -index 0000000..cd252fa +index 0000000..4868cd37 --- /dev/null +++ b/arch/arm/mach-bcm2708/armctrl.c @@ -0,0 +1,304 @@ @@ -611,7 +611,7 @@ index 0000000..cd252fa + irq_set_chip(irq, &armctrl_chip); + irq_set_chip_data(irq, (void *)data); + irq_set_handler(irq, handle_level_irq); -+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_DISABLED); ++ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); + } + + armctrl_pm_register(base, irq_start, resume_sources); @@ -653,7 +653,7 @@ index 0000000..0aa916e +#endif diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c new file mode 100644 -index 0000000..d6659b0 +index 0000000..a209c58 --- /dev/null +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -0,0 +1,622 @@ @@ -1164,7 +1164,7 @@ index 0000000..d6659b0 + +static struct irqaction bcm2708_timer_irq = { + .name = "BCM2708 Timer Tick", -+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, ++ .flags = IRQF_TIMER | IRQF_IRQPOLL, + .handler = bcm2708_timer_interrupt, +}; + @@ -3577,7 +3577,7 @@ index 0000000..e33265d +MODULE_LICENSE("GPL"); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c new file mode 100644 -index 0000000..19d0601 +index 0000000..d135620 --- /dev/null +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -0,0 +1,801 @@ @@ -4120,7 +4120,7 @@ index 0000000..19d0601 + +static struct irqaction bcm2709_timer_irq = { + .name = "BCM2709 Timer Tick", -+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, ++ .flags = IRQF_TIMER | IRQF_IRQPOLL, + .handler = bcm2709_timer_interrupt, +}; + @@ -7002,10 +7002,10 @@ index b5bedae..b0258e8 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ -From aa090a771afa15310eb10d3209c190441f3ecefd Mon Sep 17 00:00:00 2001 +From 081ebd4ba394a354c03f7800b8d14519f165a0f9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 23:48:09 +0100 -Subject: [PATCH 02/77] power: Add power driver +Subject: [PATCH 02/85] power: Add power driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -7362,10 +7362,10 @@ index 0000000..bf22b26 + +#endif -From 9409d45ef7d82d4f0677ea1a16bb6e87d41ed8de Mon Sep 17 00:00:00 2001 +From ddd21104179e4df6cf77762b1a7f4dabe65cc808 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 Oct 2014 18:50:05 +0100 -Subject: [PATCH 03/77] Add bcm2708_gpio driver +Subject: [PATCH 03/85] Add bcm2708_gpio driver Signed-off-by: popcornmix @@ -7439,7 +7439,7 @@ index e7d5a29..5120994 100644 obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o +obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index d6659b0..c606853 100644 +index a209c58..6c1c616 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -298,6 +298,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -7476,7 +7476,7 @@ index d6659b0..c606853 100644 int ret; diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c new file mode 100644 -index 0000000..c1e9254 +index 0000000..e33265d --- /dev/null +++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -0,0 +1,426 @@ @@ -7788,7 +7788,7 @@ index 0000000..c1e9254 + +static struct irqaction bcm2708_gpio_irq = { + .name = "BCM2708 GPIO catchall handler", -+ .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, ++ .flags = IRQF_TIMER | IRQF_IRQPOLL, + .handler = bcm2708_gpio_interrupt, +}; + @@ -7930,7 +7930,7 @@ index 0000000..7965a97 + +#endif diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 19d0601..6060a0d 100644 +index d135620..b173422 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -329,6 +329,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -7995,10 +7995,10 @@ index 0000000..fb69624 + +#endif -From 4b9ec02bb6738a9c29f6308c55cbcab58c2c88a3 Mon Sep 17 00:00:00 2001 +From 8957f79b301a70ab625baa2f9a4c613f871c3f22 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 04/77] mailbox: bcm2708: Add bcm2708-vcio +Subject: [PATCH 04/85] mailbox: bcm2708: Add bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -8629,10 +8629,10 @@ index 0000000..cc284ed + +#endif -From c921ec1cd21e8a8eb4e453834a205e9da5dff30a Mon Sep 17 00:00:00 2001 +From c1a8c5708161961f248f228d25da578e90fe127f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 05/77] Add dwc_otg driver +Subject: [PATCH 05/85] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -9253,7 +9253,7 @@ index 8dd26e1..eef4847 100644 + mov pc, r8 +ENDPROC(__FIQ_Branch) diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c -index cd252fa..74bacb3 100644 +index 4868cd37..0429225 100644 --- a/arch/arm/mach-bcm2708/armctrl.c +++ b/arch/arm/mach-bcm2708/armctrl.c @@ -54,8 +54,12 @@ static void armctrl_mask_irq(struct irq_data *d) @@ -9297,7 +9297,7 @@ index cd252fa..74bacb3 100644 return 0; } diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index c606853..4455f34 100644 +index 6c1c616..1735b72 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -254,12 +254,23 @@ static struct resource bcm2708_usb_resources[] = { @@ -69906,10 +69906,10 @@ index 0000000..cdc9963 +test_main(); +0; -From 560486db654a651cebb107628426d1705ef4cc20 Mon Sep 17 00:00:00 2001 +From 2aced0ae5562b3dc60806a3ba2799af134732bdb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 06/77] bcm2708 watchdog driver +Subject: [PATCH 06/85] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -70346,10 +70346,10 @@ index 0000000..8a27d68 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); -From 7014dbd386a6ce510bd6b9fa3a3fcfc2bd89d237 Mon Sep 17 00:00:00 2001 +From 4a64377d42fac96be299fd210b0eb0bc3ba159b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 07/77] bcm2708 framebuffer driver +Subject: [PATCH 07/85] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73788,10 +73788,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 5efe288a95d60bd10a162be79442d04b6f1d4079 Mon Sep 17 00:00:00 2001 +From b04b39dfe4cb2a287062d3b81287d9a9bf80e91a Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 08/77] dmaengine: Add support for BCM2708 +Subject: [PATCH 08/85] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -73907,7 +73907,7 @@ Without this field set properly we get playback issues with I2S cards. create mode 100644 include/linux/platform_data/dma-bcm2708.h diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 4455f34..6b0b6c4 100644 +index 1735b72..1622300 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -234,6 +234,73 @@ static struct amba_device *amba_devs[] __initdata = { @@ -73993,7 +73993,7 @@ index 4455f34..6b0b6c4 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 6060a0d..86ebfbe 100644 +index b173422..fee17e2 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -244,6 +244,73 @@ static struct amba_device *amba_devs[] __initdata = { @@ -75559,10 +75559,10 @@ index 0000000..2310e34 + +#endif /* _PLAT_BCM2708_DMA_H */ -From be30ad8849aa9fd6ffbe6f8198a5af4bb62c465f Mon Sep 17 00:00:00 2001 +From 34e4aa2e25b49261e2aa9d17a1ce767a3dfb90cf Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 09/77] MMC: added alternative MMC driver +Subject: [PATCH 09/85] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75637,7 +75637,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 drivers/mmc/host/bcm2835-mmc.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 6b0b6c4..5b10802 100644 +index 1622300..6257407 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -401,6 +401,34 @@ static struct platform_device bcm2708_gpio_device = { @@ -75686,7 +75686,7 @@ index 6b0b6c4..5b10802 100644 bcm2708_init_uart1(); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 86ebfbe..54c5444 100644 +index fee17e2..07750ed 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -421,6 +421,34 @@ static struct platform_device bcm2708_gpio_device = { @@ -77378,10 +77378,10 @@ index 0000000..b7c4883 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 81cff325dce6ba8765e23e542a219d3c9103a70b Mon Sep 17 00:00:00 2001 +From f1a7eefd17fbaf9335a5fdf6215d319b4042bb55 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 10/77] Adding bcm2835-sdhost driver, and an overlay to enable +Subject: [PATCH 10/85] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -79151,10 +79151,10 @@ index 0000000..eef8a24 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 34fb9ba0190b9f9e18e6c136c64af8dcea23376d Mon Sep 17 00:00:00 2001 +From effb9e4dd94cc200500fb22061ede69047cceea7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 11/77] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 11/85] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix @@ -80479,10 +80479,10 @@ index 0000000..5325832 + +#endif /* VC_CMA_H */ -From 0e6896e85bf10d584b555ecae4b55f066a774b54 Mon Sep 17 00:00:00 2001 +From d83761e1a337d8eee9e9a196e23ceeefe51fff1e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 12/77] bcm2708: alsa sound driver +Subject: [PATCH 12/85] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -80539,7 +80539,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 sound/arm/vc_vchi_audioserv_defs.h diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 5b10802..06271df 100644 +index 6257407..df32241 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -429,6 +429,57 @@ struct platform_device bcm2835_emmc_device = { @@ -80610,7 +80610,7 @@ index 5b10802..06271df 100644 if (!use_dt) { for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 54c5444..0f875ff 100644 +index 07750ed..62c95cb 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -449,6 +449,57 @@ struct platform_device bcm2835_emmc_device = { @@ -83324,10 +83324,10 @@ index 0000000..af3e6eb + +#endif // _VC_AUDIO_DEFS_H_ -From b2b5ab24c875e79e1fbb55ae76dc5a914fe301d0 Mon Sep 17 00:00:00 2001 +From 53e9a31fe01ae9460b2361ec93a54bac888d8f5f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 13/77] bcm2708 vchiq driver +Subject: [PATCH 13/85] bcm2708 vchiq driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -83493,7 +83493,7 @@ vchiq: Change logging level for inbound data create mode 100644 drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 06271df..86011af 100644 +index df32241..ecf0524 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -376,6 +376,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -83550,7 +83550,7 @@ index 2e7e1bb..69674e9 100644 /* diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 0f875ff..bc1ee1c 100644 +index 62c95cb..de9feaa 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -396,6 +396,31 @@ static struct platform_device bcm2708_vcio_device = { @@ -96581,10 +96581,10 @@ index 0000000..b6bfa21 + return vchiq_build_time; +} -From 6290b45c0e5fa71d2131718d1b5770e7849aedeb Mon Sep 17 00:00:00 2001 +From 3f8c3cd61c11d730699b14ee1d64db95215487e8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 16:07:06 +0100 -Subject: [PATCH 14/77] vc_mem: Add vc_mem driver +Subject: [PATCH 14/85] vc_mem: Add vc_mem driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -97590,10 +97590,10 @@ index 0000000..20a4753 + +#endif /* _VC_MEM_H */ -From e9ebded52208b6164753a82d268cd80e833e2737 Mon Sep 17 00:00:00 2001 +From 138483d8fb3cbfcad83b0c450e3c3eb2fca5a8de Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 15/77] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 15/85] 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 @@ -102003,10 +102003,10 @@ index 0000000..0bfb42e +MODULE_DESCRIPTION("VideoCore SharedMemory Driver"); +MODULE_LICENSE("GPL v2"); -From 7f769de038003dcf3f6eff180e2e295888789dc2 Mon Sep 17 00:00:00 2001 +From 3b4d6cc19851307c0426fe31be9627558bb1b2cf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 16/77] Add hwrng (hardware random number generator) driver +Subject: [PATCH 16/85] Add hwrng (hardware random number generator) driver --- drivers/char/hw_random/Kconfig | 13 +++- @@ -102183,10 +102183,10 @@ index 0000000..340f004 +MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver"); +MODULE_LICENSE("GPL and additional rights"); -From 68990b28334ea63cdc56bfe9663025dade9d7822 Mon Sep 17 00:00:00 2001 +From 8312a7efc6b5c8fe996e41f62adf6e9c71f7a5f8 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 17/77] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 17/85] 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 @@ -103039,10 +103039,10 @@ index 0000000..24563ec +module_param(debug, bool, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(debug, "Enable debugging messages"); -From b359d4ff9144f1ee3f333eee7b49bab1c6d92c1f Mon Sep 17 00:00:00 2001 +From 4905ceea875bf96a9dbf4989347ed1d5e4e3875b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 18/77] Add cpufreq driver +Subject: [PATCH 18/85] Add cpufreq driver Signed-off-by: popcornmix --- @@ -103315,10 +103315,10 @@ index 0000000..6735da9 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From 37e551cc949ea14042539b089e08df475bab0f59 Mon Sep 17 00:00:00 2001 +From 50ef992dbbc2e7e1c1a87a61b540c0b84f7cb3ee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 19/77] Added hwmon/thermal driver for reporting core +Subject: [PATCH 19/85] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -103341,7 +103341,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 drivers/thermal/bcm2835-thermal.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 86011af..f2d9b03 100644 +index ecf0524..978aaff 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -505,6 +505,10 @@ static struct platform_device bcm2708_alsa_devices[] = { @@ -103365,7 +103365,7 @@ index 86011af..f2d9b03 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index bc1ee1c..9631bdb 100644 +index de9feaa..0e5c8e3 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -525,6 +525,10 @@ static struct platform_device bcm2708_alsa_devices[] = { @@ -103615,10 +103615,10 @@ index 0000000..3bc80f1 + +module_platform_driver(bcm2835_thermal_driver); -From 4d5da3fa21e1d94e38644bf9a5493bb677854e42 Mon Sep 17 00:00:00 2001 +From 0e6c5417c62642c7481e57ce937007277fe31cfd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:41:33 +0100 -Subject: [PATCH 20/77] Add Chris Boot's spi driver. +Subject: [PATCH 20/85] Add Chris Boot's spi driver. spi: bcm2708: add device tree support @@ -103679,7 +103679,7 @@ index 4cbda0c..68e3706 100644 + Binds spidev driver to the SPI0 master endmenu diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index f2d9b03..e3aa6fc 100644 +index 978aaff..31ad9da 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -34,6 +34,7 @@ @@ -103764,7 +103764,7 @@ index f2d9b03..e3aa6fc 100644 static void timer_set_mode(enum clock_event_mode mode, diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 9631bdb..5fb99b6 100644 +index 0e5c8e3..6874633 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -34,6 +34,7 @@ @@ -104530,10 +104530,10 @@ index 0000000..041b5e2 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 75d6625177ee7e4746baf70b60380069d58231ba Mon Sep 17 00:00:00 2001 +From 68bec2f411f5f7ea1720f555cadc7a5c6c214934 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 21/77] Add Chris Boot's i2c driver +Subject: [PATCH 21/85] Add Chris Boot's i2c driver i2c-bcm2708: fixed baudrate @@ -104594,7 +104594,7 @@ i2c-bcm2708: When using DT, leave the GPIO setup to pinctrl create mode 100644 drivers/i2c/busses/i2c-bcm2708.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index e3aa6fc..efb3544 100644 +index 31ad9da..26be516 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -83,6 +83,7 @@ static unsigned uart_clock = UART0_CLOCK; @@ -104674,7 +104674,7 @@ index e3aa6fc..efb3544 100644 +module_param(vc_i2c_override, bool, 0644); +MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral."); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 5fb99b6..8017c50 100644 +index 6874633..50843df 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -85,6 +85,7 @@ static unsigned uart_clock = UART0_CLOCK; @@ -105334,10 +105334,10 @@ index 0000000..8773203 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 87711afd62feac0850e063b279057c91fe0aabbf Mon Sep 17 00:00:00 2001 +From f039d3ed041c0fd3267b149ef476638142535ef3 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 22/77] bcm2835: add v4l2 camera device +Subject: [PATCH 22/85] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -112664,10 +112664,10 @@ index 0000000..9d1d11e + +#endif /* MMAL_VCHIQ_H */ -From 0ecc87e37d9107eb533346a4a482bbf78920d16c Mon Sep 17 00:00:00 2001 +From 35af37046308a29d529e83d908c1fea9cd01a8a2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 23 Jan 2015 14:48:55 +0000 -Subject: [PATCH 23/77] scripts/dtc: Update to upstream version with overlay +Subject: [PATCH 23/85] scripts/dtc: Update to upstream version with overlay patches --- @@ -117880,10 +117880,10 @@ index 54d4e904..d644002 100644 -#define DTC_VERSION "DTC 1.4.0-dirty" +#define DTC_VERSION "DTC 1.4.1-g36c70742" -From 4cccd63c16e3ef4e2a35144e2806d1d1c56bc381 Mon Sep 17 00:00:00 2001 +From 7b42e6d4640654b00e46f0b14a2f4d4f9979610e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 24/77] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 24/85] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -118368,10 +118368,10 @@ index 0000000..3dff948 + return (($val eq 'y') || ($val eq '1')); +} -From 780d72c0e43679ff58f9f3f005ef17a5fa79ee9f Mon Sep 17 00:00:00 2001 +From 23bd48a5f3cae21a2074ef421a675dfba54866de Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 5 Dec 2014 17:26:26 +0000 -Subject: [PATCH 25/77] fdt: Add support for the CONFIG_CMDLINE_EXTEND option +Subject: [PATCH 25/85] fdt: Add support for the CONFIG_CMDLINE_EXTEND option --- drivers/of/fdt.c | 29 ++++++++++++++++++++++++----- @@ -118426,10 +118426,10 @@ index cde35c5d01..dd7fbfe 100644 pr_debug("Command line is: %s\n", (char*)data); -From 7ff1afbc6732a16d87c5640be8fec1de73a39770 Mon Sep 17 00:00:00 2001 +From 4c4001e3bc03206e4d87273ac410a719c7a128b4 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 26/77] BCM2708: Add core Device Tree support +Subject: [PATCH 26/85] BCM2708: Add core Device Tree support Add the bare minimum needed to boot BCM2708 from a Device Tree. @@ -122306,10 +122306,10 @@ index 0000000..66a98f6 + }; +}; -From 4bd17cf8893beb8fb36fe6e321abfe2bc091eb17 Mon Sep 17 00:00:00 2001 +From 5cbd38e967d11494dbf7d401bfcce0240a176f1f Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 27/77] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 27/85] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -122402,10 +122402,10 @@ index fb795c3..fa72af0 100644 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ #define FB_TYPE_PLANES 1 /* Non interleaved planes */ -From 54459bf0dcbd9019a1bc98cdc77a5c37811c1be5 Mon Sep 17 00:00:00 2001 +From 9907bcbcbae0e355d82cbc29e4f9667fb6fadfac Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 30/77] Speed up console framebuffer imageblit function +Subject: [PATCH 30/85] 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 @@ -122614,10 +122614,10 @@ index a2bb276..436494f 100644 start_index, pitch_index); } else -From b78abfc78e582f82fda5e69816eaa97b1097c853 Mon Sep 17 00:00:00 2001 +From c50184c27d8c47aa92288d11c79ccbc193f91a74 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 31/77] Allow mac address to be set in smsc95xx +Subject: [PATCH 31/85] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -122708,10 +122708,10 @@ index 26423ad..e29a323 100644 if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -From 468a5ebe451a5e3bc693fdbd67173f2fadb7d217 Mon Sep 17 00:00:00 2001 +From b579f8fd561c7347d6354d3f7fc6880ac6b49e7f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 32/77] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 32/85] 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 @@ -122741,7 +122741,7 @@ w1-gpio: Sort out the pullup/parasitic power tangle 7 files changed, 157 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index efb3544..c7b4b61 100644 +index 26be516..55d2889 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -36,6 +36,7 @@ @@ -122814,7 +122814,7 @@ index efb3544..c7b4b61 100644 module_param(vc_i2c_override, bool, 0644); MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral."); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 8017c50..03e208b 100644 +index 50843df..0a5e4188 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -36,6 +36,7 @@ @@ -123109,10 +123109,10 @@ index d58594a..feae942 100644 unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 00d8013737c9e736f70e04e07b761517559e495e Mon Sep 17 00:00:00 2001 +From 8828223a011c97121c5824e4a9056ebfdb178612 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 34/77] config: Enable CONFIG_MEMCG, but leave it disabled (due +Subject: [PATCH 34/85] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -123167,10 +123167,10 @@ index a04225d..a2ef8af 100644 /** -From 5e192d7296061c5d70da39b3fbd1eeedef467923 Mon Sep 17 00:00:00 2001 +From 9028029fe919c229779c848fd2a645bf02d2d959 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:33:38 +0100 -Subject: [PATCH 35/77] ASoC: Add support for BCM2708 +Subject: [PATCH 35/85] ASoC: Add support for BCM2708 This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the @@ -124313,10 +124313,10 @@ index 0000000..6fdcbc1 + +#endif -From 355253cae3f2e9200926bfeb8d21646600d0768e Mon Sep 17 00:00:00 2001 +From 2cd4bdd8e03b8a9ce11d39741d5670d10b58f13e Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:59:51 +0100 -Subject: [PATCH 36/77] ASoC: Add support for PCM5102A codec +Subject: [PATCH 36/85] ASoC: Add support for PCM5102A codec Some definitions to support the PCM5102A codec by Texas Instruments. @@ -124441,10 +124441,10 @@ index 0000000..126f1e9 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 49e137bd21361ad8f4439f35956ceab424013411 Mon Sep 17 00:00:00 2001 +From 214e3f42b42cc6512664e15c2e6d48c44397ff30 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:04:54 +0100 -Subject: [PATCH 37/77] BCM2708: Add I2S support to board file +Subject: [PATCH 37/85] BCM2708: Add I2S support to board file Adds the required initializations for I2S to the board file of mach-bcm2708. @@ -124464,7 +124464,7 @@ See: #1004 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index c7b4b61..dc57983 100644 +index 55d2889..01f2de7 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -616,6 +616,28 @@ static struct platform_device bcm2835_thermal_device = { @@ -124533,10 +124533,10 @@ index a3b65dc..a515992 100644 for (i = 0; i <= 1; i++) { void __iomem *base; -From 5786483930fcb7863012d8bb81d1f73a67b258da Mon Sep 17 00:00:00 2001 +From 7cf3e108eda83b02d6dcf336c5e1842b36fab753 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 38/77] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 38/85] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -124685,10 +124685,10 @@ index 0000000..4b70b45 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 47d7a2a48fd4b2da2f9400de4307febe755b2ef2 Mon Sep 17 00:00:00 2001 +From 895fd13e0cf6dc5febf489837d068825db70d7ac Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:21:34 +0100 -Subject: [PATCH 39/77] BCM2708: Add HifiBerry DAC to board file +Subject: [PATCH 39/85] BCM2708: Add HifiBerry DAC to board file This adds the initalization of the HifiBerry DAC to the mach-bcm2708 board file. @@ -124699,7 +124699,7 @@ Signed-off-by: Florian Meier 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index dc57983..ef7c48d 100644 +index 01f2de7..1d9b788 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -638,6 +638,20 @@ static struct platform_device bcm2708_i2s_device = { @@ -124736,10 +124736,10 @@ index dc57983..ef7c48d 100644 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { struct amba_device *d = amba_devs[i]; -From 403dc5c76505dd5813174532b2f032e52cbe06b8 Mon Sep 17 00:00:00 2001 +From e01a75a2784a659fbd297dc849a2e25ae120e35c Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 6 Dec 2013 20:50:28 +0100 -Subject: [PATCH 40/77] ASoC: BCM2708: Add support for RPi-DAC +Subject: [PATCH 40/85] ASoC: BCM2708: Add support for RPi-DAC This adds a machine driver for the RPi-DAC. @@ -124757,7 +124757,7 @@ Signed-off-by: Florian Meier create mode 100644 sound/soc/codecs/pcm1794a.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index ef7c48d..be27073 100644 +index 1d9b788..6d53beb 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -652,6 +652,20 @@ static struct platform_device snd_pcm5102a_codec_device = { @@ -125034,10 +125034,10 @@ index 0000000..b4eaa44 +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 0418e9bd3eab8e21b5d69ed0b7899dd5a80263f1 Mon Sep 17 00:00:00 2001 +From 4250d743113025b72b841b0b801aee698d8761ef Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 41/77] ASoC: wm8804: Implement MCLK configuration options, add +Subject: [PATCH 41/85] 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 @@ -125077,10 +125077,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 82c2f5a297701240bf5a77611d2d93c041497246 Mon Sep 17 00:00:00 2001 +From bb771a22197d65ccab827fe36a8699d18b961693 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 42/77] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 42/85] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -125345,10 +125345,10 @@ index 0000000..92e9e46 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From df14e52cd5e411324c58e28ec158f503d4905dbb Mon Sep 17 00:00:00 2001 +From 6081cb2ed879b4e99cd91a36331460bf6ec2e3f0 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:26:08 +0100 -Subject: [PATCH 43/77] BCM2708: Added support for HiFiBerry Digi board Board +Subject: [PATCH 43/85] BCM2708: Added support for HiFiBerry Digi board Board initalization by I2C Signed-off-by: Daniel Matuschek @@ -125357,7 +125357,7 @@ Signed-off-by: Daniel Matuschek 1 file changed, 20 insertions(+) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index be27073..2a33663 100644 +index 6d53beb..a062d7f 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -652,6 +652,21 @@ static struct platform_device snd_pcm5102a_codec_device = { @@ -125395,10 +125395,10 @@ index be27073..2a33663 100644 bcm_register_device_dt(&snd_rpi_dac_device); bcm_register_device_dt(&snd_pcm1794a_codec_device); -From d8de9644604c68b7148b023608d70d8ac3bf466f Mon Sep 17 00:00:00 2001 +From 6d26e73e4afc0f00e514498776ff0e24d595f919 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Thu, 16 Jan 2014 07:36:35 +0100 -Subject: [PATCH 44/77] ASoC: wm8804: Set idle_bias_off to false Idle bias has +Subject: [PATCH 44/85] ASoC: wm8804: Set idle_bias_off to false Idle bias has been change to remove warning on driver startup Signed-off-by: Daniel Matuschek @@ -125420,10 +125420,10 @@ index d4efa85..f3f26a2 100644 .dapm_widgets = wm8804_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wm8804_dapm_widgets), -From 40f01186460630fa704c88adbefbc347e5e402e4 Mon Sep 17 00:00:00 2001 +From 76c18d6844de1ab292a34baf6c96566ba05db024 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 45/77] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 45/85] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -125440,7 +125440,7 @@ limit of 0dB for this control. create mode 100644 sound/soc/bcm/iqaudio-dac.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 2a33663..957504e 100644 +index a062d7f..a51a6168 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -681,6 +681,22 @@ static struct platform_device snd_pcm1794a_codec_device = { @@ -125631,10 +125631,10 @@ index 0000000..aff7377 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 5d1014e6dfa91f7f4b07851eefaa0a8bc544fda8 Mon Sep 17 00:00:00 2001 +From 712b1f5ed46d64ace42306b175e84247ad466a86 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Jun 2014 13:42:01 +0100 -Subject: [PATCH 46/77] vmstat: Workaround for issue where dirty page count +Subject: [PATCH 46/85] vmstat: Workaround for issue where dirty page count goes negative See: @@ -125661,10 +125661,10 @@ index 82e7db7..f87d16d 100644 static inline void __inc_zone_page_state(struct page *page, -From 462ac627ee409f190f5519727c80942afafd0d6d Mon Sep 17 00:00:00 2001 +From 8fe8c0d0126e286164be182add69b996012753b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 47/77] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 47/85] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -125700,10 +125700,10 @@ index bfbe1be..a738b25 100644 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From 6a68d9854eed6f1c5741aff8466cb5877deecd54 Mon Sep 17 00:00:00 2001 +From db5d9cfda38672c42a52574924297223f44ab568 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 48/77] Added support for HiFiBerry DAC+ +Subject: [PATCH 48/85] 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. @@ -125716,7 +125716,7 @@ a different codec chip (PCM5122), therefore a new driver is necessary. create mode 100644 sound/soc/bcm/hifiberry_dacplus.c diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 957504e..90459b8 100644 +index a51a6168..d421a89 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -652,6 +652,20 @@ static struct platform_device snd_pcm5102a_codec_device = { @@ -125914,10 +125914,10 @@ index 0000000..c63387b +MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+"); +MODULE_LICENSE("GPL v2"); -From 1ca3777a5f3e17847136937e1bab1717281c73ca Mon Sep 17 00:00:00 2001 +From f929e0ea9b902ca56a57439ad326a7fe1bc190d2 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 49/77] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 49/85] 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. @@ -125947,7 +125947,7 @@ Some code to load the driver based on device-tree-overlays was missing. This is create mode 100644 sound/soc/codecs/tas5713.h diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 90459b8..785cf1a 100644 +index d421a89..363b9c5 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -681,6 +681,20 @@ static struct i2c_board_info __initdata snd_wm8804_i2c_devices[] = { @@ -126786,10 +126786,10 @@ index 0000000..8f019e0 + +#endif /* _TAS5713_H */ -From 06c9b132b1340b495048f8814be13fe71b5cd77e Mon Sep 17 00:00:00 2001 +From 0d10a0439bbde5d1bf74427cb93a55a29ea7ec12 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Apr 2015 19:14:18 +0100 -Subject: [PATCH 50/77] bcm2708: Allow option card devices to be configured via +Subject: [PATCH 50/85] bcm2708: Allow option card devices to be configured via DT If the kernel is built with Device Tree support, and if a DT blob @@ -126814,10 +126814,10 @@ index 03fa1cb..c816526 100644 static struct platform_driver bcm2835_i2s_driver = { .probe = bcm2835_i2s_probe, -From a9fff3c9005e6658977bd5e7df92114e70e1f813 Mon Sep 17 00:00:00 2001 +From 8eaeacdeca7966b710fbdefad07bd3f0de14447c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 18:45:39 +0100 -Subject: [PATCH 51/77] Adding Device Tree support for some RPi audio cards +Subject: [PATCH 51/85] Adding Device Tree support for some RPi audio cards --- arch/arm/mach-bcm2709/bcm2709.c | 143 ++++++++++++++++++++++++++++++++++++++ @@ -126829,7 +126829,7 @@ Subject: [PATCH 51/77] Adding Device Tree support for some RPi audio cards 6 files changed, 232 insertions(+) diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 03e208b..2ae79d9 100644 +index 0a5e4188..57e1f3d 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -636,6 +636,115 @@ static struct platform_device bcm2835_thermal_device = { @@ -127180,10 +127180,10 @@ index 126f1e9..7c6598e 100644 }; -From 9518bd237c4fb516a0ec78f7ec81e5784f8425e0 Mon Sep 17 00:00:00 2001 +From 7dfce43c57cc203535e6098fcc1e8977d85ddeac Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Wed, 29 Oct 2014 23:30:30 -0700 -Subject: [PATCH 52/77] Added support to reserve/enable a GPIO pin to be used +Subject: [PATCH 52/85] Added support to reserve/enable a GPIO pin to be used from pps-gpio module (LinuxPPS). Enable PPS modules in default config for RPi. @@ -127193,7 +127193,7 @@ Subject: [PATCH 52/77] Added support to reserve/enable a GPIO pin to be used 2 files changed, 54 insertions(+) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index 785cf1a..e42f5a5 100644 +index 363b9c5..74ec578 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -37,6 +37,7 @@ @@ -127256,7 +127256,7 @@ index 785cf1a..e42f5a5 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 2ae79d9..95223ff 100644 +index 57e1f3d..721559b 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -37,6 +37,7 @@ @@ -127319,10 +127319,10 @@ index 2ae79d9..95223ff 100644 +module_param(pps_gpio_pin, int, 0644); +MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS"); -From 6831eded602a01774036cb24d3195dbbd51f9135 Mon Sep 17 00:00:00 2001 +From a3936496fcb450e52716292427b60570447b6b03 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 53/77] Update ds1307 driver for device-tree support +Subject: [PATCH 53/85] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -127349,10 +127349,10 @@ index 4ffabb3..c6789a7 100644 .driver = { .name = "rtc-ds1307", -From 47ca2482bc03a888435d35139cd2f5989354ee1b Mon Sep 17 00:00:00 2001 +From eed1565f9cb449204057486a48c39f917c269fa1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 54/77] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 54/85] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -127463,10 +127463,10 @@ index 0000000..2ca2b98 +MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); +MODULE_LICENSE("GPL"); -From 38c278bba1388423ba1508d0712babb717685530 Mon Sep 17 00:00:00 2001 +From 494f12e28e415f895a337fcfcfe45cd530c1cc99 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 20 Jun 2014 17:19:27 +0100 -Subject: [PATCH 55/77] bcm2709: Simplify and strip down IRQ handler +Subject: [PATCH 55/85] bcm2709: Simplify and strip down IRQ handler --- arch/arm/include/asm/entry-macro-multi.S | 2 + @@ -127685,10 +127685,10 @@ index d08591b..08d184c 100644 +1: get_irqnr_and_base r0, r2, r6, lr + .endm -From a69146643bae1215ab2860b9646f0f380bd3c50f Mon Sep 17 00:00:00 2001 +From 3e2b399180b8f5a0090134ba1889443945a13cf6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 12 Feb 2015 11:17:53 +0000 -Subject: [PATCH 56/77] Fix LED "input" trigger implementation for 3.19 +Subject: [PATCH 56/85] Fix LED "input" trigger implementation for 3.19 --- drivers/leds/leds-gpio.c | 10 +++++++++- @@ -127775,10 +127775,10 @@ index 9a2b000..60accc5 100644 /* Set LED brightness level */ /* Must not sleep, use a workqueue if needed */ -From d8f6c527b14c125e58173e8bd0e7c6c59bab4919 Mon Sep 17 00:00:00 2001 +From 5c958120f03edcedf40ff2d07b825229d348d26b Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 57/77] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 57/85] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -127800,10 +127800,10 @@ index 8d908e3..7a1900d 100644 .can_sleep = false, }; -From bf8c97c74733237b219a22da649cb6cb7029615d Mon Sep 17 00:00:00 2001 +From 784bb9af1427a9b17cd6894cff2dc3c2eb8c4735 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 4 Feb 2015 10:02:24 +0000 -Subject: [PATCH 58/77] pinctrl-bcm2835: bcm2835_gpio_direction_output must set +Subject: [PATCH 58/85] pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value --- @@ -127831,10 +127831,10 @@ index 7a1900d..62f85aa 100644 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) -From 1262602778ac5adbe798e7ace41b22262a578fcf Mon Sep 17 00:00:00 2001 +From c885a17c2aee5d4f00b2dc950bcdadd3ed7bd7cb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 59/77] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 +Subject: [PATCH 59/85] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -127980,10 +127980,10 @@ index 62f85aa..c7cf266 100644 }, }; -From fd7e740e1c83bd550444192a8beff54ea5291c50 Mon Sep 17 00:00:00 2001 +From ead5cb2483b2fb0943121dfb69786e6ec1c20ced Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 60/77] pinctrl-bcm2835: Only request the interrupts listed in +Subject: [PATCH 60/85] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -128010,10 +128010,10 @@ index c7cf266..986779a 100644 pc->irq_data[i].irqgroup = i; -From c24fbfc7a5bc3c7cb35f51d0a40ad25b98a8a422 Mon Sep 17 00:00:00 2001 +From 15eff0b34d5eba282dfa1fc0303bb66f08d237ad Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 27 Feb 2015 15:10:24 +0000 -Subject: [PATCH 61/77] enc28j60: Add device tree compatible string and an +Subject: [PATCH 61/85] enc28j60: Add device tree compatible string and an overlay --- @@ -128047,10 +128047,10 @@ index b1b5f66..c6b6e1a 100644 .probe = enc28j60_probe, .remove = enc28j60_remove, -From 331cdec0de30933d5e7839f0e3def9b98d3fa968 Mon Sep 17 00:00:00 2001 +From 4c1fa7e5d19f7f006576def6cdf591c325d9a167 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 62/77] Add driver for rpi-proto +Subject: [PATCH 62/85] 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 @@ -128265,10 +128265,10 @@ index 0000000..c6e45a0 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 2079392f1bde4f50d8c1ad65c2f7b52a6ff34848 Mon Sep 17 00:00:00 2001 +From 3a796c13d6cf8d6cd51170b34944b18d50f30bba Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Thu, 2 Apr 2015 12:22:55 +0100 -Subject: [PATCH 63/77] Add Device Tree support for RPi-DAC. +Subject: [PATCH 63/85] Add Device Tree support for RPi-DAC. --- sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++ @@ -128343,10 +128343,10 @@ index b4eaa44..afe1b41 100644 }; -From 4725644a3f7c09811486c1324f9653e79ecbdcb7 Mon Sep 17 00:00:00 2001 +From 69754b2aaecf3eb2dd3bef6f68d7e7787a9dc6cc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 64/77] config: Add default configs +Subject: [PATCH 64/85] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1204 ++++++++++++++++++++++++++++++++++++ @@ -130771,10 +130771,10 @@ index 0000000..6a41231 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 7de29243d1ac891a526c77e17129d6e2d547361d Mon Sep 17 00:00:00 2001 +From c6ed3e60b55412cdf8e130053f600c05c3e1460a Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 65/77] smsx95xx: fix crimes against truesize +Subject: [PATCH 65/85] 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. @@ -130809,10 +130809,10 @@ index e29a323..aff63dc usbnet_skb_return(dev, ax_skb); } -From 4772a6e4cc3921cb41515b7b0a91ad646d1491aa Mon Sep 17 00:00:00 2001 +From ef3796d3a8cdb18963e2eeb04fa493abca03af14 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 17 Apr 2015 16:58:45 +0100 -Subject: [PATCH 66/77] smsc95xx: Disable turbo mode by default +Subject: [PATCH 66/85] smsc95xx: Disable turbo mode by default --- drivers/net/usb/smsc95xx.c | 2 +- @@ -130832,10 +130832,10 @@ index aff63dc..08a8a8c 100755 MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); -From 9d1fbb7b2dbe16c506f54984c361a55d1b2603fb Mon Sep 17 00:00:00 2001 +From 831d4392562d46f0d9a55c755c1363b84832af2a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Apr 2015 19:30:22 +0100 -Subject: [PATCH 67/77] Add blk_pos parameter to mmc multi_io_quirk callback +Subject: [PATCH 67/85] Add blk_pos parameter to mmc multi_io_quirk callback --- drivers/mmc/card/block.c | 1 + @@ -130918,10 +130918,10 @@ index b0258e8..d3cdad9 100644 struct mmc_card; -From d8492b31751e7eda1b9b2c92dd381b5d7df1679d Mon Sep 17 00:00:00 2001 +From a20e01130fd949a90e5e91821edd63581e95cc1e 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 68/77] bcm2835: bcm2835_defconfig +Subject: [PATCH 68/85] bcm2835: bcm2835_defconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132251,10 +132251,10 @@ index 31cb073..2e8a95a 100644 # CONFIG_XZ_DEC_ARM is not set # CONFIG_XZ_DEC_ARMTHUMB is not set -From 4e2ed4a7a7971ea763017bc6234d30cdc5bfb984 Mon Sep 17 00:00:00 2001 +From f06ed380a59b6b336820510c6716db5bd9928e66 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 69/77] BCM270x_DT: Add mailbox bcm2708-vcio +Subject: [PATCH 69/85] BCM270x_DT: Add mailbox bcm2708-vcio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -132269,7 +132269,7 @@ Signed-off-by: Noralf Trønnes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index e42f5a5..de2f93a 100644 +index 74ec578..5527d5c 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -870,7 +870,7 @@ void __init bcm2708_init(void) @@ -132282,7 +132282,7 @@ index e42f5a5..de2f93a 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 95223ff..350647a 100644 +index 721559b..4a00561 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -890,7 +890,7 @@ void __init bcm2709_init(void) @@ -132295,10 +132295,10 @@ index 95223ff..350647a 100644 #ifdef CONFIG_BCM2708_GPIO bcm_register_device_dt(&bcm2708_gpio_device); -From 2867da0a54803e6eb8e748b63a474877e16899b0 Mon Sep 17 00:00:00 2001 +From ad4a25a7e27ffac5b4f5b9eba60c8588ec2e04c1 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 70/77] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 70/85] rpi-ft5406: Add touchscreen driver for pi LCD display --- drivers/input/touchscreen/Kconfig | 7 + @@ -132615,10 +132615,10 @@ index cc284ed..d3ea839 100644 VCMSG_SET_CURSOR_STATE = 0x00008011, }; -From f794a0549b3a54cbe6dcfef3b37c421dda92d13a Mon Sep 17 00:00:00 2001 +From 4d11ea5e022aa484a8884a54d08bb5d3f26bed0b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Oct 2014 11:47:53 +0100 -Subject: [PATCH 71/77] Improve __copy_to_user and __copy_from_user performance +Subject: [PATCH 71/85] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use optimised memcpy/memmove/memcmp/memset implementations. @@ -134142,10 +134142,10 @@ index 3e58d71..0622891 100644 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) -From 5787d557e062cdac5f3e19ccd60394dc6df38aab Mon Sep 17 00:00:00 2001 +From 961d37927bd0de6c86334892d19341f427a6d543 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 27 May 2015 17:22:15 +0100 -Subject: [PATCH 72/77] bcm2835-audio: Create the platform device if the DT +Subject: [PATCH 72/85] bcm2835-audio: Create the platform device if the DT node is disabled For backwards compatibility, allow the built-in ALSA driver to be enabled @@ -134157,7 +134157,7 @@ node in DT. 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index de2f93a..cfc4f13 100644 +index 5527d5c..937c2d3 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -898,8 +898,14 @@ void __init bcm2708_init(void) @@ -134178,7 +134178,7 @@ index de2f93a..cfc4f13 100644 bcm_register_device_dt(&bcm2708_spi_device); diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 350647a..507ff52 100644 +index 4a00561..dec8043 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -918,8 +918,14 @@ void __init bcm2709_init(void) @@ -134199,10 +134199,10 @@ index 350647a..507ff52 100644 bcm_register_device_dt(&bcm2708_spi_device); -From 070a6f51cd5f81f635cfcccd3452ee5f252a7ee4 Mon Sep 17 00:00:00 2001 +From 729ca6d5fc85ce618d61af67f400d1f20ddd2fbd 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 73/77] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 73/85] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -134261,10 +134261,10 @@ index 70f2f39..f7fdacd 100644 static const char * const bcm2835_compat[] = { -From 3add74da14e27d18ef276f66c55a69e6dc014216 Mon Sep 17 00:00:00 2001 +From 9a645229a554cd9b0f211bd15310ceb4c61f32b2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Jun 2015 17:47:27 +0100 -Subject: [PATCH 74/77] platform: Add force_core command line setting to boot +Subject: [PATCH 74/85] platform: Add force_core command line setting to boot from a different core number --- @@ -134315,7 +134315,7 @@ index a366275..90805a6 100644 writel(1 << (data & 0x1f), __io_address(enables[(data >> 5) & 0x3])); } else if (d->irq == INTERRUPT_ARM_LOCAL_PMU_FAST) { diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index 507ff52..c5e51e8 100644 +index dec8043..fe71c50 100644 --- a/arch/arm/mach-bcm2709/bcm2709.c +++ b/arch/arm/mach-bcm2709/bcm2709.c @@ -96,6 +96,7 @@ static unsigned w1_gpio_pin = W1_GPIO; @@ -134335,112 +134335,2041 @@ index 507ff52..c5e51e8 100644 module_param(serial, uint, 0644); module_param(uart_clock, uint, 0644); -From a283be0c98260b1f29c8c46df7e8fb2a9cdaf5a8 Mon Sep 17 00:00:00 2001 +From 0733a658a5b233abd9da4157ab2bfd52ceebf404 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 18 Jun 2015 17:46:17 +0100 -Subject: [PATCH 75/77] mach-bcm270x: Enable the building of pinctrl-bcm2835 +Subject: [PATCH 75/85] mach-bcm270x: Enable the building of pinctrl-bcm2835 --- drivers/pinctrl/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile -index 6eadf04..ca6e1be 100644 +index 6eadf04..9119513 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o -+obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_MACH_BCM2709) += bcm/ - obj-$(CONFIG_ARCH_BCM) += bcm/ - obj-$(CONFIG_ARCH_BERLIN) += berlin/ - obj-y += freescale/ - -From fd08db11f15960c30449a5a2cb14d3ab7fd470ea Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 18 Jun 2015 18:06:28 +0100 -Subject: [PATCH 76/77] squash: Fix inconsistency in pinctrl Makefile patch - ---- - drivers/pinctrl/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile -index ca6e1be..9119513 100644 ---- a/drivers/pinctrl/Makefile -+++ b/drivers/pinctrl/Makefile -@@ -38,7 +38,7 @@ obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o - obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o - obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o - --obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_MACH_BCM2709) += bcm/ +obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_ARCH_BCM2709) += bcm/ obj-$(CONFIG_ARCH_BCM) += bcm/ obj-$(CONFIG_ARCH_BERLIN) += berlin/ obj-y += freescale/ -From 05376fce25aaab4f47182a5af04928bfa06f30d6 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 18 Jun 2015 19:53:58 +0100 -Subject: [PATCH 77/77] platform: squash: Remove IRQF_DISABLED +From 3c7dc45eee7c0339b72469bf6674e842385b7ab9 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 19 Jun 2015 16:41:39 +0100 +Subject: [PATCH 76/85] BCM270X_DT: Document the i2s-mmap overlay --- - arch/arm/mach-bcm2708/armctrl.c | 2 +- - arch/arm/mach-bcm2708/bcm2708.c | 2 +- - arch/arm/mach-bcm2708/bcm2708_gpio.c | 2 +- - arch/arm/mach-bcm2709/bcm2709.c | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) + arch/arm/boot/dts/overlays/README | 6 ++++++ + 1 file changed, 6 insertions(+) -diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c -index 74bacb3..0429225 100644 ---- a/arch/arm/mach-bcm2708/armctrl.c -+++ b/arch/arm/mach-bcm2708/armctrl.c -@@ -305,7 +305,7 @@ int __init armctrl_init(void __iomem * base, unsigned int irq_start, - irq_set_chip(irq, &armctrl_chip); - irq_set_chip_data(irq, (void *)data); - irq_set_handler(irq, handle_level_irq); -- set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_DISABLED); -+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 3e08f98..7fa6d33 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -260,6 +260,12 @@ Params: ds1307 Select the DS1307 device + pcf8563 Select the PCF8563 device + + ++Name: i2s-mmap ++Info: Enables mmap support in the bcm2708-i2s driver ++Load: dtoverlay=i2s-mmap ++Params: ++ ++ + Name: iqaudio-dac + Info: Configures the IQaudio DAC audio card + Load: dtoverlay=iqaudio-dac + +From d9fa11803a0d2e3b1eaf4041ddd0ca5651300d96 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 17 Jun 2015 11:36:53 +0100 +Subject: [PATCH 77/85] bcm2835-sdhost: Improve error handling and recovery + +1) Expose the hw_reset method to the MMC framework, removing many + internal calls by the driver. + +2) Reduce overclock setting on error. + +3) Increase timeout to cope with high capacity cards. + +4) Add properties and parameters to control pio_limit and debug. + +5) Reduce messages at probe time. +--- + arch/arm/boot/dts/overlays/README | 8 +- + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 4 +- + drivers/mmc/host/bcm2835-sdhost.c | 578 ++++++++++++++++++-------- + 3 files changed, 404 insertions(+), 186 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 7fa6d33..63da266 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -408,7 +408,13 @@ Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock + Load: dtoverlay=sdhost,= + Params: overclock_50 Clock (in MHz) to use when the MMC framework + requests 50MHz +- force_pio Disable DMA support ++ ++ force_pio Disable DMA support (default off) ++ ++ pio_limit Number of blocks above which to use DMA ++ (default 2) ++ ++ debug Enable debug output (default off) + + + Name: spi-bcm2708 +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index 8fb28e9..b408ab4 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -22,6 +22,7 @@ + dma-names = "tx", "rx"; + brcm,delay-after-stop = <0>; + brcm,overclock-50 = <0>; ++ brcm,pio-limit = <2>; + status = "okay"; + }; + }; +@@ -70,9 +71,10 @@ + }; + + __overrides__ { +- delay_after_stop = <&sdhost>,"brcm,delay-after-stop:0"; + overclock_50 = <&sdhost>,"brcm,overclock-50:0"; + force_pio = <&sdhost>,"brcm,force-pio?"; ++ pio_limit = <&sdhost>,"brcm,pio-limit:0"; ++ debug = <&sdhost>,"brcm,debug?"; + sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; + }; + }; +diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c +index eef8a24..6277e43 100644 +--- a/drivers/mmc/host/bcm2835-sdhost.c ++++ b/drivers/mmc/host/bcm2835-sdhost.c +@@ -90,9 +90,8 @@ + /* Reserved */ + #define SDHSTS_DATA_FLAG 0x01 + +-#define SDHSTS_TRANSFER_ERROR_MASK (SDHSTS_CRC16_ERROR|SDHSTS_REW_TIME_OUT|SDHSTS_FIFO_ERROR) ++#define SDHSTS_TRANSFER_ERROR_MASK (SDHSTS_CRC7_ERROR|SDHSTS_CRC16_ERROR|SDHSTS_REW_TIME_OUT|SDHSTS_FIFO_ERROR) + #define SDHSTS_ERROR_MASK (SDHSTS_CMD_TIME_OUT|SDHSTS_TRANSFER_ERROR_MASK) +-/* SDHSTS_CRC7_ERROR - ignore this as MMC cards generate this spuriously */ + + #define SDHCFG_BUSY_IRPT_EN (1<<10) + #define SDHCFG_BLOCK_IRPT_EN (1<<8) +@@ -111,16 +110,7 @@ + #define SDEDM_READ_THRESHOLD_SHIFT 14 + #define SDEDM_THRESHOLD_MASK 0x1f + +-/* the inclusive limit in bytes under which PIO will be used instead of DMA */ +-#ifdef CONFIG_MMC_BCM2835_SDHOST_PIO_DMA_BARRIER +-#define PIO_DMA_BARRIER CONFIG_MMC_BCM2835_SDHOST_PIO_DMA_BARRIER +-#else +-#define PIO_DMA_BARRIER 0 +-#endif +- +-#define MIN_FREQ 400000 +-#define TIMEOUT_VAL 0xE +-#define BCM2835_SDHOST_WRITE_DELAY(f) (((2 * 1000000) / f) + 1) ++#define MHZ 1000000 + + #ifndef BCM2708_PERI_BASE + #define BCM2708_PERI_BASE 0x20000000 +@@ -138,19 +128,20 @@ struct bcm2835_host { + + struct mmc_host *mmc; + +- u32 timeout; ++ u32 pio_timeout; /* In jiffies */ + + int clock; /* Current clock speed */ + + bool slow_card; /* Force 11-bit divisor */ + + unsigned int max_clk; /* Max possible freq */ +- unsigned int timeout_clk; /* Timeout freq (KHz) */ + + struct tasklet_struct finish_tasklet; /* Tasklet structures */ + + struct timer_list timer; /* Timer for timeouts */ + ++ struct timer_list pio_timer; /* PIO error detection timer */ ++ + struct sg_mapping_iter sg_miter; /* SG state for PIO */ + unsigned int blocks; /* remaining PIO blocks */ + +@@ -170,6 +161,10 @@ struct bcm2835_host { + + unsigned int use_busy:1; /* Wait for busy interrupt */ + ++ unsigned int reduce_overclock:1; /* ...at the next opportunity */ ++ ++ unsigned int debug:1; /* Enable debug output */ ++ + u32 thread_isr; + + /*DMA part*/ +@@ -185,7 +180,8 @@ struct bcm2835_host { + struct timeval stop_time; /* when the last stop was issued */ + u32 delay_after_stop; /* minimum time between stop and subsequent data transfer */ + u32 overclock_50; /* frequency to use when 50MHz is requested (in MHz) */ +- u32 max_overclock; /* Highest reported */ ++ u32 overclock; /* Current frequency if overclocked, else zero */ ++ u32 pio_limit; /* Maximum block count for PIO (0 = always DMA) */ + }; + + +@@ -204,41 +200,79 @@ static inline u32 bcm2835_sdhost_read_relaxed(struct bcm2835_host *host, int reg + return readl_relaxed(host->ioaddr + reg); + } + ++static void bcm2835_sdhost_dumpcmd(struct bcm2835_host *host, ++ struct mmc_command *cmd, ++ const char *label) ++{ ++ if (cmd) ++ pr_info("%s:%c%s op %d arg 0x%x flags 0x%x - resp %08x %08x %08x %08x, err %d\n", ++ mmc_hostname(host->mmc), ++ (cmd == host->cmd) ? '>' : ' ', ++ label, cmd->opcode, cmd->arg, cmd->flags, ++ cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3], ++ cmd->error); ++} ++ + static void bcm2835_sdhost_dumpregs(struct bcm2835_host *host) + { +- pr_info(DRIVER_NAME ": =========== REGISTER DUMP (%s)===========\n", ++ bcm2835_sdhost_dumpcmd(host, host->mrq->sbc, "sbc"); ++ bcm2835_sdhost_dumpcmd(host, host->mrq->cmd, "cmd"); ++ if (host->mrq->data) ++ pr_err("%s: data blocks %x blksz %x - err %d\n", ++ mmc_hostname(host->mmc), ++ host->mrq->data->blocks, ++ host->mrq->data->blksz, ++ host->mrq->data->error); ++ bcm2835_sdhost_dumpcmd(host, host->mrq->stop, "stop"); ++ ++ pr_info("%s: =========== REGISTER DUMP ===========\n", + mmc_hostname(host->mmc)); + +- pr_info(DRIVER_NAME ": SDCMD 0x%08x\n", ++ pr_info("%s: SDCMD 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCMD)); +- pr_info(DRIVER_NAME ": SDARG 0x%08x\n", ++ pr_info("%s: SDARG 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDARG)); +- pr_info(DRIVER_NAME ": SDTOUT 0x%08x\n", ++ pr_info("%s: SDTOUT 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDTOUT)); +- pr_info(DRIVER_NAME ": SDCDIV 0x%08x\n", ++ pr_info("%s: SDCDIV 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDCDIV)); +- pr_info(DRIVER_NAME ": SDRSP0 0x%08x\n", ++ pr_info("%s: SDRSP0 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP0)); +- pr_info(DRIVER_NAME ": SDRSP1 0x%08x\n", ++ pr_info("%s: SDRSP1 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP1)); +- pr_info(DRIVER_NAME ": SDRSP2 0x%08x\n", ++ pr_info("%s: SDRSP2 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP2)); +- pr_info(DRIVER_NAME ": SDRSP3 0x%08x\n", ++ pr_info("%s: SDRSP3 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDRSP3)); +- pr_info(DRIVER_NAME ": SDHSTS 0x%08x\n", ++ pr_info("%s: SDHSTS 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHSTS)); +- pr_info(DRIVER_NAME ": SDVDD 0x%08x\n", ++ pr_info("%s: SDVDD 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDVDD)); +- pr_info(DRIVER_NAME ": SDEDM 0x%08x\n", ++ pr_info("%s: SDEDM 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDEDM)); +- pr_info(DRIVER_NAME ": SDHCFG 0x%08x\n", ++ pr_info("%s: SDHCFG 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHCFG)); +- pr_info(DRIVER_NAME ": SDHBCT 0x%08x\n", ++ pr_info("%s: SDHBCT 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBCT)); +- pr_info(DRIVER_NAME ": SDHBLC 0x%08x\n", ++ pr_info("%s: SDHBLC 0x%08x\n", ++ mmc_hostname(host->mmc), + bcm2835_sdhost_read(host, SDHBLC)); + +- pr_debug(DRIVER_NAME ": ===========================================\n"); ++ pr_info("%s: ===========================================\n", ++ mmc_hostname(host->mmc)); + } + + +@@ -248,12 +282,10 @@ static void bcm2835_sdhost_set_power(struct bcm2835_host *host, bool on) + } + + +-static void bcm2835_sdhost_reset(struct bcm2835_host *host) ++static void bcm2835_sdhost_reset_internal(struct bcm2835_host *host) + { + u32 temp; + +- pr_debug("bcm2835_sdhost_reset\n"); +- + bcm2835_sdhost_set_power(host, false); + + bcm2835_sdhost_write(host, 0, SDCMD); +@@ -281,6 +313,20 @@ static void bcm2835_sdhost_reset(struct bcm2835_host *host) + mmiowb(); + } + ++ ++static void bcm2835_sdhost_reset(struct mmc_host *mmc) ++{ ++ struct bcm2835_host *host = mmc_priv(mmc); ++ unsigned long flags; ++ if (host->debug) ++ pr_info("%s: reset\n", mmc_hostname(mmc)); ++ spin_lock_irqsave(&host->lock, flags); ++ ++ bcm2835_sdhost_reset_internal(host); ++ ++ spin_unlock_irqrestore(&host->lock, flags); ++} ++ + static void bcm2835_sdhost_set_ios(struct mmc_host *mmc, struct mmc_ios *ios); + + static void bcm2835_sdhost_init(struct bcm2835_host *host, int soft) +@@ -290,7 +336,7 @@ static void bcm2835_sdhost_init(struct bcm2835_host *host, int soft) + /* Set interrupt enables */ + host->hcfg = SDHCFG_BUSY_IRPT_EN; + +- bcm2835_sdhost_reset(host); ++ bcm2835_sdhost_reset_internal(host); + + if (soft) { + /* force clock reconfiguration */ +@@ -420,6 +466,40 @@ static void bcm2835_sdhost_dma_complete(void *param) + spin_unlock_irqrestore(&host->lock, flags); + } + ++static bool data_transfer_wait(struct bcm2835_host *host, const char *caller) ++{ ++ unsigned long timeout = 1000000; ++ u32 hsts; ++ while (timeout) ++ { ++ hsts = bcm2835_sdhost_read(host, SDHSTS); ++ if (hsts & (SDHSTS_TRANSFER_ERROR_MASK | ++ SDHSTS_DATA_FLAG)) { ++ bcm2835_sdhost_write(host, SDHSTS_TRANSFER_ERROR_MASK, ++ SDHSTS); ++ break; ++ } ++ timeout--; ++ } ++ ++ if (hsts & (SDHSTS_CRC16_ERROR | ++ SDHSTS_CRC7_ERROR | ++ SDHSTS_FIFO_ERROR)) { ++ pr_err("%s: data error in %s - HSTS %x\n", ++ mmc_hostname(host->mmc), caller, hsts); ++ host->data->error = -EILSEQ; ++ return false; ++ } else if ((timeout == 0) || ++ (hsts & (SDHSTS_CMD_TIME_OUT | ++ SDHSTS_REW_TIME_OUT))) { ++ pr_err("%s: timeout in %s - HSTS %x\n", ++ mmc_hostname(host->mmc), caller, hsts); ++ host->data->error = -ETIMEDOUT; ++ return false; ++ } ++ return true; ++} ++ + static void bcm2835_sdhost_read_block_pio(struct bcm2835_host *host) + { + unsigned long flags; +@@ -443,35 +523,15 @@ static void bcm2835_sdhost_read_block_pio(struct bcm2835_host *host) + buf = (u32 *)host->sg_miter.addr; + + while (len) { +- while (1) { +- u32 hsts; +- hsts = bcm2835_sdhost_read(host, SDHSTS); +- if (hsts & SDHSTS_DATA_FLAG) +- break; +- +- if (hsts & SDHSTS_ERROR_MASK) { +- pr_err("%s: Transfer error - HSTS %x, HBCT %x - %x left\n", +- mmc_hostname(host->mmc), +- hsts, +- bcm2835_sdhost_read(host, SDHBCT), +- blksize + len); +- if (hsts & SDHSTS_REW_TIME_OUT) +- host->data->error = -ETIMEDOUT; +- else if (hsts & (SDHSTS_CRC16_ERROR || +- SDHSTS_CRC7_ERROR)) +- host->data->error = -EILSEQ; +- else { +- pr_err("%s: unexpected data error\n", +- mmc_hostname(host->mmc)); +- bcm2835_sdhost_dumpregs(host); +- host->cmd->error = -EIO; +- } +- } +- } ++ if (!data_transfer_wait(host, "read_block_pio")) ++ break; + + *(buf++) = bcm2835_sdhost_read(host, SDDATA); + len -= 4; + } ++ ++ if (host->data->error) ++ break; } - armctrl_pm_register(base, irq_start, resume_sources); -diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -index cfc4f13..937c2d3 100644 ---- a/arch/arm/mach-bcm2708/bcm2708.c -+++ b/arch/arm/mach-bcm2708/bcm2708.c -@@ -1028,7 +1028,7 @@ static irqreturn_t bcm2708_timer_interrupt(int irq, void *dev_id) + sg_miter_stop(&host->sg_miter); +@@ -502,11 +562,15 @@ static void bcm2835_sdhost_write_block_pio(struct bcm2835_host *host) + buf = host->sg_miter.addr; - static struct irqaction bcm2708_timer_irq = { - .name = "BCM2708 Timer Tick", -- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, -+ .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = bcm2708_timer_interrupt, + while (len) { +- while (!(bcm2835_sdhost_read(host, SDHSTS) & SDHSTS_DATA_FLAG)) +- continue; ++ if (!data_transfer_wait(host, "write_block_pio")) ++ break; ++ + bcm2835_sdhost_write(host, *(buf++), SDDATA); + len -= 4; + } ++ ++ if (host->data->error) ++ break; + } + + sg_miter_stop(&host->sg_miter); +@@ -519,10 +583,15 @@ static void bcm2835_sdhost_transfer_pio(struct bcm2835_host *host) + { + BUG_ON(!host->data); + +- if (host->data->flags & MMC_DATA_READ) ++ if (host->data->flags & MMC_DATA_READ) { + bcm2835_sdhost_read_block_pio(host); +- else ++ } else { + bcm2835_sdhost_write_block_pio(host); ++ ++ /* Start a timer in case a transfer error occurs because ++ there is no error interrupt */ ++ mod_timer(&host->pio_timer, jiffies + host->pio_timeout); ++ } + } + + +@@ -607,6 +676,7 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + host->flush_fifo = 0; + host->data->bytes_xfered = 0; + ++ host->use_dma = host->have_dma && (data->blocks > host->pio_limit); + if (!host->use_dma) { + int flags; + +@@ -619,8 +689,6 @@ static void bcm2835_sdhost_prepare_data(struct bcm2835_host *host, struct mmc_co + host->blocks = data->blocks; + } + +- host->use_dma = host->have_dma && data->blocks > PIO_DMA_BARRIER; +- + bcm2835_sdhost_set_transfer_irqs(host); + + bcm2835_sdhost_write(host, data->blksz, SDHBCT); +@@ -638,22 +706,25 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + + WARN_ON(host->cmd); + +- if (1) { +- pr_debug("bcm2835_sdhost_send_command: %08x %08x (flags %x)\n", +- cmd->opcode, cmd->arg, (cmd->flags & 0xff) | (cmd->data ? cmd->data->flags : 0)); +- if (cmd->data) +- pr_debug("bcm2835_sdhost_send_command: %s %d*%x\n", +- (cmd->data->flags & MMC_DATA_READ) ? +- "read" : "write", cmd->data->blocks, +- cmd->data->blksz); +- } ++ if (cmd->data) ++ pr_debug("%s: send_command %d 0x%x " ++ "(flags 0x%x) - %s %d*%d\n", ++ mmc_hostname(host->mmc), ++ cmd->opcode, cmd->arg, cmd->flags, ++ (cmd->data->flags & MMC_DATA_READ) ? ++ "read" : "write", cmd->data->blocks, ++ cmd->data->blksz); ++ else ++ pr_debug("%s: send_command %d 0x%x (flags 0x%x)\n", ++ mmc_hostname(host->mmc), ++ cmd->opcode, cmd->arg, cmd->flags); + + /* Wait max 10 ms */ + timeout = 1000; + + while (bcm2835_sdhost_read(host, SDCMD) & SDCMD_NEW_FLAG) { + if (timeout == 0) { +- pr_err("%s: Previous command never completed.\n", ++ pr_err("%s: previous command never completed.\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); + cmd->error = -EIO; +@@ -666,16 +737,16 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + + if ((1000-timeout)/100 > 1 && (1000-timeout)/100 > host->max_delay) { + host->max_delay = (1000-timeout)/100; +- pr_warning("Warning: SDHost controller hung for %d ms\n", host->max_delay); ++ pr_warning("%s: controller hung for %d ms\n", ++ mmc_hostname(host->mmc), ++ host->max_delay); + } + + timeout = jiffies; +-#ifdef CONFIG_ARCH_BCM2835 + if (!cmd->data && cmd->busy_timeout > 9000) + timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ; + else +-#endif +- timeout += 10 * HZ; ++ timeout += 10 * HZ; + mod_timer(&host->timer, timeout); + + host->cmd = cmd; +@@ -685,7 +756,7 @@ void bcm2835_sdhost_send_command(struct bcm2835_host *host, struct mmc_command * + bcm2835_sdhost_write(host, cmd->arg, SDARG); + + if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { +- pr_err("%s: Unsupported response type!\n", ++ pr_err("%s: unsupported response type!\n", + mmc_hostname(host->mmc)); + cmd->error = -EINVAL; + tasklet_schedule(&host->finish_tasklet); +@@ -783,13 +854,6 @@ static void bcm2835_sdhost_transfer_complete(struct bcm2835_host *host) + pr_debug("transfer_complete(error %d, stop %d)\n", + data->error, data->stop ? 1 : 0); + +- if (data->error) +- /* +- * The controller needs a reset of internal state machines +- * upon error conditions. +- */ +- bcm2835_sdhost_reset(host); +- + /* + * Need to send CMD12 if - + * a) open-ended multiblock transfer (no CMD23) +@@ -845,7 +909,7 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + #endif + + if (timeout == 0) { +- pr_err("%s: Command never completed.\n", ++ pr_err("%s: command never completed.\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); + host->cmd->error = -EIO; +@@ -875,14 +939,23 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + { + u32 sdhsts = bcm2835_sdhost_read(host, SDHSTS); + +- pr_debug("%s: error detected - CMD %x, HSTS %03x, EDM %x\n", +- mmc_hostname(host->mmc), sdcmd, sdhsts, +- bcm2835_sdhost_read(host, SDEDM)); +- +- if (sdhsts & SDHSTS_CMD_TIME_OUT) ++ if (host->debug) ++ pr_info("%s: error detected - CMD %x, HSTS %03x, EDM %x\n", ++ mmc_hostname(host->mmc), sdcmd, sdhsts, ++ bcm2835_sdhost_read(host, SDEDM)); ++ ++ if (sdhsts & SDHSTS_CMD_TIME_OUT) { ++ switch (host->cmd->opcode) { ++ case 5: case 52: case 53: ++ /* Don't warn about SDIO commands */ ++ break; ++ default: ++ pr_err("%s: command timeout\n", ++ mmc_hostname(host->mmc)); ++ break; ++ } + host->cmd->error = -ETIMEDOUT; +- else +- { ++ } else { + pr_err("%s: unexpected command error\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); +@@ -897,11 +970,13 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + int i; + for (i = 0; i < 4; i++) + host->cmd->resp[3 - i] = bcm2835_sdhost_read(host, SDRSP0 + i*4); +- pr_debug("bcm2835_sdhost_finish_command: %08x %08x %08x %08x\n", ++ pr_debug("%s: finish_command %08x %08x %08x %08x\n", ++ mmc_hostname(host->mmc), + host->cmd->resp[0], host->cmd->resp[1], host->cmd->resp[2], host->cmd->resp[3]); + } else { + host->cmd->resp[0] = bcm2835_sdhost_read(host, SDRSP0); +- pr_debug("bcm2835_sdhost_finish_command: %08x\n", ++ pr_debug("%s: finish_command %08x\n", ++ mmc_hostname(host->mmc), + host->cmd->resp[0]); + } + } +@@ -932,7 +1007,7 @@ static void bcm2835_sdhost_finish_command(struct bcm2835_host *host) + } + } + +-static void bcm2835_sdhost_timeout_timer(unsigned long data) ++static void bcm2835_sdhost_timeout(unsigned long data) + { + struct bcm2835_host *host; + unsigned long flags; +@@ -942,7 +1017,7 @@ static void bcm2835_sdhost_timeout_timer(unsigned long data) + spin_lock_irqsave(&host->lock, flags); + + if (host->mrq) { +- pr_err("%s: Timeout waiting for hardware interrupt.\n", ++ pr_err("%s: timeout waiting for hardware interrupt.\n", + mmc_hostname(host->mmc)); + bcm2835_sdhost_dumpregs(host); + +@@ -964,6 +1039,41 @@ static void bcm2835_sdhost_timeout_timer(unsigned long data) + spin_unlock_irqrestore(&host->lock, flags); + } + ++static void bcm2835_sdhost_pio_timeout(unsigned long data) ++{ ++ struct bcm2835_host *host; ++ unsigned long flags; ++ ++ host = (struct bcm2835_host *)data; ++ ++ spin_lock_irqsave(&host->lock, flags); ++ ++ if (host->data) { ++ u32 hsts = bcm2835_sdhost_read(host, SDHSTS); ++ ++ if (hsts & SDHSTS_REW_TIME_OUT) { ++ pr_err("%s: transfer timeout\n", ++ mmc_hostname(host->mmc)); ++ if (host->debug) ++ bcm2835_sdhost_dumpregs(host); ++ } else { ++ pr_err("%s: unexpected transfer timeout\n", ++ mmc_hostname(host->mmc)); ++ bcm2835_sdhost_dumpregs(host); ++ } ++ ++ bcm2835_sdhost_write(host, SDHSTS_TRANSFER_ERROR_MASK, ++ SDHSTS); ++ ++ host->data->error = -ETIMEDOUT; ++ ++ bcm2835_sdhost_finish_data(host); ++ } ++ ++ mmiowb(); ++ spin_unlock_irqrestore(&host->lock, flags); ++} ++ + static void bcm2835_sdhost_enable_sdio_irq_nolock(struct bcm2835_host *host, int enable) + { + if (enable) +@@ -979,7 +1089,7 @@ static void bcm2835_sdhost_enable_sdio_irq(struct mmc_host *mmc, int enable) + struct bcm2835_host *host = mmc_priv(mmc); + unsigned long flags; + +- pr_debug("bcm2835_sdhost_enable_sdio_irq(%d)\n", enable); ++ pr_debug("%s: enable_sdio_irq(%d)\n", mmc_hostname(mmc), enable); + spin_lock_irqsave(&host->lock, flags); + bcm2835_sdhost_enable_sdio_irq_nolock(host, enable); + spin_unlock_irqrestore(&host->lock, flags); +@@ -987,11 +1097,12 @@ static void bcm2835_sdhost_enable_sdio_irq(struct mmc_host *mmc, int enable) + + static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + { +- const u32 handled = (SDHSTS_CMD_TIME_OUT | SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | SDHSTS_FIFO_ERROR); ++ const u32 handled = (SDHSTS_REW_TIME_OUT | SDHSTS_CMD_TIME_OUT | ++ SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR | ++ SDHSTS_FIFO_ERROR); + + if (!host->cmd) { +- pr_err("%s: Got command busy interrupt 0x%08x even " ++ pr_err("%s: got command busy interrupt 0x%08x even " + "though no command operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); +@@ -999,7 +1110,7 @@ static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + } + + if (!host->use_busy) { +- pr_err("%s: Got command busy interrupt 0x%08x even " ++ pr_err("%s: got command busy interrupt 0x%08x even " + "though not expecting one.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); +@@ -1007,14 +1118,28 @@ static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + } + host->use_busy = 0; + +- if (intmask & SDHSTS_CMD_TIME_OUT) +- host->cmd->error = -ETIMEDOUT; +- else if (intmask & (SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR | +- SDHSTS_FIFO_ERROR)) +- host->cmd->error = -EILSEQ; ++ if (intmask & SDHSTS_ERROR_MASK) ++ { ++ pr_err("sdhost_busy_irq: intmask %x, data %p\n", intmask, host->mrq->data); ++ if (intmask & SDHSTS_CRC7_ERROR) ++ host->cmd->error = -EILSEQ; ++ else if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR)) { ++ if (host->mrq->data) ++ host->mrq->data->error = -EILSEQ; ++ else ++ host->cmd->error = -EILSEQ; ++ } else if (intmask & SDHSTS_REW_TIME_OUT) { ++ if (host->mrq->data) ++ host->mrq->data->error = -ETIMEDOUT; ++ else ++ host->cmd->error = -ETIMEDOUT; ++ } else if (intmask & SDHSTS_CMD_TIME_OUT) ++ host->cmd->error = -ETIMEDOUT; + +- if (host->cmd->error) ++ bcm2835_sdhost_dumpregs(host); + tasklet_schedule(&host->finish_tasklet); ++ } + else + bcm2835_sdhost_finish_command(host); + +@@ -1023,8 +1148,9 @@ static u32 bcm2835_sdhost_busy_irq(struct bcm2835_host *host, u32 intmask) + + static u32 bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask) + { +- const u32 handled = (SDHSTS_CMD_TIME_OUT | SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | SDHSTS_FIFO_ERROR); ++ const u32 handled = (SDHSTS_REW_TIME_OUT | ++ SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR); + + /* There are no dedicated data/space available interrupt + status bits, so it is necessary to use the single shared +@@ -1034,13 +1160,19 @@ static u32 bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask) + if (!host->data) + return 0; + +- // XXX FIFO_ERROR +- if (intmask & SDHSTS_CMD_TIME_OUT) +- host->cmd->error = -ETIMEDOUT; +- else if ((intmask & (SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR)) && +- ((bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK) +- != MMC_BUS_TEST_R)) +- host->cmd->error = -EILSEQ; ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR | ++ SDHSTS_REW_TIME_OUT)) { ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR)) ++ host->data->error = -EILSEQ; ++ else ++ host->data->error = -ETIMEDOUT; ++ ++ bcm2835_sdhost_dumpregs(host); ++ tasklet_schedule(&host->finish_tasklet); ++ return handled; ++ } + + /* Use the block interrupt for writes after the first block */ + if (host->data->flags & MMC_DATA_WRITE) { +@@ -1067,31 +1199,48 @@ static u32 bcm2835_sdhost_block_irq(struct bcm2835_host *host, u32 intmask) + { + struct dma_chan *dma_chan; + u32 dir_data; +- const u32 handled = (SDHSTS_CMD_TIME_OUT | SDHSTS_CRC16_ERROR | +- SDHSTS_CRC7_ERROR | SDHSTS_FIFO_ERROR); ++ const u32 handled = (SDHSTS_REW_TIME_OUT | ++ SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR); + + if (!host->data) { +- pr_err("%s: Got block interrupt 0x%08x even " ++ pr_err("%s: got block interrupt 0x%08x even " + "though no data operation was in progress.\n", + mmc_hostname(host->mmc), (unsigned)intmask); + bcm2835_sdhost_dumpregs(host); + return handled; + } + +- if (intmask & SDHSTS_CMD_TIME_OUT) +- host->cmd->error = -ETIMEDOUT; +- else if ((intmask & (SDHSTS_CRC16_ERROR | SDHSTS_CRC7_ERROR)) && +- ((bcm2835_sdhost_read(host, SDCMD) & SDCMD_CMD_MASK) +- != MMC_BUS_TEST_R)) +- host->cmd->error = -EILSEQ; ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR | ++ SDHSTS_REW_TIME_OUT)) { ++ if (intmask & (SDHSTS_CRC16_ERROR | ++ SDHSTS_FIFO_ERROR)) ++ host->data->error = -EILSEQ; ++ else ++ host->data->error = -ETIMEDOUT; ++ ++ if (host->debug) ++ bcm2835_sdhost_dumpregs(host); ++ tasklet_schedule(&host->finish_tasklet); ++ return handled; ++ } + + if (!host->use_dma) { + BUG_ON(!host->blocks); + host->blocks--; +- if ((host->blocks == 0) || host->data->error) ++ if ((host->blocks == 0) || host->data->error) { ++ /* Cancel the timer */ ++ del_timer(&host->pio_timer); ++ + bcm2835_sdhost_finish_data(host); +- else ++ } else { + bcm2835_sdhost_transfer_pio(host); ++ ++ /* Reset the timer */ ++ mod_timer(&host->pio_timer, ++ jiffies + host->pio_timeout); ++ } + } else if (host->data->flags & MMC_DATA_WRITE) { + dma_chan = host->dma_chan_tx; + dir_data = DMA_TO_DEVICE; +@@ -1125,7 +1274,7 @@ static irqreturn_t bcm2835_sdhost_irq(int irq, void *dev_id) + SDHSTS_BLOCK_IRPT | + SDHSTS_SDIO_IRPT | + SDHSTS_DATA_FLAG); +- if ((handled == SDHSTS_DATA_FLAG) && // XXX ++ if ((handled == SDHSTS_DATA_FLAG) && + (loops == 0) && !host->data) { + pr_err("%s: sdhost_irq data interrupt 0x%08x even " + "though no data operation was in progress.\n", +@@ -1177,10 +1326,11 @@ static irqreturn_t bcm2835_sdhost_irq(int irq, void *dev_id) + spin_unlock(&host->lock); + + if (early) +- pr_debug("%s: early %x (loops %d)\n", mmc_hostname(host->mmc), early, loops); ++ pr_debug("%s: early %x (loops %d)\n", ++ mmc_hostname(host->mmc), early, loops); + + if (unexpected) { +- pr_err("%s: Unexpected interrupt 0x%08x.\n", ++ pr_err("%s: unexpected interrupt 0x%08x.\n", + mmc_hostname(host->mmc), unexpected); + bcm2835_sdhost_dumpregs(host); + } +@@ -1227,8 +1377,22 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + int div = 0; /* Initialized for compiler warning */ + unsigned int input_clock = clock; + +- if (host->overclock_50 && (clock == 50000000)) +- clock = host->overclock_50 * 1000000 + 999999; ++ if (host->debug) ++ pr_info("%s: set_clock(%d)\n", mmc_hostname(host->mmc), clock); ++ ++ if ((clock == 0) && host->reduce_overclock) { ++ /* This is a reset following data corruption - reduce any ++ overclock */ ++ host->reduce_overclock = 0; ++ if (host->overclock_50 > 50) { ++ pr_warn("%s: reducing overclock due to errors\n", ++ mmc_hostname(host->mmc)); ++ host->overclock_50--; ++ } ++ } ++ ++ if (host->overclock_50 && (clock == 50*MHZ)) ++ clock = host->overclock_50 * MHZ + (MHZ - 1); + + /* The SDCDIV register has 11 bits, and holds (div - 2). + But in data mode the max is 50MHz wihout a minimum, and only the +@@ -1275,17 +1439,34 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) + clock = host->max_clk / (div + 2); + host->mmc->actual_clock = clock; + +- if ((clock > input_clock) && (clock > host->max_overclock)) { +- pr_warn("%s: Overclocking to %dHz\n", +- mmc_hostname(host->mmc), clock); +- host->max_overclock = clock; ++ if (clock > input_clock) { ++ /* Save the closest value, to make it easier ++ to reduce in the event of error */ ++ host->overclock_50 = (clock/MHZ); ++ ++ if (clock != host->overclock) { ++ pr_warn("%s: overclocking to %dHz\n", ++ mmc_hostname(host->mmc), clock); ++ host->overclock = clock; ++ } ++ } ++ else if ((clock == 50 * MHZ) && host->overclock) ++ { ++ pr_warn("%s: cancelling overclock\n", ++ mmc_hostname(host->mmc)); ++ host->overclock = 0; + } + + host->cdiv = div; + bcm2835_sdhost_write(host, host->cdiv, SDCDIV); + +- pr_debug(DRIVER_NAME ": clock=%d -> max_clk=%d, cdiv=%x (actual clock %d)\n", +- input_clock, host->max_clk, host->cdiv, host->mmc->actual_clock); ++ /* Set the timeout to 500ms */ ++ bcm2835_sdhost_write(host, host->mmc->actual_clock/2, SDTOUT); ++ ++ if (host->debug) ++ pr_info("%s: clock=%d -> max_clk=%d, cdiv=%x (actual clock %d)\n", ++ mmc_hostname(host->mmc), input_clock, ++ host->max_clk, host->cdiv, host->mmc->actual_clock); + } + + static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1293,29 +1474,32 @@ static void bcm2835_sdhost_request(struct mmc_host *mmc, struct mmc_request *mrq + struct bcm2835_host *host; + unsigned long flags; + +- if (1) { ++ host = mmc_priv(mmc); ++ ++ if (host->debug) { + struct mmc_command *cmd = mrq->cmd; +- const char *src = "cmd"; + BUG_ON(!cmd); +- pr_debug("bcm2835_sdhost_request: %s %08x %08x (flags %x)\n", +- src, cmd->opcode, cmd->arg, cmd->flags); + if (cmd->data) +- pr_debug("bcm2835_sdhost_request: %s %d*%d\n", +- (cmd->data->flags & MMC_DATA_READ) ? +- "read" : "write", cmd->data->blocks, +- cmd->data->blksz); ++ pr_info("%s: cmd %d 0x%x (flags 0x%x) - %s %d*%d\n", ++ mmc_hostname(mmc), ++ cmd->opcode, cmd->arg, cmd->flags, ++ (cmd->data->flags & MMC_DATA_READ) ? ++ "read" : "write", cmd->data->blocks, ++ cmd->data->blksz); ++ else ++ pr_info("%s: cmd %d 0x%x (flags 0x%x)\n", ++ mmc_hostname(mmc), ++ cmd->opcode, cmd->arg, cmd->flags); + } + + if (mrq->data && !is_power_of_2(mrq->data->blksz)) { +- pr_err("%s: Unsupported block size (%d bytes)\n", ++ pr_err("%s: unsupported block size (%d bytes)\n", + mmc_hostname(mmc), mrq->data->blksz); + mrq->cmd->error = -EINVAL; + mmc_request_done(mmc, mrq); + return; + } + +- host = mmc_priv(mmc); +- + spin_lock_irqsave(&host->lock, flags); + + WARN_ON(host->mrq != NULL); +@@ -1345,9 +1529,12 @@ static void bcm2835_sdhost_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) + struct bcm2835_host *host = mmc_priv(mmc); + unsigned long flags; + +- pr_debug("bcm2835_sdhost_set_ios: clock %d, pwr %d, bus_width %d, timing %d, vdd %d, drv_type %d\n", +- ios->clock, ios->power_mode, ios->bus_width, +- ios->timing, ios->signal_voltage, ios->drv_type); ++ if (host->debug) ++ pr_info("%s: ios clock %d, pwr %d, bus_width %d, " ++ "timing %d, vdd %d, drv_type %d\n", ++ mmc_hostname(mmc), ++ ios->clock, ios->power_mode, ios->bus_width, ++ ios->timing, ios->signal_voltage, ios->drv_type); + + spin_lock_irqsave(&host->lock, flags); + +@@ -1396,6 +1583,7 @@ static struct mmc_host_ops bcm2835_sdhost_ops = { + .request = bcm2835_sdhost_request, + .set_ios = bcm2835_sdhost_set_ios, + .enable_sdio_irq = bcm2835_sdhost_enable_sdio_irq, ++ .hw_reset = bcm2835_sdhost_reset, + .multi_io_quirk = bcm2835_sdhost_multi_io_quirk, }; -diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c -index c1e9254..e33265d 100644 ---- a/arch/arm/mach-bcm2708/bcm2708_gpio.c -+++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c -@@ -306,7 +306,7 @@ static irqreturn_t bcm2708_gpio_interrupt(int irq, void *dev_id) +@@ -1423,15 +1611,24 @@ static void bcm2835_sdhost_tasklet_finish(unsigned long param) - static struct irqaction bcm2708_gpio_irq = { - .name = "BCM2708 GPIO catchall handler", -- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, -+ .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = bcm2708_gpio_interrupt, + mrq = host->mrq; + +- /* +- * The controller needs a reset of internal state machines +- * upon error conditions. +- */ +- if (((mrq->cmd && mrq->cmd->error) || +- (mrq->data && (mrq->data->error || +- (mrq->data->stop && mrq->data->stop->error))))) { ++ /* Drop the overclock after any data corruption, or after any ++ error overclocked */ ++ if (mrq->data && (mrq->data->error == -EILSEQ)) ++ host->reduce_overclock = 1; ++ else if (host->overclock) { ++ /* Convert timeout errors while overclocked to data errors, ++ because the system recovers better. */ ++ if (mrq->cmd && mrq->cmd->error) { ++ host->reduce_overclock = 1; ++ if (mrq->cmd->error == -ETIMEDOUT) ++ mrq->cmd->error = -EILSEQ; ++ } + +- bcm2835_sdhost_reset(host); ++ if (mrq->data && mrq->data->error) { ++ host->reduce_overclock = 1; ++ if (mrq->data->error == -ETIMEDOUT) ++ mrq->data->error = -EILSEQ; ++ } + } + + host->mrq = NULL; +@@ -1450,35 +1647,37 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + { + struct mmc_host *mmc; + struct dma_slave_config cfg; ++ char pio_limit_string[20]; + int ret; + + mmc = host->mmc; + +- bcm2835_sdhost_reset(host); ++ bcm2835_sdhost_reset_internal(host); + + mmc->f_max = host->max_clk; + mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV; + +- /* SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK */ +- host->timeout_clk = mmc->f_max / 1000; +-#ifdef CONFIG_ARCH_BCM2835 +- mmc->max_busy_timeout = (1 << 27) / host->timeout_clk; +-#endif ++ mmc->max_busy_timeout = (~(unsigned int)0)/(mmc->f_max/1000); ++ ++ pr_debug("f_max %d, f_min %d, max_busy_timeout %d\n", ++ mmc->f_max, mmc->f_min, mmc->max_busy_timeout); ++ + /* host controller capabilities */ + mmc->caps |= /* MMC_CAP_SDIO_IRQ |*/ MMC_CAP_4_BIT_DATA | + MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | +- MMC_CAP_NEEDS_POLL | ++ MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET | + (ALLOW_CMD23 * MMC_CAP_CMD23); + + spin_lock_init(&host->lock); + + if (host->allow_dma) { +- if (!host->dma_chan_tx || !host->dma_chan_rx || +- IS_ERR(host->dma_chan_tx) || IS_ERR(host->dma_chan_rx)) { +- pr_err("%s: Unable to initialise DMA channels. Falling back to PIO\n", DRIVER_NAME); ++ if (IS_ERR_OR_NULL(host->dma_chan_tx) || ++ IS_ERR_OR_NULL(host->dma_chan_rx)) { ++ pr_err("%s: unable to initialise DMA channels. " ++ "Falling back to PIO\n", ++ mmc_hostname(mmc)); + host->have_dma = false; + } else { +- pr_info("DMA channels allocated for the SDHost driver"); + host->have_dma = true; + + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; +@@ -1496,7 +1695,6 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + ret = dmaengine_slave_config(host->dma_chan_rx, &cfg); + } + } else { +- pr_info("Forcing PIO mode\n"); + host->have_dma = false; + } + +@@ -1512,18 +1710,23 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + tasklet_init(&host->finish_tasklet, + bcm2835_sdhost_tasklet_finish, (unsigned long)host); + +- setup_timer(&host->timer, bcm2835_sdhost_timeout_timer, (unsigned long)host); ++ setup_timer(&host->timer, bcm2835_sdhost_timeout, ++ (unsigned long)host); ++ ++ setup_timer(&host->pio_timer, bcm2835_sdhost_pio_timeout, ++ (unsigned long)host); + + bcm2835_sdhost_init(host, 0); + #ifndef CONFIG_ARCH_BCM2835 + ret = request_irq(host->irq, bcm2835_sdhost_irq, 0 /*IRQF_SHARED*/, + mmc_hostname(mmc), host); + #else +- ret = request_threaded_irq(host->irq, bcm2835_sdhost_irq, bcm2835_sdhost_thread_irq, ++ ret = request_threaded_irq(host->irq, bcm2835_sdhost_irq, ++ bcm2835_sdhost_thread_irq, + IRQF_SHARED, mmc_hostname(mmc), host); + #endif + if (ret) { +- pr_err("%s: Failed to request IRQ %d: %d\n", ++ pr_err("%s: failed to request IRQ %d: %d\n", + mmc_hostname(mmc), host->irq, ret); + goto untasklet; + } +@@ -1531,10 +1734,13 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) + mmiowb(); + mmc_add_host(mmc); + +- pr_info("Load BCM2835 SDHost driver\n"); +- if (host->delay_after_stop) +- pr_info("BCM2835 SDHost: delay_after_stop=%dus\n", +- host->delay_after_stop); ++ pio_limit_string[0] = '\0'; ++ if (host->have_dma && (host->pio_limit > 0)) ++ sprintf(pio_limit_string, " (>%d)", host->pio_limit); ++ pr_info("%s: %s loaded - DMA %s%s\n", ++ mmc_hostname(mmc), DRIVER_NAME, ++ host->have_dma ? "enabled" : "disabled", ++ pio_limit_string); + + return 0; + +@@ -1562,7 +1768,7 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + mmc->ops = &bcm2835_sdhost_ops; + host = mmc_priv(mmc); + host->mmc = mmc; +- host->timeout = msecs_to_jiffies(1000); ++ host->pio_timeout = msecs_to_jiffies(500); + spin_lock_init(&host->lock); + + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); +@@ -1588,8 +1794,12 @@ static int bcm2835_sdhost_probe(struct platform_device *pdev) + of_property_read_u32(node, + "brcm,overclock-50", + &host->overclock_50); ++ of_property_read_u32(node, ++ "brcm,pio-limit", ++ &host->pio_limit); + host->allow_dma = ALLOW_DMA && + !of_property_read_bool(node, "brcm,force-pio"); ++ host->debug = of_property_read_bool(node, "brcm,debug"); + } + + if (host->allow_dma) { + +From 5920303037d30f0ecee57f83015cd8838ba1f77e Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 4 Jun 2015 13:11:46 -0700 +Subject: [PATCH 78/85] 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 +set clock rates. + +Signed-off-by: Eric Anholt +--- + drivers/firmware/Kconfig | 7 + + drivers/firmware/Makefile | 1 + + drivers/firmware/raspberrypi.c | 260 +++++++++++++++++++++++++++++ + include/soc/bcm2835/raspberrypi-firmware.h | 115 +++++++++++++ + 4 files changed, 383 insertions(+) + create mode 100644 drivers/firmware/raspberrypi.c + create mode 100644 include/soc/bcm2835/raspberrypi-firmware.h + +diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig +index 6517132..564aa5b 100644 +--- a/drivers/firmware/Kconfig ++++ b/drivers/firmware/Kconfig +@@ -136,6 +136,13 @@ config QCOM_SCM + bool + depends on ARM || ARM64 + ++config RASPBERRYPI_FIRMWARE ++ tristate "Raspberry Pi Firmware Driver" ++ depends on BCM2835_MBOX ++ help ++ This option enables support for communicating with the firmware on the ++ Raspberry Pi. ++ + source "drivers/firmware/google/Kconfig" + source "drivers/firmware/efi/Kconfig" + +diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile +index 3fdd391..ee101a2 100644 +--- a/drivers/firmware/Makefile ++++ b/drivers/firmware/Makefile +@@ -13,6 +13,7 @@ obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o + obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o + obj-$(CONFIG_QCOM_SCM) += qcom_scm.o + CFLAGS_qcom_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) ++obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o + + obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ + obj-$(CONFIG_EFI) += efi/ +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +new file mode 100644 +index 0000000..dd506cd +--- /dev/null ++++ b/drivers/firmware/raspberrypi.c +@@ -0,0 +1,260 @@ ++/* ++ * Defines interfaces for interacting wtih the Raspberry Pi firmware's ++ * property channel. ++ * ++ * Copyright © 2015 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) ++#define MBOX_CHAN(msg) ((msg) & 0xf) ++#define MBOX_DATA28(msg) ((msg) & ~0xf) ++#define MBOX_CHAN_PROPERTY 8 ++ ++struct rpi_firmware { ++ struct mbox_client cl; ++ struct mbox_chan *chan; /* The property channel. */ ++ struct completion c; ++ u32 enabled; ++}; ++ ++static DEFINE_MUTEX(transaction_lock); ++ ++static void response_callback(struct mbox_client *cl, void *msg) ++{ ++ struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl); ++ complete(&fw->c); ++} ++ ++/* ++ * Sends a request to the firmware through the BCM2835 mailbox driver, ++ * and synchronously waits for the reply. ++ */ ++static int ++rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) ++{ ++ u32 message = MBOX_MSG(chan, data); ++ int ret; ++ ++ WARN_ON(data & 0xf); ++ ++ mutex_lock(&transaction_lock); ++ reinit_completion(&fw->c); ++ ret = mbox_send_message(fw->chan, &message); ++ if (ret >= 0) { ++ wait_for_completion(&fw->c); ++ ret = 0; ++ } else { ++ dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret); ++ } ++ mutex_unlock(&transaction_lock); ++ ++ return ret; ++} ++ ++/** ++ * rpi_firmware_property_list - Submit firmware property list ++ * @fw: Pointer to firmware structure from rpi_firmware_get(). ++ * @data: Buffer holding tags. ++ * @tag_size: Size of tags buffer. ++ * ++ * Submits a set of concatenated tags to the VPU firmware through the ++ * mailbox property interface. ++ * ++ * The buffer header and the ending tag are added by this function and ++ * don't need to be supplied, just the actual tags for your operation. ++ * See struct rpi_firmware_property_tag_header for the per-tag ++ * structure. ++ */ ++int rpi_firmware_property_list(struct rpi_firmware *fw, ++ void *data, size_t tag_size) ++{ ++ size_t size = tag_size + 12; ++ u32 *buf; ++ dma_addr_t bus_addr; ++ int ret; ++ ++ /* Packets are processed a dword at a time. */ ++ if (size & 3) ++ return -EINVAL; ++ ++ buf = dma_alloc_coherent(fw->cl.dev, PAGE_ALIGN(size), &bus_addr, ++ GFP_ATOMIC); ++ if (!buf) ++ return -ENOMEM; ++ ++ /* The firmware will error out without parsing in this case. */ ++ WARN_ON(size >= 1024 * 1024); ++ ++ buf[0] = size; ++ buf[1] = RPI_FIRMWARE_STATUS_REQUEST; ++ memcpy(&buf[2], data, tag_size); ++ buf[size / 4 - 1] = RPI_FIRMWARE_PROPERTY_END; ++ wmb(); ++ ++ ret = rpi_firmware_transaction(fw, MBOX_CHAN_PROPERTY, bus_addr); ++ ++ rmb(); ++ memcpy(data, &buf[2], tag_size); ++ if (ret == 0 && buf[1] != RPI_FIRMWARE_STATUS_SUCCESS) { ++ /* ++ * The tag name here might not be the one causing the ++ * error, if there were multiple tags in the request. ++ * But single-tag is the most common, so go with it. ++ */ ++ dev_err(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n", ++ buf[2], buf[1]); ++ ret = -EINVAL; ++ } ++ ++ dma_free_coherent(fw->cl.dev, PAGE_ALIGN(size), buf, bus_addr); ++ ++ return ret; ++} ++EXPORT_SYMBOL_GPL(rpi_firmware_property_list); ++ ++/** ++ * rpi_firmware_property - Submit single firmware property ++ * @fw: Pointer to firmware structure from rpi_firmware_get(). ++ * @tag: One of enum_mbox_property_tag. ++ * @tag_data: Tag data buffer. ++ * @buf_size: Buffer size. ++ * ++ * Submits a single tag to the VPU firmware through the mailbox ++ * property interface. ++ * ++ * This is a convenience wrapper around ++ * rpi_firmware_property_list() to avoid some of the ++ * boilerplate in property calls. ++ */ ++int rpi_firmware_property(struct rpi_firmware *fw, ++ u32 tag, void *tag_data, size_t buf_size) ++{ ++ /* Single tags are very small (generally 8 bytes), so the ++ * stack should be safe. ++ */ ++ u8 data[buf_size + sizeof(struct rpi_firmware_property_tag_header)]; ++ struct rpi_firmware_property_tag_header *header = ++ (struct rpi_firmware_property_tag_header *)data; ++ int ret; ++ ++ header->tag = tag; ++ header->buf_size = buf_size; ++ header->req_resp_size = 0; ++ memcpy(data + sizeof(struct rpi_firmware_property_tag_header), ++ tag_data, buf_size); ++ ++ ret = rpi_firmware_property_list(fw, &data, sizeof(data)); ++ memcpy(tag_data, ++ data + sizeof(struct rpi_firmware_property_tag_header), ++ buf_size); ++ ++ return ret; ++} ++EXPORT_SYMBOL_GPL(rpi_firmware_property); ++ ++static void ++rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) ++{ ++ u32 packet; ++ int ret = rpi_firmware_property(fw, ++ RPI_FIRMWARE_GET_FIRMWARE_REVISION, ++ &packet, sizeof(packet)); ++ ++ if (ret == 0) { ++ struct tm tm; ++ ++ time_to_tm(packet, 0, &tm); ++ ++ dev_info(fw->cl.dev, ++ "Attached to firmware from %04ld-%02d-%02d %02d:%02d\n", ++ tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, ++ tm.tm_hour, tm.tm_min); ++ } ++} ++ ++static int rpi_firmware_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct rpi_firmware *fw; ++ ++ fw = devm_kzalloc(dev, sizeof(*fw), GFP_KERNEL); ++ if (!fw) ++ return -ENOMEM; ++ ++ fw->cl.dev = dev; ++ fw->cl.rx_callback = response_callback; ++ fw->cl.tx_block = true; ++ ++ fw->chan = mbox_request_channel(&fw->cl, 0); ++ if (IS_ERR(fw->chan)) { ++ int ret = PTR_ERR(fw->chan); ++ if (ret != -EPROBE_DEFER) ++ dev_err(dev, "Failed to get mbox channel: %d\n", ret); ++ return ret; ++ } ++ ++ init_completion(&fw->c); ++ ++ platform_set_drvdata(pdev, fw); ++ ++ rpi_firmware_print_firmware_revision(fw); ++ ++ return 0; ++} ++ ++static int rpi_firmware_remove(struct platform_device *pdev) ++{ ++ struct rpi_firmware *fw = platform_get_drvdata(pdev); ++ ++ mbox_free_channel(fw->chan); ++ ++ return 0; ++} ++ ++/** ++ * rpi_firmware_get - Get pointer to rpi_firmware structure. ++ * @firmware_node: Pointer to the firmware Device Tree node. ++ * ++ * Returns NULL is the firmware device is not ready. ++ */ ++struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node) ++{ ++ struct platform_device *pdev = of_find_device_by_node(firmware_node); ++ ++ if (!pdev) ++ return NULL; ++ ++ return platform_get_drvdata(pdev); ++} ++EXPORT_SYMBOL_GPL(rpi_firmware_get); ++ ++static const struct of_device_id rpi_firmware_of_match[] = { ++ { .compatible = "raspberrypi,bcm2835-firmware", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, rpi_firmware_of_match); ++ ++static struct platform_driver rpi_firmware_driver = { ++ .driver = { ++ .name = "raspberrypi-firmware", ++ .of_match_table = rpi_firmware_of_match, ++ }, ++ .probe = rpi_firmware_probe, ++ .remove = rpi_firmware_remove, ++}; ++module_platform_driver(rpi_firmware_driver); ++ ++MODULE_AUTHOR("Eric Anholt "); ++MODULE_DESCRIPTION("Raspberry Pi firmware driver"); ++MODULE_LICENSE("GPL v2"); +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +new file mode 100644 +index 0000000..9d9efb7 +--- /dev/null ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -0,0 +1,115 @@ ++/* ++ * Copyright © 2015 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++ ++struct rpi_firmware; ++ ++enum rpi_firmware_property_status { ++ RPI_FIRMWARE_STATUS_REQUEST = 0, ++ RPI_FIRMWARE_STATUS_SUCCESS = 0x80000000, ++ RPI_FIRMWARE_STATUS_ERROR = 0x80000001, ++}; ++ ++/** ++ * struct rpi_firmware_property_tag_header - Firmware property tag header ++ * @tag: One of enum_mbox_property_tag. ++ * @buf_size: The number of bytes in the value buffer following this ++ * struct. ++ * @req_resp_size: On submit, the length of the request (though it doesn't ++ * appear to be currently used by the firmware). On return, ++ * the length of the response (always 4 byte aligned), with ++ * the low bit set. ++ */ ++struct rpi_firmware_property_tag_header { ++ u32 tag; ++ u32 buf_size; ++ u32 req_resp_size; ++}; ++ ++enum rpi_firmware_property_tag { ++ RPI_FIRMWARE_PROPERTY_END = 0, ++ RPI_FIRMWARE_GET_FIRMWARE_REVISION = 0x00000001, ++ ++ RPI_FIRMWARE_SET_CURSOR_INFO = 0x00008010, ++ RPI_FIRMWARE_SET_CURSOR_STATE = 0x00008011, ++ ++ RPI_FIRMWARE_GET_BOARD_MODEL = 0x00010001, ++ RPI_FIRMWARE_GET_BOARD_REVISION = 0x00010002, ++ RPI_FIRMWARE_GET_BOARD_MAC_ADDRESS = 0x00010003, ++ RPI_FIRMWARE_GET_BOARD_SERIAL = 0x00010004, ++ RPI_FIRMWARE_GET_ARM_MEMORY = 0x00010005, ++ RPI_FIRMWARE_GET_VC_MEMORY = 0x00010006, ++ RPI_FIRMWARE_GET_CLOCKS = 0x00010007, ++ RPI_FIRMWARE_GET_POWER_STATE = 0x00020001, ++ RPI_FIRMWARE_GET_TIMING = 0x00020002, ++ RPI_FIRMWARE_SET_POWER_STATE = 0x00028001, ++ RPI_FIRMWARE_GET_CLOCK_STATE = 0x00030001, ++ RPI_FIRMWARE_GET_CLOCK_RATE = 0x00030002, ++ RPI_FIRMWARE_GET_VOLTAGE = 0x00030003, ++ RPI_FIRMWARE_GET_MAX_CLOCK_RATE = 0x00030004, ++ RPI_FIRMWARE_GET_MAX_VOLTAGE = 0x00030005, ++ RPI_FIRMWARE_GET_TEMPERATURE = 0x00030006, ++ RPI_FIRMWARE_GET_MIN_CLOCK_RATE = 0x00030007, ++ RPI_FIRMWARE_GET_MIN_VOLTAGE = 0x00030008, ++ RPI_FIRMWARE_GET_TURBO = 0x00030009, ++ RPI_FIRMWARE_GET_MAX_TEMPERATURE = 0x0003000a, ++ RPI_FIRMWARE_ALLOCATE_MEMORY = 0x0003000c, ++ RPI_FIRMWARE_LOCK_MEMORY = 0x0003000d, ++ RPI_FIRMWARE_UNLOCK_MEMORY = 0x0003000e, ++ RPI_FIRMWARE_RELEASE_MEMORY = 0x0003000f, ++ RPI_FIRMWARE_EXECUTE_CODE = 0x00030010, ++ RPI_FIRMWARE_EXECUTE_QPU = 0x00030011, ++ RPI_FIRMWARE_SET_ENABLE_QPU = 0x00030012, ++ RPI_FIRMWARE_GET_DISPMANX_RESOURCE_MEM_HANDLE = 0x00030014, ++ RPI_FIRMWARE_GET_EDID_BLOCK = 0x00030020, ++ RPI_FIRMWARE_SET_CLOCK_STATE = 0x00038001, ++ RPI_FIRMWARE_SET_CLOCK_RATE = 0x00038002, ++ RPI_FIRMWARE_SET_VOLTAGE = 0x00038003, ++ RPI_FIRMWARE_SET_TURBO = 0x00038009, ++ ++ /* Dispmanx TAGS */ ++ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, ++ RPI_FIRMWARE_FRAMEBUFFER_BLANK = 0x00040002, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT = 0x00040003, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT = 0x00040004, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_DEPTH = 0x00040005, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PIXEL_ORDER = 0x00040006, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_ALPHA_MODE = 0x00040007, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH = 0x00040008, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_VIRTUAL_OFFSET = 0x00040009, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_OVERSCAN = 0x0004000a, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_PALETTE = 0x0004000b, ++ RPI_FIRMWARE_FRAMEBUFFER_RELEASE = 0x00048001, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT = 0x00044003, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT = 0x00044004, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_DEPTH = 0x00044005, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_PIXEL_ORDER = 0x00044006, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_ALPHA_MODE = 0x00044007, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_OFFSET = 0x00044009, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_OVERSCAN = 0x0004400a, ++ RPI_FIRMWARE_FRAMEBUFFER_TEST_PALETTE = 0x0004400b, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT = 0x00048003, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT = 0x00048004, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH = 0x00048005, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_PIXEL_ORDER = 0x00048006, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_ALPHA_MODE = 0x00048007, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET = 0x00048009, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_OVERSCAN = 0x0004800a, ++ RPI_FIRMWARE_FRAMEBUFFER_SET_PALETTE = 0x0004800b, ++ ++ RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, ++ RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, ++}; ++ ++int rpi_firmware_property(struct rpi_firmware *fw, ++ u32 tag, void *data, size_t len); ++int rpi_firmware_property_list(struct rpi_firmware *fw, ++ void *data, size_t tag_size); ++struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node); + +From c97b07c0494073a69820a78b6012dc62cb902144 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 22 Mar 2015 13:33:23 +0000 +Subject: [PATCH 79/85] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING + +--- + 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 a3067bf..7ef615c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -49,6 +49,8 @@ CONFIG_OABI_COMPAT=y + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y + CONFIG_CMA=y ++CONFIG_ZSMALLOC=m ++CONFIG_PGTABLE_MAPPING=y + CONFIG_UACCESS_WITH_MEMCPY=y + CONFIG_SECCOMP=y + CONFIG_ZBOOT_ROM_TEXT=0x0 +@@ -389,6 +391,8 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_ZRAM=m ++CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y + CONFIG_BLK_DEV_CRYPTOLOOP=m + CONFIG_BLK_DEV_DRBD=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 6a41231..cacde14 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -44,6 +44,8 @@ CONFIG_OABI_COMPAT=y + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y + CONFIG_CMA=y ++CONFIG_ZSMALLOC=m ++CONFIG_PGTABLE_MAPPING=y + CONFIG_UACCESS_WITH_MEMCPY=y + CONFIG_SECCOMP=y + CONFIG_ZBOOT_ROM_TEXT=0x0 +@@ -382,6 +384,8 @@ CONFIG_DEVTMPFS=y + CONFIG_DEVTMPFS_MOUNT=y + CONFIG_DMA_CMA=y + CONFIG_CMA_SIZE_MBYTES=5 ++CONFIG_ZRAM=m ++CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_BLK_DEV_LOOP=y + CONFIG_BLK_DEV_CRYPTOLOOP=m + CONFIG_BLK_DEV_DRBD=m + +From e547d7e94a85179d7ff7787eb95e29f0b0b657f4 Mon Sep 17 00:00:00 2001 +From: Gordon Hollingworth +Date: Mon, 22 Jun 2015 16:27:07 +0100 +Subject: [PATCH 80/85] Add rpi-ft5406 overlay Add rpi-ft5406 driver as module + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 5 +++++ + arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts | 16 ++++++++++++++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 5 files changed, 24 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 6947556..19eef3c 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -35,6 +35,7 @@ dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb ++dtb-$(RPI_DT_OVERLAYS) += rpi-ft5406-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb + dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 63da266..aa09b6c 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -396,6 +396,11 @@ Params: speed Display SPI bus speed + + xohms Touchpanel sensitivity (X-plate resistance) + ++Name: rpi-ft5406 ++Info: Official Raspberry Pi display touchscreen ++Load: dtoverlay=rpi-ft5406 ++Params: ++ + + Name: rpi-proto + Info: Configures the RPi Proto audio card +diff --git a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +new file mode 100644 +index 0000000..40deab5 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +@@ -0,0 +1,16 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/"; ++ __overlay__ { ++ rpi_ft5406: rpi_ft5406 { ++ compatible = "rpi,rpi-ft5406"; ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 7ef615c..7469d07 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -535,6 +535,7 @@ CONFIG_JOYSTICK_XPAD_FF=y + CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m ++CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + CONFIG_INPUT_MISC=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index cacde14..f952ff2 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -528,6 +528,7 @@ CONFIG_JOYSTICK_XPAD_FF=y + CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m ++CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + CONFIG_INPUT_MISC=y + +From 9dea271e610d0524fad677b9cccdd3be84ab25da Mon Sep 17 00:00:00 2001 +From: Gordon Hollingworth +Date: Tue, 23 Jun 2015 09:53:40 +0100 +Subject: [PATCH 81/85] Fix driver detection failure Check that the buffer + response is non-zero meaning the touchscreen was detected + +--- + drivers/input/touchscreen/rpi-ft5406.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c +index f55151b..d41851d 100644 +--- a/drivers/input/touchscreen/rpi-ft5406.c ++++ b/drivers/input/touchscreen/rpi-ft5406.c +@@ -184,7 +184,7 @@ static int ft5406_probe(struct platform_device *pdev) + + bcm_mailbox_property(&request, sizeof(request)); + +- if(request.request_code == VCMSG_REQUEST_SUCCESSFUL) ++ if(request.request_code == VCMSG_REQUEST_SUCCESSFUL && request.tag.val != 0) + { + dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val); + } + +From 8ad2b6ac33fca9a40238c42fdd2b5ed840c2fc8d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 23 Jun 2015 13:24:01 +0100 +Subject: [PATCH 82/85] config: Enable 8250 serial port + +--- + arch/arm/configs/bcm2709_defconfig | 7 +++++++ + arch/arm/configs/bcmrpi_defconfig | 7 +++++++ + 2 files changed, 14 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 7469d07..7e8643c 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -557,8 +557,15 @@ CONFIG_GAMEPORT_L4=m + CONFIG_DEVPTS_MULTIPLE_INSTANCES=y + # CONFIG_LEGACY_PTYS is not set + # CONFIG_DEVKMEM is not set ++CONFIG_SERIAL_8250=y ++# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set ++CONFIG_SERIAL_8250_CONSOLE=y ++# CONFIG_SERIAL_8250_DMA is not set ++CONFIG_SERIAL_8250_NR_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=1 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y ++CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_HW_RANDOM_BCM2835=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index f952ff2..0c25d8b 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -550,8 +550,15 @@ CONFIG_GAMEPORT_L4=m + CONFIG_DEVPTS_MULTIPLE_INSTANCES=y + # CONFIG_LEGACY_PTYS is not set + # CONFIG_DEVKMEM is not set ++CONFIG_SERIAL_8250=y ++# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set ++CONFIG_SERIAL_8250_CONSOLE=y ++# CONFIG_SERIAL_8250_DMA is not set ++CONFIG_SERIAL_8250_NR_UARTS=1 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=1 + CONFIG_SERIAL_AMBA_PL011=y + CONFIG_SERIAL_AMBA_PL011_CONSOLE=y ++CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_TTY_PRINTK=y + CONFIG_HW_RANDOM=y + CONFIG_HW_RANDOM_BCM2835=m + +From cc78a5ef74fc67465fdacffe452a5fab5848b33c Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 23 Jun 2015 14:10:58 +0100 +Subject: [PATCH 83/85] config: Enable POWER_RESET_GPIO + +--- + arch/arm/configs/bcm2709_defconfig | 2 ++ + arch/arm/configs/bcmrpi_defconfig | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 7e8643c..46d56d7 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -606,6 +606,8 @@ CONFIG_W1_SLAVE_DS2781=m + CONFIG_W1_SLAVE_DS28E04=m + CONFIG_W1_SLAVE_BQ27000=m + CONFIG_BATTERY_DS2760=m ++CONFIG_POWER_RESET=y ++CONFIG_POWER_RESET_GPIO=y + # CONFIG_HWMON is not set + CONFIG_THERMAL=y + CONFIG_THERMAL_BCM2835=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 0c25d8b..e757db6 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -599,6 +599,8 @@ CONFIG_W1_SLAVE_DS2781=m + CONFIG_W1_SLAVE_DS28E04=m + CONFIG_W1_SLAVE_BQ27000=m + CONFIG_BATTERY_DS2760=m ++CONFIG_POWER_RESET=y ++CONFIG_POWER_RESET_GPIO=y + # CONFIG_HWMON is not set + CONFIG_THERMAL=y + CONFIG_THERMAL_BCM2835=y + +From 01f5e319010c90770e0c8a87656c360a18a35208 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 26 Jun 2015 17:37:38 +0100 +Subject: [PATCH 84/85] 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). +Locking should be handled on each mailbox access +--- + drivers/mailbox/bcm2708-vcio.c | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/drivers/mailbox/bcm2708-vcio.c b/drivers/mailbox/bcm2708-vcio.c +index d91672b..06fb2c2f 100644 +--- a/drivers/mailbox/bcm2708-vcio.c ++++ b/drivers/mailbox/bcm2708-vcio.c +@@ -242,20 +242,9 @@ EXPORT_SYMBOL_GPL(bcm_mailbox_property); + + /* Platform Device for Mailbox */ + +-/* +- * Is the device open right now? Used to prevent +- * concurent access into the same device +- */ +-static bool device_is_open; +- + /* This is called whenever a process attempts to open the device file */ + static int device_open(struct inode *inode, struct file *file) + { +- /* We don't want to talk to two processes at the same time */ +- if (device_is_open) +- return -EBUSY; +- +- device_is_open = true; + try_module_get(THIS_MODULE); + + return 0; +@@ -263,9 +252,6 @@ static int device_open(struct inode *inode, struct file *file) + + static int device_release(struct inode *inode, struct file *file) + { +- /* We're now ready for our next caller */ +- device_is_open = false; +- + module_put(THIS_MODULE); + + return 0; + +From 2cdae3dcbcca3d818f64d14580f22c67e32d851c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 26 Jun 2015 08:39:19 +0100 +Subject: [PATCH 85/85] BCM270X_DT: Create a "core" clock, use it for SPI and + sdhost + +--- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-b.dts | 1 + + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 1 + + arch/arm/boot/dts/bcm2708_common.dtsi | 6 +++--- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 1 + + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 28 ++------------------------- + 6 files changed, 9 insertions(+), 29 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 0fa2210..3b252dc 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -124,6 +124,7 @@ + i2c1 = <&i2c1>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 3fd49d0..40fded1 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -118,6 +118,7 @@ + i2c1 = <&i2c1>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index 238bd65..e82fcb2 100755 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -14,5 +14,6 @@ + __overrides__ { + uart0 = <&uart0>,"status"; + uart0_clkrate = <&clk_uart0>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + }; }; +diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi +index 8caa234..4a975dfd 100644 +--- a/arch/arm/boot/dts/bcm2708_common.dtsi ++++ b/arch/arm/boot/dts/bcm2708_common.dtsi +@@ -110,7 +110,7 @@ + compatible = "brcm,bcm2835-spi"; + reg = <0x7e204000 0x1000>; + interrupts = <2 22>; +- clocks = <&clk_spi>; ++ clocks = <&clk_core>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; +@@ -203,11 +203,11 @@ + clock-frequency = <250000000>; + }; -diff --git a/arch/arm/mach-bcm2709/bcm2709.c b/arch/arm/mach-bcm2709/bcm2709.c -index c5e51e8..fe71c50 100644 ---- a/arch/arm/mach-bcm2709/bcm2709.c -+++ b/arch/arm/mach-bcm2709/bcm2709.c -@@ -1050,7 +1050,7 @@ static irqreturn_t bcm2709_timer_interrupt(int irq, void *dev_id) +- clk_spi: clock@2 { ++ clk_core: clock@2 { + compatible = "fixed-clock"; + reg = <2>; + #clock-cells = <0>; +- clock-output-names = "spi"; ++ clock-output-names = "core"; + clock-frequency = <250000000>; + }; - static struct irqaction bcm2709_timer_irq = { - .name = "BCM2709 Timer Tick", -- .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, -+ .flags = IRQF_TIMER | IRQF_IRQPOLL, - .handler = bcm2709_timer_interrupt, +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index 8aaaf1f..24fa849 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -124,6 +124,7 @@ + i2c1 = <&i2c1>,"status"; + i2c0_baudrate = <&i2c0>,"clock-frequency:0"; + i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ core_freq = <&clk_core>,"clock-frequency:0"; + + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; +diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +index b408ab4..897204a 100644 +--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts ++++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts +@@ -16,7 +16,7 @@ + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_pins>; + interrupts = <2 24>; +- clocks = <&clk_sdhost>; ++ clocks = <&clk_core>; + dmas = <&dma 13>, + <&dma 13>; + dma-names = "tx", "rx"; +@@ -29,22 +29,6 @@ + }; + + fragment@1 { +- target = <&clocks>; +- __overlay__ { +- #address-cells = <1>; +- #size-cells = <0>; +- +- clk_sdhost: sdhost { +- compatible = "fixed-clock"; +- reg = <0>; +- #clock-cells = <0>; +- clock-output-names = "sdhost"; +- clock-frequency = <250000000>; +- }; +- }; +- }; +- +- fragment@2 { + target = <&gpio>; + __overlay__ { + sdhost_pins: sdhost_pins { +@@ -54,7 +38,7 @@ + }; + }; + +- fragment@3 { ++ fragment@2 { + target = <&mmc>; + __overlay__ { + /* Find a way to disable the other driver */ +@@ -63,18 +47,10 @@ + }; + }; + +- fragment@4 { +- target-path = "/__overrides__"; +- __overlay__ { +- sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; +- }; +- }; +- + __overrides__ { + overclock_50 = <&sdhost>,"brcm,overclock-50:0"; + force_pio = <&sdhost>,"brcm,force-pio?"; + pio_limit = <&sdhost>,"brcm,pio-limit:0"; + debug = <&sdhost>,"brcm,debug?"; +- sdhost_freq = <&clk_sdhost>,"clock-frequency:0"; + }; }; -