From ab8c00f798b89b0420d3de9b64165fd850ab26a8 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 21 Jul 2013 04:27:51 +0200 Subject: [PATCH] projects/RPi/patches/linux: update RPi kernel patch Signed-off-by: Stephan Raue --- ...tch => linux-01-RPi_support-b04d3b1.patch} | 2254 +++++------------ 1 file changed, 663 insertions(+), 1591 deletions(-) rename projects/RPi/patches/linux/{linux-01-RPi_support-2fa497b.patch => linux-01-RPi_support-b04d3b1.patch} (98%) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support-2fa497b.patch b/projects/RPi/patches/linux/linux-01-RPi_support-b04d3b1.patch similarity index 98% rename from projects/RPi/patches/linux/linux-01-RPi_support-2fa497b.patch rename to projects/RPi/patches/linux/linux-01-RPi_support-b04d3b1.patch index 43e658b2bd..d1ba3eb691 100644 --- a/projects/RPi/patches/linux/linux-01-RPi_support-2fa497b.patch +++ b/projects/RPi/patches/linux/linux-01-RPi_support-b04d3b1.patch @@ -1,7 +1,7 @@ -From 6080f53cd84a39e1c8245ad0730fb1a3011f0769 Mon Sep 17 00:00:00 2001 +From c8c2c38e2e6f946c4eb5bec85a4d119f9e4187fb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 01/91] Main bcm2708 linux port +Subject: [PATCH 01/99] Main bcm2708 linux port Signed-off-by: popcornmix --- @@ -8259,10 +8259,10 @@ index b838ffc..f3a39c1 100644 1.8.1.6 -From 17f5dfb674bf0a817f8f3075d4d16ea0da3e2451 Mon Sep 17 00:00:00 2001 +From ebc13205d511583860ae7ba112a89135329c4dda Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 02/91] Add dwc_otg driver +Subject: [PATCH 02/99] Add dwc_otg driver Signed-off-by: popcornmix --- @@ -65341,10 +65341,10 @@ index 0000000..abcf284 1.8.1.6 -From 08a588f1e93ac1f3ca0eaa232928b0a3a67a6544 Mon Sep 17 00:00:00 2001 +From e5b4e5d798579eb1f9e596acf6c17b0549e2f873 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:54:32 +0100 -Subject: [PATCH 03/91] bcm2708 watchdog driver +Subject: [PATCH 03/99] bcm2708 watchdog driver Signed-off-by: popcornmix --- @@ -65778,10 +65778,10 @@ index 0000000..dd33c35 1.8.1.6 -From 9aa24fa38df74e7bb63e7c5f1e6f0cd7930926f4 Mon Sep 17 00:00:00 2001 +From 378f91f6bc45eb06c549f8cf1b09995715327701 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:55:09 +0100 -Subject: [PATCH 04/91] bcm2708 framebuffer driver +Subject: [PATCH 04/99] bcm2708 framebuffer driver Signed-off-by: popcornmix --- @@ -68816,10 +68816,10 @@ index 3c14e43..7626beb 100644 1.8.1.6 -From 0a4f13f76c049e4819d9f80cf754e0681c299c06 Mon Sep 17 00:00:00 2001 +From da834fbe72658bafb431c63b0160b0a57a0ea06d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 2 Jul 2013 23:42:01 +0100 -Subject: [PATCH 05/91] bcm2708 vchiq driver +Subject: [PATCH 05/99] bcm2708 vchiq driver Signed-off-by: popcornmix --- @@ -81267,10 +81267,10 @@ index 0000000..b6bfa21 1.8.1.6 -From a2d8faeec6f4dfa0f81df73ecf86d58f2d25bf8f Mon Sep 17 00:00:00 2001 +From 00bd6a3906ca51ab52a07aad2c908fc76b1da39c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 06/91] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 06/99] cma: Add vc_cma driver to enable use of CMA Signed-off-by: popcornmix --- @@ -82566,10 +82566,10 @@ index 0000000..bdc9d79 1.8.1.6 -From 9171ef805ac273e7eabf444b3338ed3a42d7070d Mon Sep 17 00:00:00 2001 +From d7f919d0ce6207f0e98520ca9045f4dc18de52c9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 07/91] bcm2708: alsa sound driver +Subject: [PATCH 07/99] bcm2708: alsa sound driver Signed-off-by: popcornmix --- @@ -84892,10 +84892,10 @@ index 0000000..af3e6eb 1.8.1.6 -From debf621c3999ce1d7ff13cbcc8de7beaa85aa14d Mon Sep 17 00:00:00 2001 +From bf8b3a360e26791caa1d9114df7c80d5c27a0711 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 08/91] Allow mac address to be set in smsc95xx +Subject: [PATCH 08/99] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -84989,10 +84989,10 @@ index 3f38ba8..60076fe 100644 1.8.1.6 -From b4a73b853b9734a668aaacdb4b5935bcc883695b Mon Sep 17 00:00:00 2001 +From 43f606bf172f727d4d65c74c4f42cf58db19fcf8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 8 May 2012 23:12:13 +0100 -Subject: [PATCH 09/91] possible fix for sdcard missing status. Thank naren +Subject: [PATCH 09/99] possible fix for sdcard missing status. Thank naren --- drivers/mmc/host/sdhci-bcm2708.c | 9 +++++++++ @@ -85029,10 +85029,10 @@ index e79723d..a405114 100644 1.8.1.6 -From 93779f0e37d786e6360ea7b388ddbc76c3cf4daf Mon Sep 17 00:00:00 2001 +From d725e274b999e4326449ff3629066edb42d00c3a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 May 2012 14:44:19 +0100 -Subject: [PATCH 10/91] sdcard patch improvements from naren +Subject: [PATCH 10/99] sdcard patch improvements from naren --- drivers/mmc/host/sdhci-bcm2708.c | 23 +++++++---------------- @@ -85091,10 +85091,10 @@ index a405114..ae8edf7 100644 1.8.1.6 -From c79be143c5db0159c96c8301b1ae4ce50bebeeb1 Mon Sep 17 00:00:00 2001 +From 14a9f7efae05898a45ac550af36323e2c9682e28 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 4 Jun 2012 04:27:48 +0200 -Subject: [PATCH 11/91] sdhci-bcm2708: speed up DMA sync +Subject: [PATCH 11/99] sdhci-bcm2708: speed up DMA sync Experiments show that it doesn't really take that long to sync, so we can reduce the poll interval slightly. Might improve performance a bit. @@ -85119,10 +85119,10 @@ index ae8edf7..a6bdc25 100644 1.8.1.6 -From 7e3d10edf2cb0657e032863034b280697eb92d32 Mon Sep 17 00:00:00 2001 +From ad970a2722da54be80dc810d81c75a6938d3e58a Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:52:04 +0200 -Subject: [PATCH 12/91] sdhci-bcm2708: remove custom clock handling +Subject: [PATCH 12/99] sdhci-bcm2708: remove custom clock handling The custom clock handling code is redundant and buggy. The MMC/SDHCI subsystem does a better job than it, so remove it for good. @@ -85220,10 +85220,10 @@ index a6bdc25..0ed4d85 100644 1.8.1.6 -From 864e235c6c115a57215cfa40107b180a3d61e3a0 Mon Sep 17 00:00:00 2001 +From 38cd27c91c8ea233aec8ae9477a2108a3ca519ea Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:53:59 +0200 -Subject: [PATCH 13/91] sdhci-bcm2708: add additional quirks +Subject: [PATCH 13/99] sdhci-bcm2708: add additional quirks Some additional quirks are needed for correct operation. There's no SDHCI capabilities register documented, and it always reads @@ -85253,10 +85253,10 @@ index 0ed4d85..3001836 100644 1.8.1.6 -From f012cd2c3be22b5ac4b6bd2e7fed17b5a47a376c Mon Sep 17 00:00:00 2001 +From f14d342ff13c3262cb31b9138cd1d3833c75a5a7 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:57:13 +0200 -Subject: [PATCH 14/91] sdhci-bcm2708: add allow_highspeed parameter +Subject: [PATCH 14/99] sdhci-bcm2708: add allow_highspeed parameter Add a parameter to disable high-speed mode for the few cards that still might have problems. High-speed mode is enabled by default. @@ -85304,10 +85304,10 @@ index 3001836..c64de21 100644 1.8.1.6 -From de4d917a430e9b1c6ee890eb02e707bdbb5551b7 Mon Sep 17 00:00:00 2001 +From 02fd8aacce57a8c77e02ceb3e6aff3e46fb06a72 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 11 Jun 2012 18:58:40 +0200 -Subject: [PATCH 15/91] sdhci-bcm2708: assume 50 MHz eMMC clock +Subject: [PATCH 15/99] sdhci-bcm2708: assume 50 MHz eMMC clock 80 MHz clock isnt't suited well to be dividable to get SD clocks of 25 MHz (default mode) or 50 MHz (high speed mode). 50 MHz are perfect to @@ -85333,10 +85333,10 @@ index c64de21..d174938 100644 1.8.1.6 -From ca9519b849238cc00d7fdc045683476152cd680d Mon Sep 17 00:00:00 2001 +From 2186ee5f876aad0d666d6f31692ad2a883f60196 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Jun 2012 22:31:55 +0100 -Subject: [PATCH 16/91] Allow emmc clock to be specified as command line +Subject: [PATCH 16/99] Allow emmc clock to be specified as command line parameter --- @@ -85383,10 +85383,10 @@ index d174938..0ee983c 100644 1.8.1.6 -From 68681c00fe7e60b3d3205d24531b2a10d8596ea7 Mon Sep 17 00:00:00 2001 +From bd13f67e2f81a783890c9083fcba77dde0b29809 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Jun 2012 22:35:38 +0100 -Subject: [PATCH 17/91] sdhci-bcm2708: raise DMA sync timeout +Subject: [PATCH 17/99] sdhci-bcm2708: raise DMA sync timeout Commit d64b84c by accident reduced the maximum overall DMA sync timeout. The maximum overall timeout was reduced from 100ms to 30ms, @@ -85416,10 +85416,10 @@ index 0ee983c..b0cdd7d 100644 1.8.1.6 -From db66a7b0ff1eb7b63ba25003405f7e67d59d497e Mon Sep 17 00:00:00 2001 +From a892f560e785c614c47ef60fc38950e47cf644be Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 22 Jun 2012 12:57:42 +0100 -Subject: [PATCH 18/91] Use ndelay rather than udelay. Thanks lb +Subject: [PATCH 18/99] Use ndelay rather than udelay. Thanks lb --- drivers/mmc/host/sdhci-bcm2708.c | 8 ++++---- @@ -85466,10 +85466,10 @@ index b0cdd7d..7bba950 100644 1.8.1.6 -From 71392b4e1322e0cd972cb3e7b8efa88b37f3578e Mon Sep 17 00:00:00 2001 +From 20c684aea3aafbbb1424905b7cd63e241db44b88 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:41:10 +0100 -Subject: [PATCH 19/91] Backport of Chris Boot's i2c and spi drivers. +Subject: [PATCH 19/99] Backport of Chris Boot's i2c and spi drivers. --- arch/arm/configs/bcmrpi_cutdown_defconfig | 10 + @@ -86758,10 +86758,10 @@ index 0000000..9f1580e 1.8.1.6 -From 30d5060bcf0883c2b72e362bd76d2d32ea90ba2a Mon Sep 17 00:00:00 2001 +From fa218dd798563865e7d1845fbd3cdf88ddac4568 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 19 Jul 2012 16:00:28 +0100 -Subject: [PATCH 20/91] Add SPI_SPI_DEV module +Subject: [PATCH 20/99] Add SPI_SPI_DEV module --- arch/arm/configs/bcmrpi_defconfig | 1 + @@ -86783,10 +86783,10 @@ index 6219df3..31f5afaa 100644 1.8.1.6 -From 0139a2bbd4f30ba7b59a44d7f11a38c8ae15c24c Mon Sep 17 00:00:00 2001 +From 65bfccc3a8523cef7b80230e972f4d6fff68bcc8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 13 Jul 2012 18:34:18 +0100 -Subject: [PATCH 21/91] Fix for quitting X hang. Interrupted mailbox reads are +Subject: [PATCH 21/99] Fix for quitting X hang. Interrupted mailbox reads are not something we can reliably recover from, so down_interruptable is not a safe call. @@ -86821,10 +86821,10 @@ index 799a0ac..3874051 100644 1.8.1.6 -From a53fbe6aab3b6e996741b0bc12b964c5c39c5da3 Mon Sep 17 00:00:00 2001 +From 98a3d88e3a7f8e3e51f0a7e87bacf9779bbeac06 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 17 Jul 2012 00:48:27 +0100 -Subject: [PATCH 22/91] Add sync_after_dma module parameter +Subject: [PATCH 22/99] Add sync_after_dma module parameter --- drivers/mmc/host/sdhci-bcm2708.c | 60 +++++++++++++++++++++------------------- @@ -86941,10 +86941,10 @@ index 7bba950..3792b9f 100644 1.8.1.6 -From d55680e3f7f80bb0cfd1cff2b94e2e00874e7ade Mon Sep 17 00:00:00 2001 +From 53a6e2c9df4180d614cd49425b0387569788f4a8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:25:52 +0100 -Subject: [PATCH 23/91] sdhci-bcm2708: use extension FIFO to buffer DMA +Subject: [PATCH 23/99] sdhci-bcm2708: use extension FIFO to buffer DMA transfers The additional FIFO might speed up transfers in some cases. @@ -86996,10 +86996,10 @@ index 3792b9f..326b962 100644 1.8.1.6 -From 55cdffec9f1d501823c9899867f775b97fa38785 Mon Sep 17 00:00:00 2001 +From 889c54183fcb491aa8738f73b569c8f64a2f83b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:42:49 +0100 -Subject: [PATCH 24/91] sdhci-bcm2708: use multiblock-type transfers for single +Subject: [PATCH 24/99] sdhci-bcm2708: use multiblock-type transfers for single blocks There are issues with both single block reads (missed completion) @@ -87055,10 +87055,10 @@ index e326ae2..70020e3 100644 1.8.1.6 -From ce3c78e01628a7fd80625223a2377a6c58562b0e Mon Sep 17 00:00:00 2001 +From 3dbb84a60f62598345aa3a5aa0478753c8d2058f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Aug 2012 19:02:14 +0100 -Subject: [PATCH 25/91] Add module parameter for missing_status quirk. +Subject: [PATCH 25/99] Add module parameter for missing_status quirk. sdhci-bcm2708.missing_status=0 may improve interrupt latency --- @@ -87114,10 +87114,10 @@ index c6d6bb0..8243593 100644 1.8.1.6 -From 6fa717aa060b8d60006aa6bee5f223884d5f8bcf Mon Sep 17 00:00:00 2001 +From 669d28370d45ac6cfe4dc07b2889abffbd1aff52 Mon Sep 17 00:00:00 2001 From: ddv2005 Date: Sun, 5 Aug 2012 10:42:12 -0400 -Subject: [PATCH 26/91] Fix spinlock recursion in sdhci-bcm2708.c +Subject: [PATCH 26/99] Fix spinlock recursion in sdhci-bcm2708.c --- drivers/mmc/host/sdhci-bcm2708.c | 14 +++++++------- @@ -87186,10 +87186,10 @@ index 8243593..7a703c2 100644 1.8.1.6 -From eba5eb2eae782a05538df7404ef4dfa00403144e Mon Sep 17 00:00:00 2001 +From bb9a79055bf7d1596b9f1c6d08c9526fa3d616ed Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 21 Aug 2012 18:49:44 +0100 -Subject: [PATCH 27/91] Read memory size for vc_mem through mailbox property +Subject: [PATCH 27/99] Read memory size for vc_mem through mailbox property channel --- @@ -87360,10 +87360,10 @@ index fd9d4be..7a7748e 100644 1.8.1.6 -From 23effc5826fd97a33418646601e5aea1cef1143d Mon Sep 17 00:00:00 2001 +From 375ad1bb17db91b98602924bbbbc6a9ac7fa5e11 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 28/91] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 28/99] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) --- @@ -87426,10 +87426,10 @@ index 510be0b..d61e747 100644 1.8.1.6 -From 6bfb747cf6be7dd680c15753d78ffcc9117fabb2 Mon Sep 17 00:00:00 2001 +From 4154023606fb33c371aca4c5075218b0df54d864 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:27:48 +0100 -Subject: [PATCH 29/91] Add low-latency mode to sdcard driver. Disable with +Subject: [PATCH 29/99] Add low-latency mode to sdcard driver. Disable with sdhci-bcm2708.enable_llm=0. Thanks ddv2005. --- @@ -87952,10 +87952,10 @@ index f3a39c1..58bfab0 100644 1.8.1.6 -From 56b675fceebb97e27686cdfaa918591d28e6f1bb Mon Sep 17 00:00:00 2001 +From 681651078bf2d1cad92b3eb803ccb5f141b06db0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:46:42 +0100 -Subject: [PATCH 30/91] Add FIQ patch to dwc_otg driver. Enable with +Subject: [PATCH 30/99] Add FIQ patch to dwc_otg driver. Enable with dwc_otg.fiq_fix_enable=1. Should give about 10% more ARM performance. Thanks to Gordon and Costas @@ -89115,10 +89115,10 @@ index a7e9076..bb1c42d 100644 1.8.1.6 -From d2c50dbe9f75e1b89aadfb87eafea7874ec0fe63 Mon Sep 17 00:00:00 2001 +From 02516ae111bbdec2a3e03ef8f42e6a54f7ebc48d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 12 Apr 2013 23:58:47 +0100 -Subject: [PATCH 33/91] Add verious user config requests. +Subject: [PATCH 33/99] Add verious user config requests. CONFIG_DEVTMPFS_MOUNT, CONFIG_NFS_V4_1=y CONFIG_NFSD_V3_ACL=y CONFIG_NFSD_V4=y, drbd and IPSEC modules @@ -89528,10 +89528,10 @@ index 31f5afaa..ef43466 100644 1.8.1.6 -From 41886846d6954160e12a8a615670aa75c008f74c Mon Sep 17 00:00:00 2001 +From d9f05b5596f47c80bebf7acd9a2bbce6d4521375 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Sep 2012 15:17:53 +0100 -Subject: [PATCH 34/91] Avoid dynamic memory allocation for channel lock in USB +Subject: [PATCH 34/99] Avoid dynamic memory allocation for channel lock in USB driver. Thanks ddv2005. --- @@ -89638,10 +89638,10 @@ index f1658fa..21e8f09 100644 1.8.1.6 -From f7ac5d29e294fd756c952b0a58fba1ede77221e5 Mon Sep 17 00:00:00 2001 +From b7e56e22e1128f99388c5869769590c812ee3467 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 35/91] Add cpufreq driver +Subject: [PATCH 35/99] Add cpufreq driver --- arch/arm/Kconfig | 1 + @@ -90168,10 +90168,10 @@ index 0000000..aa6fc66 1.8.1.6 -From 9a13f810caf54c783f29731af4a50da242bca676 Mon Sep 17 00:00:00 2001 +From bde86bb81df0a9119108b8baadd3c87bc7394167 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 8 Apr 2013 21:12:48 +0100 -Subject: [PATCH 36/91] Add NAK holdoff scheme. Enabled by default, disable +Subject: [PATCH 36/99] Add NAK holdoff scheme. Enabled by default, disable with dwc_otg.nak_holdoff_enable=0. Thanks gsh --- @@ -90381,10 +90381,10 @@ index ac10323..e6b2a7b 100644 1.8.1.6 -From 8a29d2cd7f9c46ad76010620b3fca8082dd34f1f Mon Sep 17 00:00:00 2001 +From c9748c8b0dab670e3e963708b253b471a14cc4b6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 37/91] Added hwmon/thermal driver for reporting core +Subject: [PATCH 37/99] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian --- @@ -90908,10 +90908,10 @@ index 0000000..f1ecdb2 1.8.1.6 -From f10623b14323b7fd230da611043b7098b0353cba Mon Sep 17 00:00:00 2001 +From 278f0aa4868514d23a3c21fd71782638105b3cc1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 12 Apr 2013 23:59:27 +0100 -Subject: [PATCH 38/91] Add config options for thermal sensor, L2TP, +Subject: [PATCH 38/99] Add config options for thermal sensor, L2TP, RT2800USB_UNKNOWN, and various I2C and SPI RTCs. Tidy of thermal driver. --- @@ -91079,10 +91079,10 @@ index f1ecdb2..3f9a733 100644 1.8.1.6 -From d7c871a20faf02c4a9e4fa9434f7109c870de68a Mon Sep 17 00:00:00 2001 +From cb7b29a8bab3312bea4b37cff8fb08477a9dd280 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 28 Mar 2013 01:19:54 +0000 -Subject: [PATCH 39/91] 2708fb: Remove some unnecessary dmesg output. +Subject: [PATCH 39/99] 2708fb: Remove some unnecessary dmesg output. --- drivers/video/bcm2708_fb.c | 34 +++++++++++++++++++--------------- @@ -91209,10 +91209,10 @@ index c82dd90..08d9238 100644 1.8.1.6 -From 80027aa78529bb27b8b368eecdc73ddb99b87dca Mon Sep 17 00:00:00 2001 +From 317d5b4df2b5ef8a2227d778a3d267657940d8f5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 28 Mar 2013 01:20:34 +0000 -Subject: [PATCH 40/91] cpufreq: Remove some unnecessary dmesg output. +Subject: [PATCH 40/99] cpufreq: Remove some unnecessary dmesg output. --- drivers/cpufreq/bcm2835-cpufreq.c | 2 +- @@ -91235,10 +91235,10 @@ index aa6fc66..6ff1edb 100755 1.8.1.6 -From c1d625a495bda54a60b56a5bd0f5449b7ac53d49 Mon Sep 17 00:00:00 2001 +From 371d191f321a252cfac87e7ffb09e24cc6e0f452 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 17 Sep 2012 22:57:29 +0100 -Subject: [PATCH 41/91] Switch to powersave governor. We'll enable ondemand in +Subject: [PATCH 41/99] Switch to powersave governor. We'll enable ondemand in the distribution --- @@ -91266,10 +91266,10 @@ index d11f688..c1afa47 100644 1.8.1.6 -From c33b7bcc3a6de49b94381096f6a0c2e4879682af Mon Sep 17 00:00:00 2001 +From 707f3a7af88b74b654c77687f276e1afbc480e82 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Apr 2013 12:16:36 +0100 -Subject: [PATCH 42/91] Enable multiple ALSA channels +Subject: [PATCH 42/99] Enable multiple ALSA channels --- arch/arm/mach-bcm2708/bcm2708.c | 54 ++++++++++++++++++++++++++++++++++++----- @@ -91344,10 +91344,10 @@ index 2875cd2..27e9553 100644 1.8.1.6 -From 86cd9547f7bc2f8c427e34527be3d8e27a44f298 Mon Sep 17 00:00:00 2001 +From a6db2e423dc8ce4d6fa43c2237258805a1146ee5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Oct 2012 20:08:19 +0100 -Subject: [PATCH 43/91] set i2c speed via module-parameter or menuconfig. +Subject: [PATCH 43/99] set i2c speed via module-parameter or menuconfig. Thanks FrankBoesing --- @@ -91422,10 +91422,10 @@ index 7cae615..3391889 100644 1.8.1.6 -From dc1c709396bd2711af5c4e285a223bb0f026244f Mon Sep 17 00:00:00 2001 +From 1d18bb9dd8c8b62e45cad2d0dcc30eaecc2c6a69 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Oct 2012 21:31:48 +0100 -Subject: [PATCH 44/91] Allow the number of cycles delay between sdcard +Subject: [PATCH 44/99] Allow the number of cycles delay between sdcard peripheral writes to be specified on command line with sdhci-bcm2708.cycle_delay @@ -91467,10 +91467,10 @@ index 7ce2829..ffd7310 100644 1.8.1.6 -From c372f2d12122085d55d03268a0cb4c2d670a7064 Mon Sep 17 00:00:00 2001 +From 4aecef94dd8c0705a023c89db4c370500f340e10 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Apr 2013 14:37:25 +0100 -Subject: [PATCH 45/91] Fix vc-mem by using module parameters +Subject: [PATCH 45/99] Fix vc-mem by using module parameters --- arch/arm/mach-bcm2708/bcm2708.c | 12 ++--- @@ -91705,10 +91705,10 @@ index 5ef68b3..057f74f 100644 1.8.1.6 -From 9578fd3da96819661e04f6d856c3fd0cb4d4dcdf Mon Sep 17 00:00:00 2001 +From d4d52a1403731c1c673e97be27b28d9e3a8a4136 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 5 Oct 2012 22:44:47 +0100 -Subject: [PATCH 46/91] Support dummy vc-mem ioctl used by vcdbg +Subject: [PATCH 46/99] Support dummy vc-mem ioctl used by vcdbg --- arch/arm/mach-bcm2708/include/mach/vc_mem.h | 1 + @@ -91756,10 +91756,10 @@ index 057f74f..aeae4d5 100644 1.8.1.6 -From 321f91d1c01a6dfb91ccc3a05d01f487ddb67c5e Mon Sep 17 00:00:00 2001 +From ea6d83f5c4fa383d86f7b8c410c62cceea3ecb36 Mon Sep 17 00:00:00 2001 From: dero Date: Mon, 19 Nov 2012 12:46:06 +0100 -Subject: [PATCH 47/91] Lazy CRC quirk: Implemented retrying mechanisms for SD +Subject: [PATCH 47/99] Lazy CRC quirk: Implemented retrying mechanisms for SD SSR and SCR, disabled missing_status and spurious CRC ACMD51 quirks by default (should be fixed by the retrying-mechanishm) @@ -91991,10 +91991,10 @@ index ffd7310..3556ed3 100644 1.8.1.6 -From 5fd69f8d1c8b53b52319bb712c9d925b429caa5e Mon Sep 17 00:00:00 2001 +From 3bcecc233a96399a4e88a2a209a34fcfac8dc3fd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 28 Mar 2013 00:10:32 +0000 -Subject: [PATCH 48/91] bcm2708: Add vc_cma driver to enable use of CMA +Subject: [PATCH 48/99] bcm2708: Add vc_cma driver to enable use of CMA --- arch/arm/mach-bcm2708/bcm2708.c | 18 ++++++++++++++++++ @@ -92055,10 +92055,10 @@ index e010515..9d38d40 100644 1.8.1.6 -From b243d68cd0e3e1ac8fe4d9313e44a6c94886ee5a Mon Sep 17 00:00:00 2001 +From 027f6c9ff7ef276abc540ad4269803884d3099e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Oct 2012 22:00:43 +0100 -Subject: [PATCH 49/91] Fix reboot with new restart method of machine driver +Subject: [PATCH 49/99] Fix reboot with new restart method of machine driver --- arch/arm/mach-bcm2708/bcm2708.c | 18 +++++++++++++++++- @@ -92136,10 +92136,10 @@ index bc9d458..2d0b821 100644 1.8.1.6 -From dafd5e9e557ffa7494f6a5c11ab62b5c2dab6139 Mon Sep 17 00:00:00 2001 +From 5a11b596dde3ab3f1ed7e3bc26ba213461c5aa35 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Sun, 4 Nov 2012 15:55:01 +0000 -Subject: [PATCH 50/91] Make sure we wait for the reset to finish +Subject: [PATCH 50/99] Make sure we wait for the reset to finish --- drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 2 ++ @@ -92162,10 +92162,10 @@ index 3e762e2..e8c91e7 100644 1.8.1.6 -From cf9d13622e80e613716a03de85045247d7382bfd Mon Sep 17 00:00:00 2001 +From 4b12c94e5ad7ea1e93ba52d7c6160cc0fefd4c61 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 19 Nov 2012 18:27:05 +0000 -Subject: [PATCH 51/91] Add Simon Hall's dma helper module, useful in future +Subject: [PATCH 51/99] Add Simon Hall's dma helper module, useful in future for X acceleration --- @@ -93503,10 +93503,10 @@ index 0000000..5cb1335 1.8.1.6 -From 6ffd27277fcf553852d92aa961714aef6104d98e Mon Sep 17 00:00:00 2001 +From 7ba8d6a7442791f9c67095d49705ce9fa94c58a3 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 52/91] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 52/99] lirc: added support for RaspberryPi GPIO --- drivers/staging/media/lirc/Kconfig | 6 + @@ -94241,10 +94241,10 @@ index 0000000..96acab0 1.8.1.6 -From bcf9c84e3c30f79d9beae9bad42f7a18ccd15c3c Mon Sep 17 00:00:00 2001 +From 8372f6fe360b00d43a27f3fce9b24a47d088dd75 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 25 Nov 2012 18:28:09 +0000 -Subject: [PATCH 53/91] Allow mailbox driver to be called from user code though +Subject: [PATCH 53/99] Allow mailbox driver to be called from user code though ioctl --- @@ -94481,10 +94481,10 @@ index 468fdef..09b78b5 100644 1.8.1.6 -From f7048aa2a847de942629ce21d11345a57c2e66e4 Mon Sep 17 00:00:00 2001 +From 3182ee5f146dddc9bbcbb4d73c670b5a5b6c2866 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Dec 2012 18:23:03 +0000 -Subject: [PATCH 54/91] Default to dwc_otp.lpm_enable=0 +Subject: [PATCH 54/99] Default to dwc_otp.lpm_enable=0 --- drivers/usb/host/dwc_otg/dwc_otg_driver.c | 2 +- @@ -94507,10 +94507,10 @@ index d353a9a..cea8fcb 100644 1.8.1.6 -From a49eddff6d55578a3caa1d2e5cd11c92df4f278a Mon Sep 17 00:00:00 2001 +From d25b264279de2a98dfeb74d68dd8b6bb8838ef93 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Dec 2012 19:04:27 +0000 -Subject: [PATCH 55/91] Increase default coherent pool so vchiq starts up +Subject: [PATCH 55/99] Increase default coherent pool so vchiq starts up --- arch/arm/mach-bcm2708/bcm2708.c | 4 +--- @@ -94535,10 +94535,10 @@ index 9f456e9..87fd348 100644 1.8.1.6 -From f5adca2359cd6b7bb40d41ddc66e290141e05a58 Mon Sep 17 00:00:00 2001 +From 540d544c17f3ee3614f50c7807989639ba15fc91 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Jan 2013 21:34:59 +0000 -Subject: [PATCH 56/91] Add mutex around bcm_mailbox_property function +Subject: [PATCH 56/99] Add mutex around bcm_mailbox_property function --- arch/arm/mach-bcm2708/vcio.c | 5 ++++- @@ -94578,10 +94578,10 @@ index 09b78b5..599eb63 100644 1.8.1.6 -From de86ee42fc5f624a9879bce5b2603c0555741016 Mon Sep 17 00:00:00 2001 +From db66ac826bbca8163eaa233ae74d93611a1d6830 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 9 Jan 2013 16:12:04 +0000 -Subject: [PATCH 57/91] dwc_otg: fix bug in dwc_otg_hcd.c resulting in silent +Subject: [PATCH 57/99] dwc_otg: fix bug in dwc_otg_hcd.c resulting in silent kernel memory corruption, escalating to OOPS under high USB load. --- @@ -94618,10 +94618,10 @@ index e6b2a7b..b337e1b 100644 1.8.1.6 -From f6156c223969196d360586d6e09d81a1fe85e8de Mon Sep 17 00:00:00 2001 +From 6be8954eb70b616249353fdf4ea69d4c43df36aa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 21 Jan 2013 23:03:53 +0000 -Subject: [PATCH 58/91] Return error value from bcm2708_setup_state. Thanks +Subject: [PATCH 58/99] Return error value from bcm2708_setup_state. Thanks notro --- @@ -94644,10 +94644,10 @@ index 9f1580e..8513704 100644 1.8.1.6 -From 3c635bdecfe28dbbaabaf0f7afc9f70066d470ab Mon Sep 17 00:00:00 2001 +From 1962bb39b3a61eac199da29f057c5998a3b3fb26 Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Mon, 22 Oct 2012 15:52:44 -0700 -Subject: [PATCH 59/91] spi/spi-bcm2708: respect per-transfer SPI clock +Subject: [PATCH 59/99] spi/spi-bcm2708: respect per-transfer SPI clock speed_hz value The bcm2708 SPI driver's bcm2708_process_transfer() was ignoring the @@ -94692,10 +94692,10 @@ index 8513704..b74aa32 100644 1.8.1.6 -From 43d6cf5febd600a9ef11ba7b8656519d2c356346 Mon Sep 17 00:00:00 2001 +From 2b5353b5e7245753a6709986b79f413838ad38e4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:51:55 +0100 -Subject: [PATCH 60/91] Add hwrng (hardware random number generator) driver +Subject: [PATCH 60/99] Add hwrng (hardware random number generator) driver --- arch/arm/mach-bcm2708/include/mach/platform.h | 1 + @@ -94873,10 +94873,10 @@ index 0000000..1ffa7d7 1.8.1.6 -From ee3463d963f75ec8d1b13d81d7ab583255e1d890 Mon Sep 17 00:00:00 2001 +From 1a7fa1b69ae87ca896420024791322ad9eb53184 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 7 Feb 2013 17:04:13 +0000 -Subject: [PATCH 61/91] Add missing newlines to log messages +Subject: [PATCH 61/99] Add missing newlines to log messages --- drivers/cpufreq/bcm2835-cpufreq.c | 20 ++++++++++---------- @@ -94975,10 +94975,10 @@ index 6ff1edb..5a19212 100755 1.8.1.6 -From 9f3f17339f5165e1060883db422398a7f165c2be Mon Sep 17 00:00:00 2001 +From 91d1e7dc598707cc207231eb3da6af7fb4220dfe Mon Sep 17 00:00:00 2001 From: Technion Date: Mon, 11 Feb 2013 22:08:53 +1100 -Subject: [PATCH 62/91] Changed wording on logging. Previously, we received +Subject: [PATCH 62/99] Changed wording on logging. Previously, we received errors like this: mmc0: could read SD Status register (SSR) at the 3th attempt A more sensible response is now returned. A typo also fixed in comments. @@ -95013,10 +95013,10 @@ index 1ee6cf3..90228f9 100644 1.8.1.6 -From bbdfaf49aa05257794d7ddc19717e3e1f035285a Mon Sep 17 00:00:00 2001 +From c7d43ef857410811f7e87deca3cae3ede61a6960 Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 15 Feb 2013 22:36:47 +0000 -Subject: [PATCH 63/91] dwc_otg: Fix unsafe access of QTD during URB enqueue +Subject: [PATCH 63/99] dwc_otg: Fix unsafe access of QTD during URB enqueue In dwc_otg_hcd_urb_enqueue during qtd creation, it was possible that the transaction could complete almost immediately after the qtd was assigned @@ -95103,10 +95103,10 @@ index b337e1b..b3e6e52 100644 1.8.1.6 -From f385db71cd990d3e6d5e7020127357afabe0b4e4 Mon Sep 17 00:00:00 2001 +From 0d56c0c2af666dbc6760d0ac1da67b4da2556fc3 Mon Sep 17 00:00:00 2001 From: P33M Date: Fri, 15 Feb 2013 22:38:40 +0000 -Subject: [PATCH 64/91] dwc_otg: Fix incorrect URB allocation error handling +Subject: [PATCH 64/99] dwc_otg: Fix incorrect URB allocation error handling If the memory allocation for a dwc_otg_urb failed, the kernel would OOPS because for some reason a member of the *unallocated* struct was set to @@ -95147,10 +95147,10 @@ index e653d84..fcec97f 100644 1.8.1.6 -From 9cb0f13eb3ffc4f82a8756f6b79e3653406f529b Mon Sep 17 00:00:00 2001 +From 317fc23a9cd49bbf6afd6fadf89edddb817db9a9 Mon Sep 17 00:00:00 2001 From: pjennings Date: Wed, 20 Feb 2013 17:51:43 -0600 -Subject: [PATCH 65/91] Added inverted transmitter support +Subject: [PATCH 65/99] Added inverted transmitter support --- drivers/staging/media/lirc/lirc_rpi.c | 17 +++++++++++------ @@ -95231,10 +95231,10 @@ index 96acab0..5bb0dfe 100644 1.8.1.6 -From c332df8c672e573f6ba42e011fa9d2a6fc5ce527 Mon Sep 17 00:00:00 2001 +From 95ed7f785da984ace8ccf7524fb450d0a44e9d9c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 24 Feb 2013 16:30:57 +0000 -Subject: [PATCH 66/91] Add retry on error and tidy of temperature driver +Subject: [PATCH 66/99] Add retry on error and tidy of temperature driver --- drivers/thermal/bcm2835-thermal.c | 78 ++++++++++++++------------------------- @@ -95361,10 +95361,10 @@ index 3f9a733..85fceb5 100644 1.8.1.6 -From 01690a39d2700286bb67bed762b88b4895a40c76 Mon Sep 17 00:00:00 2001 +From f6c2e77434c76596ffd86e09ccd5d108ea124a0b Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 28 Feb 2013 16:52:51 +0000 -Subject: [PATCH 67/91] dwc_otg: fix potential use-after-free case in interrupt +Subject: [PATCH 67/99] dwc_otg: fix potential use-after-free case in interrupt handler If a transaction had previously aborted, certain interrupts are @@ -95396,10 +95396,10 @@ index e8c91e7..0c81a64 100644 1.8.1.6 -From d3ebe68a2b7629d107b31ae0644ebce63ccee58a Mon Sep 17 00:00:00 2001 +From 749b88c3d2636de12adfdb247f0da98f331dbe88 Mon Sep 17 00:00:00 2001 From: P33M Date: Sun, 3 Mar 2013 14:45:53 +0000 -Subject: [PATCH 68/91] dwc_otg: add handling of SPLIT transaction data toggle +Subject: [PATCH 68/99] dwc_otg: add handling of SPLIT transaction data toggle errors Previously a data toggle error on packets from a USB1.1 device behind @@ -95454,10 +95454,10 @@ index 0c81a64..16e8c6c 100644 1.8.1.6 -From 56cbbf3c61827a1a3e795ba0d2e8ecaa9e3e73da Mon Sep 17 00:00:00 2001 +From 39c5e0cc5dec38fb9c530fad0250c3047c752dc0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 21:14:28 +0100 -Subject: [PATCH 69/91] Add bitbanging pullups, use them for w1-gpio +Subject: [PATCH 69/99] Add bitbanging pullups, use them for w1-gpio Allows parasite power to work, uses module option pullup=1 --- @@ -95596,10 +95596,10 @@ index e10acc2..667fdd5 100644 1.8.1.6 -From 8af17a0ad8e286c71468d15076f9209791971149 Mon Sep 17 00:00:00 2001 +From b8fab4e6dfef8a0c150536a9232477c67cdd8065 Mon Sep 17 00:00:00 2001 From: notro Date: Sat, 26 Jan 2013 20:38:03 +0100 -Subject: [PATCH 70/91] spi-bcm2708: add 9-bit support using LoSSI mode +Subject: [PATCH 70/99] spi-bcm2708: add 9-bit support using LoSSI mode --- drivers/spi/spi-bcm2708.c | 30 ++++++++++++++++++++++++++++-- @@ -95669,10 +95669,10 @@ index b74aa32..abaa5a6 100644 1.8.1.6 -From ddd6ba1219a97ec27e002ecc6bc8d41bc0b8e591 Mon Sep 17 00:00:00 2001 +From d9028dd04d2ad83ebc5713159603fffd24f3a22b Mon Sep 17 00:00:00 2001 From: P33M Date: Thu, 21 Mar 2013 19:36:17 +0000 -Subject: [PATCH 71/91] dwc_otg: implement tasklet for returning URBs to +Subject: [PATCH 71/99] dwc_otg: implement tasklet for returning URBs to usbcore hcd layer The dwc_otg driver interrupt handler for transfer completion will spend @@ -95914,10 +95914,10 @@ index 9702f81..7bb133a 100644 1.8.1.6 -From f33f65ca756725be996e508fba215f7d5457341b Mon Sep 17 00:00:00 2001 +From c71f14fd40a4fadb40a7449f583de733895dc2e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Apr 2013 15:36:01 +0100 -Subject: [PATCH 73/91] Add v6wbi_flush_kern_tlb_range to allow zsmalloc to be +Subject: [PATCH 73/99] Add v6wbi_flush_kern_tlb_range to allow zsmalloc to be built as a module --- @@ -95940,10 +95940,10 @@ index 60d3b73..cba4d28 100644 1.8.1.6 -From f79f0fd16fe7e180db35b21566fbb9adf9ff9978 Mon Sep 17 00:00:00 2001 +From 07b4444a2c199eebf90b6d3556c06be61162a4aa Mon Sep 17 00:00:00 2001 From: P33M Date: Mon, 22 Apr 2013 00:08:36 +0100 -Subject: [PATCH 74/91] dwc_otg: fix NAK holdoff and allow on split +Subject: [PATCH 74/99] dwc_otg: fix NAK holdoff and allow on split transactions only This corrects a bug where if a single active non-periodic endpoint @@ -96013,10 +96013,10 @@ index 91eefecd..eaa8f38 100644 1.8.1.6 -From 4de35edee9be469614d1632a198cfd800ae5b25e Mon Sep 17 00:00:00 2001 +From 847b720d29f170f59838851ef89fa16d4e8be328 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 26 Apr 2013 10:08:31 -0700 -Subject: [PATCH 75/91] Merge pull request #286 from +Subject: [PATCH 75/99] Merge pull request #286 from martinezjavier/rpi-3.6.y-dev add mmap support and some cleanups to bcm2835 ALSA driver @@ -96497,10 +96497,10 @@ index b966e28..08c763d 100755 1.8.1.6 -From 911b47b068b6e7e15f1abbc918b28b294856870b Mon Sep 17 00:00:00 2001 +From b084004a4e4956baa6caae26892c987a814e5b86 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 7 May 2013 22:20:24 +0100 -Subject: [PATCH 76/91] Add quick config. +Subject: [PATCH 76/99] Add quick config. This is designed for quick compiling when developing. No modules are needed and it includes all Pi specific drivers @@ -96716,10 +96716,10 @@ index 0000000..e5efe75 1.8.1.6 -From aacfe85df55f02c51b405a01f4391a2eb790fdff Mon Sep 17 00:00:00 2001 +From ce78b69a10967de55daa264905bf5c3c082fa58e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 May 2013 19:42:38 +0100 -Subject: [PATCH 77/91] mmc: suppress sdcard warnings we are happy about by +Subject: [PATCH 77/99] mmc: suppress sdcard warnings we are happy about by default --- @@ -96785,10 +96785,10 @@ index 3556ed3..c2409b9 100644 1.8.1.6 -From 84d80662cd68320b63ed25cfa4f611b96f2e6f82 Mon Sep 17 00:00:00 2001 +From 82a33c8bf57a7973e6a9e691b26b2302623cc283 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 May 2013 11:42:25 +0100 -Subject: [PATCH 78/91] Allow reboot=q on command line to set a flag that +Subject: [PATCH 78/99] Allow reboot=q on command line to set a flag that bootcode.bin can use to boot from alternate partition --- @@ -96819,10 +96819,10 @@ index 87fd348..1ed4d73 100644 1.8.1.6 -From d88ada9ddccea359ee02e044f86cd9e33aecc02f Mon Sep 17 00:00:00 2001 +From c59cd6c169dbd7bfbaac7f0db70202d1ea77f998 Mon Sep 17 00:00:00 2001 From: hutorny Date: Mon, 13 May 2013 10:26:14 +0300 -Subject: [PATCH 80/91] Update bcm2708.c to use CONFIG_BCM2708_SPIDEV rather +Subject: [PATCH 80/99] Update bcm2708.c to use CONFIG_BCM2708_SPIDEV rather than CONFIG_SPI --- @@ -96872,10 +96872,10 @@ index 1ed4d73..68c577a 100644 1.8.1.6 -From 8b2532eaea9f27d74973aa563c209e95a6436377 Mon Sep 17 00:00:00 2001 +From f49ef700428e660617cb2af4c5ac3b7b21422d3e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Jun 2013 22:14:13 +0100 -Subject: [PATCH 82/91] Only init gpio pins of selected i2c bus +Subject: [PATCH 82/99] Only init gpio pins of selected i2c bus --- drivers/i2c/busses/i2c-bcm2708.c | 8 +++++--- @@ -96919,10 +96919,10 @@ index 3391889..edc90c0 100644 1.8.1.6 -From b87736ed6ed5d4d5cc534f679ab8b832e693d452 Mon Sep 17 00:00:00 2001 +From 10bf7045ddd880bbe4f7dde8b4f49598d83b6efa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 13 Jun 2013 16:46:54 +0100 -Subject: [PATCH 83/91] Avoid responding to unexpected I2C interrupts +Subject: [PATCH 83/99] Avoid responding to unexpected I2C interrupts --- drivers/i2c/busses/i2c-bcm2708.c | 6 ++++++ @@ -96956,10 +96956,10 @@ index edc90c0..33f4e7d 100644 1.8.1.6 -From c9e3680fe3d1b66ec5e8947b52cf582001d39690 Mon Sep 17 00:00:00 2001 +From 2b64a5202b8a2de9976bea21b8b2274bd42ef958 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 84/91] Speed up console framebuffer imageblit function +Subject: [PATCH 84/99] 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 @@ -97171,10 +97171,10 @@ index baed57d..ce91bf2 100644 1.8.1.6 -From 37fa288e60b2f5cdfde5a392504bf1097699c0d8 Mon Sep 17 00:00:00 2001 +From e61adeb1dbd2011d96b2c0be749694577232a547 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 85/91] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 85/99] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -97270,10 +97270,10 @@ index fb795c3..fa72af0 100644 1.8.1.6 -From 511c5dd60c2023b810e0f419fd37b2bc3f078cdc Mon Sep 17 00:00:00 2001 +From c989cdcb64873668a5fd83cf853c0a229ee55292 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 16:00:25 +0300 -Subject: [PATCH 86/91] bcm2708_fb: DMA acceleration for fb_copyarea +Subject: [PATCH 86/99] bcm2708_fb: DMA acceleration for fb_copyarea Based on http://www.raspberrypi.org/phpBB3/viewtopic.php?p=62425#p62425 Also used Simon's dmaer_master module as a reference for tweaking DMA @@ -97517,10 +97517,10 @@ index 08d9238..c10c5ee 100644 1.8.1.6 -From 44aa1f6534dbd06e3529d8496a1dd494be5f9b98 Mon Sep 17 00:00:00 2001 +From d1ea37d0b0639cce0beae86bae421df4d55701ee Mon Sep 17 00:00:00 2001 From: Mike Bradley Date: Mon, 17 Jun 2013 11:31:42 -0700 -Subject: [PATCH 87/91] dwc_otg: Call usb_hcd_unlink_urb_from_ep with lock held +Subject: [PATCH 87/99] dwc_otg: Call usb_hcd_unlink_urb_from_ep with lock held in completion handler usb_hcd_unlink_urb_from_ep must be called with the HCD lock held. Calling it @@ -97607,10 +97607,10 @@ index 7bb133a..fef557d 100644 1.8.1.6 -From 1fdd347791b4e01e811427ab5974b3659b805982 Mon Sep 17 00:00:00 2001 +From 3a7b4e1205985ac992799c956d9a9e2085a43f06 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Thu, 4 Apr 2013 11:05:21 +0100 -Subject: [PATCH 88/91] USB fix using a FIQ to implement split transactions +Subject: [PATCH 88/99] USB fix using a FIQ to implement split transactions This commit adds a FIQ implementaion that schedules the split transactions using a FIQ so we don't get @@ -99029,10 +99029,10 @@ index 27061d3..9720937 100644 1.8.1.6 -From 03c3eeff807818fc5d7587e556b86f4ea705e93c Mon Sep 17 00:00:00 2001 +From ba0e64bf9cdac248ffe00961a6fa07e3fbdbdf7b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 11:39:46 +0100 -Subject: [PATCH 89/91] dwc_otg: fix device attributes and avoid kernel +Subject: [PATCH 89/99] dwc_otg: fix device attributes and avoid kernel warnings on boot --- @@ -99101,1431 +99101,10 @@ index 95eb7f8..9602fda 100644 1.8.1.6 -From 1c11989d30ada6ad6a8de30998d08fdc29d2d406 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 3 Jul 2013 13:39:19 +0100 -Subject: [PATCH 90/91] Revert "USB fix using a FIQ to implement split - transactions" - -This reverts commit 1fdd347791b4e01e811427ab5974b3659b805982. ---- - .../usb/host/dwc_common_port/dwc_common_linux.c | 7 +- - drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c | 37 +- - drivers/usb/host/dwc_otg/dwc_otg_driver.c | 6 +- - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 125 +---- - drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 20 +- - drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 538 +++------------------ - drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 18 +- - drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 31 +- - drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h | 26 +- - drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c | 2 +- - 10 files changed, 114 insertions(+), 696 deletions(-) - -diff --git a/drivers/usb/host/dwc_common_port/dwc_common_linux.c b/drivers/usb/host/dwc_common_port/dwc_common_linux.c -index 0812d3a..6814e51 100644 ---- a/drivers/usb/host/dwc_common_port/dwc_common_linux.c -+++ b/drivers/usb/host/dwc_common_port/dwc_common_linux.c -@@ -580,12 +580,7 @@ void DWC_WRITE_REG64(uint64_t volatile *reg, uint64_t value) - - void DWC_MODIFY_REG32(uint32_t volatile *reg, uint32_t clear_mask, uint32_t set_mask) - { -- unsigned long flags; -- -- local_irq_save(flags); -- local_fiq_disable(); - writel((readl(reg) & ~clear_mask) | set_mask, reg); -- local_irq_restore(flags); - } - - #if 0 -@@ -1306,7 +1301,7 @@ int DWC_WORKQ_PENDING(dwc_workq_t *wq) - EXPORT_SYMBOL(__DWC_DEBUG); - #endif - --EXPORT_SYMBOL(__DWC_DMA_ALLOC); -+EXPORT_SYMBOL(__DWC_DMA_ALLOC); - EXPORT_SYMBOL(__DWC_DMA_ALLOC_ATOMIC); - EXPORT_SYMBOL(__DWC_DMA_FREE); - EXPORT_SYMBOL(__DWC_ALLOC); -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -index b5a007d..b861b55 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -@@ -47,6 +47,8 @@ - #include "dwc_otg_hcd.h" - #include "dwc_otg_mphi_fix.h" - -+extern bool fiq_fix_enable; -+ - #ifdef DEBUG - inline const char *op_state_str(dwc_otg_core_if_t * core_if) - { -@@ -1319,7 +1321,7 @@ static int32_t dwc_otg_handle_lpm_intr(dwc_otg_core_if_t * core_if) - /** - * This function returns the Core Interrupt register. - */ --static inline uint32_t dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if, gintmsk_data_t *reenable_gintmsk) -+static inline uint32_t dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if) - { - gahbcfg_data_t gahbcfg = {.d32 = 0 }; - gintsts_data_t gintsts; -@@ -1336,33 +1338,19 @@ static inline uint32_t dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if, gin - gintmsk_common.b.lpmtranrcvd = 1; - #endif - gintmsk_common.b.restoredone = 1; -- if(dwc_otg_is_device_mode(core_if)) -- { -- /** @todo: The port interrupt occurs while in device -- * mode. Added code to CIL to clear the interrupt for now! -- */ -- gintmsk_common.b.portintr = 1; -- } -+ /** @todo: The port interrupt occurs while in device -+ * mode. Added code to CIL to clear the interrupt for now! -+ */ -+ gintmsk_common.b.portintr = 1; -+ - gintsts.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintsts); - gintmsk.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintmsk); -- { -- unsigned long flags; -- -- // Re-enable the saved interrupts -- local_irq_save(flags); -- local_fiq_disable(); -- gintmsk.d32 |= gintmsk_common.d32; -- gintsts_saved.d32 &= ~gintmsk_common.d32; -- reenable_gintmsk->d32 = gintmsk.d32; -- local_irq_restore(flags); -- } -- - gahbcfg.d32 = DWC_READ_REG32(&core_if->core_global_regs->gahbcfg); - - #ifdef DEBUG - /* if any common interrupts set */ - if (gintsts.d32 & gintmsk_common.d32) { -- DWC_DEBUGPL(DBG_ANY, "common_intr: gintsts=%08x gintmsk=%08x\n", -+ DWC_DEBUGPL(DBG_ANY, "gintsts=%08x gintmsk=%08x\n", - gintsts.d32, gintmsk.d32); - } - #endif -@@ -1406,7 +1394,6 @@ int32_t dwc_otg_handle_common_intr(void *dev) - { - int retval = 0; - gintsts_data_t gintsts; -- gintmsk_data_t reenable_gintmsk; - gpwrdn_data_t gpwrdn = {.d32 = 0 }; - dwc_otg_device_t *otg_dev = dev; - dwc_otg_core_if_t *core_if = otg_dev->core_if; -@@ -1428,7 +1415,7 @@ int32_t dwc_otg_handle_common_intr(void *dev) - } - - if (core_if->hibernation_suspend <= 0) { -- gintsts.d32 = dwc_otg_read_common_intr(core_if, &reenable_gintmsk); -+ gintsts.d32 = dwc_otg_read_common_intr(core_if); - - if (gintsts.b.modemismatch) { - retval |= dwc_otg_handle_mode_mismatch_intr(core_if); -@@ -1525,12 +1512,8 @@ int32_t dwc_otg_handle_common_intr(void *dev) - gintsts.b.portintr = 1; - DWC_WRITE_REG32(&core_if->core_global_regs->gintsts,gintsts.d32); - retval |= 1; -- reenable_gintmsk.b.portintr = 1; - - } -- -- DWC_WRITE_REG32(&core_if->core_global_regs->gintmsk, reenable_gintmsk.d32); -- - } else { - DWC_DEBUGPL(DBG_ANY, "gpwrdn=%08x\n", gpwrdn.d32); - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c -index 6c89a69..cea8fcb 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c -@@ -242,8 +242,7 @@ struct dwc_otg_driver_module_params { - - //Global variable to switch the fiq fix on or off (declared in bcm2708.c) - extern bool fiq_fix_enable; --// Global variable to enable the split transaction fix --bool fiq_split_enable = true; -+ - //Global variable to switch the nak holdoff on or off - bool nak_holdoff_enable = true; - -@@ -1091,7 +1090,6 @@ static int __init dwc_otg_driver_init(void) - } - printk(KERN_DEBUG "dwc_otg: FIQ %s\n", fiq_fix_enable ? "enabled":"disabled"); - printk(KERN_DEBUG "dwc_otg: NAK holdoff %s\n", nak_holdoff_enable ? "enabled":"disabled"); -- printk(KERN_DEBUG "dwc_otg: FIQ split fix %s\n", fiq_split_enable ? "enabled":"disabled"); - - error = driver_create_file(drv, &driver_attr_version); - #ifdef DEBUG -@@ -1376,8 +1374,6 @@ static void __exit dwc_otg_driver_cleanup(void) - MODULE_PARM_DESC(fiq_fix_enable, "Enable the fiq fix"); - module_param(nak_holdoff_enable, bool, 0444); - MODULE_PARM_DESC(nak_holdoff_enable, "Enable the NAK holdoff"); --module_param(fiq_split_enable, bool, 0444); --MODULE_PARM_DESC(fiq_split_enable, "Enable the FIQ fix on split transactions"); - - /** @page "Module Parameters" - * -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index af9108c..9c2e71a 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -45,7 +45,6 @@ - - #include "dwc_otg_hcd.h" - #include "dwc_otg_regs.h" --#include "dwc_otg_mphi_fix.h" - - extern bool microframe_schedule, nak_holdoff_enable; - -@@ -582,8 +581,6 @@ int dwc_otg_hcd_urb_dequeue(dwc_otg_hcd_t * hcd, - */ - dwc_otg_hc_halt(hcd->core_if, qh->channel, - DWC_OTG_HC_XFER_URB_DEQUEUE); -- -- dwc_otg_hcd_release_port(hcd, qh); - } - } - -@@ -719,8 +716,6 @@ static void completion_tasklet_func(void *ptr) - - usb_hcd_giveback_urb(hcd->priv, urb, urb->status); - -- fiq_print(FIQDBG_PORTHUB, "COMPLETE"); -- - DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); - } - DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); -@@ -984,10 +979,6 @@ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) - hcd->frame_list = NULL; - hcd->frame_list_dma = 0; - hcd->periodic_qh_count = 0; -- -- DWC_MEMSET(hcd->hub_port, 0, sizeof(hcd->hub_port)); -- DWC_MEMSET(hcd->hub_port_alloc, -1, sizeof(hcd->hub_port_alloc)); -- - out: - return retval; - } -@@ -1133,12 +1124,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - uint32_t hub_addr, port_addr; - hc->do_split = 1; - hc->xact_pos = qtd->isoc_split_pos; -- /* We don't need to do complete splits anymore */ -- if(fiq_split_enable) -- hc->complete_split = qtd->complete_split = 0; -- else -- hc->complete_split = qtd->complete_split; -- -+ hc->complete_split = qtd->complete_split; - hcd->fops->hub_info(hcd, urb->priv, &hub_addr, &port_addr); - hc->hub_addr = (uint8_t) hub_addr; - hc->port_addr = (uint8_t) port_addr; -@@ -1285,62 +1271,6 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - hc->qh = qh; - } - --/* --** Check the transaction to see if the port / hub has already been assigned for --** a split transaction --** --** Return 0 - Port is already in use --*/ --int dwc_otg_hcd_allocate_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh) --{ -- uint32_t hub_addr, port_addr; -- -- if(!fiq_split_enable) -- return 0; -- -- hcd->fops->hub_info(hcd, DWC_CIRCLEQ_FIRST(&qh->qtd_list)->urb->priv, &hub_addr, &port_addr); -- -- if(hcd->hub_port[hub_addr] & (1 << port_addr)) -- { -- fiq_print(FIQDBG_PORTHUB, "H%dP%d:S%02d", hub_addr, port_addr, qh->skip_count); -- -- qh->skip_count++; -- -- if(qh->skip_count > 40000) -- { -- printk_once(KERN_ERR "Error: Having to skip port allocation"); -- local_fiq_disable(); -- BUG(); -- return 0; -- } -- return 1; -- } -- else -- { -- qh->skip_count = 0; -- hcd->hub_port[hub_addr] |= 1 << port_addr; -- fiq_print(FIQDBG_PORTHUB, "H%dP%d:A %d", hub_addr, port_addr, DWC_CIRCLEQ_FIRST(&qh->qtd_list)->urb->pipe_info.ep_num); -- hcd->hub_port_alloc[hub_addr * 16 + port_addr] = dwc_otg_hcd_get_frame_number(hcd); -- return 0; -- } --} --void dwc_otg_hcd_release_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh) --{ -- uint32_t hub_addr, port_addr; -- -- if(!fiq_split_enable) -- return; -- -- hcd->fops->hub_info(hcd, DWC_CIRCLEQ_FIRST(&qh->qtd_list)->urb->priv, &hub_addr, &port_addr); -- -- hcd->hub_port[hub_addr] &= ~(1 << port_addr); -- hcd->hub_port_alloc[hub_addr * 16 + port_addr] = -1; -- -- fiq_print(FIQDBG_PORTHUB, "H%dP%d:RO%d", hub_addr, port_addr, DWC_CIRCLEQ_FIRST(&qh->qtd_list)->urb->pipe_info.ep_num); -- --} -- -- - /** - * This function selects transactions from the HCD transfer schedule and - * assigns them to available host channels. It is called from HCD interrupt -@@ -1374,22 +1304,11 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - - while (qh_ptr != &hcd->periodic_sched_ready && - !DWC_CIRCLEQ_EMPTY(&hcd->free_hc_list)) { -- -- qh = DWC_LIST_ENTRY(qh_ptr, dwc_otg_qh_t, qh_list_entry); -- -- if(qh->do_split && dwc_otg_hcd_allocate_port(hcd, qh)) -- { -- qh_ptr = DWC_LIST_NEXT(qh_ptr); -- g_next_sched_frame = dwc_frame_num_inc(dwc_otg_hcd_get_frame_number(hcd), 1); -- continue; -- } -- - if (microframe_schedule) { - // Make sure we leave one channel for non periodic transactions. - DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - if (hcd->available_host_channels <= 1) { - DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); -- if(qh->do_split) dwc_otg_hcd_release_port(hcd, qh); - break; - } - hcd->available_host_channels--; -@@ -1410,6 +1329,8 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - DWC_LIST_MOVE_HEAD(&hcd->periodic_sched_assigned, - &qh->qh_list_entry); - DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); -+ -+ ret_val = DWC_OTG_TRANSACTION_PERIODIC; - } - - /* -@@ -1448,19 +1369,10 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - qh->nak_frame = 0xffff; - } - } -- -- if (qh->do_split && dwc_otg_hcd_allocate_port(hcd, qh)) -- { -- g_next_sched_frame = dwc_frame_num_inc(dwc_otg_hcd_get_frame_number(hcd), 1); -- qh_ptr = DWC_LIST_NEXT(qh_ptr); -- continue; -- } -- - if (microframe_schedule) { - DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - if (hcd->available_host_channels < 1) { - DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); -- if(qh->do_split) dwc_otg_hcd_release_port(hcd, qh); - break; - } - hcd->available_host_channels--; -@@ -1484,17 +1396,16 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - - g_np_sent++; - -+ if (ret_val == DWC_OTG_TRANSACTION_NONE) { -+ ret_val = DWC_OTG_TRANSACTION_NON_PERIODIC; -+ } else { -+ ret_val = DWC_OTG_TRANSACTION_ALL; -+ } -+ - if (!microframe_schedule) - hcd->non_periodic_channels++; - } - -- if(!DWC_LIST_EMPTY(&hcd->periodic_sched_assigned)) -- ret_val |= DWC_OTG_TRANSACTION_PERIODIC; -- -- if(!DWC_LIST_EMPTY(&hcd->non_periodic_sched_active)) -- ret_val |= DWC_OTG_TRANSACTION_NON_PERIODIC; -- -- - #ifdef DEBUG_HOST_CHANNELS - last_sel_trans_num_avail_hc_at_end = hcd->available_host_channels; - #endif /* DEBUG_HOST_CHANNELS */ -@@ -1611,15 +1522,6 @@ static void process_periodic_channels(dwc_otg_hcd_t * hcd) - - qh = DWC_LIST_ENTRY(qh_ptr, dwc_otg_qh_t, qh_list_entry); - -- // Do not send a split start transaction any later than frame .6 -- // Note, we have to schedule a periodic in .5 to make it go in .6 -- if(fiq_split_enable && qh->do_split && ((dwc_otg_hcd_get_frame_number(hcd) + 1) & 7) > 6) -- { -- qh_ptr = qh_ptr->next; -- g_next_sched_frame = dwc_otg_hcd_get_frame_number(hcd) | 7; -- continue; -- } -- - /* - * Set a flag if we're queuing high-bandwidth in slave mode. - * The flag prevents any halts to get into the request queue in -@@ -1749,15 +1651,6 @@ static void process_non_periodic_channels(dwc_otg_hcd_t * hcd) - - qh = DWC_LIST_ENTRY(hcd->non_periodic_qh_ptr, dwc_otg_qh_t, - qh_list_entry); -- -- // Do not send a split start transaction any later than frame .5 -- // non periodic transactions will start immediately in this uframe -- if(fiq_split_enable && qh->do_split && ((dwc_otg_hcd_get_frame_number(hcd) + 1) & 7) > 6) -- { -- g_next_sched_frame = dwc_otg_hcd_get_frame_number(hcd) | 7; -- break; -- } -- - status = - queue_transaction(hcd, qh->channel, - tx_status.b.nptxfspcavail); -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -index d3d6e997..0493dbf 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -@@ -168,10 +168,10 @@ static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe, - - /** Transaction types. */ - typedef enum dwc_otg_transaction_type { -- DWC_OTG_TRANSACTION_NONE = 0, -- DWC_OTG_TRANSACTION_PERIODIC = 1, -- DWC_OTG_TRANSACTION_NON_PERIODIC = 2, -- DWC_OTG_TRANSACTION_ALL = DWC_OTG_TRANSACTION_PERIODIC + DWC_OTG_TRANSACTION_NON_PERIODIC -+ DWC_OTG_TRANSACTION_NONE, -+ DWC_OTG_TRANSACTION_PERIODIC, -+ DWC_OTG_TRANSACTION_NON_PERIODIC, -+ DWC_OTG_TRANSACTION_ALL - } dwc_otg_transaction_type_e; - - struct dwc_otg_qh; -@@ -370,8 +370,6 @@ static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe, - - uint16_t speed; - uint16_t frame_usecs[8]; -- -- uint32_t skip_count; - } dwc_otg_qh_t; - - DWC_CIRCLEQ_HEAD(hc_list, dwc_hc); -@@ -576,10 +574,6 @@ struct dwc_otg_hcd { - /** Frame List */ - uint32_t *frame_list; - -- /** Hub - Port assignment */ -- int hub_port[16]; -- int hub_port_alloc[256]; -- - /** Frame List DMA address */ - dma_addr_t frame_list_dma; - -@@ -610,16 +604,12 @@ extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t - extern void dwc_otg_hcd_queue_transactions(dwc_otg_hcd_t * hcd, - dwc_otg_transaction_type_e tr_type); - --int dwc_otg_hcd_allocate_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh); --void dwc_otg_hcd_release_port(dwc_otg_hcd_t * dwc_otg_hcd, dwc_otg_qh_t *qh); -- -- - /** @} */ - - /** @name Interrupt Handler Functions */ - /** @{ */ - extern int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd); --extern int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * dwc_otg_hcd, int32_t); - extern int32_t dwc_otg_hcd_handle_rx_status_q_level_intr(dwc_otg_hcd_t * - dwc_otg_hcd); - extern int32_t dwc_otg_hcd_handle_np_tx_fifo_empty_intr(dwc_otg_hcd_t * -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -index e8b4d35..16e8c6c 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -@@ -38,7 +38,6 @@ - - #include - #include --#include - - - extern bool microframe_schedule; -@@ -53,295 +52,21 @@ - - void * dummy_send; - mphi_regs_t c_mphi_regs; --volatile void *dwc_regs_base; - int fiq_done, int_done; -- --gintsts_data_t gintsts_saved = {.d32 = 0}; --hcint_data_t hcint_saved[MAX_EPS_CHANNELS]; --hcintmsk_data_t hcintmsk_saved[MAX_EPS_CHANNELS]; --int split_out_xfersize[MAX_EPS_CHANNELS]; --haint_data_t haint_saved; -- --int g_next_sched_frame, g_np_count, g_np_sent; -+int g_next_sched_frame, g_np_count, g_np_sent, g_work_expected; - static int mphi_int_count = 0 ; - -+extern bool fiq_fix_enable, nak_holdoff_enable; -+ - hcchar_data_t nak_hcchar; - hctsiz_data_t nak_hctsiz; - hcsplt_data_t nak_hcsplt; - int nak_count; - --int complete_sched[MAX_EPS_CHANNELS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; --int split_start_frame[MAX_EPS_CHANNELS]; --int queued_port[MAX_EPS_CHANNELS]; -- --#ifdef FIQ_DEBUG --char buffer[1000*16]; --int wptr; --void _fiq_print(FIQDBG_T dbg_lvl, char *fmt, ...) --{ -- FIQDBG_T dbg_lvl_req = FIQDBG_PORTHUB; -- va_list args; -- char text[17]; -- hfnum_data_t hfnum = { .d32 = FIQ_READ(dwc_regs_base + 0x408) }; -- unsigned long flags; -- -- local_irq_save(flags); -- local_fiq_disable(); -- if(dbg_lvl & dbg_lvl_req || dbg_lvl == FIQDBG_ERR) -- { -- snprintf(text, 9, "%4d%d:%d ", hfnum.b.frnum/8, hfnum.b.frnum%8, 8 - hfnum.b.frrem/937); -- va_start(args, fmt); -- vsnprintf(text+8, 9, fmt, args); -- va_end(args); -- -- memcpy(buffer + wptr, text, 16); -- wptr = (wptr + 16) % sizeof(buffer); -- } -- local_irq_restore(flags); --} --#endif -- --void fiq_queue_request(int channel, int odd_frame) --{ -- hcchar_data_t hcchar = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x0) }; -- hcsplt_data_t hcsplt = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x4) }; -- hctsiz_data_t hctsiz = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x10) }; -- -- if(hcsplt.b.spltena == 0) -- { -- fiq_print(FIQDBG_ERR, "SPLTENA "); -- BUG(); -- } -- -- if(hcchar.b.epdir == 1) -- { -- fiq_print(FIQDBG_SCHED, "IN Ch %d", channel); -- } -- else -- { -- hctsiz.b.xfersize = 0; -- fiq_print(FIQDBG_SCHED, "OUT Ch %d", channel); -- } -- FIQ_WRITE((dwc_regs_base + 0x500 + (channel * 0x20) + 0x10), hctsiz.d32); -- -- hcsplt.b.compsplt = 1; -- FIQ_WRITE((dwc_regs_base + 0x500 + (channel * 0x20) + 0x4), hcsplt.d32); -- -- // Send the Split complete -- hcchar.b.chen = 1; -- hcchar.b.oddfrm = odd_frame ? 1 : 0; -- -- // Post this for transmit on the next frame for periodic or this frame for non-periodic -- fiq_print(FIQDBG_SCHED, "SND_%s", odd_frame ? "ODD " : "EVEN"); -- -- FIQ_WRITE((dwc_regs_base + 0x500 + (channel * 0x20) + 0x0), hcchar.d32); --} -- --static int last_sof = -1; -- --/* --** Function to handle the start of frame interrupt, choose whether we need to do anything and --** therefore trigger the main interrupt --** --** returns int != 0 - interrupt has been handled --*/ --int diff; -- --int fiq_sof_handle(hfnum_data_t hfnum) --{ -- int handled = 0; -- int i; -- -- // Just check that once we're running we don't miss a SOF -- /*if(last_sof != -1 && (hfnum.b.frnum != ((last_sof + 1) & 0x3fff))) -- { -- fiq_print(FIQDBG_ERR, "LASTSOF "); -- fiq_print(FIQDBG_ERR, "%4d%d ", last_sof / 8, last_sof & 7); -- fiq_print(FIQDBG_ERR, "%4d%d ", hfnum.b.frnum / 8, hfnum.b.frnum & 7); -- BUG(); -- }*/ -- -- // Only start remembering the last sof when the interrupt has been -- // enabled (we don't check the mask to come in here...) -- if(last_sof != -1 || FIQ_READ(dwc_regs_base + 0x18) & (1<<3)) -- last_sof = hfnum.b.frnum; -- -- for(i = 0; i < MAX_EPS_CHANNELS; i++) -- { -- if(complete_sched[i] != -1) -- { -- if(complete_sched[i] <= hfnum.b.frnum || (complete_sched[i] > 0x3f00 && hfnum.b.frnum < 0xf0)) -- { -- fiq_queue_request(i, hfnum.b.frnum & 1); -- complete_sched[i] = -1; -- } -- } -- -- if(complete_sched[i] != -1) -- { -- // This is because we've seen a split complete occur with no start... -- // most likely because missed the complete 0x3fff frames ago! -- -- diff = (hfnum.b.frnum + 0x3fff - complete_sched[i]) & 0x3fff ; -- if(diff > 32 && diff < 0x3f00) -- { -- fiq_print(FIQDBG_ERR, "SPLTMISS"); -- BUG(); -- } -- } -- } -- -- if(g_np_count == g_np_sent && dwc_frame_num_gt(g_next_sched_frame, hfnum.b.frnum)) -- { -- /* -- * If np_count != np_sent that means we need to queue non-periodic (bulk) packets this packet -- * g_next_sched_frame is the next frame we have periodic packets for -- * -- * if neither of these are required for this frame then just clear the interrupt -- */ -- handled = 1; -- -- } -- -- return handled; --} -- --int port_id(hcsplt_data_t hcsplt) --{ -- return hcsplt.b.prtaddr + (hcsplt.b.hubaddr << 8); --} -- --int fiq_hcintr_handle(int channel, hfnum_data_t hfnum) --{ -- hcchar_data_t hcchar = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x0) }; -- hcsplt_data_t hcsplt = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x4) }; -- hcint_data_t hcint = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x8) }; -- hcintmsk_data_t hcintmsk = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0xc) }; -- hctsiz_data_t hctsiz = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x10)}; -- -- hcint_saved[channel].d32 |= hcint.d32; -- hcintmsk_saved[channel].d32 = hcintmsk.d32; -- -- if(hcsplt.b.spltena) -- { -- fiq_print(FIQDBG_PORTHUB, "ph: %4x", port_id(hcsplt)); -- if(hcint.b.chhltd) -- { -- fiq_print(FIQDBG_SCHED, "CH HLT %d", channel); -- fiq_print(FIQDBG_SCHED, "%08x", hcint_saved[channel]); -- } -- if(hcint.b.stall || hcint.b.xacterr || hcint.b.bblerr || hcint.b.frmovrun || hcint.b.datatglerr) -- { -- queued_port[channel] = 0; -- fiq_print(FIQDBG_ERR, "CHAN ERR"); -- } -- if(hcint.b.xfercomp) -- { -- // Clear the port allocation and transmit anything also on this port -- queued_port[channel] = 0; -- fiq_print(FIQDBG_SCHED, "XFERCOMP"); -- } -- if(hcint.b.nak) -- { -- queued_port[channel] = 0; -- fiq_print(FIQDBG_SCHED, "NAK"); -- } -- if(hcint.b.ack && !hcsplt.b.compsplt) -- { -- int i; -- -- // Do not complete isochronous out transactions -- if(hcchar.b.eptype == 1 && hcchar.b.epdir == 0) -- { -- queued_port[channel] = 0; -- fiq_print(FIQDBG_SCHED, "ISOC_OUT"); -- } -- else -- { -- // Make sure we check the port / hub combination that we sent this split on. -- // Do not queue a second request to the same port -- for(i = 0; i < MAX_EPS_CHANNELS; i++) -- { -- if(port_id(hcsplt) == queued_port[i]) -- { -- fiq_print(FIQDBG_ERR, "PORTERR "); -- //BUG(); -- } -- } -- -- split_start_frame[channel] = (hfnum.b.frnum + 1) & ~7; -- -- // Note, the size of an OUT is in the start split phase, not -- // the complete split -- split_out_xfersize[channel] = hctsiz.b.xfersize; -- -- hcint_saved[channel].b.chhltd = 0; -- hcint_saved[channel].b.ack = 0; -- -- queued_port[channel] = port_id(hcsplt); -- -- if(hcchar.b.eptype & 1) -- { -- // Send the periodic complete in the same oddness frame as the ACK went... -- fiq_queue_request(channel, !(hfnum.b.frnum & 1)); -- // complete_sched[channel] = dwc_frame_num_inc(hfnum.b.frnum, 1); -- } -- else -- { -- // Schedule the split complete to occur later -- complete_sched[channel] = dwc_frame_num_inc(hfnum.b.frnum, 2); -- fiq_print(FIQDBG_SCHED, "ACK%04d%d", complete_sched[channel]/8, complete_sched[channel]%8); -- } -- } -- } -- if(hcint.b.nyet) -- { -- fiq_print(FIQDBG_ERR, "NYETERR1"); -- //BUG(); -- // Can transmit a split complete up to uframe .0 of the next frame -- if(hfnum.b.frnum <= dwc_frame_num_inc(split_start_frame[channel], 8)) -- { -- // Send it next frame -- if(hcchar.b.eptype & 1) // type 1 & 3 are interrupt & isoc -- { -- fiq_print(FIQDBG_SCHED, "NYT:SEND"); -- fiq_queue_request(channel, !(hfnum.b.frnum & 1)); -- } -- else -- { -- // Schedule non-periodic access for next frame (the odd-even bit doesn't effect NP) -- complete_sched[channel] = dwc_frame_num_inc(hfnum.b.frnum, 1); -- fiq_print(FIQDBG_SCHED, "NYT%04d%d", complete_sched[channel]/8, complete_sched[channel]%8); -- } -- hcint_saved[channel].b.chhltd = 0; -- hcint_saved[channel].b.nyet = 0; -- } -- else -- { -- queued_port[channel] = 0; -- fiq_print(FIQDBG_ERR, "NYETERR2"); -- //BUG(); -- } -- } -- } -- -- // Clear the interrupt, this will also clear the HAINT bit -- FIQ_WRITE((dwc_regs_base + 0x500 + (channel * 0x20) + 0x8), hcint.d32); -- return hcint_saved[channel].d32 == 0; --} -- --gintsts_data_t gintsts; --gintmsk_data_t gintmsk; --// triggered: The set of interrupts that were triggered --// handled: The set of interrupts that have been handled (no IRQ is --// required) --// keep: The set of interrupts we want to keep unmasked even though we --// want to trigger an IRQ to handle it (SOF and HCINTR) --gintsts_data_t triggered, handled, keep; --hfnum_data_t hfnum; -- - void __attribute__ ((naked)) dwc_otg_hcd_handle_fiq(void) - { -+ gintsts_data_t gintsts; -+ hfnum_data_t hfnum; - - /* entry takes care to store registers we will be treading on here */ - asm __volatile__ ( -@@ -349,112 +74,43 @@ void __attribute__ ((naked)) dwc_otg_hcd_handle_fiq(void) - /* stash FIQ and normal regs */ - "stmdb sp!, {r0-r12, lr};" - /* !! THIS SETS THE FRAME, adjust to > sizeof locals */ -- "sub fp, ip, #512 ;" -+ "sub fp, ip, #256 ;" - ); - -- // Cannot put local variables at the beginning of the function -- // because otherwise 'C' will play with the stack pointer. any locals -- // need to be inside the following block -- do -+ fiq_done++; -+ gintsts.d32 = FIQ_READ_IO_ADDRESS(USB_BASE + 0x14) & FIQ_READ_IO_ADDRESS(USB_BASE + 0x18); -+ hfnum.d32 = FIQ_READ_IO_ADDRESS(USB_BASE + 0x408); -+ -+ if(gintsts.d32) - { -- fiq_done++; -- gintsts.d32 = FIQ_READ(dwc_regs_base + 0x14); -- gintmsk.d32 = FIQ_READ(dwc_regs_base + 0x18); -- hfnum.d32 = FIQ_READ(dwc_regs_base + 0x408); -- triggered.d32 = gintsts.d32 & gintmsk.d32; -- handled.d32 = 0; -- keep.d32 = 0; -- fiq_print(FIQDBG_INT, "FIQ "); -- fiq_print(FIQDBG_INT, "%08x", gintsts.d32); -- fiq_print(FIQDBG_INT, "%08x", gintmsk.d32); -- if(gintsts.d32) -+ if(gintsts.b.sofintr && g_np_count == g_np_sent && dwc_frame_num_gt(g_next_sched_frame, hfnum.b.frnum)) - { -- // If port enabled -- if((FIQ_READ(dwc_regs_base + 0x440) & 0xf) == 0x5) -- { -- if(gintsts.b.sofintr) -- { -- if(fiq_sof_handle(hfnum)) -- { -- handled.b.sofintr = 1; /* Handled in FIQ */ -- } -- else -- { -- /* Keer interrupt unmasked */ -- keep.b.sofintr = 1; -- } -- { -- // Need to make sure the read and clearing of the SOF interrupt is as close as possible to avoid the possibility of missing -- // a start of frame interrupt -- gintsts_data_t gintsts = { .b.sofintr = 1 }; -- FIQ_WRITE((dwc_regs_base + 0x14), gintsts.d32); -- } -- } -- -- if(fiq_split_enable && gintsts.b.hcintr) -- { -- int i; -- haint_data_t haint; -- haintmsk_data_t haintmsk; -- -- haint.d32 = FIQ_READ(dwc_regs_base + 0x414); -- haintmsk.d32 = FIQ_READ(dwc_regs_base + 0x418); -- haint.d32 &= haintmsk.d32; -- haint_saved.d32 |= haint.d32; -- -- fiq_print(FIQDBG_INT, "hcintr"); -- fiq_print(FIQDBG_INT, "%08x", FIQ_READ(dwc_regs_base + 0x414)); -- -- // Go through each channel that has an enabled interrupt -- for(i = 0; i < 16; i++) -- if((haint.d32 >> i) & 1) -- if(fiq_hcintr_handle(i, hfnum)) -- haint_saved.d32 &= ~(1 << i); /* this was handled */ -- -- /* If we've handled all host channel interrupts then don't trigger the interrupt */ -- if(haint_saved.d32 == 0) -- { -- handled.b.hcintr = 1; -- } -- else -- { -- /* Make sure we keep the channel interrupt unmasked when triggering the IRQ */ -- keep.b.hcintr = 1; -- } -- -- { -- gintsts_data_t gintsts = { .b.hcintr = 1 }; -+ /* -+ * If np_count != np_sent that means we need to queue non-periodic (bulk) packets this packet -+ * g_next_sched_frame is the next frame we have periodic packets for -+ * -+ * if neither of these are required for this frame then just clear the interrupt -+ */ -+ gintsts.d32 = 0; -+ gintsts.b.sofintr = 1; -+ FIQ_WRITE_IO_ADDRESS((USB_BASE + 0x14), gintsts.d32); - -- // Always clear the channel interrupt -- FIQ_WRITE((dwc_regs_base + 0x14), gintsts.d32); -- } -- } -- } -- else -- { -- last_sof = -1; -- } -+ g_work_expected = 0; - } -- -- // Mask out the interrupts triggered - those handled - don't mask out the ones we want to keep -- gintmsk.d32 = keep.d32 | (gintmsk.d32 & ~(triggered.d32 & ~handled.d32)); -- // Save those that were triggered but not handled -- gintsts_saved.d32 |= triggered.d32 & ~handled.d32; -- FIQ_WRITE(dwc_regs_base + 0x18, gintmsk.d32); -- -- // Clear and save any unhandled interrupts and trigger the interrupt -- if(gintsts_saved.d32) -+ else - { -+ g_work_expected = 1; - /* To enable the MPHI interrupt (INT 32) - */ -- FIQ_WRITE( c_mphi_regs.outdda, (int) dummy_send); -+ FIQ_WRITE( c_mphi_regs.outdda, (int) dummy_send); - FIQ_WRITE( c_mphi_regs.outddb, (1 << 29)); - - mphi_int_count++; -+ /* Clear the USB global interrupt so we don't just sit in the FIQ */ -+ FIQ_MODIFY_IO_ADDRESS((USB_BASE + 0x8),1,0); -+ - } - } -- while(0); -- - mb(); - - /* exit back to normal mode restoring everything */ -@@ -477,7 +133,6 @@ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd) - - dwc_otg_core_if_t *core_if = dwc_otg_hcd->core_if; - gintsts_data_t gintsts; -- gintmsk_data_t gintmsk; - hfnum_data_t hfnum; - - #ifdef DEBUG -@@ -485,9 +140,6 @@ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd) - - #endif - -- gintsts.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintsts); -- gintmsk.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintmsk); -- - /* Exit from ISR if core is hibernated */ - if (core_if->hibernation_suspend == 1) { - goto exit_handler_routine; -@@ -495,18 +147,11 @@ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd) - DWC_SPINLOCK(dwc_otg_hcd->lock); - /* Check if HOST Mode */ - if (dwc_otg_is_host_mode(core_if)) { -- local_fiq_disable(); -- gintmsk.d32 |= gintsts_saved.d32; -- gintsts.d32 |= gintsts_saved.d32; -- gintsts_saved.d32 = 0; -- local_fiq_enable(); -+ gintsts.d32 = dwc_otg_read_core_intr(core_if); - if (!gintsts.d32) { - goto exit_handler_routine; - } -- gintsts.d32 &= gintmsk.d32; -- - #ifdef DEBUG -- // We should be OK doing this because the common interrupts should already have been serviced - /* Don't print debug message in the interrupt handler on SOF */ - #ifndef DEBUG_SOF - if (gintsts.d32 != DWC_SOF_INTR_MASK) -@@ -526,12 +171,11 @@ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd) - if (gintsts.b.sofintr && g_np_count == g_np_sent && dwc_frame_num_gt(g_next_sched_frame, hfnum.b.frnum)) - { - /* Note, we should never get here if the FIQ is doing it's job properly*/ -- retval |= dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd); -+ retval |= dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd, g_work_expected); - } - else if (gintsts.b.sofintr) { -- retval |= dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd); -+ retval |= dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd, g_work_expected); - } -- - if (gintsts.b.rxstsqlvl) { - retval |= - dwc_otg_hcd_handle_rx_status_q_level_intr -@@ -546,10 +190,7 @@ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd) - /** @todo Implement i2cintr handler. */ - } - if (gintsts.b.portintr) { -- -- gintmsk_data_t gintmsk = { .b.portintr = 1}; - retval |= dwc_otg_hcd_handle_port_intr(dwc_otg_hcd); -- DWC_MODIFY_REG32(&core_if->core_global_regs->gintmsk, 0, gintmsk.d32); - } - if (gintsts.b.hcintr) { - retval |= dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd); -@@ -586,35 +227,26 @@ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd) - - if (fiq_fix_enable) - { -- local_fiq_disable(); -- // Make sure that we don't clear the interrupt if we've still got pending work to do -- if(gintsts_saved.d32 == 0) -+ /* Clear the MPHI interrupt */ -+ DWC_WRITE_REG32(c_mphi_regs.intstat, (1<<16)); -+ if (mphi_int_count >= 60) - { -- /* Clear the MPHI interrupt */ -- DWC_WRITE_REG32(c_mphi_regs.intstat, (1<<16)); -- if (mphi_int_count >= 60) -- { -- DWC_WRITE_REG32(c_mphi_regs.ctrl, ((1<<31) + (1<<16))); -- while(!(DWC_READ_REG32(c_mphi_regs.ctrl) & (1 << 17))) -- ; -- DWC_WRITE_REG32(c_mphi_regs.ctrl, (1<<31)); -- mphi_int_count = 0; -- } -- int_done++; -+ DWC_WRITE_REG32(c_mphi_regs.ctrl, ((1<<31) + (1<<16))); -+ while(!(DWC_READ_REG32(c_mphi_regs.ctrl) & (1 << 17))) -+ ; -+ DWC_WRITE_REG32(c_mphi_regs.ctrl, (1<<31)); -+ mphi_int_count = 0; - } -- -- // Unmask handled interrupts -- FIQ_WRITE(dwc_regs_base + 0x18, gintmsk.d32); -- //DWC_MODIFY_REG32((uint32_t *)IO_ADDRESS(USB_BASE + 0x8), 0 , 1); -- -- local_fiq_enable(); -- -+ int_done++; - if((jiffies / HZ) > last_time) - { - /* Once a second output the fiq and irq numbers, useful for debug */ - last_time = jiffies / HZ; - DWC_DEBUGPL(DBG_USER, "int_done = %d fiq_done = %d\n", int_done, fiq_done); - } -+ -+ /* Re-Enable FIQ interrupt from USB peripheral */ -+ DWC_MODIFY_REG32((uint32_t *)IO_ADDRESS(USB_BASE + 0x8), 0 , 1); - } - - DWC_SPINUNLOCK(dwc_otg_hcd->lock); -@@ -662,12 +294,13 @@ static inline void track_missed_sofs(uint16_t curr_frame_number) - * (micro)frame. Periodic transactions may be queued to the controller for the - * next (micro)frame. - */ --int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * hcd) -+int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * hcd, int32_t work_expected) - { - hfnum_data_t hfnum; - dwc_list_link_t *qh_entry; - dwc_otg_qh_t *qh; - dwc_otg_transaction_type_e tr_type; -+ gintsts_data_t gintsts = {.d32 = 0 }; - int did_something = 0; - int32_t next_sched_frame = -1; - -@@ -693,7 +326,6 @@ int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * hcd) - qh = DWC_LIST_ENTRY(qh_entry, dwc_otg_qh_t, qh_list_entry); - qh_entry = qh_entry->next; - if (dwc_frame_num_le(qh->sched_frame, hcd->frame_number)) { -- - /* - * Move QH to the ready list to be executed next - * (micro)frame. -@@ -719,10 +351,15 @@ int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * hcd) - dwc_otg_hcd_queue_transactions(hcd, tr_type); - did_something = 1; - } -+ if(work_expected && !did_something) -+ DWC_DEBUGPL(DBG_USER, "Nothing to do !! frame = %x, g_next_sched_frame = %x\n", (int) hfnum.b.frnum, g_next_sched_frame); -+ if(!work_expected && did_something) -+ DWC_DEBUGPL(DBG_USER, "Unexpected work done !! frame = %x, g_next_sched_frame = %x\n", (int) hfnum.b.frnum, g_next_sched_frame); -+ - - /* Clear interrupt */ -- //gintsts.b.sofintr = 1; -- //DWC_WRITE_REG32(&hcd->core_if->core_global_regs->gintsts, gintsts.d32); -+ gintsts.b.sofintr = 1; -+ DWC_WRITE_REG32(&hcd->core_if->core_global_regs->gintsts, gintsts.d32); - - return 1; - } -@@ -1006,15 +643,6 @@ int32_t dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd_t * dwc_otg_hcd) - - haint.d32 = dwc_otg_read_host_all_channels_intr(dwc_otg_hcd->core_if); - -- // Overwrite with saved interrupts from fiq handler -- if(fiq_split_enable) -- { -- local_fiq_disable(); -- haint.d32 = haint_saved.d32; -- haint_saved.d32 = 0; -- local_fiq_enable(); -- } -- - for (i = 0; i < dwc_otg_hcd->core_if->core_params->host_channels; i++) { - if (haint.b2.chint & (1 << i)) { - retval |= dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd, i); -@@ -1055,10 +683,7 @@ static uint32_t get_actual_xfer_length(dwc_hc_t * hc, - *short_read = (hctsiz.b.xfersize != 0); - } - } else if (hc->qh->do_split) { -- if(fiq_split_enable) -- length = split_out_xfersize[hc->hc_num]; -- else -- length = qtd->ssplit_out_xfer_count; -+ length = qtd->ssplit_out_xfer_count; - } else { - length = hc->xfer_len; - } -@@ -1102,6 +727,7 @@ static int update_urb_state_xfer_comp(dwc_hc_t * hc, - DWC_OTG_HC_XFER_COMPLETE, - &short_read); - -+ - /* non DWORD-aligned buffer case handling. */ - if (hc->align_buff && xfer_length && hc->ep_is_in) { - dwc_memcpy(urb->buf + urb->actual_length, hc->qh->dw_align_buf, -@@ -1304,9 +930,6 @@ static void release_channel(dwc_otg_hcd_t * hcd, - int free_qtd; - dwc_irqflags_t flags; - dwc_spinlock_t *channel_lock = hcd->channel_lock; --#ifdef FIQ_DEBUG -- int endp = qtd->urb ? qtd->urb->pipe_info.ep_num : 0; --#endif - - DWC_DEBUGPL(DBG_HCDV, " %s: channel %d, halt_status %d, xfer_len %d\n", - __func__, hc->hc_num, halt_status, hc->xfer_len); -@@ -1385,24 +1008,9 @@ static void release_channel(dwc_otg_hcd_t * hcd, - - DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - hcd->available_host_channels++; -- fiq_print(FIQDBG_PORTHUB, "AHC = %d ", hcd->available_host_channels); - DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - } - -- if(fiq_split_enable && hc->do_split) -- { -- if(!(hcd->hub_port[hc->hub_addr] & (1 << hc->port_addr))) -- { -- fiq_print(FIQDBG_ERR, "PRTNOTAL"); -- //BUG(); -- } -- -- hcd->hub_port[hc->hub_addr] &= ~(1 << hc->port_addr); -- hcd->hub_port_alloc[hc->hub_addr * 16 + hc->port_addr] = -1; -- -- fiq_print(FIQDBG_PORTHUB, "H%dP%d:RR%d", hc->hub_addr, hc->port_addr, endp); -- } -- - /* Try to queue more transfers now that there's a free channel. */ - tr_type = dwc_otg_hcd_select_transactions(hcd); - if (tr_type != DWC_OTG_TRANSACTION_NONE) { -@@ -2025,10 +1633,8 @@ static int32_t handle_hc_nyet_intr(dwc_otg_hcd_t * hcd, - hc->ep_type == DWC_OTG_EP_TYPE_ISOC) { - int frnum = dwc_otg_hcd_get_frame_number(hcd); - -- // With the FIQ running we only ever see the failed NYET - if (dwc_full_frame_num(frnum) != -- dwc_full_frame_num(hc->qh->sched_frame) || -- fiq_split_enable) { -+ dwc_full_frame_num(hc->qh->sched_frame)) { - /* - * No longer in the same full speed frame. - * Treat this as a transaction error. -@@ -2406,10 +2012,10 @@ static inline int halt_status_ok(dwc_otg_hcd_t * hcd, - static void handle_hc_chhltd_intr_dma(dwc_otg_hcd_t * hcd, - dwc_hc_t * hc, - dwc_otg_hc_regs_t * hc_regs, -- dwc_otg_qtd_t * qtd, -- hcint_data_t hcint, -- hcintmsk_data_t hcintmsk) -+ dwc_otg_qtd_t * qtd) - { -+ hcint_data_t hcint; -+ hcintmsk_data_t hcintmsk; - int out_nak_enh = 0; - - /* For core with OUT NAK enhancement, the flow for high- -@@ -2441,11 +2047,8 @@ static void handle_hc_chhltd_intr_dma(dwc_otg_hcd_t * hcd, - } - - /* Read the HCINTn register to determine the cause for the halt. */ -- if(!fiq_split_enable) -- { -- hcint.d32 = DWC_READ_REG32(&hc_regs->hcint); -- hcintmsk.d32 = DWC_READ_REG32(&hc_regs->hcintmsk); -- } -+ hcint.d32 = DWC_READ_REG32(&hc_regs->hcint); -+ hcintmsk.d32 = DWC_READ_REG32(&hc_regs->hcintmsk); - - if (hcint.b.xfercomp) { - /** @todo This is here because of a possible hardware bug. Spec -@@ -2558,15 +2161,13 @@ static void handle_hc_chhltd_intr_dma(dwc_otg_hcd_t * hcd, - static int32_t handle_hc_chhltd_intr(dwc_otg_hcd_t * hcd, - dwc_hc_t * hc, - dwc_otg_hc_regs_t * hc_regs, -- dwc_otg_qtd_t * qtd, -- hcint_data_t hcint, -- hcintmsk_data_t hcintmsk) -+ dwc_otg_qtd_t * qtd) - { - DWC_DEBUGPL(DBG_HCDI, "--Host Channel %d Interrupt: " - "Channel Halted--\n", hc->hc_num); - - if (hcd->core_if->dma_enable) { -- handle_hc_chhltd_intr_dma(hcd, hc, hc_regs, qtd, hcint, hcintmsk); -+ handle_hc_chhltd_intr_dma(hcd, hc, hc_regs, qtd); - } else { - #ifdef DEBUG - if (!halt_status_ok(hcd, hc, hc_regs, qtd)) { -@@ -2583,7 +2184,7 @@ static int32_t handle_hc_chhltd_intr(dwc_otg_hcd_t * hcd, - int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, uint32_t num) - { - int retval = 0; -- hcint_data_t hcint, hcint_orig; -+ hcint_data_t hcint; - hcintmsk_data_t hcintmsk; - dwc_hc_t *hc; - dwc_otg_hc_regs_t *hc_regs; -@@ -2596,23 +2197,12 @@ int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, uint32_t num) - qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); - - hcint.d32 = DWC_READ_REG32(&hc_regs->hcint); -- hcint_orig = hcint; - hcintmsk.d32 = DWC_READ_REG32(&hc_regs->hcintmsk); - DWC_DEBUGPL(DBG_HCDV, - " hcint 0x%08x, hcintmsk 0x%08x, hcint&hcintmsk 0x%08x\n", - hcint.d32, hcintmsk.d32, (hcint.d32 & hcintmsk.d32)); - hcint.d32 = hcint.d32 & hcintmsk.d32; - -- if(fiq_split_enable) -- { -- // replace with the saved interrupts from the fiq handler -- local_fiq_disable(); -- hcint_orig.d32 = hcint_saved[num].d32; -- hcint.d32 = hcint_orig.d32 & hcintmsk_saved[num].d32; -- hcint_saved[num].d32 = 0; -- local_fiq_enable(); -- } -- - if (!dwc_otg_hcd->core_if->dma_enable) { - if (hcint.b.chhltd && hcint.d32 != 0x2) { - hcint.b.chhltd = 0; -@@ -2630,7 +2220,7 @@ int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, uint32_t num) - hcint.b.nyet = 0; - } - if (hcint.b.chhltd) { -- retval |= handle_hc_chhltd_intr(dwc_otg_hcd, hc, hc_regs, qtd, hcint_orig, hcintmsk_saved[num]); -+ retval |= handle_hc_chhltd_intr(dwc_otg_hcd, hc, hc_regs, qtd); - } - if (hcint.b.ahberr) { - retval |= handle_hc_ahberr_intr(dwc_otg_hcd, hc, hc_regs, qtd); -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c -index 0d6f5f4..fef557d 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c -@@ -392,11 +392,7 @@ static int _complete(dwc_otg_hcd_t * hcd, void *urb_handle, - static struct fiq_handler fh = { - .name = "usb_fiq", - }; --struct fiq_stack_s { -- int magic1; -- uint8_t stack[2048]; -- int magic2; --} fiq_stack; -+static uint8_t fiqStack[1024]; - - extern mphi_regs_t c_mphi_regs; - /** -@@ -438,11 +434,9 @@ int hcd_init(dwc_bus_dev_t *_dev) - memset(®s,0,sizeof(regs)); - regs.ARM_r8 = (long)dwc_otg_hcd_handle_fiq; - regs.ARM_r9 = (long)0; -- regs.ARM_sp = (long)fiq_stack.stack + sizeof(fiq_stack.stack) - 4; -+ regs.ARM_sp = (long)fiqStack + sizeof(fiqStack) - 4; - set_fiq_regs(®s); -- fiq_stack.magic1 = 0xdeadbeef; -- fiq_stack.magic2 = 0xaa995566; -- } -+ } - - /* - * Allocate memory for the base HCD plus the DWC OTG HCD. -@@ -465,8 +459,6 @@ int hcd_init(dwc_bus_dev_t *_dev) - - if (fiq_fix_enable) - { -- volatile extern void *dwc_regs_base; -- - //Set the mphi periph to the required registers - c_mphi_regs.base = otg_dev->os_dep.mphi_base; - c_mphi_regs.ctrl = otg_dev->os_dep.mphi_base + 0x4c; -@@ -474,8 +466,6 @@ int hcd_init(dwc_bus_dev_t *_dev) - c_mphi_regs.outddb = otg_dev->os_dep.mphi_base + 0x2c; - c_mphi_regs.intstat = otg_dev->os_dep.mphi_base + 0x50; - -- dwc_regs_base = otg_dev->os_dep.base; -- - //Enable mphi peripheral - writel((1<<31),c_mphi_regs.ctrl); - #ifdef DEBUG -@@ -849,8 +839,6 @@ static int dwc_otg_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) - usb_hcd_unlink_urb_from_ep(hcd, urb); - #endif - DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, flags); -- -- - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) - usb_hcd_giveback_urb(hcd, urb); - #else -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -index 8125307..b3e6e52 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -@@ -41,7 +41,6 @@ - - #include "dwc_otg_hcd.h" - #include "dwc_otg_regs.h" --#include "dwc_otg_mphi_fix.h" - - extern bool microframe_schedule; - -@@ -192,7 +191,6 @@ void qh_init(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, dwc_otg_hcd_urb_t * urb) - dwc_otg_hcd_get_ep_num(&urb->pipe_info), hub_addr, - hub_port); - qh->do_split = 1; -- qh->skip_count = 0; - } - - if (qh->ep_type == UE_INTERRUPT || qh->ep_type == UE_ISOCHRONOUS) { -@@ -739,9 +737,6 @@ void dwc_otg_hcd_qh_remove(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - hcd->non_periodic_qh_ptr->next; - } - DWC_LIST_REMOVE_INIT(&qh->qh_list_entry); -- -- // If we've removed the last non-periodic entry then there are none left! -- g_np_count = g_np_sent; - } else { - deschedule_periodic(hcd, qh); - hcd->periodic_qh_count--; -@@ -771,21 +766,21 @@ void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, - { - if (dwc_qh_is_non_per(qh)) { - -- dwc_otg_qh_t *qh_tmp; -- dwc_list_link_t *qh_list; -- DWC_LIST_FOREACH(qh_list, &hcd->non_periodic_sched_inactive) -+ dwc_otg_qh_t *qh_tmp; -+ dwc_list_link_t *qh_list; -+ DWC_LIST_FOREACH(qh_list, &hcd->non_periodic_sched_inactive) -+ { -+ qh_tmp = DWC_LIST_ENTRY(qh_list, struct dwc_otg_qh, qh_list_entry); -+ if(qh_tmp == qh) - { -- qh_tmp = DWC_LIST_ENTRY(qh_list, struct dwc_otg_qh, qh_list_entry); -- if(qh_tmp == qh) -- { -- /* -- * FIQ is being disabled because this one nevers gets a np_count increment -- * This is still not absolutely correct, but it should fix itself with -- * just an unnecessary extra interrupt -- */ -- g_np_sent = g_np_count; -- } -+ /* -+ * FIQ is being disabled because this one nevers gets a np_count increment -+ * This is still not absolutely correct, but it should fix itself with -+ * just an unnecessary extra interrupt -+ */ -+ g_np_sent = g_np_count; - } -+ } - - - dwc_otg_hcd_qh_remove(hcd, qh); -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h b/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h -index ca17379..22f28e1 100755 ---- a/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h -+++ b/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h -@@ -1,7 +1,10 @@ - #ifndef __DWC_OTG_MPHI_FIX_H__ - #define __DWC_OTG_MPHI_FIX_H__ --#define FIQ_WRITE(_addr_,_data_) (*(volatile uint32_t *) (_addr_) = (_data_)) --#define FIQ_READ(_addr_) (*(volatile uint32_t *) (_addr_)) -+ -+#define FIQ_WRITE_IO_ADDRESS(_addr_,_data_) *(volatile uint32_t *) IO_ADDRESS(_addr_) = _data_ -+#define FIQ_READ_IO_ADDRESS(_addr_) *(volatile uint32_t *) IO_ADDRESS(_addr_) -+#define FIQ_MODIFY_IO_ADDRESS(_addr_,_clear_,_set_) FIQ_WRITE_IO_ADDRESS(_addr_ , (FIQ_READ_IO_ADDRESS(_addr_)&~_clear_)|_set_) -+#define FIQ_WRITE(_addr_,_data_) *(volatile uint32_t *) _addr_ = _data_ - - typedef struct { - volatile void* base; -@@ -9,13 +12,13 @@ - volatile void* outdda; - volatile void* outddb; - volatile void* intstat; --} mphi_regs_t; -+} mphi_regs_t; - - void dwc_debug_print_core_int_reg(gintsts_data_t gintsts, const char* function_name); - void dwc_debug_core_int_mask(gintsts_data_t gintmsk, const char* function_name); - void dwc_debug_otg_int(gotgint_data_t gotgint, const char* function_name); - --extern gintsts_data_t gintsts_saved; -+ - - #ifdef DEBUG - #define DWC_DBG_PRINT_CORE_INT(_arg_) dwc_debug_print_core_int_reg(_arg_,__func__) -@@ -27,22 +30,7 @@ - #define DWC_DBG_PRINT_CORE_INT_MASK(_arg_) - #define DWC_DBG_PRINT_OTG_INT(_arg_) - --#endif -- --typedef enum { -- FIQDBG_SCHED = (1 << 0), -- FIQDBG_INT = (1 << 1), -- FIQDBG_ERR = (1 << 2), -- FIQDBG_PORTHUB = (1 << 3), --} FIQDBG_T; - --void _fiq_print(FIQDBG_T dbg_lvl, char *fmt, ...); --#ifdef FIQ_DEBUG --#define fiq_print _fiq_print --#else --#define fiq_print(x, y, ...) - #endif - --extern bool fiq_fix_enable, nak_holdoff_enable, fiq_split_enable; -- - #endif -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c -index 9720937..27061d3 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c -@@ -4276,7 +4276,7 @@ static int32_t dwc_otg_pcd_handle_out_ep_intr(dwc_otg_pcd_t * pcd) - && (pcd->ep0state == EP0_OUT_DATA_PHASE)) - status.d32 = core_if->dev_if->out_desc_addr->status.d32; - if (pcd->ep0state == EP0_OUT_STATUS_PHASE) -- status.d32 = core_if->dev_if-> -+ status.d32 = status.d32 = core_if->dev_if-> - out_desc_addr->status.d32; - - if (status.b.sr) { --- -1.8.1.6 - - -From 2fa497bfb56426ce8934f3a0ca3ac85a5c2e6008 Mon Sep 17 00:00:00 2001 +From 36657f543f34a08f35d438911997ac6eab7a9bfd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 13:55:00 +0100 -Subject: [PATCH 91/91] hack: fix for incorrect uart fifo size detection +Subject: [PATCH 90/99] hack: fix for incorrect uart fifo size detection --- drivers/tty/serial/amba-pl011.c | 2 +- @@ -100547,3 +99126,496 @@ index e2774f9..5254f10 100644 -- 1.8.1.6 + +From 894b002d9f89d5e68ef2b28fb190b4a983096ec7 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 10 Jul 2013 23:53:31 +0100 +Subject: [PATCH 93/99] sdhci-bcm2807: Increase sync_after_dma timeout + +The current timeout is being hit with some cards that complete successfully with a longer timeout. +The timeout is not handled well, and is believed to be a code path that causes corruption. +872a8ff suggests that crappy cards can take up to 3 seconds to respond +--- + drivers/mmc/host/sdhci-bcm2708.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index c2409b9..4770680 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -842,7 +842,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, + We get CRC and DEND errors unless we wait for + the SD controller to finish reading/writing to the card. */ + u32 state_mask; +- int timeout=30*5000; ++ int timeout=3*1000*1000; + + DBG("PDMA over - sync card\n"); + if (data->flags & MMC_DATA_READ) +-- +1.8.1.6 + + +From 7d1ed3501217a5c3d40fbdf2d8168ceca2517c54 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 15 Jul 2013 23:55:52 +0100 +Subject: [PATCH 94/99] dcw_otg: avoid logging function that can cause panics + +See: https://github.com/raspberrypi/firmware/issues/21 +Thanks to cleverca22 for fix +--- + drivers/usb/host/dwc_otg/dwc_otg_attr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_attr.c b/drivers/usb/host/dwc_otg/dwc_otg_attr.c +index 9602fda..c6966af 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_attr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_attr.c +@@ -920,7 +920,7 @@ static ssize_t spramdump_show(struct device *_dev, + { + dwc_otg_device_t *otg_dev = dwc_otg_drvdev(_dev); + +- dwc_otg_dump_spram(otg_dev->core_if); ++ //dwc_otg_dump_spram(otg_dev->core_if); + + return sprintf(buf, "SPRAM Dump\n"); + } +-- +1.8.1.6 + + +From 2b902d2bcd1ae9e5801a24615aaaa9129680a639 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Sat, 13 Jul 2013 20:41:26 +0100 +Subject: [PATCH 95/99] dwc_otg: mask correct interrupts after transaction + error recovery + +The dwc_otg driver will unmask certain interrupts on a transaction +that previously halted in the error state in order to reset the +QTD error count. The various fine-grained interrupt handlers do not +consider that other interrupts besides themselves were unmasked. + +By disabling the two other interrupts only ever enabled in DMA mode +for this purpose, we can avoid unnecessary function calls in the +IRQ handler. This will also prevent an unneccesary FIQ interrupt +from being generated if the FIQ is enabled. +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +index e8b4d35..27b673f 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -1851,7 +1851,11 @@ static int32_t handle_hc_nak_intr(dwc_otg_hcd_t * hcd, + * transfers in DMA mode for the sole purpose of + * resetting the error count after a transaction error + * occurs. The core will continue transferring data. ++ * Disable other interrupts unmasked for the same ++ * reason. + */ ++ disable_hc_int(hc_regs, datatglerr); ++ disable_hc_int(hc_regs, ack); + qtd->error_count = 0; + goto handle_nak_done; + } +@@ -1963,6 +1967,15 @@ static int32_t handle_hc_ack_intr(dwc_otg_hcd_t * hcd, + halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_ACK); + } + } else { ++ /* ++ * An unmasked ACK on a non-split DMA transaction is ++ * for the sole purpose of resetting error counts. Disable other ++ * interrupts unmasked for the same reason. ++ */ ++ if(hcd->core_if->dma_enable) { ++ disable_hc_int(hc_regs, datatglerr); ++ disable_hc_int(hc_regs, nak); ++ } + qtd->error_count = 0; + + if (hc->qh->ping_state) { +@@ -2328,6 +2341,14 @@ static int32_t handle_hc_datatglerr_intr(dwc_otg_hcd_t * hcd, + qtd->urb, qtd, DWC_OTG_HC_XFER_XACT_ERR); + halt_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_XACT_ERR); + } else if (hc->ep_is_in) { ++ /* An unmasked data toggle error on a non-split DMA transaction is ++ * for the sole purpose of resetting error counts. Disable other ++ * interrupts unmasked for the same reason. ++ */ ++ if(hcd->core_if->dma_enable) { ++ disable_hc_int(hc_regs, ack); ++ disable_hc_int(hc_regs, nak); ++ } + qtd->error_count = 0; + } + +-- +1.8.1.6 + + +From 07ce82f9461cb966d2ee549bcd44e59d4019bf5e Mon Sep 17 00:00:00 2001 +From: P33M +Date: Sat, 13 Jul 2013 21:48:41 +0100 +Subject: [PATCH 96/99] dwc_otg: fiq: prevent FIQ thrash and incorrect state + passing to IRQ + +In the case of a transaction to a device that had previously aborted +due to an error, several interrupts are enabled to reset the error +count when a device responds. This has the side-effect of making the +FIQ thrash because the hardware will generate multiple instances of +a NAK on an IN bulk/interrupt endpoint and multiple instances of ACK +on an OUT bulk/interrupt endpoint. Make the FIQ mask and clear the +associated interrupts. + +Additionally, on non-split transactions make sure that only unmasked +interrupts are cleared. This caused a hard-to-trigger but serious +race condition when you had the combination of an endpoint awaiting +error recovery and a transaction completed on an endpoint - due to +the sequencing and timing of interrupts generated by the dwc_otg core, +it was possible to confuse the IRQ handler. +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +index 27b673f..d655363 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -324,6 +324,27 @@ int fiq_hcintr_handle(int channel, hfnum_data_t hfnum) + } + } + } ++ else ++ { ++ /* ++ * If we have any of NAK, ACK, Datatlgerr active on a ++ * non-split channel, the sole reason is to reset error ++ * counts for a previously broken transaction. The FIQ ++ * will thrash on NAK IN and ACK OUT in particular so ++ * handle it "once" and allow the IRQ to do the rest. ++ */ ++ hcint.d32 &= hcintmsk.d32; ++ if(hcint.b.nak) ++ { ++ hcintmsk.b.nak = 0; ++ FIQ_WRITE((dwc_regs_base + 0x500 + (channel * 0x20) + 0xc), hcintmsk.d32); ++ } ++ if (hcint.b.ack) ++ { ++ hcintmsk.b.ack = 0; ++ FIQ_WRITE((dwc_regs_base + 0x500 + (channel * 0x20) + 0xc), hcintmsk.d32); ++ } ++ } + + // Clear the interrupt, this will also clear the HAINT bit + FIQ_WRITE((dwc_regs_base + 0x500 + (channel * 0x20) + 0x8), hcint.d32); +-- +1.8.1.6 + + +From 2538878c1c3ec2da6d3cbf13d3e2820b06ce5ac5 Mon Sep 17 00:00:00 2001 +From: Gordon Hollingworth +Date: Mon, 8 Jul 2013 04:12:19 +0100 +Subject: [PATCH 97/99] Fix function tracing + +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +index d655363..765451b 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -77,7 +77,7 @@ + #ifdef FIQ_DEBUG + char buffer[1000*16]; + int wptr; +-void _fiq_print(FIQDBG_T dbg_lvl, char *fmt, ...) ++void notrace _fiq_print(FIQDBG_T dbg_lvl, char *fmt, ...) + { + FIQDBG_T dbg_lvl_req = FIQDBG_PORTHUB; + va_list args; +@@ -101,7 +101,7 @@ void _fiq_print(FIQDBG_T dbg_lvl, char *fmt, ...) + } + #endif + +-void fiq_queue_request(int channel, int odd_frame) ++void notrace fiq_queue_request(int channel, int odd_frame) + { + hcchar_data_t hcchar = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x0) }; + hcsplt_data_t hcsplt = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x4) }; +@@ -147,7 +147,7 @@ void fiq_queue_request(int channel, int odd_frame) + */ + int diff; + +-int fiq_sof_handle(hfnum_data_t hfnum) ++int notrace fiq_sof_handle(hfnum_data_t hfnum) + { + int handled = 0; + int i; +@@ -206,12 +206,12 @@ int fiq_sof_handle(hfnum_data_t hfnum) + return handled; + } + +-int port_id(hcsplt_data_t hcsplt) ++int notrace port_id(hcsplt_data_t hcsplt) + { + return hcsplt.b.prtaddr + (hcsplt.b.hubaddr << 8); + } + +-int fiq_hcintr_handle(int channel, hfnum_data_t hfnum) ++int notrace fiq_hcintr_handle(int channel, hfnum_data_t hfnum) + { + hcchar_data_t hcchar = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x0) }; + hcsplt_data_t hcsplt = { .d32 = FIQ_READ(dwc_regs_base + 0x500 + (channel * 0x20) + 0x4) }; +@@ -361,7 +361,7 @@ int fiq_hcintr_handle(int channel, hfnum_data_t hfnum) + gintsts_data_t triggered, handled, keep; + hfnum_data_t hfnum; + +-void __attribute__ ((naked)) dwc_otg_hcd_handle_fiq(void) ++void __attribute__ ((naked)) notrace dwc_otg_hcd_handle_fiq(void) + { + + /* entry takes care to store registers we will be treading on here */ +-- +1.8.1.6 + + +From 3199ec63629973afe0dc99a9f11cf83b0f0a3c12 Mon Sep 17 00:00:00 2001 +From: P33M +Date: Thu, 18 Jul 2013 16:32:41 +0100 +Subject: [PATCH 98/99] dwc_otg: whitespace cleanup in dwc_otg_urb_enqueue + +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 59 ++++++++++++++-------------- + 1 file changed, 29 insertions(+), 30 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +index 0d6f5f4..0f72bd5 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +@@ -733,10 +733,10 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd, + if(dwc_otg_urb == NULL) + return -ENOMEM; + +- urb->hcpriv = dwc_otg_urb; +- if (!dwc_otg_urb && urb->number_of_packets) +- return -ENOMEM; +- ++ urb->hcpriv = dwc_otg_urb; ++ if (!dwc_otg_urb && urb->number_of_packets) ++ return -ENOMEM; ++ + dwc_otg_hcd_urb_set_pipeinfo(dwc_otg_urb, usb_pipedevice(urb->pipe), + usb_pipeendpoint(urb->pipe), ep_type, + usb_pipein(urb->pipe), +@@ -776,36 +776,35 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd, + } + + #if USB_URB_EP_LINKING +- DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &irqflags); ++ DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &irqflags); + retval = usb_hcd_link_urb_to_ep(hcd, urb); +- DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, irqflags); +- if (0 == retval) ++ DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, irqflags); ++ if (0 == retval) + #endif +- { +- retval = dwc_otg_hcd_urb_enqueue(dwc_otg_hcd, dwc_otg_urb, +- /*(dwc_otg_qh_t **)*/ +- ref_ep_hcpriv, +- mem_flags == GFP_ATOMIC ? 1 : 0); +- if (0 == retval) { +- if (alloc_bandwidth) { +- allocate_bus_bandwidth(hcd, +- dwc_otg_hcd_get_ep_bandwidth( +- dwc_otg_hcd, *ref_ep_hcpriv), +- urb); +- } +- } else { ++ { ++ retval = dwc_otg_hcd_urb_enqueue(dwc_otg_hcd, dwc_otg_urb, ++ /*(dwc_otg_qh_t **)*/ ++ ref_ep_hcpriv, ++ mem_flags == GFP_ATOMIC ? 1 : 0); ++ if (0 == retval) { ++ if (alloc_bandwidth) { ++ allocate_bus_bandwidth(hcd, ++ dwc_otg_hcd_get_ep_bandwidth( ++ dwc_otg_hcd, *ref_ep_hcpriv), ++ urb); ++ } ++ } else { + #if USB_URB_EP_LINKING +- dwc_irqflags_t irqflags; +- DWC_DEBUGPL(DBG_HCD, "DWC OTG dwc_otg_hcd_urb_enqueue failed rc %d\n", retval); +- DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &irqflags); +- usb_hcd_unlink_urb_from_ep(hcd, urb); +- DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, irqflags); ++ dwc_irqflags_t irqflags; ++ DWC_DEBUGPL(DBG_HCD, "DWC OTG dwc_otg_hcd_urb_enqueue failed rc %d\n", retval); ++ DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &irqflags); ++ usb_hcd_unlink_urb_from_ep(hcd, urb); ++ DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, irqflags); + #endif +- if (retval == -DWC_E_NO_DEVICE) { +- retval = -ENODEV; +- } +- } +- } ++ if (retval == -DWC_E_NO_DEVICE) ++ retval = -ENODEV; ++ } ++ } + return retval; + } + +-- +1.8.1.6 + + +From b04d3b18742ce3a66b166c4bd7dabce67950c0ec Mon Sep 17 00:00:00 2001 +From: P33M +Date: Thu, 18 Jul 2013 17:07:26 +0100 +Subject: [PATCH 99/99] dwc_otg: prevent OOPSes during device disconnects + +The dwc_otg_urb_enqueue function is thread-unsafe. In particular the +access of urb->hcpriv, usb_hcd_link_urb_to_ep, dwc_otg_urb->qtd and +friends does not occur within a critical section and so if a device +was unplugged during activity there was a high chance that the +usbcore hub_thread would try to disable the endpoint with partially- +formed entries in the URB queue. This would result in BUG() or null +pointer dereferences. + +Fix so that access of urb->hcpriv, enqueuing to the hardware and +adding to usbcore endpoint URB lists is contained within a single +critical section. +--- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 3 --- + drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 14 +++++--------- + drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 6 +----- + 3 files changed, 6 insertions(+), 17 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index af9108c..a1970dc 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -464,7 +464,6 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t * hcd, + dwc_otg_hcd_urb_t * dwc_otg_urb, void **ep_handle, + int atomic_alloc) + { +- dwc_irqflags_t flags; + int retval = 0; + uint8_t needs_scheduling = 0; + dwc_otg_transaction_type_e tr_type; +@@ -515,12 +514,10 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t * hcd, + } + + if(needs_scheduling) { +- DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); + tr_type = dwc_otg_hcd_select_transactions(hcd); + if (tr_type != DWC_OTG_TRANSACTION_NONE) { + dwc_otg_hcd_queue_transactions(hcd, tr_type); + } +- DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); + } + return retval; + } +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +index 0f72bd5..ad03ff1 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +@@ -679,9 +679,7 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd, + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) + struct usb_host_endpoint *ep = urb->ep; + #endif +-#if USB_URB_EP_LINKING + dwc_irqflags_t irqflags; +-#endif + void **ref_ep_hcpriv = &ep->hcpriv; + dwc_otg_hcd_t *dwc_otg_hcd = hcd_to_dwc_otg_hcd(hcd); + dwc_otg_hcd_urb_t *dwc_otg_urb; +@@ -733,7 +731,6 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd, + if(dwc_otg_urb == NULL) + return -ENOMEM; + +- urb->hcpriv = dwc_otg_urb; + if (!dwc_otg_urb && urb->number_of_packets) + return -ENOMEM; + +@@ -775,10 +772,10 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd, + iso_frame_desc[i].length); + } + +-#if USB_URB_EP_LINKING + DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &irqflags); ++ urb->hcpriv = dwc_otg_urb; ++#if USB_URB_EP_LINKING + retval = usb_hcd_link_urb_to_ep(hcd, urb); +- DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, irqflags); + if (0 == retval) + #endif + { +@@ -794,17 +791,16 @@ static int dwc_otg_urb_enqueue(struct usb_hcd *hcd, + urb); + } + } else { +-#if USB_URB_EP_LINKING +- dwc_irqflags_t irqflags; + DWC_DEBUGPL(DBG_HCD, "DWC OTG dwc_otg_hcd_urb_enqueue failed rc %d\n", retval); +- DWC_SPINLOCK_IRQSAVE(dwc_otg_hcd->lock, &irqflags); ++#if USB_URB_EP_LINKING + usb_hcd_unlink_urb_from_ep(hcd, urb); +- DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, irqflags); + #endif ++ urb->hcpriv = NULL; + if (retval == -DWC_E_NO_DEVICE) + retval = -ENODEV; + } + } ++ DWC_SPINUNLOCK_IRQRESTORE(dwc_otg_hcd->lock, irqflags); + return retval; + } + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +index 8125307..5aed416 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +@@ -919,6 +919,7 @@ void dwc_otg_hcd_qtd_init(dwc_otg_qtd_t * qtd, dwc_otg_hcd_urb_t * urb) + * QH to place the QTD into. If it does not find a QH, then it will create a + * new QH. If the QH to which the QTD is added is not currently scheduled, it + * is placed into the proper schedule based on its EP type. ++ * HCD lock must be held and interrupts must be disabled on entry + * + * @param[in] qtd The QTD to add + * @param[in] hcd The DWC HCD structure +@@ -931,8 +932,6 @@ int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, + dwc_otg_hcd_t * hcd, dwc_otg_qh_t ** qh, int atomic_alloc) + { + int retval = 0; +- dwc_irqflags_t flags; +- + dwc_otg_hcd_urb_t *urb = qtd->urb; + + /* +@@ -946,15 +945,12 @@ int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, + goto done; + } + } +- DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); + retval = dwc_otg_hcd_qh_add(hcd, *qh); + if (retval == 0) { + DWC_CIRCLEQ_INSERT_TAIL(&((*qh)->qtd_list), qtd, + qtd_list_entry); + qtd->qh = *qh; + } +- DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); +- + done: + + return retval; +-- +1.8.1.6 +