diff --git a/packages/linux/meta b/packages/linux/meta index 6b03fe7197..60701b55ce 100644 --- a/packages/linux/meta +++ b/packages/linux/meta @@ -19,7 +19,7 @@ ################################################################################ PKG_NAME="linux" -PKG_VERSION="3.2.19" +PKG_VERSION="3.2.20" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/linux/patches/linux-3.2.19-611-RPi_mmc-fixes.patch b/packages/linux/patches/linux-3.2.19-611-RPi_mmc-fixes.patch deleted file mode 100644 index 0e268a173a..0000000000 --- a/packages/linux/patches/linux-3.2.19-611-RPi_mmc-fixes.patch +++ /dev/null @@ -1,285 +0,0 @@ -From c6b53e85f5e9237b6649ae78965739665374aa78 Mon Sep 17 00:00:00 2001 -From: Paul Walmsley -Date: Mon, 12 Mar 2012 10:58:00 -0600 -Subject: [PATCH 1/7] mmc: use really long write timeout to deal with crappy - cards - -mmc: use really long write timeout to deal with crappy cards - -Several people have noticed that crappy SD cards take much longer to -complete multiple block writes than the 300ms that Linux specifies. -Try to work around this by using a three second write timeout instead. - -This is a generalized version of a patch from Chase Maupin -, whose patch description said: - -* With certain SD cards timeouts like the following have been seen - due to an improper calculation of the dto value: - mmcblk0: error -110 transferring data, sector 4126233, nr 8, - card status 0xc00 -* By removing the dto calculation and setting the timeout value - to the maximum specified by the SD card specification part A2 - section 2.2.15 these timeouts can be avoided. -* This change has been used by beagleboard users as well as the - Texas Instruments SDK without a negative impact. -* There are multiple discussion threads about this but the most - relevant ones are: - * http://talk.maemo.org/showthread.php?p=1000707#post1000707 - * http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42213.html -* Original proposal for this fix was done by Sukumar Ghoral of - Texas Instruments -* Tested using a Texas Instruments AM335x EVM - -Signed-off-by: Paul Walmsley -Tested-by: Tony Lindgren -Signed-off-by: Chris Ball ---- - drivers/mmc/core/core.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c -index 411a994..ad08933 100644 ---- a/drivers/mmc/core/core.c -+++ b/drivers/mmc/core/core.c -@@ -514,10 +514,14 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) - - if (data->flags & MMC_DATA_WRITE) - /* -- * The limit is really 250 ms, but that is -- * insufficient for some crappy cards. -+ * The MMC spec "It is strongly recommended -+ * for hosts to implement more than 500ms -+ * timeout value even if the card indicates -+ * the 250ms maximum busy length." Even the -+ * previous value of 300ms is known to be -+ * insufficient for some cards. - */ -- limit_us = 300000; -+ limit_us = 3000000; - else - limit_us = 100000; - --- -1.7.10 - - -From 346266077685f95b633f7ba34665218fbd4759c6 Mon Sep 17 00:00:00 2001 -From: Grigori Goronzy -Date: Mon, 4 Jun 2012 04:27:48 +0200 -Subject: [PATCH 2/7] 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. ---- - 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 3fe165a..c5cf67f 100644 ---- a/drivers/mmc/host/sdhci-bcm2708.c -+++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -822,7 +822,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, - while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE) - & state_mask) && --timeout > 0) - { -- udelay(100); -+ udelay(30); - continue; - } - if (timeout <= 0) --- -1.7.10 - - -From 445a298a9e0b4083a911a76922bfcdfb9ca5a2e7 Mon Sep 17 00:00:00 2001 -From: Grigori Goronzy -Date: Mon, 11 Jun 2012 18:52:04 +0200 -Subject: [PATCH 3/7] 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. ---- - drivers/mmc/host/sdhci-bcm2708.c | 11 +---------- - 1 file changed, 1 insertion(+), 10 deletions(-) - -diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index c5cf67f..e9ded27 100644 ---- a/drivers/mmc/host/sdhci-bcm2708.c -+++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -328,12 +328,7 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg) - - static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host) - { -- return 100000000; // this value is in Hz (100MHz/4) --} -- --static unsigned int sdhci_bcm2708_get_timeout_clock(struct sdhci_host *host) --{ -- return 100000; // this value is in kHz (100MHz/4) -+ return BCM2708_EMMC_CLOCK_FREQ; - } - - /*****************************************************************************\ -@@ -1222,11 +1217,7 @@ static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host) - #else - #error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set - #endif -- //.enable_dma = NULL, -- //.set_clock = NULL, - .get_max_clock = sdhci_bcm2708_get_max_clock, -- //.get_min_clock = NULL, -- .get_timeout_clock = sdhci_bcm2708_get_timeout_clock, - - .enable = sdhci_bcm2708_enable, - .disable = sdhci_bcm2708_disable, --- -1.7.10 - - -From 2968818af9ad725df0ea0097cc65ee4b4b5c6cfd Mon Sep 17 00:00:00 2001 -From: Grigori Goronzy -Date: Mon, 11 Jun 2012 18:53:59 +0200 -Subject: [PATCH 4/7] sdhci-bcm2708: add additional quirks - -Some additional quirks are needed for correct operation. -There's no SDHCI capabilities register documented, and it always reads -zero, so add SDHCI_QUIRK_MISSING_CAPS. Apparently -SDHCI_QUIRK_NO_HISPD_BIT is needed for many cards to work correctly in -high-speed mode, so add it as well. ---- - drivers/mmc/host/sdhci-bcm2708.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index e9ded27..378182c 100644 ---- a/drivers/mmc/host/sdhci-bcm2708.c -+++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -1278,7 +1278,11 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) - host->irq = platform_get_irq(pdev, 0); - - host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | -- SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; -+ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | -+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | -+ SDHCI_QUIRK_MISSING_CAPS | -+ SDHCI_QUIRK_NO_HISPD_BIT; -+ - #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA - host->flags = SDHCI_USE_PLATDMA; - #endif --- -1.7.10 - - -From 64a3687bffa7da3fba3a813e54708574a92a38ae Mon Sep 17 00:00:00 2001 -From: Grigori Goronzy -Date: Mon, 11 Jun 2012 18:57:13 +0200 -Subject: [PATCH 5/7] 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. ---- - drivers/mmc/host/sdhci-bcm2708.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 378182c..196c379 100644 ---- a/drivers/mmc/host/sdhci-bcm2708.c -+++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -130,6 +130,8 @@ static inline unsigned long int since_ns(hptime_t t) - return (unsigned long)((hptime() - t) * HPTIME_CLK_NS); - } - -+static bool allow_highspeed = 1; -+ - #if 0 - static void hptime_test(void) - { -@@ -1349,6 +1351,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) - host_priv->cb_base, (unsigned)host_priv->cb_handle, - host_priv->dma_chan, host_priv->dma_chan_base, - host_priv->dma_irq); -+ -+ if (allow_highspeed) -+ host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; - #endif - - ret = sdhci_add_host(host); -@@ -1454,8 +1459,12 @@ static void __exit sdhci_drv_exit(void) - module_init(sdhci_drv_init); - module_exit(sdhci_drv_exit); - -+module_param(allow_highspeed, bool, 0444); -+ - MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); - MODULE_AUTHOR("Broadcom "); - MODULE_LICENSE("GPL v2"); - MODULE_ALIAS("platform:"DRIVER_NAME); - -+MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes"); -+ --- -1.7.10 - - -From 35dd4a448a662fbefd0f18eadcc6d108b8d30edb Mon Sep 17 00:00:00 2001 -From: Grigori Goronzy -Date: Mon, 11 Jun 2012 18:58:40 +0200 -Subject: [PATCH 6/7] 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 -drive the SD interface at ideal frequencies. ---- - drivers/mmc/host/sdhci-bcm2708.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -index 196c379..8118f4a 100644 ---- a/drivers/mmc/host/sdhci-bcm2708.c -+++ b/drivers/mmc/host/sdhci-bcm2708.c -@@ -71,6 +71,9 @@ - - #define BCM2708_SDHCI_SLEEP_TIMEOUT 1000 /* msecs */ - -+/* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */ -+#define BCM2708_EMMC_CLOCK_FREQ 50000000 -+ - #define POWER_OFF 0 - #define POWER_LAZY_OFF 1 - #define POWER_ON 2 --- -1.7.10 - - -From 35b98bbd5d240156f8d4d5cdc70050906b41e0e3 Mon Sep 17 00:00:00 2001 -From: Iain Paton -Date: Mon, 11 Jun 2012 18:38:25 +0100 -Subject: [PATCH 7/7] sdhci: disable 1.8v modes when voltage_broken is set - -this is the last hunk from -https://github.com/raspberrypi/linux/commit/7e8ae226fe6e95954df6b0dcdde40a53dbbc1a0b ---- - drivers/mmc/host/sdhci.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index e147db2..4cfad2e 100644 ---- a/drivers/mmc/host/sdhci.c -+++ b/drivers/mmc/host/sdhci.c -@@ -2927,8 +2927,11 @@ int sdhci_add_host(struct sdhci_host *host) - mmc->caps |= MMC_CAP_MAX_CURRENT_200; - } - -- if(host->ops->voltage_broken) -+ if(host->ops->voltage_broken) { - ocr_avail |= MMC_VDD_29_30 | MMC_VDD_30_31; -+ // Cannot support UHS modes is we are stuck at 3.3V; -+ mmc->caps &= ~(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50); -+ } - - mmc->ocr_avail = ocr_avail; - mmc->ocr_avail_sdio = ocr_avail; --- -1.7.10 - diff --git a/packages/linux/patches/linux-3.2.19-991-medialink-bluetooth.patch b/packages/linux/patches/linux-3.2.19-991-medialink-bluetooth.patch deleted file mode 100644 index d4d80acafe..0000000000 --- a/packages/linux/patches/linux-3.2.19-991-medialink-bluetooth.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur linux-3.2.16/drivers/bluetooth/btusb.c linux-3.2.16.patch/drivers/bluetooth/btusb.c ---- linux-3.2.17/drivers/bluetooth/btusb.c 2012-04-22 18:31:32.000000000 -0400 -+++ linux-3.2.17.patch/drivers/bluetooth/btusb.c 2012-04-29 15:19:24.120925633 -0400 -@@ -102,6 +102,7 @@ - - /* Broadcom BCM20702A0 */ - { USB_DEVICE(0x0a5c, 0x21e3) }, -+ { USB_DEVICE(0x0a5c, 0x21e8) }, - { USB_DEVICE(0x413c, 0x8197) }, - - { } /* Terminating entry */ diff --git a/packages/linux/patches/linux-3.2.19-000_crosscompile.patch b/packages/linux/patches/linux-3.2.20-000_crosscompile.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-000_crosscompile.patch rename to packages/linux/patches/linux-3.2.20-000_crosscompile.patch diff --git a/packages/linux/patches/linux-3.2.19-003-no_dev_console.patch b/packages/linux/patches/linux-3.2.20-003-no_dev_console.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-003-no_dev_console.patch rename to packages/linux/patches/linux-3.2.20-003-no_dev_console.patch diff --git a/packages/linux/patches/linux-3.2.19-004_lower_undefined_mode_timeout.patch b/packages/linux/patches/linux-3.2.20-004_lower_undefined_mode_timeout.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-004_lower_undefined_mode_timeout.patch rename to packages/linux/patches/linux-3.2.20-004_lower_undefined_mode_timeout.patch diff --git a/packages/linux/patches/linux-3.2.19-006_enable_utf8.patch b/packages/linux/patches/linux-3.2.20-006_enable_utf8.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-006_enable_utf8.patch rename to packages/linux/patches/linux-3.2.20-006_enable_utf8.patch diff --git a/packages/linux/patches/linux-3.2.19-007_die_floppy_die.patch b/packages/linux/patches/linux-3.2.20-007_die_floppy_die.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-007_die_floppy_die.patch rename to packages/linux/patches/linux-3.2.20-007_die_floppy_die.patch diff --git a/packages/linux/patches/linux-3.2.19-009_disable_i8042_check_on_apple_mac.patch b/packages/linux/patches/linux-3.2.20-009_disable_i8042_check_on_apple_mac.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-009_disable_i8042_check_on_apple_mac.patch rename to packages/linux/patches/linux-3.2.20-009_disable_i8042_check_on_apple_mac.patch diff --git a/packages/linux/patches/linux-3.2.19-052-aureal_remote_quirk-0.1.patch b/packages/linux/patches/linux-3.2.20-052-aureal_remote_quirk-0.1.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-052-aureal_remote_quirk-0.1.patch rename to packages/linux/patches/linux-3.2.20-052-aureal_remote_quirk-0.1.patch diff --git a/packages/linux/patches/linux-3.2.19-053-spinelplus-remote-0.1.patch b/packages/linux/patches/linux-3.2.20-053-spinelplus-remote-0.1.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-053-spinelplus-remote-0.1.patch rename to packages/linux/patches/linux-3.2.20-053-spinelplus-remote-0.1.patch diff --git a/packages/linux/patches/linux-3.2.19-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3f54c13.patch b/packages/linux/patches/linux-3.2.20-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3f54c13.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3f54c13.patch rename to packages/linux/patches/linux-3.2.20-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3f54c13.patch diff --git a/packages/linux/patches/linux-3.2.19-056-Formosa-IR606.patch b/packages/linux/patches/linux-3.2.20-056-Formosa-IR606.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-056-Formosa-IR606.patch rename to packages/linux/patches/linux-3.2.20-056-Formosa-IR606.patch diff --git a/packages/linux/patches/linux-3.2.19-057.01-media-ati_remote-allow-specifying-a-default-keymap-s.patch b/packages/linux/patches/linux-3.2.20-057.01-media-ati_remote-allow-specifying-a-default-keymap-s.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-057.01-media-ati_remote-allow-specifying-a-default-keymap-s.patch rename to packages/linux/patches/linux-3.2.20-057.01-media-ati_remote-allow-specifying-a-default-keymap-s.patch diff --git a/packages/linux/patches/linux-3.2.19-057.02-media-ati_remote-add-support-for-Medion-X10-Digitain.patch b/packages/linux/patches/linux-3.2.20-057.02-media-ati_remote-add-support-for-Medion-X10-Digitain.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-057.02-media-ati_remote-add-support-for-Medion-X10-Digitain.patch rename to packages/linux/patches/linux-3.2.20-057.02-media-ati_remote-add-support-for-Medion-X10-Digitain.patch diff --git a/packages/linux/patches/linux-3.2.19-057.03-media-ati_remote-add-keymap-for-Medion-X10-OR2x-remo.patch b/packages/linux/patches/linux-3.2.20-057.03-media-ati_remote-add-keymap-for-Medion-X10-OR2x-remo.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-057.03-media-ati_remote-add-keymap-for-Medion-X10-OR2x-remo.patch rename to packages/linux/patches/linux-3.2.20-057.03-media-ati_remote-add-keymap-for-Medion-X10-OR2x-remo.patch diff --git a/packages/linux/patches/linux-3.2.19-057.04-media-ati_remote-add-regular-up-down-buttons-to-Medi.patch b/packages/linux/patches/linux-3.2.20-057.04-media-ati_remote-add-regular-up-down-buttons-to-Medi.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-057.04-media-ati_remote-add-regular-up-down-buttons-to-Medi.patch rename to packages/linux/patches/linux-3.2.20-057.04-media-ati_remote-add-regular-up-down-buttons-to-Medi.patch diff --git a/packages/linux/patches/linux-3.2.19-071-silence_i915_agp-module-0.1.patch b/packages/linux/patches/linux-3.2.20-071-silence_i915_agp-module-0.1.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-071-silence_i915_agp-module-0.1.patch rename to packages/linux/patches/linux-3.2.20-071-silence_i915_agp-module-0.1.patch diff --git a/packages/linux/patches/linux-3.2.19-081-drm_cea_modes.patch b/packages/linux/patches/linux-3.2.20-081-drm_cea_modes.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-081-drm_cea_modes.patch rename to packages/linux/patches/linux-3.2.20-081-drm_cea_modes.patch diff --git a/packages/linux/patches/linux-3.2.19-201-add_Anysee_T2C_support-0.1.patch b/packages/linux/patches/linux-3.2.20-201-add_Anysee_T2C_support-0.1.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-201-add_Anysee_T2C_support-0.1.patch rename to packages/linux/patches/linux-3.2.20-201-add_Anysee_T2C_support-0.1.patch diff --git a/packages/linux/patches/linux-3.2.19-202-add_HVR930C_support-0.1.patch b/packages/linux/patches/linux-3.2.20-202-add_HVR930C_support-0.1.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-202-add_HVR930C_support-0.1.patch rename to packages/linux/patches/linux-3.2.20-202-add_HVR930C_support-0.1.patch diff --git a/packages/linux/patches/linux-3.2.19-203-stb0899_enable_low_symbol_rate.patch b/packages/linux/patches/linux-3.2.20-203-stb0899_enable_low_symbol_rate.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-203-stb0899_enable_low_symbol_rate.patch rename to packages/linux/patches/linux-3.2.20-203-stb0899_enable_low_symbol_rate.patch diff --git a/packages/linux/patches/linux-3.2.19-204-add_Formosa_eHome_Infrared_Receiver.patch b/packages/linux/patches/linux-3.2.20-204-add_Formosa_eHome_Infrared_Receiver.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-204-add_Formosa_eHome_Infrared_Receiver.patch rename to packages/linux/patches/linux-3.2.20-204-add_Formosa_eHome_Infrared_Receiver.patch diff --git a/packages/linux/patches/linux-3.2.19-210-add_DVBSky_support.patch b/packages/linux/patches/linux-3.2.20-210-add_DVBSky_support.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-210-add_DVBSky_support.patch rename to packages/linux/patches/linux-3.2.20-210-add_DVBSky_support.patch diff --git a/packages/linux/patches/linux-3.2.19-211-add_TeVii_s471_support.patch b/packages/linux/patches/linux-3.2.20-211-add_TeVii_s471_support.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-211-add_TeVii_s471_support.patch rename to packages/linux/patches/linux-3.2.20-211-add_TeVii_s471_support.patch diff --git a/packages/linux/patches/linux-3.2.19-212-mantis_stb0899_faster_lock.patch b/packages/linux/patches/linux-3.2.20-212-mantis_stb0899_faster_lock.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-212-mantis_stb0899_faster_lock.patch rename to packages/linux/patches/linux-3.2.20-212-mantis_stb0899_faster_lock.patch diff --git a/packages/linux/patches/linux-3.2.19-251-acpi-5.0_support.patch b/packages/linux/patches/linux-3.2.20-251-acpi-5.0_support.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-251-acpi-5.0_support.patch rename to packages/linux/patches/linux-3.2.20-251-acpi-5.0_support.patch diff --git a/packages/linux/patches/linux-3.2.19-601-RPi_support-0.1.patch b/packages/linux/patches/linux-3.2.20-601-RPi_support-0.1.patch similarity index 97% rename from packages/linux/patches/linux-3.2.19-601-RPi_support-0.1.patch rename to packages/linux/patches/linux-3.2.20-601-RPi_support-0.1.patch index d7a2fab414..bbf02c47da 100644 --- a/packages/linux/patches/linux-3.2.19-601-RPi_support-0.1.patch +++ b/packages/linux/patches/linux-3.2.20-601-RPi_support-0.1.patch @@ -1,6 +1,73 @@ -diff -Naur linux-3.2.19/arch/arm/configs/bcmrpi_cutdown_defconfig linux-3.2.19.patch/arch/arm/configs/bcmrpi_cutdown_defconfig ---- linux-3.2.19/arch/arm/configs/bcmrpi_cutdown_defconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/configs/bcmrpi_cutdown_defconfig 2012-06-10 05:51:05.255409323 +0200 +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 987c72d..98ea27e 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -955,6 +955,21 @@ config PLAT_SPEAR + help + Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). + ++config ARCH_BCM2708 ++ bool "Broadcom BCM2708 family" ++ select CPU_V6 ++ select ARM_AMBA ++ select HAVE_CLK ++ select HAVE_SCHED_CLOCK ++ select NEED_MACH_MEMORY_H ++ select CLKDEV_LOOKUP ++ select GENERIC_CLOCKEVENTS ++ select ARM_ERRATA_411920 ++ select MACH_BCM2708 ++ select VC4 ++ help ++ This enables support for Broadcom BCM2708 boards. ++ + config ARCH_VT8500 + bool "VIA/WonderMedia 85xx" + select CPU_ARM926T +@@ -1098,6 +1113,7 @@ source "arch/arm/plat-versatile/Kconfig" + source "arch/arm/mach-vt8500/Kconfig" + + source "arch/arm/mach-w90x900/Kconfig" ++source "arch/arm/mach-bcm2708/Kconfig" + + # Definitions to make life easier + config ARCH_ACORN +diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug +index c5213e7..5e58b8f 100644 +--- a/arch/arm/Kconfig.debug ++++ b/arch/arm/Kconfig.debug +@@ -247,6 +247,14 @@ choice + their output to the standard serial port on the RealView + PB1176 platform. + ++ config DEBUG_BCM2708_UART0 ++ bool "Broadcom BCM2708 UART0 (PL011)" ++ depends on MACH_BCM2708 ++ help ++ Say Y here if you want the debug print routines to direct ++ their output to UART 0. The port must have been initialised ++ by the boot-loader before use. ++ + endchoice + + config EARLY_PRINTK +diff --git a/arch/arm/Makefile b/arch/arm/Makefile +index dfcf3b0..1b18ede 100644 +--- a/arch/arm/Makefile ++++ b/arch/arm/Makefile +@@ -198,6 +198,7 @@ machine-$(CONFIG_MACH_SPEAR310) := spear3xx + machine-$(CONFIG_MACH_SPEAR320) := spear3xx + machine-$(CONFIG_MACH_SPEAR600) := spear6xx + machine-$(CONFIG_ARCH_ZYNQ) := zynq ++machine-$(CONFIG_ARCH_BCM2708) := bcm2708 + + # Platform directory name. This list is sorted alphanumerically + # by CONFIG_* macro name. +diff --git a/arch/arm/configs/bcmrpi_cutdown_defconfig b/arch/arm/configs/bcmrpi_cutdown_defconfig +new file mode 100644 +index 0000000..6732014 +--- /dev/null ++++ b/arch/arm/configs/bcmrpi_cutdown_defconfig @@ -0,0 +1,494 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -496,9 +563,11 @@ diff -Naur linux-3.2.19/arch/arm/configs/bcmrpi_cutdown_defconfig linux-3.2.19.p +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -diff -Naur linux-3.2.19/arch/arm/configs/bcmrpi_defconfig linux-3.2.19.patch/arch/arm/configs/bcmrpi_defconfig ---- linux-3.2.19/arch/arm/configs/bcmrpi_defconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/configs/bcmrpi_defconfig 2012-06-10 05:51:05.255409323 +0200 +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +new file mode 100644 +index 0000000..fcbf8a5 +--- /dev/null ++++ b/arch/arm/configs/bcmrpi_defconfig @@ -0,0 +1,530 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -1030,9 +1099,11 @@ diff -Naur linux-3.2.19/arch/arm/configs/bcmrpi_defconfig linux-3.2.19.patch/arc +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -diff -Naur linux-3.2.19/arch/arm/configs/bcmrpi_emergency_defconfig linux-3.2.19.patch/arch/arm/configs/bcmrpi_emergency_defconfig ---- linux-3.2.19/arch/arm/configs/bcmrpi_emergency_defconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/configs/bcmrpi_emergency_defconfig 2012-06-10 05:51:05.263409483 +0200 +diff --git a/arch/arm/configs/bcmrpi_emergency_defconfig b/arch/arm/configs/bcmrpi_emergency_defconfig +new file mode 100644 +index 0000000..3b40c49 +--- /dev/null ++++ b/arch/arm/configs/bcmrpi_emergency_defconfig @@ -0,0 +1,532 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -1566,60 +1637,72 @@ diff -Naur linux-3.2.19/arch/arm/configs/bcmrpi_emergency_defconfig linux-3.2.19 +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -diff -Naur linux-3.2.19/arch/arm/Kconfig linux-3.2.19.patch/arch/arm/Kconfig ---- linux-3.2.19/arch/arm/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/arch/arm/Kconfig 2012-06-10 05:51:05.334410914 +0200 -@@ -955,6 +955,21 @@ - help - Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). - -+config ARCH_BCM2708 -+ bool "Broadcom BCM2708 family" +diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig +new file mode 100644 +index 0000000..5593167 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/Kconfig +@@ -0,0 +1,32 @@ ++menu "Broadcom BCM2708 Implementations" ++ depends on ARCH_BCM2708 ++ ++config MACH_BCM2708 ++ bool "Broadcom BCM2708 Development Platform" + select CPU_V6 -+ select ARM_AMBA -+ select HAVE_CLK -+ select HAVE_SCHED_CLOCK -+ select NEED_MACH_MEMORY_H -+ select CLKDEV_LOOKUP -+ select GENERIC_CLOCKEVENTS -+ select ARM_ERRATA_411920 -+ select MACH_BCM2708 -+ select VC4 + help -+ This enables support for Broadcom BCM2708 boards. ++ Include support for the Broadcom(R) BCM2708 platform. + - config ARCH_VT8500 - bool "VIA/WonderMedia 85xx" - select CPU_ARM926T -@@ -1098,6 +1113,7 @@ - source "arch/arm/mach-vt8500/Kconfig" - - source "arch/arm/mach-w90x900/Kconfig" -+source "arch/arm/mach-bcm2708/Kconfig" - - # Definitions to make life easier - config ARCH_ACORN -diff -Naur linux-3.2.19/arch/arm/Kconfig.debug linux-3.2.19.patch/arch/arm/Kconfig.debug ---- linux-3.2.19/arch/arm/Kconfig.debug 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/arch/arm/Kconfig.debug 2012-06-10 05:51:05.334410914 +0200 -@@ -247,6 +247,14 @@ - their output to the standard serial port on the RealView - PB1176 platform. - -+ config DEBUG_BCM2708_UART0 -+ bool "Broadcom BCM2708 UART0 (PL011)" -+ depends on MACH_BCM2708 -+ help -+ Say Y here if you want the debug print routines to direct -+ their output to UART 0. The port must have been initialised -+ by the boot-loader before use. ++config BCM2708_GPIO ++ bool "BCM2708 gpio support" ++ depends on MACH_BCM2708 ++ select ARCH_REQUIRE_GPIOLIB ++ default y ++ help ++ Include support for the Broadcom(R) BCM2708 gpio. + - endchoice - - config EARLY_PRINTK -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/armctrl.c linux-3.2.19.patch/arch/arm/mach-bcm2708/armctrl.c ---- linux-3.2.19/arch/arm/mach-bcm2708/armctrl.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/armctrl.c 2012-06-10 05:51:05.042405026 +0200 ++config BCM2708_VCMEM ++ bool "Videocore Memory" ++ depends on MACH_BCM2708 ++ default y ++ help ++ Helper for videocore memory access and total size allocation. ++ ++config BCM2708_NOL2CACHE ++ bool "Videocore L2 cache disable" ++ depends on MACH_BCM2708 ++ default n ++ help ++ Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt. ++ ++endmenu +diff --git a/arch/arm/mach-bcm2708/Makefile b/arch/arm/mach-bcm2708/Makefile +new file mode 100644 +index 0000000..164ecb2 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/Makefile +@@ -0,0 +1,8 @@ ++# ++# Makefile for the linux kernel. ++# ++ ++obj-$(CONFIG_MACH_BCM2708) += clock.o bcm2708.o armctrl.o vcio.o power.o dma.o ++obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o ++obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o ++ +diff --git a/arch/arm/mach-bcm2708/Makefile.boot b/arch/arm/mach-bcm2708/Makefile.boot +new file mode 100644 +index 0000000..67039c3 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/Makefile.boot +@@ -0,0 +1,3 @@ ++ zreladdr-y := 0x00008000 ++params_phys-y := 0x00000100 ++initrd_phys-y := 0x00800000 +diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c +new file mode 100644 +index 0000000..6b97124 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/armctrl.c @@ -0,0 +1,399 @@ +/* + * linux/arch/arm/mach-bcm2708/armctrl.c @@ -2020,9 +2103,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/armctrl.c linux-3.2.19.patch/arch/ + armctrl_pm_register(base, irq_start, resume_sources); + return 0; +} -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/armctrl.h linux-3.2.19.patch/arch/arm/mach-bcm2708/armctrl.h ---- linux-3.2.19/arch/arm/mach-bcm2708/armctrl.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/armctrl.h 2012-06-10 05:51:05.042405026 +0200 +diff --git a/arch/arm/mach-bcm2708/armctrl.h b/arch/arm/mach-bcm2708/armctrl.h +new file mode 100644 +index 0000000..0aa916e +--- /dev/null ++++ b/arch/arm/mach-bcm2708/armctrl.h @@ -0,0 +1,27 @@ +/* + * linux/arch/arm/mach-bcm2708/armctrl.h @@ -2051,9 +2136,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/armctrl.h linux-3.2.19.patch/arch/ + u32 armctrl_sources, u32 resume_sources); + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/bcm2708.c linux-3.2.19.patch/arch/arm/mach-bcm2708/bcm2708.c ---- linux-3.2.19/arch/arm/mach-bcm2708/bcm2708.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/bcm2708.c 2012-06-10 05:51:05.360411439 +0200 +diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c +new file mode 100644 +index 0000000..0207807 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -0,0 +1,749 @@ +/* + * linux/arch/arm/mach-bcm2708/bcm2708.c @@ -2804,9 +2891,68 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/bcm2708.c linux-3.2.19.patch/arch/ + &bcm2708_timer,.init_machine = + bcm2708_init, MACHINE_END module_param(boardrev, uint, 0644); +module_param(serial, uint, 0644); -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-3.2.19.patch/arch/arm/mach-bcm2708/bcm2708_gpio.c ---- linux-3.2.19/arch/arm/mach-bcm2708/bcm2708_gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/bcm2708_gpio.c 2012-06-10 05:51:05.044405066 +0200 +diff --git a/arch/arm/mach-bcm2708/bcm2708.h b/arch/arm/mach-bcm2708/bcm2708.h +new file mode 100644 +index 0000000..dfe8700 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/bcm2708.h +@@ -0,0 +1,51 @@ ++/* ++ * linux/arch/arm/mach-bcm2708/bcm2708.h ++ * ++ * BCM2708 machine support header ++ * ++ * Copyright (C) 2010 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef __BCM2708_BCM2708_H ++#define __BCM2708_BCM2708_H ++ ++#include ++ ++extern void __init bcm2708_init(void); ++extern void __init bcm2708_init_irq(void); ++extern void __init bcm2708_map_io(void); ++extern struct sys_timer bcm2708_timer; ++extern unsigned int mmc_status(struct device *dev); ++ ++#define AMBA_DEVICE(name, busid, base, plat) \ ++static struct amba_device name##_device = { \ ++ .dev = { \ ++ .coherent_dma_mask = ~0, \ ++ .init_name = busid, \ ++ .platform_data = plat, \ ++ }, \ ++ .res = { \ ++ .start = base##_BASE, \ ++ .end = (base##_BASE) + SZ_4K - 1,\ ++ .flags = IORESOURCE_MEM, \ ++ }, \ ++ .dma_mask = ~0, \ ++ .irq = base##_IRQ, \ ++ /* .dma = base##_DMA,*/ \ ++} ++ ++#endif +diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c +new file mode 100644 +index 0000000..59df912 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -0,0 +1,323 @@ +/* + * linux/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -3131,64 +3277,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-3.2.19.patch/ +MODULE_DESCRIPTION("Broadcom BCM2708 GPIO driver"); +MODULE_LICENSE("GPL"); + -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/bcm2708.h linux-3.2.19.patch/arch/arm/mach-bcm2708/bcm2708.h ---- linux-3.2.19/arch/arm/mach-bcm2708/bcm2708.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/bcm2708.h 2012-06-10 05:51:05.044405066 +0200 -@@ -0,0 +1,51 @@ -+/* -+ * linux/arch/arm/mach-bcm2708/bcm2708.h -+ * -+ * BCM2708 machine support header -+ * -+ * Copyright (C) 2010 Broadcom -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef __BCM2708_BCM2708_H -+#define __BCM2708_BCM2708_H -+ -+#include -+ -+extern void __init bcm2708_init(void); -+extern void __init bcm2708_init_irq(void); -+extern void __init bcm2708_map_io(void); -+extern struct sys_timer bcm2708_timer; -+extern unsigned int mmc_status(struct device *dev); -+ -+#define AMBA_DEVICE(name, busid, base, plat) \ -+static struct amba_device name##_device = { \ -+ .dev = { \ -+ .coherent_dma_mask = ~0, \ -+ .init_name = busid, \ -+ .platform_data = plat, \ -+ }, \ -+ .res = { \ -+ .start = base##_BASE, \ -+ .end = (base##_BASE) + SZ_4K - 1,\ -+ .flags = IORESOURCE_MEM, \ -+ }, \ -+ .dma_mask = ~0, \ -+ .irq = base##_IRQ, \ -+ /* .dma = base##_DMA,*/ \ -+} -+ -+#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/clock.c linux-3.2.19.patch/arch/arm/mach-bcm2708/clock.c ---- linux-3.2.19/arch/arm/mach-bcm2708/clock.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/clock.c 2012-06-10 05:51:05.045405086 +0200 +diff --git a/arch/arm/mach-bcm2708/clock.c b/arch/arm/mach-bcm2708/clock.c +new file mode 100644 +index 0000000..4fc556e +--- /dev/null ++++ b/arch/arm/mach-bcm2708/clock.c @@ -0,0 +1,61 @@ +/* + * linux/arch/arm/mach-bcm2708/clock.c @@ -3251,9 +3344,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/clock.c linux-3.2.19.patch/arch/ar + return -EIO; +} +EXPORT_SYMBOL(clk_set_rate); -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/clock.h linux-3.2.19.patch/arch/arm/mach-bcm2708/clock.h ---- linux-3.2.19/arch/arm/mach-bcm2708/clock.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/clock.h 2012-06-10 05:51:05.045405086 +0200 +diff --git a/arch/arm/mach-bcm2708/clock.h b/arch/arm/mach-bcm2708/clock.h +new file mode 100644 +index 0000000..5f9d725 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/clock.h @@ -0,0 +1,24 @@ +/* + * linux/arch/arm/mach-bcm2708/clock.h @@ -3279,9 +3374,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/clock.h linux-3.2.19.patch/arch/ar +struct clk { + unsigned long rate; +}; -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/dma.c linux-3.2.19.patch/arch/arm/mach-bcm2708/dma.c ---- linux-3.2.19/arch/arm/mach-bcm2708/dma.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/dma.c 2012-06-10 05:51:05.046405107 +0200 +diff --git a/arch/arm/mach-bcm2708/dma.c b/arch/arm/mach-bcm2708/dma.c +new file mode 100644 +index 0000000..0b7a4f6 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/dma.c @@ -0,0 +1,397 @@ +/* + * linux/arch/arm/mach-bcm2708/dma.c @@ -3680,9 +3777,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/dma.c linux-3.2.19.patch/arch/arm/ +MODULE_LICENSE("GPL"); + +MODULE_PARM_DESC(dmachans, "Bitmap of DMA channels available to the ARM"); -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/arm_control.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/arm_control.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/arm_control.h 2012-06-10 05:51:05.047405128 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/arm_control.h b/arch/arm/mach-bcm2708/include/mach/arm_control.h +new file mode 100644 +index 0000000..a82bb92 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/arm_control.h @@ -0,0 +1,419 @@ +/* + * linux/arch/arm/mach-bcm2708/arm_control.h @@ -4103,9 +4202,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-3 +#define AJBTDO HW_REGISTER_RW(AJB_BASE+0x0c) + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/arm_power.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/arm_power.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/arm_power.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/arm_power.h 2012-06-10 05:51:05.048405149 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/arm_power.h b/arch/arm/mach-bcm2708/include/mach/arm_power.h +new file mode 100644 +index 0000000..aae9136 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/arm_power.h @@ -0,0 +1,60 @@ +/* + * linux/arch/arm/mach-bcm2708/include/mach/arm_power.h @@ -4167,9 +4268,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/arm_power.h linux-3.2 +}; + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/clkdev.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/clkdev.h 2012-06-10 05:51:05.048405149 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/clkdev.h b/arch/arm/mach-bcm2708/include/mach/clkdev.h +new file mode 100644 +index 0000000..04b37a8 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/clkdev.h @@ -0,0 +1,7 @@ +#ifndef __ASM_MACH_CLKDEV_H +#define __ASM_MACH_CLKDEV_H @@ -4178,9 +4281,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-3.2.19 +#define __clk_put(clk) do { } while (0) + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/debug-macro.S ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/debug-macro.S 2012-06-10 05:51:05.336410955 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/debug-macro.S b/arch/arm/mach-bcm2708/include/mach/debug-macro.S +new file mode 100644 +index 0000000..2d0dc1c +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/debug-macro.S @@ -0,0 +1,22 @@ +/* arch/arm/mach-bcm2708/include/mach/debug-macro.S + * @@ -4204,9 +4309,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-3 + .endm + +#include -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/dma.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/dma.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/dma.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/dma.h 2012-06-10 05:51:05.049405169 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/dma.h b/arch/arm/mach-bcm2708/include/mach/dma.h +new file mode 100644 +index 0000000..25e06d7 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/dma.h @@ -0,0 +1,84 @@ +/* + * linux/arch/arm/mach-bcm2708/include/mach/dma.h @@ -4292,9 +4399,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/dma.h linux-3.2.19.pa + + +#endif /* _MACH_BCM2708_DMA_H */ -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/entry-macro.S ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/entry-macro.S 2012-06-10 05:51:05.049405169 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/entry-macro.S b/arch/arm/mach-bcm2708/include/mach/entry-macro.S +new file mode 100644 +index 0000000..79b62d9 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/entry-macro.S @@ -0,0 +1,69 @@ +/* + * arch/arm/mach-bcm2708/include/mach/entry-macro.S @@ -4365,9 +4474,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-3 +1020: @ EQ will be set if no irqs pending + + .endm -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/frc.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/frc.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/frc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/frc.h 2012-06-10 05:51:05.050405189 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/frc.h b/arch/arm/mach-bcm2708/include/mach/frc.h +new file mode 100644 +index 0000000..dd51e07 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/frc.h @@ -0,0 +1,38 @@ +/* + * arch/arm/mach-bcm2708/include/mach/timex.h @@ -4407,9 +4518,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/frc.h linux-3.2.19.pa +extern unsigned long long frc_clock_ticks63(void); + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/gpio.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/gpio.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/gpio.h 2012-06-10 05:51:05.050405189 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/gpio.h b/arch/arm/mach-bcm2708/include/mach/gpio.h +new file mode 100644 +index 0000000..526004f +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/gpio.h @@ -0,0 +1,48 @@ +/* + * arch/arm/mach-bcm2708/include/mach/gpio.h @@ -4459,9 +4572,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/gpio.h linux-3.2.19.p +#endif /* CONFIG_GPIOLIB */ + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/hardware.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/hardware.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/hardware.h 2012-06-10 05:51:05.050405189 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/hardware.h b/arch/arm/mach-bcm2708/include/mach/hardware.h +new file mode 100644 +index 0000000..c2954e8 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/hardware.h @@ -0,0 +1,28 @@ +/* + * arch/arm/mach-bcm2708/include/mach/hardware.h @@ -4491,9 +4606,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/hardware.h linux-3.2. +#include + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/io.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/io.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/io.h 2012-06-10 05:51:05.051405209 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/io.h b/arch/arm/mach-bcm2708/include/mach/io.h +new file mode 100644 +index 0000000..e8c7fca +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/io.h @@ -0,0 +1,28 @@ +/* + * arch/arm/mach-bcm2708/include/mach/io.h @@ -4523,9 +4640,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/io.h linux-3.2.19.pat +#define __mem_pci(a) (a) + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/irqs.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/irqs.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/irqs.h 2012-06-10 05:51:05.052405229 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/irqs.h b/arch/arm/mach-bcm2708/include/mach/irqs.h +new file mode 100644 +index 0000000..f59d474 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/irqs.h @@ -0,0 +1,190 @@ +/* + * arch/arm/mach-bcm2708/include/mach/irqs.h @@ -4717,9 +4836,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/irqs.h linux-3.2.19.p +#define NR_IRQS (64 + 21) + +#endif /* _BCM2708_IRQS_H_ */ -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/memory.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/memory.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/memory.h 2012-06-10 05:51:05.336410955 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/memory.h b/arch/arm/mach-bcm2708/include/mach/memory.h +new file mode 100644 +index 0000000..5d47513 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/memory.h @@ -0,0 +1,64 @@ +/* + * arch/arm/mach-bcm2708/include/mach/memory.h @@ -4785,9 +4906,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/memory.h linux-3.2.19 +#define CONSISTENT_DMA_SIZE 0x00200000 + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/platform.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/platform.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/platform.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/platform.h 2012-06-10 05:51:05.357411379 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/platform.h b/arch/arm/mach-bcm2708/include/mach/platform.h +new file mode 100644 +index 0000000..d038597 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/platform.h @@ -0,0 +1,213 @@ +/* + * arch/arm/mach-bcm2708/include/mach/platform.h @@ -5002,9 +5125,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/platform.h linux-3.2. +#endif + +/* END */ -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/power.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/power.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/power.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/power.h 2012-06-10 05:51:05.055405289 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/power.h b/arch/arm/mach-bcm2708/include/mach/power.h +new file mode 100644 +index 0000000..52b3b02 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/power.h @@ -0,0 +1,26 @@ +/* + * linux/arch/arm/mach-bcm2708/power.h @@ -5032,9 +5157,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/power.h linux-3.2.19. +extern int bcm_power_close(BCM_POWER_HANDLE_T handle); + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/system.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/system.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/system.h 2012-06-10 05:51:05.055405289 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/system.h b/arch/arm/mach-bcm2708/include/mach/system.h +new file mode 100644 +index 0000000..bc9d458 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/system.h @@ -0,0 +1,53 @@ +/* + * arch/arm/mach-bcm2708/include/mach/system.h @@ -5089,9 +5216,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/system.h linux-3.2.19 +} + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/timex.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/timex.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/timex.h 2012-06-10 05:51:05.055405289 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/timex.h b/arch/arm/mach-bcm2708/include/mach/timex.h +new file mode 100644 +index 0000000..64a660c +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/timex.h @@ -0,0 +1,23 @@ +/* + * arch/arm/mach-bcm2708/include/mach/timex.h @@ -5116,9 +5245,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/timex.h linux-3.2.19. + */ + +#define CLOCK_TICK_RATE (1000000) -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/uncompress.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/uncompress.h 2012-06-10 05:51:05.303410289 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/uncompress.h b/arch/arm/mach-bcm2708/include/mach/uncompress.h +new file mode 100644 +index 0000000..dca1247 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/uncompress.h @@ -0,0 +1,84 @@ +/* + * arch/arm/mach-bcn2708/include/mach/uncompress.h @@ -5204,9 +5335,52 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-3. + * nothing to do + */ +#define arch_decomp_wdog() -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vcio.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/vcio.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vcio.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/vcio.h 2012-06-10 05:51:05.057405329 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/vc_mem.h b/arch/arm/mach-bcm2708/include/mach/vc_mem.h +new file mode 100644 +index 0000000..9d41c3a +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/vc_mem.h +@@ -0,0 +1,35 @@ ++/***************************************************************************** ++* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ ++ ++#if !defined( VC_MEM_H ) ++#define VC_MEM_H ++ ++#include ++ ++#define VC_MEM_IOC_MAGIC 'v' ++ ++#define VC_MEM_IOC_MEM_PHYS_ADDR _IOR( VC_MEM_IOC_MAGIC, 0, unsigned long ) ++#define VC_MEM_IOC_MEM_SIZE _IOR( VC_MEM_IOC_MAGIC, 1, unsigned int ) ++#define VC_MEM_IOC_MEM_BASE _IOR( VC_MEM_IOC_MAGIC, 2, unsigned int ) ++ ++#if defined( __KERNEL__ ) ++#define VC_MEM_TO_ARM_ADDR_MASK 0x3FFFFFFF ++ ++extern unsigned long mm_vc_mem_phys_addr; ++extern unsigned int mm_vc_mem_size; ++extern int vc_mem_get_current_size( void ); ++#endif ++ ++#endif /* VC_MEM_H */ ++ +diff --git a/arch/arm/mach-bcm2708/include/mach/vcio.h b/arch/arm/mach-bcm2708/include/mach/vcio.h +new file mode 100644 +index 0000000..0d7f9a5 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/vcio.h @@ -0,0 +1,42 @@ +/* + * arch/arm/mach-bcm2708/include/mach/vcio.h @@ -5250,48 +5424,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vcio.h linux-3.2.19.p +extern int /*rc*/ bcm_mailbox_write(unsigned chan, uint32_t data28); + +#endif -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vc_mem.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/vc_mem.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vc_mem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/vc_mem.h 2012-06-10 05:51:05.246409140 +0200 -@@ -0,0 +1,35 @@ -+/***************************************************************************** -+* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved. -+* -+* Unless you and Broadcom execute a separate written software license -+* agreement governing use of this software, this software is licensed to you -+* under the terms of the GNU General Public License version 2, available at -+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). -+* -+* Notwithstanding the above, under no circumstances may you combine this -+* software in any way with any other Broadcom software provided under a -+* license other than the GPL, without Broadcom's express prior written -+* consent. -+*****************************************************************************/ -+ -+#if !defined( VC_MEM_H ) -+#define VC_MEM_H -+ -+#include -+ -+#define VC_MEM_IOC_MAGIC 'v' -+ -+#define VC_MEM_IOC_MEM_PHYS_ADDR _IOR( VC_MEM_IOC_MAGIC, 0, unsigned long ) -+#define VC_MEM_IOC_MEM_SIZE _IOR( VC_MEM_IOC_MAGIC, 1, unsigned int ) -+#define VC_MEM_IOC_MEM_BASE _IOR( VC_MEM_IOC_MAGIC, 2, unsigned int ) -+ -+#if defined( __KERNEL__ ) -+#define VC_MEM_TO_ARM_ADDR_MASK 0x3FFFFFFF -+ -+extern unsigned long mm_vc_mem_phys_addr; -+extern unsigned int mm_vc_mem_size; -+extern int vc_mem_get_current_size( void ); -+#endif -+ -+#endif /* VC_MEM_H */ -+ -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/vmalloc.h ---- linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/include/mach/vmalloc.h 2012-06-10 05:51:05.057405329 +0200 +diff --git a/arch/arm/mach-bcm2708/include/mach/vmalloc.h b/arch/arm/mach-bcm2708/include/mach/vmalloc.h +new file mode 100644 +index 0000000..28ecc15 +--- /dev/null ++++ b/arch/arm/mach-bcm2708/include/mach/vmalloc.h @@ -0,0 +1,20 @@ +/* + * arch/arm/mach-bcm2708/include/mach/vmalloc.h @@ -5313,64 +5450,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-3.2.1 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#define VMALLOC_END (0xd8000000) -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/Kconfig linux-3.2.19.patch/arch/arm/mach-bcm2708/Kconfig ---- linux-3.2.19/arch/arm/mach-bcm2708/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/Kconfig 2012-06-10 05:51:05.208408374 +0200 -@@ -0,0 +1,32 @@ -+menu "Broadcom BCM2708 Implementations" -+ depends on ARCH_BCM2708 -+ -+config MACH_BCM2708 -+ bool "Broadcom BCM2708 Development Platform" -+ select CPU_V6 -+ help -+ Include support for the Broadcom(R) BCM2708 platform. -+ -+config BCM2708_GPIO -+ bool "BCM2708 gpio support" -+ depends on MACH_BCM2708 -+ select ARCH_REQUIRE_GPIOLIB -+ default y -+ help -+ Include support for the Broadcom(R) BCM2708 gpio. -+ -+config BCM2708_VCMEM -+ bool "Videocore Memory" -+ depends on MACH_BCM2708 -+ default y -+ help -+ Helper for videocore memory access and total size allocation. -+ -+config BCM2708_NOL2CACHE -+ bool "Videocore L2 cache disable" -+ depends on MACH_BCM2708 -+ default n -+ help -+ Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt. -+ -+endmenu -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/Makefile linux-3.2.19.patch/arch/arm/mach-bcm2708/Makefile ---- linux-3.2.19/arch/arm/mach-bcm2708/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/Makefile 2012-06-10 05:51:05.041405006 +0200 -@@ -0,0 +1,8 @@ -+# -+# Makefile for the linux kernel. -+# -+ -+obj-$(CONFIG_MACH_BCM2708) += clock.o bcm2708.o armctrl.o vcio.o power.o dma.o -+obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o -+obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o -+ -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/Makefile.boot linux-3.2.19.patch/arch/arm/mach-bcm2708/Makefile.boot ---- linux-3.2.19/arch/arm/mach-bcm2708/Makefile.boot 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/Makefile.boot 2012-06-10 05:51:05.041405006 +0200 -@@ -0,0 +1,3 @@ -+ zreladdr-y := 0x00008000 -+params_phys-y := 0x00000100 -+initrd_phys-y := 0x00800000 -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/power.c linux-3.2.19.patch/arch/arm/mach-bcm2708/power.c ---- linux-3.2.19/arch/arm/mach-bcm2708/power.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/power.c 2012-06-10 05:51:05.366411559 +0200 +diff --git a/arch/arm/mach-bcm2708/power.c b/arch/arm/mach-bcm2708/power.c +new file mode 100644 +index 0000000..256bf1a +--- /dev/null ++++ b/arch/arm/mach-bcm2708/power.c @@ -0,0 +1,194 @@ +/* + * linux/arch/arm/mach-bcm2708/power.c @@ -5566,321 +5650,11 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/power.c linux-3.2.19.patch/arch/ar +MODULE_AUTHOR("Phil Elwell"); +MODULE_DESCRIPTION("Interface to BCM2708 power management"); +MODULE_LICENSE("GPL"); -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/vcio.c linux-3.2.19.patch/arch/arm/mach-bcm2708/vcio.c ---- linux-3.2.19/arch/arm/mach-bcm2708/vcio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/vcio.c 2012-06-10 05:51:05.341411055 +0200 -@@ -0,0 +1,308 @@ -+/* -+ * linux/arch/arm/mach-bcm2708/vcio.c -+ * -+ * Copyright (C) 2010 Broadcom -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ * -+ * This device provides a shared mechanism for writing to the mailboxes, -+ * semaphores, doorbells etc. that are shared between the ARM and the -+ * VideoCore processor -+ */ -+ -+#if defined(CONFIG_SERIAL_BCM_MBOX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) -+#define SUPPORT_SYSRQ -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+ -+#define DRIVER_NAME BCM_VCIO_DRIVER_NAME -+ -+/* ---------------------------------------------------------------------- -+ * Mailbox -+ * -------------------------------------------------------------------- */ -+ -+/* offsets from a mail box base address */ -+#define MAIL_WRT 0x00 /* write - and next 4 words */ -+#define MAIL_RD 0x00 /* read - and next 4 words */ -+#define MAIL_POL 0x10 /* read without popping the fifo */ -+#define MAIL_SND 0x14 /* sender ID (bottom two bits) */ -+#define MAIL_STA 0x18 /* status */ -+#define MAIL_CNF 0x1C /* configuration */ -+ -+#define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) -+#define MBOX_MSG_LSB(chan, data28) (((data28) << 4) | ((chan) & 0xf)) -+#define MBOX_CHAN(msg) ((msg) & 0xf) -+#define MBOX_DATA28(msg) ((msg) & ~0xf) -+#define MBOX_DATA28_LSB(msg) (((uint32_t)msg) >> 4) -+ -+#define MBOX_MAGIC 0xd0d0c0de -+ -+struct vc_mailbox { -+ struct device *dev; /* parent device */ -+ void __iomem *status; -+ void __iomem *config; -+ void __iomem *read; -+ void __iomem *write; -+ uint32_t msg[MBOX_CHAN_COUNT]; -+ struct semaphore sema[MBOX_CHAN_COUNT]; -+ uint32_t magic; -+}; -+ -+static void mbox_init(struct vc_mailbox *mbox_out, struct device *dev, -+ uint32_t addr_mbox) -+{ -+ int i; -+ -+ mbox_out->dev = dev; -+ mbox_out->status = __io_address(addr_mbox + MAIL_STA); -+ mbox_out->config = __io_address(addr_mbox + MAIL_CNF); -+ mbox_out->read = __io_address(addr_mbox + MAIL_RD); -+ /* Write to the other mailbox */ -+ mbox_out->write = -+ __io_address((addr_mbox ^ ARM_0_MAIL0_WRT ^ ARM_0_MAIL1_WRT) + -+ MAIL_WRT); -+ -+ for (i = 0; i < MBOX_CHAN_COUNT; i++) { -+ mbox_out->msg[i] = 0; -+ sema_init(&mbox_out->sema[i], 0); -+ } -+ -+ /* Enable the interrupt on data reception */ -+ writel(ARM_MC_IHAVEDATAIRQEN, mbox_out->config); -+ -+ mbox_out->magic = MBOX_MAGIC; -+} -+ -+static int mbox_write(struct vc_mailbox *mbox, unsigned chan, uint32_t data28) -+{ -+ int rc; -+ -+ if (mbox->magic != MBOX_MAGIC) -+ rc = -EINVAL; -+ else { -+ /* wait for the mailbox FIFO to have some space in it */ -+ while (0 != (readl(mbox->status) & ARM_MS_FULL)) -+ cpu_relax(); -+ -+ writel(MBOX_MSG(chan, data28), mbox->write); -+ rc = 0; -+ } -+ return rc; -+} -+ -+static int mbox_read(struct vc_mailbox *mbox, unsigned chan, uint32_t *data28) -+{ -+ int rc; -+ -+ if (mbox->magic != MBOX_MAGIC) -+ rc = -EINVAL; -+ else { -+ if (down_interruptible(&mbox->sema[chan]) == 0) { -+ *data28 = MBOX_DATA28(mbox->msg[chan]); -+ mbox->msg[chan] = 0; -+ rc = 0; -+ } else { -+ /* The wait was interrupted */ -+ rc = -EINTR; -+ } -+ } -+ return rc; -+} -+ -+static irqreturn_t mbox_irq(int irq, void *dev_id) -+{ -+ /* wait for the mailbox FIFO to have some data in it */ -+ struct vc_mailbox *mbox = (struct vc_mailbox *) dev_id; -+ int status = readl(mbox->status); -+ int ret = IRQ_NONE; -+ -+ while (!(status & ARM_MS_EMPTY)) { -+ uint32_t msg = readl(mbox->read); -+ int chan = MBOX_CHAN(msg); -+ if (chan < MBOX_CHAN_COUNT) { -+ if (mbox->msg[chan]) { -+ /* Overflow */ -+ printk(KERN_ERR DRIVER_NAME -+ ": mbox chan %d overflow - drop %08x\n", -+ chan, msg); -+ } else { -+ mbox->msg[chan] = (msg | 0xf); -+ up(&mbox->sema[chan]); -+ } -+ } else { -+ printk(KERN_ERR DRIVER_NAME -+ ": invalid channel selector (msg %08x)\n", msg); -+ } -+ ret = IRQ_HANDLED; -+ status = readl(mbox->status); -+ } -+ return ret; -+} -+ -+static struct irqaction mbox_irqaction = { -+ .name = "ARM Mailbox IRQ", -+ .flags = IRQF_DISABLED | IRQF_IRQPOLL, -+ .handler = mbox_irq, -+}; -+ -+/* ---------------------------------------------------------------------- -+ * Mailbox Methods -+ * -------------------------------------------------------------------- */ -+ -+static struct device *mbox_dev; /* we assume there's only one! */ -+ -+static int dev_mbox_write(struct device *dev, unsigned chan, uint32_t data28) -+{ -+ int rc; -+ -+ struct vc_mailbox *mailbox = dev_get_drvdata(dev); -+ device_lock(dev); -+ rc = mbox_write(mailbox, chan, data28); -+ device_unlock(dev); -+ -+ return rc; -+} -+ -+static int dev_mbox_read(struct device *dev, unsigned chan, uint32_t *data28) -+{ -+ int rc; -+ -+ struct vc_mailbox *mailbox = dev_get_drvdata(dev); -+ device_lock(dev); -+ rc = mbox_read(mailbox, chan, data28); -+ device_unlock(dev); -+ -+ return rc; -+} -+ -+extern int bcm_mailbox_write(unsigned chan, uint32_t data28) -+{ -+ if (mbox_dev) -+ return dev_mbox_write(mbox_dev, chan, data28); -+ else -+ return -ENODEV; -+} -+EXPORT_SYMBOL_GPL(bcm_mailbox_write); -+ -+extern int bcm_mailbox_read(unsigned chan, uint32_t *data28) -+{ -+ if (mbox_dev) -+ return dev_mbox_read(mbox_dev, chan, data28); -+ else -+ return -ENODEV; -+} -+EXPORT_SYMBOL_GPL(bcm_mailbox_read); -+ -+static void dev_mbox_register(const char *dev_name, struct device *dev) -+{ -+ mbox_dev = dev; -+} -+ -+/* ---------------------------------------------------------------------- -+ * Platform Device for Mailbox -+ * -------------------------------------------------------------------- */ -+ -+static int bcm_vcio_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ struct vc_mailbox *mailbox; -+ -+ mailbox = kzalloc(sizeof(*mailbox), GFP_KERNEL); -+ if (NULL == mailbox) { -+ printk(KERN_ERR DRIVER_NAME ": failed to allocate " -+ "mailbox memory\n"); -+ ret = -ENOMEM; -+ } else { -+ struct resource *res; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res == NULL) { -+ printk(KERN_ERR DRIVER_NAME ": failed to obtain memory " -+ "resource\n"); -+ ret = -ENODEV; -+ kfree(mailbox); -+ } else { -+ /* should be based on the registers from res really */ -+ mbox_init(mailbox, &pdev->dev, ARM_0_MAIL0_RD); -+ -+ platform_set_drvdata(pdev, mailbox); -+ dev_mbox_register(DRIVER_NAME, &pdev->dev); -+ -+ mbox_irqaction.dev_id = mailbox; -+ setup_irq(IRQ_ARM_MAILBOX, &mbox_irqaction); -+ printk(KERN_INFO DRIVER_NAME ": mailbox at %p\n", -+ __io_address(ARM_0_MAIL0_RD)); -+ } -+ } -+ return ret; -+} -+ -+static int bcm_vcio_remove(struct platform_device *pdev) -+{ -+ struct vc_mailbox *mailbox = platform_get_drvdata(pdev); -+ -+ platform_set_drvdata(pdev, NULL); -+ kfree(mailbox); -+ -+ return 0; -+} -+ -+static struct platform_driver bcm_mbox_driver = { -+ .probe = bcm_vcio_probe, -+ .remove = bcm_vcio_remove, -+ -+ .driver = { -+ .name = DRIVER_NAME, -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static int __init bcm_mbox_init(void) -+{ -+ int ret; -+ -+ printk(KERN_INFO "mailbox: Broadcom VideoCore Mailbox driver\n"); -+ -+ ret = platform_driver_register(&bcm_mbox_driver); -+ if (ret != 0) { -+ printk(KERN_ERR DRIVER_NAME ": failed to register " -+ "on platform\n"); -+ } -+ -+ return ret; -+} -+ -+static void __exit bcm_mbox_exit(void) -+{ -+ platform_driver_unregister(&bcm_mbox_driver); -+} -+ -+arch_initcall(bcm_mbox_init); /* Initialize early */ -+module_exit(bcm_mbox_exit); -+ -+MODULE_AUTHOR("Gray Girling"); -+MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS("platform:bcm-mbox"); -diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/vc_mem.c linux-3.2.19.patch/arch/arm/mach-bcm2708/vc_mem.c ---- linux-3.2.19/arch/arm/mach-bcm2708/vc_mem.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/arch/arm/mach-bcm2708/vc_mem.c 2012-06-10 05:51:05.250409220 +0200 +diff --git a/arch/arm/mach-bcm2708/vc_mem.c b/arch/arm/mach-bcm2708/vc_mem.c +new file mode 100644 +index 0000000..67c10ee +--- /dev/null ++++ b/arch/arm/mach-bcm2708/vc_mem.c @@ -0,0 +1,466 @@ +/***************************************************************************** +* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved. @@ -6348,21 +6122,338 @@ diff -Naur linux-3.2.19/arch/arm/mach-bcm2708/vc_mem.c linux-3.2.19.patch/arch/a +module_exit(vc_mem_exit); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Broadcom Corporation"); -diff -Naur linux-3.2.19/arch/arm/Makefile linux-3.2.19.patch/arch/arm/Makefile ---- linux-3.2.19/arch/arm/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/arch/arm/Makefile 2012-06-10 05:51:05.015404482 +0200 -@@ -198,6 +198,7 @@ - machine-$(CONFIG_MACH_SPEAR320) := spear3xx - machine-$(CONFIG_MACH_SPEAR600) := spear6xx - machine-$(CONFIG_ARCH_ZYNQ) := zynq -+machine-$(CONFIG_ARCH_BCM2708) := bcm2708 +diff --git a/arch/arm/mach-bcm2708/vcio.c b/arch/arm/mach-bcm2708/vcio.c +new file mode 100644 +index 0000000..799a0ac +--- /dev/null ++++ b/arch/arm/mach-bcm2708/vcio.c +@@ -0,0 +1,308 @@ ++/* ++ * linux/arch/arm/mach-bcm2708/vcio.c ++ * ++ * Copyright (C) 2010 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This device provides a shared mechanism for writing to the mailboxes, ++ * semaphores, doorbells etc. that are shared between the ARM and the ++ * VideoCore processor ++ */ ++ ++#if defined(CONFIG_SERIAL_BCM_MBOX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) ++#define SUPPORT_SYSRQ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include ++#include ++ ++#define DRIVER_NAME BCM_VCIO_DRIVER_NAME ++ ++/* ---------------------------------------------------------------------- ++ * Mailbox ++ * -------------------------------------------------------------------- */ ++ ++/* offsets from a mail box base address */ ++#define MAIL_WRT 0x00 /* write - and next 4 words */ ++#define MAIL_RD 0x00 /* read - and next 4 words */ ++#define MAIL_POL 0x10 /* read without popping the fifo */ ++#define MAIL_SND 0x14 /* sender ID (bottom two bits) */ ++#define MAIL_STA 0x18 /* status */ ++#define MAIL_CNF 0x1C /* configuration */ ++ ++#define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) ++#define MBOX_MSG_LSB(chan, data28) (((data28) << 4) | ((chan) & 0xf)) ++#define MBOX_CHAN(msg) ((msg) & 0xf) ++#define MBOX_DATA28(msg) ((msg) & ~0xf) ++#define MBOX_DATA28_LSB(msg) (((uint32_t)msg) >> 4) ++ ++#define MBOX_MAGIC 0xd0d0c0de ++ ++struct vc_mailbox { ++ struct device *dev; /* parent device */ ++ void __iomem *status; ++ void __iomem *config; ++ void __iomem *read; ++ void __iomem *write; ++ uint32_t msg[MBOX_CHAN_COUNT]; ++ struct semaphore sema[MBOX_CHAN_COUNT]; ++ uint32_t magic; ++}; ++ ++static void mbox_init(struct vc_mailbox *mbox_out, struct device *dev, ++ uint32_t addr_mbox) ++{ ++ int i; ++ ++ mbox_out->dev = dev; ++ mbox_out->status = __io_address(addr_mbox + MAIL_STA); ++ mbox_out->config = __io_address(addr_mbox + MAIL_CNF); ++ mbox_out->read = __io_address(addr_mbox + MAIL_RD); ++ /* Write to the other mailbox */ ++ mbox_out->write = ++ __io_address((addr_mbox ^ ARM_0_MAIL0_WRT ^ ARM_0_MAIL1_WRT) + ++ MAIL_WRT); ++ ++ for (i = 0; i < MBOX_CHAN_COUNT; i++) { ++ mbox_out->msg[i] = 0; ++ sema_init(&mbox_out->sema[i], 0); ++ } ++ ++ /* Enable the interrupt on data reception */ ++ writel(ARM_MC_IHAVEDATAIRQEN, mbox_out->config); ++ ++ mbox_out->magic = MBOX_MAGIC; ++} ++ ++static int mbox_write(struct vc_mailbox *mbox, unsigned chan, uint32_t data28) ++{ ++ int rc; ++ ++ if (mbox->magic != MBOX_MAGIC) ++ rc = -EINVAL; ++ else { ++ /* wait for the mailbox FIFO to have some space in it */ ++ while (0 != (readl(mbox->status) & ARM_MS_FULL)) ++ cpu_relax(); ++ ++ writel(MBOX_MSG(chan, data28), mbox->write); ++ rc = 0; ++ } ++ return rc; ++} ++ ++static int mbox_read(struct vc_mailbox *mbox, unsigned chan, uint32_t *data28) ++{ ++ int rc; ++ ++ if (mbox->magic != MBOX_MAGIC) ++ rc = -EINVAL; ++ else { ++ if (down_interruptible(&mbox->sema[chan]) == 0) { ++ *data28 = MBOX_DATA28(mbox->msg[chan]); ++ mbox->msg[chan] = 0; ++ rc = 0; ++ } else { ++ /* The wait was interrupted */ ++ rc = -EINTR; ++ } ++ } ++ return rc; ++} ++ ++static irqreturn_t mbox_irq(int irq, void *dev_id) ++{ ++ /* wait for the mailbox FIFO to have some data in it */ ++ struct vc_mailbox *mbox = (struct vc_mailbox *) dev_id; ++ int status = readl(mbox->status); ++ int ret = IRQ_NONE; ++ ++ while (!(status & ARM_MS_EMPTY)) { ++ uint32_t msg = readl(mbox->read); ++ int chan = MBOX_CHAN(msg); ++ if (chan < MBOX_CHAN_COUNT) { ++ if (mbox->msg[chan]) { ++ /* Overflow */ ++ printk(KERN_ERR DRIVER_NAME ++ ": mbox chan %d overflow - drop %08x\n", ++ chan, msg); ++ } else { ++ mbox->msg[chan] = (msg | 0xf); ++ up(&mbox->sema[chan]); ++ } ++ } else { ++ printk(KERN_ERR DRIVER_NAME ++ ": invalid channel selector (msg %08x)\n", msg); ++ } ++ ret = IRQ_HANDLED; ++ status = readl(mbox->status); ++ } ++ return ret; ++} ++ ++static struct irqaction mbox_irqaction = { ++ .name = "ARM Mailbox IRQ", ++ .flags = IRQF_DISABLED | IRQF_IRQPOLL, ++ .handler = mbox_irq, ++}; ++ ++/* ---------------------------------------------------------------------- ++ * Mailbox Methods ++ * -------------------------------------------------------------------- */ ++ ++static struct device *mbox_dev; /* we assume there's only one! */ ++ ++static int dev_mbox_write(struct device *dev, unsigned chan, uint32_t data28) ++{ ++ int rc; ++ ++ struct vc_mailbox *mailbox = dev_get_drvdata(dev); ++ device_lock(dev); ++ rc = mbox_write(mailbox, chan, data28); ++ device_unlock(dev); ++ ++ return rc; ++} ++ ++static int dev_mbox_read(struct device *dev, unsigned chan, uint32_t *data28) ++{ ++ int rc; ++ ++ struct vc_mailbox *mailbox = dev_get_drvdata(dev); ++ device_lock(dev); ++ rc = mbox_read(mailbox, chan, data28); ++ device_unlock(dev); ++ ++ return rc; ++} ++ ++extern int bcm_mailbox_write(unsigned chan, uint32_t data28) ++{ ++ if (mbox_dev) ++ return dev_mbox_write(mbox_dev, chan, data28); ++ else ++ return -ENODEV; ++} ++EXPORT_SYMBOL_GPL(bcm_mailbox_write); ++ ++extern int bcm_mailbox_read(unsigned chan, uint32_t *data28) ++{ ++ if (mbox_dev) ++ return dev_mbox_read(mbox_dev, chan, data28); ++ else ++ return -ENODEV; ++} ++EXPORT_SYMBOL_GPL(bcm_mailbox_read); ++ ++static void dev_mbox_register(const char *dev_name, struct device *dev) ++{ ++ mbox_dev = dev; ++} ++ ++/* ---------------------------------------------------------------------- ++ * Platform Device for Mailbox ++ * -------------------------------------------------------------------- */ ++ ++static int bcm_vcio_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ struct vc_mailbox *mailbox; ++ ++ mailbox = kzalloc(sizeof(*mailbox), GFP_KERNEL); ++ if (NULL == mailbox) { ++ printk(KERN_ERR DRIVER_NAME ": failed to allocate " ++ "mailbox memory\n"); ++ ret = -ENOMEM; ++ } else { ++ struct resource *res; ++ ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res == NULL) { ++ printk(KERN_ERR DRIVER_NAME ": failed to obtain memory " ++ "resource\n"); ++ ret = -ENODEV; ++ kfree(mailbox); ++ } else { ++ /* should be based on the registers from res really */ ++ mbox_init(mailbox, &pdev->dev, ARM_0_MAIL0_RD); ++ ++ platform_set_drvdata(pdev, mailbox); ++ dev_mbox_register(DRIVER_NAME, &pdev->dev); ++ ++ mbox_irqaction.dev_id = mailbox; ++ setup_irq(IRQ_ARM_MAILBOX, &mbox_irqaction); ++ printk(KERN_INFO DRIVER_NAME ": mailbox at %p\n", ++ __io_address(ARM_0_MAIL0_RD)); ++ } ++ } ++ return ret; ++} ++ ++static int bcm_vcio_remove(struct platform_device *pdev) ++{ ++ struct vc_mailbox *mailbox = platform_get_drvdata(pdev); ++ ++ platform_set_drvdata(pdev, NULL); ++ kfree(mailbox); ++ ++ return 0; ++} ++ ++static struct platform_driver bcm_mbox_driver = { ++ .probe = bcm_vcio_probe, ++ .remove = bcm_vcio_remove, ++ ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init bcm_mbox_init(void) ++{ ++ int ret; ++ ++ printk(KERN_INFO "mailbox: Broadcom VideoCore Mailbox driver\n"); ++ ++ ret = platform_driver_register(&bcm_mbox_driver); ++ if (ret != 0) { ++ printk(KERN_ERR DRIVER_NAME ": failed to register " ++ "on platform\n"); ++ } ++ ++ return ret; ++} ++ ++static void __exit bcm_mbox_exit(void) ++{ ++ platform_driver_unregister(&bcm_mbox_driver); ++} ++ ++arch_initcall(bcm_mbox_init); /* Initialize early */ ++module_exit(bcm_mbox_exit); ++ ++MODULE_AUTHOR("Gray Girling"); ++MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:bcm-mbox"); +diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig +index 67f75a0..2c9ec3c 100644 +--- a/arch/arm/mm/Kconfig ++++ b/arch/arm/mm/Kconfig +@@ -390,7 +390,7 @@ config CPU_PJ4 - # Platform directory name. This list is sorted alphanumerically - # by CONFIG_* macro name. -diff -Naur linux-3.2.19/arch/arm/mm/alignment.c linux-3.2.19.patch/arch/arm/mm/alignment.c ---- linux-3.2.19/arch/arm/mm/alignment.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/arch/arm/mm/alignment.c 2012-06-10 05:51:05.061405409 +0200 -@@ -855,9 +855,11 @@ + # ARMv6 + config CPU_V6 +- bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX ++ bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || MACH_BCM2708 + select CPU_32v6 + select CPU_ABRT_EV6 + select CPU_PABRT_V6 +diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c +index c335c76..118b667 100644 +--- a/arch/arm/mm/alignment.c ++++ b/arch/arm/mm/alignment.c +@@ -855,9 +855,11 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) case 0x08000000: /* ldm or stm, or thumb-2 32bit instruction */ if (thumb2_32b) handler = do_alignment_t32_to_handler(&instr, regs, &offset); @@ -6376,22 +6467,11 @@ diff -Naur linux-3.2.19/arch/arm/mm/alignment.c linux-3.2.19.patch/arch/arm/mm/a default: goto bad; -diff -Naur linux-3.2.19/arch/arm/mm/Kconfig linux-3.2.19.patch/arch/arm/mm/Kconfig ---- linux-3.2.19/arch/arm/mm/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/arch/arm/mm/Kconfig 2012-06-10 05:51:05.060405389 +0200 -@@ -390,7 +390,7 @@ - - # ARMv6 - config CPU_V6 -- bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX -+ bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || MACH_BCM2708 - select CPU_32v6 - select CPU_ABRT_EV6 - select CPU_PABRT_V6 -diff -Naur linux-3.2.19/arch/arm/mm/proc-v6.S linux-3.2.19.patch/arch/arm/mm/proc-v6.S ---- linux-3.2.19/arch/arm/mm/proc-v6.S 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/arch/arm/mm/proc-v6.S 2012-06-10 05:51:05.061405409 +0200 -@@ -70,10 +70,19 @@ +diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S +index d061d2f..436dc2c 100644 +--- a/arch/arm/mm/proc-v6.S ++++ b/arch/arm/mm/proc-v6.S +@@ -70,10 +70,19 @@ ENTRY(cpu_v6_reset) * * IRQs are already disabled. */ @@ -6414,9 +6494,42 @@ diff -Naur linux-3.2.19/arch/arm/mm/proc-v6.S linux-3.2.19.patch/arch/arm/mm/pro mov pc, lr ENTRY(cpu_v6_dcache_clean_area) -diff -Naur linux-3.2.19/drivers/i2c/busses/i2c-bcm2708.c linux-3.2.19.patch/drivers/i2c/busses/i2c-bcm2708.c ---- linux-3.2.19/drivers/i2c/busses/i2c-bcm2708.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/i2c/busses/i2c-bcm2708.c 2012-06-10 05:51:05.365411539 +0200 +diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig +index a3afac4..cbc62ff 100644 +--- a/drivers/i2c/busses/Kconfig ++++ b/drivers/i2c/busses/Kconfig +@@ -308,6 +308,14 @@ config I2C_AU1550 + This driver can also be built as a module. If so, the module + will be called i2c-au1550. + ++config I2C_BCM2708 ++ tristate "BCM2708 BSC" ++ depends on MACH_BCM2708 ++ help ++ Enabling this option will add BSC (Broadcom Serial Controller) ++ support for the BCM2708. BSC is a Broadcom proprietary bus compatible ++ with I2C/TWI/SMBus. ++ + config I2C_BLACKFIN_TWI + tristate "Blackfin TWI I2C support" + depends on BLACKFIN +diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile +index fba6da6..4022671 100644 +--- a/drivers/i2c/busses/Makefile ++++ b/drivers/i2c/busses/Makefile +@@ -30,6 +30,7 @@ obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o + # Embedded system I2C/SMBus host controller drivers + obj-$(CONFIG_I2C_AT91) += i2c-at91.o + obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o ++obj-$(CONFIG_I2C_BCM2708) += i2c-bcm2708.o + obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o + obj-$(CONFIG_I2C_CPM) += i2c-cpm.o + obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o +diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c +new file mode 100644 +index 0000000..5ec460f +--- /dev/null ++++ b/drivers/i2c/busses/i2c-bcm2708.c @@ -0,0 +1,379 @@ +/* + * Driver for Broadcom BCM2708 BSC Controllers @@ -6797,56 +6910,71 @@ diff -Naur linux-3.2.19/drivers/i2c/busses/i2c-bcm2708.c linux-3.2.19.patch/driv +MODULE_AUTHOR("Chris Boot "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -diff -Naur linux-3.2.19/drivers/i2c/busses/Kconfig linux-3.2.19.patch/drivers/i2c/busses/Kconfig ---- linux-3.2.19/drivers/i2c/busses/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/i2c/busses/Kconfig 2012-06-10 05:51:05.358411399 +0200 -@@ -308,6 +308,14 @@ - This driver can also be built as a module. If so, the module - will be called i2c-au1550. - -+config I2C_BCM2708 -+ tristate "BCM2708 BSC" -+ depends on MACH_BCM2708 -+ help -+ Enabling this option will add BSC (Broadcom Serial Controller) -+ support for the BCM2708. BSC is a Broadcom proprietary bus compatible -+ with I2C/TWI/SMBus. -+ - config I2C_BLACKFIN_TWI - tristate "Blackfin TWI I2C support" - depends on BLACKFIN -diff -Naur linux-3.2.19/drivers/i2c/busses/Makefile linux-3.2.19.patch/drivers/i2c/busses/Makefile ---- linux-3.2.19/drivers/i2c/busses/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/i2c/busses/Makefile 2012-06-10 05:51:05.358411399 +0200 -@@ -30,6 +30,7 @@ - # Embedded system I2C/SMBus host controller drivers - obj-$(CONFIG_I2C_AT91) += i2c-at91.o - obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o -+obj-$(CONFIG_I2C_BCM2708) += i2c-bcm2708.o - obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o - obj-$(CONFIG_I2C_CPM) += i2c-cpm.o - obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o -diff -Naur linux-3.2.19/drivers/misc/Kconfig linux-3.2.19.patch/drivers/misc/Kconfig ---- linux-3.2.19/drivers/misc/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/misc/Kconfig 2012-06-10 05:51:05.129406780 +0200 -@@ -508,5 +508,6 @@ +diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig +index 5664696..b4679ec 100644 +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -508,5 +508,6 @@ source "drivers/misc/ti-st/Kconfig" source "drivers/misc/lis3lv02d/Kconfig" source "drivers/misc/carma/Kconfig" source "drivers/misc/altera-stapl/Kconfig" +source "drivers/misc/vc04_services/Kconfig" endif # MISC_DEVICES -diff -Naur linux-3.2.19/drivers/misc/Makefile linux-3.2.19.patch/drivers/misc/Makefile ---- linux-3.2.19/drivers/misc/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/misc/Makefile 2012-06-10 05:51:05.129406780 +0200 -@@ -48,3 +48,4 @@ +diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile +index b26495a..a06b534 100644 +--- a/drivers/misc/Makefile ++++ b/drivers/misc/Makefile +@@ -48,3 +48,4 @@ obj-y += lis3lv02d/ obj-y += carma/ obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/ +obj-y += vc04_services/ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/connections/connection.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/connections/connection.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchi/connections/connection.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/connections/connection.h 2012-06-10 05:51:05.220408616 +0200 +diff --git a/drivers/misc/vc04_services/Kconfig b/drivers/misc/vc04_services/Kconfig +new file mode 100644 +index 0000000..d97a1e2 +--- /dev/null ++++ b/drivers/misc/vc04_services/Kconfig +@@ -0,0 +1,7 @@ ++config BCM2708_VCHIQ ++ tristate "Videocore VCHIQ" ++ depends on MACH_BCM2708 ++ default y ++ help ++ Helper for communication for VideoCore. ++ +diff --git a/drivers/misc/vc04_services/Makefile b/drivers/misc/vc04_services/Makefile +new file mode 100644 +index 0000000..ee53af7 +--- /dev/null ++++ b/drivers/misc/vc04_services/Makefile +@@ -0,0 +1,21 @@ ++obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o ++ ++vchiq-objs := \ ++ interface/vchiq_arm/vchiq_core.o \ ++ interface/vchiq_arm/vchiq_shim.o \ ++ interface/vchiq_arm/vchiq_util.o \ ++ interface/vchiq_arm/vchiq_arm.o \ ++ interface/vchiq_arm/vchiq_kern_lib.o \ ++ interface/vchiq_arm/vchiq_2835_arm.o \ ++ interface/vcos/linuxkernel/vcos_linuxkernel.o \ ++ interface/vcos/linuxkernel/vcos_thread_map.o \ ++ interface/vcos/linuxkernel/vcos_linuxkernel_cfg.o \ ++ interface/vcos/generic/vcos_generic_event_flags.o \ ++ interface/vcos/generic/vcos_logcat.o \ ++ interface/vcos/generic/vcos_mem_from_malloc.o \ ++ interface/vcos/generic/vcos_cmd.o ++ ++EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel ++ ++ ++ +diff --git a/drivers/misc/vc04_services/interface/vchi/connections/connection.h b/drivers/misc/vc04_services/interface/vchi/connections/connection.h +new file mode 100644 +index 0000000..2fe5742 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchi/connections/connection.h @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -7157,9 +7285,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/connections/co +#endif /* CONNECTION_H_ */ + +/****************************** End of file **********************************/ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 2012-06-10 05:51:05.220408616 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h b/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h +new file mode 100644 +index 0000000..7701b15 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -7347,443 +7477,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/message_driver +#endif // _VCHI_MESSAGE_H_ + +/****************************** End of file ***********************************/ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 2012-06-10 05:51:05.222408656 +0200 -@@ -0,0 +1,214 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+/*============================================================================= -+Contains the #defines for the number of servers / clients etc, these can be -+over-ridden from the platform makefile if needed -+=============================================================================*/ -+ -+#ifndef VCHI_CFG_H_ -+#define VCHI_CFG_H_ -+ -+/**************************************************************************************** -+ * Defines in this first section are part of the VCHI API and may be examined by VCHI -+ * services. -+ ***************************************************************************************/ -+ -+/* Required alignment of base addresses for bulk transfer, if unaligned transfers are not enabled */ -+/* Really determined by the message driver, and should be available from a run-time call. */ -+#ifndef VCHI_BULK_ALIGN -+# if __VCCOREVER__ >= 0x04000000 -+# define VCHI_BULK_ALIGN 32 // Allows for the need to do cache cleans -+# else -+# define VCHI_BULK_ALIGN 16 -+# endif -+#endif -+ -+/* Required length multiple for bulk transfers, if unaligned transfers are not enabled */ -+/* May be less than or greater than VCHI_BULK_ALIGN */ -+/* Really determined by the message driver, and should be available from a run-time call. */ -+#ifndef VCHI_BULK_GRANULARITY -+# if __VCCOREVER__ >= 0x04000000 -+# define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache cleans -+# else -+# define VCHI_BULK_GRANULARITY 16 -+# endif -+#endif -+ -+/* The largest possible message to be queued with vchi_msg_queue. */ -+#ifndef VCHI_MAX_MSG_SIZE -+# if defined VCHI_LOCAL_HOST_PORT -+# define VCHI_MAX_MSG_SIZE 16384 // makes file transfers fast, but should they be using bulk? -+# else -+# define VCHI_MAX_MSG_SIZE 4096 // NOTE: THIS MUST BE LARGER THAN OR EQUAL TO THE SIZE OF THE KHRONOS MERGE BUFFER!! -+# endif -+#endif -+ -+/****************************************************************************************** -+ * Defines below are system configuration options, and should not be used by VCHI services. -+ *****************************************************************************************/ -+ -+/* How many connections can we support? A localhost implementation uses 2 connections, -+ * 1 for host-app, 1 for VMCS, and these are hooked together by a loopback MPHI VCFW -+ * driver. */ -+#ifndef VCHI_MAX_NUM_CONNECTIONS -+# define VCHI_MAX_NUM_CONNECTIONS 3 -+#endif -+ -+/* How many services can we open per connection? Extending this doesn't cost processing time, just a small -+ * amount of static memory. */ -+#ifndef VCHI_MAX_SERVICES_PER_CONNECTION -+# define VCHI_MAX_SERVICES_PER_CONNECTION 36 -+#endif -+ -+/* Adjust if using a message driver that supports more logical TX channels */ -+#ifndef VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION -+# define VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION 9 // 1 MPHI + 8 CCP2 logical channels -+#endif -+ -+/* Adjust if using a message driver that supports more logical RX channels */ -+#ifndef VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION -+# define VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION 1 // 1 MPHI -+#endif -+ -+/* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives the effective -+ * receive queue space, less message headers. */ -+#ifndef VCHI_NUM_READ_SLOTS -+# if defined(VCHI_LOCAL_HOST_PORT) -+# define VCHI_NUM_READ_SLOTS 4 -+# else -+# define VCHI_NUM_READ_SLOTS 48 -+# endif -+#endif -+ -+/* Do we utilise overrun facility for receive message slots? Can aid peer transmit -+ * performance. Only define on VideoCore end, talking to host. -+ */ -+//#define VCHI_MSG_RX_OVERRUN -+ -+/* How many transmit slots do we use. Generally don't need many, as the hardware driver -+ * underneath VCHI will usually have its own buffering. */ -+#ifndef VCHI_NUM_WRITE_SLOTS -+# define VCHI_NUM_WRITE_SLOTS 4 -+#endif -+ -+/* If a service has held or queued received messages in VCHI_XOFF_THRESHOLD or more slots, -+ * then it's taking up too much buffer space, and the peer service will be told to stop -+ * transmitting with an XOFF message. For this to be effective, the VCHI_NUM_READ_SLOTS -+ * needs to be considerably bigger than VCHI_NUM_WRITE_SLOTS, or the transmit latency -+ * is too high. */ -+#ifndef VCHI_XOFF_THRESHOLD -+# define VCHI_XOFF_THRESHOLD (VCHI_NUM_READ_SLOTS / 2) -+#endif -+ -+/* After we've sent an XOFF, the peer will be told to resume transmission once the local -+ * service has dequeued/released enough messages that it's now occupying -+ * VCHI_XON_THRESHOLD slots or fewer. */ -+#ifndef VCHI_XON_THRESHOLD -+# define VCHI_XON_THRESHOLD (VCHI_NUM_READ_SLOTS / 4) -+#endif -+ -+/* A size below which a bulk transfer omits the handshake completely and always goes -+ * via the message channel, if bulk auxiliary is being sent on that service. (The user -+ * can guarantee this by enabling unaligned transmits). -+ * Not API. */ -+#ifndef VCHI_MIN_BULK_SIZE -+# define VCHI_MIN_BULK_SIZE ( VCHI_MAX_MSG_SIZE / 2 < 4096 ? VCHI_MAX_MSG_SIZE / 2 : 4096 ) -+#endif -+ -+/* Maximum size of bulk transmission chunks, for each interface type. A trade-off between -+ * speed and latency; the smaller the chunk size the better change of messages and other -+ * bulk transmissions getting in when big bulk transfers are happening. Set to 0 to not -+ * break transmissions into chunks. -+ */ -+#ifndef VCHI_MAX_BULK_CHUNK_SIZE_MPHI -+# define VCHI_MAX_BULK_CHUNK_SIZE_MPHI (16 * 1024) -+#endif -+ -+/* NB Chunked CCP2 transmissions violate the letter of the CCP2 spec by using "JPEG8" mode -+ * with multiple-line frames. Only use if the receiver can cope. */ -+#ifndef VCHI_MAX_BULK_CHUNK_SIZE_CCP2 -+# define VCHI_MAX_BULK_CHUNK_SIZE_CCP2 0 -+#endif -+ -+/* How many TX messages can we have pending in our transmit slots. Once exhausted, -+ * vchi_msg_queue will be blocked. */ -+#ifndef VCHI_TX_MSG_QUEUE_SIZE -+# define VCHI_TX_MSG_QUEUE_SIZE 256 -+#endif -+ -+/* How many RX messages can we have parsed in the receive slots. Once exhausted, parsing -+ * will be suspended until older messages are dequeued/released. */ -+#ifndef VCHI_RX_MSG_QUEUE_SIZE -+# define VCHI_RX_MSG_QUEUE_SIZE 256 -+#endif -+ -+/* Really should be able to cope if we run out of received message descriptors, by -+ * suspending parsing as the comment above says, but we don't. This sweeps the issue -+ * under the carpet. */ -+#if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS -+# undef VCHI_RX_MSG_QUEUE_SIZE -+# define VCHI_RX_MSG_QUEUE_SIZE (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS -+#endif -+ -+/* How many bulk transmits can we have pending. Once exhausted, vchi_bulk_queue_transmit -+ * will be blocked. */ -+#ifndef VCHI_TX_BULK_QUEUE_SIZE -+# define VCHI_TX_BULK_QUEUE_SIZE 64 -+#endif -+ -+/* How many bulk receives can we have pending. Once exhausted, vchi_bulk_queue_receive -+ * will be blocked. */ -+#ifndef VCHI_RX_BULK_QUEUE_SIZE -+# define VCHI_RX_BULK_QUEUE_SIZE 64 -+#endif -+ -+/* A limit on how many outstanding bulk requests we expect the peer to give us. If -+ * the peer asks for more than this, VCHI will fail and assert. The number is determined -+ * by the peer's hardware - it's the number of outstanding requests that can be queued -+ * on all bulk channels. VC3's MPHI peripheral allows 16. */ -+#ifndef VCHI_MAX_PEER_BULK_REQUESTS -+# define VCHI_MAX_PEER_BULK_REQUESTS 32 -+#endif -+ -+/* Define VCHI_CCP2TX_MANUAL_POWER if the host tells us when to turn the CCP2 -+ * transmitter on and off. -+ */ -+/*#define VCHI_CCP2TX_MANUAL_POWER*/ -+ -+#ifndef VCHI_CCP2TX_MANUAL_POWER -+ -+/* Timeout (in milliseconds) for putting the CCP2TX interface into IDLE state. Set -+ * negative for no IDLE. -+ */ -+# ifndef VCHI_CCP2TX_IDLE_TIMEOUT -+# define VCHI_CCP2TX_IDLE_TIMEOUT 5 -+# endif -+ -+/* Timeout (in milliseconds) for putting the CCP2TX interface into OFF state. Set -+ * negative for no OFF. -+ */ -+# ifndef VCHI_CCP2TX_OFF_TIMEOUT -+# define VCHI_CCP2TX_OFF_TIMEOUT 1000 -+# endif -+ -+#endif /* VCHI_CCP2TX_MANUAL_POWER */ -+ -+#endif /* VCHI_CFG_H_ */ -+ -+/****************************** End of file **********************************/ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 2012-06-10 05:51:05.223408676 +0200 -@@ -0,0 +1,56 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHI_CFG_INTERNAL_H_ -+#define VCHI_CFG_INTERNAL_H_ -+ -+/**************************************************************************************** -+ * Control optimisation attempts. -+ ***************************************************************************************/ -+ -+// Don't use lots of short-term locks - use great long ones, reducing the overall locks-per-second -+#define VCHI_COARSE_LOCKING -+ -+// Avoid lock then unlock on exit from blocking queue operations (msg tx, bulk rx/tx) -+// (only relevant if VCHI_COARSE_LOCKING) -+#define VCHI_ELIDE_BLOCK_EXIT_LOCK -+ -+// Avoid lock on non-blocking peek -+// (only relevant if VCHI_COARSE_LOCKING) -+#define VCHI_AVOID_PEEK_LOCK -+ -+// Use one slot-handler thread per connection, rather than 1 thread dealing with all connections in rotation. -+#define VCHI_MULTIPLE_HANDLER_THREADS -+ -+// Put free descriptors onto the head of the free queue, rather than the tail, so that we don't thrash -+// our way through the pool of descriptors. -+#define VCHI_PUSH_FREE_DESCRIPTORS_ONTO_HEAD -+ -+// Don't issue a MSG_AVAILABLE callback for every single message. Possibly only safe if VCHI_COARSE_LOCKING. -+#define VCHI_FEWER_MSG_AVAILABLE_CALLBACKS -+ -+// Don't use message descriptors for TX messages that don't need them -+#define VCHI_MINIMISE_TX_MSG_DESCRIPTORS -+ -+// Nano-locks for multiqueue -+//#define VCHI_MQUEUE_NANOLOCKS -+ -+// Lock-free(er) dequeuing -+//#define VCHI_RX_NANOLOCKS -+ -+#endif /*VCHI_CFG_INTERNAL_H_*/ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_common.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_common.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_common.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_common.h 2012-06-10 05:51:05.223408676 +0200 -@@ -0,0 +1,152 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+/*============================================================================= -+Contains global defs used by submodules within vchi. -+=============================================================================*/ -+ -+#ifndef VCHI_COMMON_H_ -+#define VCHI_COMMON_H_ -+ -+ -+//flags used when sending messages (must be bitmapped) -+typedef enum -+{ -+ VCHI_FLAGS_NONE = 0x0, -+ VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side) -+ VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent -+ VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go -+ VCHI_FLAGS_ALLOW_PARTIAL = 0x8, -+ VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10, -+ VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20, -+ -+ VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only -+ VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only -+ VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only -+ VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only -+ VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only -+ VCHI_FLAGS_INTERNAL = 0xFF0000 -+} VCHI_FLAGS_T; -+ -+// constants for vchi_crc_control() -+typedef enum { -+ VCHI_CRC_NOTHING = -1, -+ VCHI_CRC_PER_SERVICE = 0, -+ VCHI_CRC_EVERYTHING = 1, -+} VCHI_CRC_CONTROL_T; -+ -+//callback reasons when an event occurs on a service -+typedef enum -+{ -+ VCHI_CALLBACK_REASON_MIN, -+ -+ //This indicates that there is data available -+ //handle is the msg id that was transmitted with the data -+ // When a message is received and there was no FULL message available previously, send callback -+ // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails -+ VCHI_CALLBACK_MSG_AVAILABLE, -+ VCHI_CALLBACK_MSG_SENT, -+ VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented -+ -+ // This indicates that a transfer from the other side has completed -+ VCHI_CALLBACK_BULK_RECEIVED, -+ //This indicates that data queued up to be sent has now gone -+ //handle is the msg id that was used when sending the data -+ VCHI_CALLBACK_BULK_SENT, -+ VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented -+ VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented -+ -+ VCHI_CALLBACK_SERVICE_CLOSED, -+ -+ // this side has sent XOFF to peer due to lack of data consumption by service -+ // (suggests the service may need to take some recovery action if it has -+ // been deliberately holding off consuming data) -+ VCHI_CALLBACK_SENT_XOFF, -+ VCHI_CALLBACK_SENT_XON, -+ -+ // indicates that a bulk transfer has finished reading the source buffer -+ VCHI_CALLBACK_BULK_DATA_READ, -+ -+ // power notification events (currently host side only) -+ VCHI_CALLBACK_PEER_OFF, -+ VCHI_CALLBACK_PEER_SUSPENDED, -+ VCHI_CALLBACK_PEER_ON, -+ VCHI_CALLBACK_PEER_RESUMED, -+ VCHI_CALLBACK_FORCED_POWER_OFF, -+ -+#ifdef USE_VCHIQ_ARM -+ // some extra notifications provided by vchiq_arm -+ VCHI_CALLBACK_SERVICE_OPENED, -+ VCHI_CALLBACK_BULK_RECEIVE_ABORTED, -+ VCHI_CALLBACK_BULK_TRANSMIT_ABORTED, -+#endif -+ -+ VCHI_CALLBACK_REASON_MAX -+} VCHI_CALLBACK_REASON_T; -+ -+//Calback used by all services / bulk transfers -+typedef void (*VCHI_CALLBACK_T)( void *callback_param, //my service local param -+ VCHI_CALLBACK_REASON_T reason, -+ void *handle ); //for transmitting msg's only -+ -+ -+ -+/* -+ * Define vector struct for scatter-gather (vector) operations -+ * Vectors can be nested - if a vector element has negative length, then -+ * the data pointer is treated as pointing to another vector array, with -+ * '-vec_len' elements. Thus to append a header onto an existing vector, -+ * you can do this: -+ * -+ * void foo(const VCHI_MSG_VECTOR_T *v, int n) -+ * { -+ * VCHI_MSG_VECTOR_T nv[2]; -+ * nv[0].vec_base = my_header; -+ * nv[0].vec_len = sizeof my_header; -+ * nv[1].vec_base = v; -+ * nv[1].vec_len = -n; -+ * ... -+ * -+ */ -+typedef struct vchi_msg_vector { -+ const void *vec_base; -+ int32_t vec_len; -+} VCHI_MSG_VECTOR_T; -+ -+// Opaque type for a connection API -+typedef struct opaque_vchi_connection_api_t VCHI_CONNECTION_API_T; -+ -+// Opaque type for a message driver -+typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T; -+ -+ -+// Iterator structure for reading ahead through received message queue. Allocated by client, -+// initialised by vchi_msg_look_ahead. Fields are for internal VCHI use only. -+// Iterates over messages in queue at the instant of the call to vchi_msg_lookahead - -+// will not proceed to messages received since. Behaviour is undefined if an iterator -+// is used again after messages for that service are removed/dequeued by any -+// means other than vchi_msg_iter_... calls on the iterator itself. -+typedef struct { -+ struct opaque_vchi_service_t *service; -+ void *last; -+ void *next; -+ void *remove; -+} VCHI_MSG_ITER_T; -+ -+ -+#endif // VCHI_COMMON_H_ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi.h 2012-06-10 05:51:05.221408636 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchi/vchi.h b/drivers/misc/vc04_services/interface/vchi/vchi.h +new file mode 100644 +index 0000000..e441d8c +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchi/vchi.h @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -8132,9 +7830,451 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi.h linux-3 +#endif /* VCHI_H_ */ + +/****************************** End of file **********************************/ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_mh.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 2012-06-10 05:51:05.176407729 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h b/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h +new file mode 100644 +index 0000000..a66e489 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h +@@ -0,0 +1,214 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++/*============================================================================= ++Contains the #defines for the number of servers / clients etc, these can be ++over-ridden from the platform makefile if needed ++=============================================================================*/ ++ ++#ifndef VCHI_CFG_H_ ++#define VCHI_CFG_H_ ++ ++/**************************************************************************************** ++ * Defines in this first section are part of the VCHI API and may be examined by VCHI ++ * services. ++ ***************************************************************************************/ ++ ++/* Required alignment of base addresses for bulk transfer, if unaligned transfers are not enabled */ ++/* Really determined by the message driver, and should be available from a run-time call. */ ++#ifndef VCHI_BULK_ALIGN ++# if __VCCOREVER__ >= 0x04000000 ++# define VCHI_BULK_ALIGN 32 // Allows for the need to do cache cleans ++# else ++# define VCHI_BULK_ALIGN 16 ++# endif ++#endif ++ ++/* Required length multiple for bulk transfers, if unaligned transfers are not enabled */ ++/* May be less than or greater than VCHI_BULK_ALIGN */ ++/* Really determined by the message driver, and should be available from a run-time call. */ ++#ifndef VCHI_BULK_GRANULARITY ++# if __VCCOREVER__ >= 0x04000000 ++# define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache cleans ++# else ++# define VCHI_BULK_GRANULARITY 16 ++# endif ++#endif ++ ++/* The largest possible message to be queued with vchi_msg_queue. */ ++#ifndef VCHI_MAX_MSG_SIZE ++# if defined VCHI_LOCAL_HOST_PORT ++# define VCHI_MAX_MSG_SIZE 16384 // makes file transfers fast, but should they be using bulk? ++# else ++# define VCHI_MAX_MSG_SIZE 4096 // NOTE: THIS MUST BE LARGER THAN OR EQUAL TO THE SIZE OF THE KHRONOS MERGE BUFFER!! ++# endif ++#endif ++ ++/****************************************************************************************** ++ * Defines below are system configuration options, and should not be used by VCHI services. ++ *****************************************************************************************/ ++ ++/* How many connections can we support? A localhost implementation uses 2 connections, ++ * 1 for host-app, 1 for VMCS, and these are hooked together by a loopback MPHI VCFW ++ * driver. */ ++#ifndef VCHI_MAX_NUM_CONNECTIONS ++# define VCHI_MAX_NUM_CONNECTIONS 3 ++#endif ++ ++/* How many services can we open per connection? Extending this doesn't cost processing time, just a small ++ * amount of static memory. */ ++#ifndef VCHI_MAX_SERVICES_PER_CONNECTION ++# define VCHI_MAX_SERVICES_PER_CONNECTION 36 ++#endif ++ ++/* Adjust if using a message driver that supports more logical TX channels */ ++#ifndef VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION ++# define VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION 9 // 1 MPHI + 8 CCP2 logical channels ++#endif ++ ++/* Adjust if using a message driver that supports more logical RX channels */ ++#ifndef VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION ++# define VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION 1 // 1 MPHI ++#endif ++ ++/* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives the effective ++ * receive queue space, less message headers. */ ++#ifndef VCHI_NUM_READ_SLOTS ++# if defined(VCHI_LOCAL_HOST_PORT) ++# define VCHI_NUM_READ_SLOTS 4 ++# else ++# define VCHI_NUM_READ_SLOTS 48 ++# endif ++#endif ++ ++/* Do we utilise overrun facility for receive message slots? Can aid peer transmit ++ * performance. Only define on VideoCore end, talking to host. ++ */ ++//#define VCHI_MSG_RX_OVERRUN ++ ++/* How many transmit slots do we use. Generally don't need many, as the hardware driver ++ * underneath VCHI will usually have its own buffering. */ ++#ifndef VCHI_NUM_WRITE_SLOTS ++# define VCHI_NUM_WRITE_SLOTS 4 ++#endif ++ ++/* If a service has held or queued received messages in VCHI_XOFF_THRESHOLD or more slots, ++ * then it's taking up too much buffer space, and the peer service will be told to stop ++ * transmitting with an XOFF message. For this to be effective, the VCHI_NUM_READ_SLOTS ++ * needs to be considerably bigger than VCHI_NUM_WRITE_SLOTS, or the transmit latency ++ * is too high. */ ++#ifndef VCHI_XOFF_THRESHOLD ++# define VCHI_XOFF_THRESHOLD (VCHI_NUM_READ_SLOTS / 2) ++#endif ++ ++/* After we've sent an XOFF, the peer will be told to resume transmission once the local ++ * service has dequeued/released enough messages that it's now occupying ++ * VCHI_XON_THRESHOLD slots or fewer. */ ++#ifndef VCHI_XON_THRESHOLD ++# define VCHI_XON_THRESHOLD (VCHI_NUM_READ_SLOTS / 4) ++#endif ++ ++/* A size below which a bulk transfer omits the handshake completely and always goes ++ * via the message channel, if bulk auxiliary is being sent on that service. (The user ++ * can guarantee this by enabling unaligned transmits). ++ * Not API. */ ++#ifndef VCHI_MIN_BULK_SIZE ++# define VCHI_MIN_BULK_SIZE ( VCHI_MAX_MSG_SIZE / 2 < 4096 ? VCHI_MAX_MSG_SIZE / 2 : 4096 ) ++#endif ++ ++/* Maximum size of bulk transmission chunks, for each interface type. A trade-off between ++ * speed and latency; the smaller the chunk size the better change of messages and other ++ * bulk transmissions getting in when big bulk transfers are happening. Set to 0 to not ++ * break transmissions into chunks. ++ */ ++#ifndef VCHI_MAX_BULK_CHUNK_SIZE_MPHI ++# define VCHI_MAX_BULK_CHUNK_SIZE_MPHI (16 * 1024) ++#endif ++ ++/* NB Chunked CCP2 transmissions violate the letter of the CCP2 spec by using "JPEG8" mode ++ * with multiple-line frames. Only use if the receiver can cope. */ ++#ifndef VCHI_MAX_BULK_CHUNK_SIZE_CCP2 ++# define VCHI_MAX_BULK_CHUNK_SIZE_CCP2 0 ++#endif ++ ++/* How many TX messages can we have pending in our transmit slots. Once exhausted, ++ * vchi_msg_queue will be blocked. */ ++#ifndef VCHI_TX_MSG_QUEUE_SIZE ++# define VCHI_TX_MSG_QUEUE_SIZE 256 ++#endif ++ ++/* How many RX messages can we have parsed in the receive slots. Once exhausted, parsing ++ * will be suspended until older messages are dequeued/released. */ ++#ifndef VCHI_RX_MSG_QUEUE_SIZE ++# define VCHI_RX_MSG_QUEUE_SIZE 256 ++#endif ++ ++/* Really should be able to cope if we run out of received message descriptors, by ++ * suspending parsing as the comment above says, but we don't. This sweeps the issue ++ * under the carpet. */ ++#if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS ++# undef VCHI_RX_MSG_QUEUE_SIZE ++# define VCHI_RX_MSG_QUEUE_SIZE (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS ++#endif ++ ++/* How many bulk transmits can we have pending. Once exhausted, vchi_bulk_queue_transmit ++ * will be blocked. */ ++#ifndef VCHI_TX_BULK_QUEUE_SIZE ++# define VCHI_TX_BULK_QUEUE_SIZE 64 ++#endif ++ ++/* How many bulk receives can we have pending. Once exhausted, vchi_bulk_queue_receive ++ * will be blocked. */ ++#ifndef VCHI_RX_BULK_QUEUE_SIZE ++# define VCHI_RX_BULK_QUEUE_SIZE 64 ++#endif ++ ++/* A limit on how many outstanding bulk requests we expect the peer to give us. If ++ * the peer asks for more than this, VCHI will fail and assert. The number is determined ++ * by the peer's hardware - it's the number of outstanding requests that can be queued ++ * on all bulk channels. VC3's MPHI peripheral allows 16. */ ++#ifndef VCHI_MAX_PEER_BULK_REQUESTS ++# define VCHI_MAX_PEER_BULK_REQUESTS 32 ++#endif ++ ++/* Define VCHI_CCP2TX_MANUAL_POWER if the host tells us when to turn the CCP2 ++ * transmitter on and off. ++ */ ++/*#define VCHI_CCP2TX_MANUAL_POWER*/ ++ ++#ifndef VCHI_CCP2TX_MANUAL_POWER ++ ++/* Timeout (in milliseconds) for putting the CCP2TX interface into IDLE state. Set ++ * negative for no IDLE. ++ */ ++# ifndef VCHI_CCP2TX_IDLE_TIMEOUT ++# define VCHI_CCP2TX_IDLE_TIMEOUT 5 ++# endif ++ ++/* Timeout (in milliseconds) for putting the CCP2TX interface into OFF state. Set ++ * negative for no OFF. ++ */ ++# ifndef VCHI_CCP2TX_OFF_TIMEOUT ++# define VCHI_CCP2TX_OFF_TIMEOUT 1000 ++# endif ++ ++#endif /* VCHI_CCP2TX_MANUAL_POWER */ ++ ++#endif /* VCHI_CFG_H_ */ ++ ++/****************************** End of file **********************************/ +diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h b/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h +new file mode 100644 +index 0000000..958cc55 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h +@@ -0,0 +1,56 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHI_CFG_INTERNAL_H_ ++#define VCHI_CFG_INTERNAL_H_ ++ ++/**************************************************************************************** ++ * Control optimisation attempts. ++ ***************************************************************************************/ ++ ++// Don't use lots of short-term locks - use great long ones, reducing the overall locks-per-second ++#define VCHI_COARSE_LOCKING ++ ++// Avoid lock then unlock on exit from blocking queue operations (msg tx, bulk rx/tx) ++// (only relevant if VCHI_COARSE_LOCKING) ++#define VCHI_ELIDE_BLOCK_EXIT_LOCK ++ ++// Avoid lock on non-blocking peek ++// (only relevant if VCHI_COARSE_LOCKING) ++#define VCHI_AVOID_PEEK_LOCK ++ ++// Use one slot-handler thread per connection, rather than 1 thread dealing with all connections in rotation. ++#define VCHI_MULTIPLE_HANDLER_THREADS ++ ++// Put free descriptors onto the head of the free queue, rather than the tail, so that we don't thrash ++// our way through the pool of descriptors. ++#define VCHI_PUSH_FREE_DESCRIPTORS_ONTO_HEAD ++ ++// Don't issue a MSG_AVAILABLE callback for every single message. Possibly only safe if VCHI_COARSE_LOCKING. ++#define VCHI_FEWER_MSG_AVAILABLE_CALLBACKS ++ ++// Don't use message descriptors for TX messages that don't need them ++#define VCHI_MINIMISE_TX_MSG_DESCRIPTORS ++ ++// Nano-locks for multiqueue ++//#define VCHI_MQUEUE_NANOLOCKS ++ ++// Lock-free(er) dequeuing ++//#define VCHI_RX_NANOLOCKS ++ ++#endif /*VCHI_CFG_INTERNAL_H_*/ +diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_common.h b/drivers/misc/vc04_services/interface/vchi/vchi_common.h +new file mode 100644 +index 0000000..4057878 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchi/vchi_common.h +@@ -0,0 +1,152 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++/*============================================================================= ++Contains global defs used by submodules within vchi. ++=============================================================================*/ ++ ++#ifndef VCHI_COMMON_H_ ++#define VCHI_COMMON_H_ ++ ++ ++//flags used when sending messages (must be bitmapped) ++typedef enum ++{ ++ VCHI_FLAGS_NONE = 0x0, ++ VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side) ++ VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent ++ VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go ++ VCHI_FLAGS_ALLOW_PARTIAL = 0x8, ++ VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10, ++ VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20, ++ ++ VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only ++ VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only ++ VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only ++ VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only ++ VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only ++ VCHI_FLAGS_INTERNAL = 0xFF0000 ++} VCHI_FLAGS_T; ++ ++// constants for vchi_crc_control() ++typedef enum { ++ VCHI_CRC_NOTHING = -1, ++ VCHI_CRC_PER_SERVICE = 0, ++ VCHI_CRC_EVERYTHING = 1, ++} VCHI_CRC_CONTROL_T; ++ ++//callback reasons when an event occurs on a service ++typedef enum ++{ ++ VCHI_CALLBACK_REASON_MIN, ++ ++ //This indicates that there is data available ++ //handle is the msg id that was transmitted with the data ++ // When a message is received and there was no FULL message available previously, send callback ++ // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails ++ VCHI_CALLBACK_MSG_AVAILABLE, ++ VCHI_CALLBACK_MSG_SENT, ++ VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented ++ ++ // This indicates that a transfer from the other side has completed ++ VCHI_CALLBACK_BULK_RECEIVED, ++ //This indicates that data queued up to be sent has now gone ++ //handle is the msg id that was used when sending the data ++ VCHI_CALLBACK_BULK_SENT, ++ VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented ++ VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented ++ ++ VCHI_CALLBACK_SERVICE_CLOSED, ++ ++ // this side has sent XOFF to peer due to lack of data consumption by service ++ // (suggests the service may need to take some recovery action if it has ++ // been deliberately holding off consuming data) ++ VCHI_CALLBACK_SENT_XOFF, ++ VCHI_CALLBACK_SENT_XON, ++ ++ // indicates that a bulk transfer has finished reading the source buffer ++ VCHI_CALLBACK_BULK_DATA_READ, ++ ++ // power notification events (currently host side only) ++ VCHI_CALLBACK_PEER_OFF, ++ VCHI_CALLBACK_PEER_SUSPENDED, ++ VCHI_CALLBACK_PEER_ON, ++ VCHI_CALLBACK_PEER_RESUMED, ++ VCHI_CALLBACK_FORCED_POWER_OFF, ++ ++#ifdef USE_VCHIQ_ARM ++ // some extra notifications provided by vchiq_arm ++ VCHI_CALLBACK_SERVICE_OPENED, ++ VCHI_CALLBACK_BULK_RECEIVE_ABORTED, ++ VCHI_CALLBACK_BULK_TRANSMIT_ABORTED, ++#endif ++ ++ VCHI_CALLBACK_REASON_MAX ++} VCHI_CALLBACK_REASON_T; ++ ++//Calback used by all services / bulk transfers ++typedef void (*VCHI_CALLBACK_T)( void *callback_param, //my service local param ++ VCHI_CALLBACK_REASON_T reason, ++ void *handle ); //for transmitting msg's only ++ ++ ++ ++/* ++ * Define vector struct for scatter-gather (vector) operations ++ * Vectors can be nested - if a vector element has negative length, then ++ * the data pointer is treated as pointing to another vector array, with ++ * '-vec_len' elements. Thus to append a header onto an existing vector, ++ * you can do this: ++ * ++ * void foo(const VCHI_MSG_VECTOR_T *v, int n) ++ * { ++ * VCHI_MSG_VECTOR_T nv[2]; ++ * nv[0].vec_base = my_header; ++ * nv[0].vec_len = sizeof my_header; ++ * nv[1].vec_base = v; ++ * nv[1].vec_len = -n; ++ * ... ++ * ++ */ ++typedef struct vchi_msg_vector { ++ const void *vec_base; ++ int32_t vec_len; ++} VCHI_MSG_VECTOR_T; ++ ++// Opaque type for a connection API ++typedef struct opaque_vchi_connection_api_t VCHI_CONNECTION_API_T; ++ ++// Opaque type for a message driver ++typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T; ++ ++ ++// Iterator structure for reading ahead through received message queue. Allocated by client, ++// initialised by vchi_msg_look_ahead. Fields are for internal VCHI use only. ++// Iterates over messages in queue at the instant of the call to vchi_msg_lookahead - ++// will not proceed to messages received since. Behaviour is undefined if an iterator ++// is used again after messages for that service are removed/dequeued by any ++// means other than vchi_msg_iter_... calls on the iterator itself. ++typedef struct { ++ struct opaque_vchi_service_t *service; ++ void *last; ++ void *next; ++ void *remove; ++} VCHI_MSG_ITER_T; ++ ++ ++#endif // VCHI_COMMON_H_ +diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_mh.h b/drivers/misc/vc04_services/interface/vchi/vchi_mh.h +new file mode 100644 +index 0000000..9bcf12e +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchi/vchi_mh.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -8163,9 +8303,77 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linu +#define VCHI_MEM_HANDLE_INVALID 0 + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 2012-06-10 05:51:05.224408696 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h +new file mode 100644 +index 0000000..49d3087 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h +@@ -0,0 +1,27 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHIQ_VCHIQ_H ++#define VCHIQ_VCHIQ_H ++ ++#include "vchiq_if.h" ++#include "vchiq_util.h" ++#include "interface/vcos/vcos.h" ++ ++#endif ++ +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h +new file mode 100644 +index 0000000..959405e +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h +@@ -0,0 +1,27 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHIQ_2835_H ++#define VCHIQ_2835_H ++ ++#include "vchiq_pagelist.h" ++ ++#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX 0 ++#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1 ++ ++#endif /* VCHIQ_2835_H */ +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +new file mode 100644 +index 0000000..35f6afe +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -0,0 +1,512 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -8679,40 +8887,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_283 + kfree(pagelist); +} + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 2012-06-10 05:51:05.131406821 +0200 -@@ -0,0 +1,27 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHIQ_2835_H -+#define VCHIQ_2835_H -+ -+#include "vchiq_pagelist.h" -+ -+#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX 0 -+#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1 -+ -+#endif /* VCHIQ_2835_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 2012-06-10 05:51:05.257409363 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +new file mode 100644 +index 0000000..49a53ce +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -0,0 +1,1912 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -10626,9 +10805,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm +module_exit(vchiq_exit); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Broadcom Corporation"); -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 2012-06-10 05:51:05.226408736 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h +new file mode 100644 +index 0000000..24b42ff +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -10748,9 +10929,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm + + +#endif /* VCHIQ_ARM_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 2012-06-10 05:51:05.135406903 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h +new file mode 100644 +index 0000000..cd51d99 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -10795,9 +10978,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg +#endif + +#endif /* VCHIQ_CFG_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 2012-06-10 05:51:05.135406903 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c +new file mode 100644 +index 0000000..62e3006 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c @@ -0,0 +1,101 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -10900,9 +11085,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_con +} + +EXPORT_SYMBOL( vchiq_add_connected_callback ); -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 2012-06-10 05:51:05.136406923 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h +new file mode 100644 +index 0000000..88cfa58 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h @@ -0,0 +1,32 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -10936,9 +11123,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_con + +#endif /* VCHIQ_CONNECTED_H */ + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 2012-06-10 05:51:05.259409403 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c +new file mode 100644 +index 0000000..749e7d4 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -0,0 +1,2717 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -13657,9 +13846,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cor + } + return status; +} -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 2012-06-10 05:51:05.259409403 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h +new file mode 100644 +index 0000000..37884bd +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -0,0 +1,506 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -14167,40 +14358,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cor +vchiq_platform_conn_state_changed(VCHIQ_STATE_T* state, VCHIQ_CONNSTATE_T oldstate, VCHIQ_CONNSTATE_T newstate); + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 2012-06-10 05:51:05.131406821 +0200 -@@ -0,0 +1,27 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHIQ_VCHIQ_H -+#define VCHIQ_VCHIQ_H -+ -+#include "vchiq_if.h" -+#include "vchiq_util.h" -+#include "interface/vcos/vcos.h" -+ -+#endif -+ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 2012-06-10 05:51:05.230408818 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h +new file mode 100644 +index 0000000..42d471b +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -14357,9 +14519,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if. +extern VCHIQ_STATUS_T vchiq_dump_phys_mem( VCHIQ_SERVICE_HANDLE_T service, void *ptr, size_t num_bytes ); + +#endif /* VCHIQ_IF_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 2012-06-10 05:51:05.260409423 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h +new file mode 100644 +index 0000000..06298bf +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -14466,9 +14630,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioc +#define VCHIQ_IOC_MAX 15 + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 2012-06-10 05:51:05.143407063 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c +new file mode 100644 +index 0000000..e1768e4 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c @@ -0,0 +1,297 @@ +/***************************************************************************** +* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. @@ -14767,9 +14933,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ker +EXPORT_SYMBOL(vchiq_open_service); +EXPORT_SYMBOL(vchiq_add_service_params); +EXPORT_SYMBOL(vchiq_open_service_params); -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c 2012-06-10 05:51:05.231408838 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c +new file mode 100644 +index 0000000..f1a8f42 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c @@ -0,0 +1,1628 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -16399,9 +16567,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib + free_msgbufs = buf; + vcos_mutex_unlock(&vchiq_lib_mutex); +} -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 2012-06-10 05:51:05.145407103 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h +new file mode 100644 +index 0000000..a465b91 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h @@ -0,0 +1,45 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -16448,9 +16618,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_mem +VCHIQ_STATUS_T vchiq_memdrv_initialise(void); + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 2012-06-10 05:51:05.146407123 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h +new file mode 100644 +index 0000000..e8d4e30 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -16495,9 +16667,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pag +} FRAGMENTS_T; + +#endif /* VCHIQ_PAGELIST_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 2012-06-10 05:51:05.232408858 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c +new file mode 100644 +index 0000000..88cd86f +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c @@ -0,0 +1,1001 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17500,9 +17674,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shi +EXPORT_SYMBOL(vchi_service_use); +EXPORT_SYMBOL(vchi_service_release); +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 2012-06-10 05:51:05.148407163 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c +new file mode 100644 +index 0000000..20b67c3 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17601,9 +17777,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_uti + + return header; +} -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 2012-06-10 05:51:05.148407163 +0200 +diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h +new file mode 100644 +index 0000000..6e0c84b +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17652,9 +17830,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_uti + +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c 2012-06-10 05:51:05.149407184 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c b/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c +new file mode 100644 +index 0000000..447d577 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c @@ -0,0 +1,681 @@ +/***************************************************************************** +* Copyright 2009 - 2011 Broadcom Corporation. All rights reserved. @@ -18337,9 +18517,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_c + return VCOS_SUCCESS; +} + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h 2012-06-10 05:51:05.176407729 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h +new file mode 100644 +index 0000000..ce7816957 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -18428,9 +18610,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_c +VCOSPRE_ void VCOSPOST_ vcos_timer_init(void); +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h 2012-06-10 05:51:05.177407749 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h +new file mode 100644 +index 0000000..154b200 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -18703,9 +18887,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +#endif +#endif /* VCOS_GENERIC_BLOCKPOOL_H */ + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c 2012-06-10 05:51:05.178407769 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c +new file mode 100644 +index 0000000..3948a57 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19018,9 +19204,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +} + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h 2012-06-10 05:51:05.178407769 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h +new file mode 100644 +index 0000000..8776ebe +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19140,9 +19328,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +#endif +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h 2012-06-10 05:51:05.179407789 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h +new file mode 100644 +index 0000000..370562d +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19236,9 +19426,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h 2012-06-10 05:51:05.179407789 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h +new file mode 100644 +index 0000000..bf7945c +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19326,9 +19518,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h 2012-06-10 05:51:05.179407789 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h +new file mode 100644 +index 0000000..27563ea +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19416,9 +19610,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h 2012-06-10 05:51:05.180407809 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h +new file mode 100644 +index 0000000..22c059a +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19575,9 +19771,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h 2012-06-10 05:51:05.180407809 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h +new file mode 100644 +index 0000000..fd0e198 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19793,9 +19991,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_j +} +#endif +#endif /* VCOS_JOINABLE_THREAD_FROM_PLAIN_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h 2012-06-10 05:51:05.181407829 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h +new file mode 100644 +index 0000000..ec9e07b +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19856,9 +20056,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_l + +#endif /* VCOS_INLINE_BODIES */ + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c 2012-06-10 05:51:05.182407849 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c b/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c +new file mode 100644 +index 0000000..8b05179 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20420,9 +20622,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_l + } +} + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c 2012-06-10 05:51:05.182407849 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c b/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c +new file mode 100644 +index 0000000..dd0574a +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20508,9 +20712,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_m + _vcos_platform_free(h->ptr); +} + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h 2012-06-10 05:51:05.183407869 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h +new file mode 100644 +index 0000000..8e2a18e +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20577,9 +20783,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_m +#endif /* VCOS_INLINE_BODIES */ + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h 2012-06-10 05:51:05.183407869 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h +new file mode 100644 +index 0000000..a6a52b4 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20660,9 +20868,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_m + + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h 2012-06-10 05:51:05.184407889 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h b/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h +new file mode 100644 +index 0000000..655dc25 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20710,9 +20920,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/generic/vcos_t +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h 2012-06-10 05:51:05.184407889 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h b/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h +new file mode 100644 +index 0000000..1db1ecb +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20745,9 +20957,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/st +#include /* includes integer types */ + +#endif /* _VCOS_PLATFORM_LINUX_STDINT_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c 2012-06-10 05:51:05.185407909 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c +new file mode 100644 +index 0000000..0385540 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c @@ -0,0 +1,627 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -21376,9 +21590,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +EXPORT_SYMBOL( vcos_verify_bkpts_enabled ); + +EXPORT_SYMBOL( vcos_strdup ); -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c 2012-06-10 05:51:05.160407405 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c +new file mode 100644 +index 0000000..e3f0840 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c @@ -0,0 +1,332 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -21712,9 +21928,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc + +EXPORT_SYMBOL_GPL( vcos_cfg_get_proc_entry ); + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c 2012-06-10 05:51:05.185407909 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c +new file mode 100644 +index 0000000..4a9cedf +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c @@ -0,0 +1,111 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -21827,9 +22045,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc + +// END ######################################################################### +// ############################################################################# -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c 2012-06-10 05:51:05.160407405 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c +new file mode 100644 +index 0000000..6ffd755 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c @@ -0,0 +1,64 @@ +/***************************************************************************** +* Copyright 2006 - 2008 Broadcom Corporation. All rights reserved. @@ -21895,9 +22115,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +MODULE_LICENSE( "GPL" ); +MODULE_VERSION( "1.0" ); + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h 2012-06-10 05:51:05.186407930 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h +new file mode 100644 +index 0000000..381688e +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h @@ -0,0 +1,507 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -22406,9 +22628,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc + +#endif /* VCOS_PLATFORM_H */ + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h 2012-06-10 05:51:05.333410894 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h +new file mode 100644 +index 0000000..5f82aaf +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -22469,9 +22693,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +#define PRIx64 "llx" + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c 2012-06-10 05:51:05.162407447 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c +new file mode 100644 +index 0000000..2d62589 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c @@ -0,0 +1,129 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -22602,9 +22828,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc + + return *vcos_thread_storage; +} -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h 2012-06-10 05:51:05.163407467 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h +new file mode 100644 +index 0000000..62963c1 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h @@ -0,0 +1,39 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -22645,9 +22873,229 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +VCOS_THREAD_T *vcos_kthread_current(void); + +#endif /*VCOS_THREAD_MAP_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_assert.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_assert.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_assert.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_assert.h 2012-06-10 05:51:05.187407951 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos.h b/drivers/misc/vc04_services/interface/vcos/vcos.h +new file mode 100644 +index 0000000..e37d795 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos.h +@@ -0,0 +1,212 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++/*============================================================================= ++VideoCore OS Abstraction Layer - public header file ++=============================================================================*/ ++ ++/** ++ * \mainpage OS Abstraction Layer ++ * ++ * \section intro Introduction ++ * ++ * This abstraction layer is here to allow the underlying OS to be easily changed (e.g. from ++ * Nucleus to ThreadX) and to aid in porting host applications to new targets. ++ * ++ * \subsection error Error handling ++ * ++ * Wherever possible, VCOS functions assert internally and return void. The only exceptions ++ * are creation functions (which might fail due to lack of resources) and functions that ++ * might timeout or fail due to lack of space. Errors that might be reported by the underlying ++ * OS API (e.g. invalid mutex) are treated as a programming error, and are merely asserted on. ++ * ++ * \section thread_synch Threads and synchronisation ++ * ++ * \subsection thread Threads ++ * ++ * The thread API is somewhat different to that found in Nucleus. In particular, threads ++ * cannot just be destroyed at arbitrary times and nor can they merely exit. This is so ++ * that the same API can be implemented across all interesting platforms without too much ++ * difficulty. See vcos_thread.h for details. Thread attributes are configured via ++ * the VCOS_THREAD_ATTR_T structure, found in vcos_thread_attr.h. ++ * ++ * \subsection sema Semaphores ++ * ++ * Counted semaphores (c.f. Nucleus NU_SEMAPHORE) are created with VCOS_SEMAPHORE_T. ++ * Under ThreadX on VideoCore, semaphores are implemented using VideoCore spinlocks, and ++ * so are quite a lot faster than ordinary ThreadX semaphores. See vcos_semaphore.h. ++ * ++ * \subsection mtx Mutexes ++ * ++ * Mutexes are used for locking. Attempts to take a mutex twice, or to unlock it ++ * in a different thread to the one in which it was locked should be expected to fail. ++ * Mutexes are not re-entrant (see vcos_reentrant_mutex.h for a slightly slower ++ * re-entrant mutex). ++ * ++ * \subsection evflags Event flags ++ * ++ * Event flags (the ThreadX name - also known as event groups under Nucleus) provide ++ * 32 flags which can be waited on by multiple clients, and signalled by multiple clients. ++ * A timeout can be specified. See vcos_event_flags.h. An alternative to this is the ++ * VCOS_EVENT_T (see vcos_event.h) which is akin to the Win32 auto-reset event, or a ++ * saturating counted semaphore. ++ * ++ * \subsection event Events ++ * ++ * A VCOS_EVENT_T is a bit like a saturating semaphore. No matter how many times it ++ * is signalled, the waiter will only wake up once. See vcos_event.h. You might think this ++ * is useful if you suspect that the cost of reading the semaphore count (perhaps via a ++ * system call) is expensive on your platform. ++ * ++ * \subsection tls Thread local storage ++ * ++ * Thread local storage is supported using vcos_tls.h. This is emulated on Nucleus ++ * and ThreadX. ++ * ++ * \section int Interrupts ++ * ++ * The legacy LISR/HISR scheme found in Nucleus is supported via the legacy ISR API, ++ * which is also supported on ThreadX. New code should avoid this, and old code should ++ * be migrated away from it, since it is slow. See vcos_legacy_isr.h. ++ * ++ * Registering an interrupt handler, and disabling/restoring interrupts, is handled ++ * using the functions in vcos_isr.h. ++ * ++ */ ++ ++/** ++ * \file vcos.h ++ * ++ * This is the top level header file. Clients include this. It pulls in the platform-specific ++ * header file (vcos_platform.h) together with header files defining the expected APIs, such ++ * as vcos_mutex.h, vcos_semaphore.h, etc. It is also possible to include these header files ++ * directly. ++ * ++ */ ++ ++#ifndef VCOS_H ++#define VCOS_H ++ ++#include "interface/vcos/vcos_assert.h" ++#include "vcos_types.h" ++#include "vcos_platform.h" ++ ++#ifndef VCOS_INIT_H ++#include "interface/vcos/vcos_init.h" ++#endif ++ ++#ifndef VCOS_SEMAPHORE_H ++#include "interface/vcos/vcos_semaphore.h" ++#endif ++ ++#ifndef VCOS_THREAD_H ++#include "interface/vcos/vcos_thread.h" ++#endif ++ ++#ifndef VCOS_MUTEX_H ++#include "interface/vcos/vcos_mutex.h" ++#endif ++ ++#ifndef VCOS_MEM_H ++#include "interface/vcos/vcos_mem.h" ++#endif ++ ++#ifndef VCOS_LOGGING_H ++#include "interface/vcos/vcos_logging.h" ++#endif ++ ++#ifndef VCOS_STRING_H ++#include "interface/vcos/vcos_string.h" ++#endif ++ ++#ifndef VCOS_EVENT_H ++#include "interface/vcos/vcos_event.h" ++#endif ++ ++#ifndef VCOS_THREAD_ATTR_H ++#include "interface/vcos/vcos_thread_attr.h" ++#endif ++ ++#ifndef VCOS_TLS_H ++#include "interface/vcos/vcos_tls.h" ++#endif ++ ++#ifndef VCOS_REENTRANT_MUTEX_H ++#include "interface/vcos/vcos_reentrant_mutex.h" ++#endif ++ ++#ifndef VCOS_NAMED_SEMAPHORE_H ++#include "interface/vcos/vcos_named_semaphore.h" ++#endif ++ ++#ifndef VCOS_QUICKSLOW_MUTEX_H ++#include "interface/vcos/vcos_quickslow_mutex.h" ++#endif ++ ++/* Headers with predicates */ ++ ++#if VCOS_HAVE_EVENT_FLAGS ++#include "interface/vcos/vcos_event_flags.h" ++#endif ++ ++#if VCOS_HAVE_QUEUE ++#include "interface/vcos/vcos_queue.h" ++#endif ++ ++#if VCOS_HAVE_LEGACY_ISR ++#include "interface/vcos/vcos_legacy_isr.h" ++#endif ++ ++#if VCOS_HAVE_TIMER ++#include "interface/vcos/vcos_timer.h" ++#endif ++ ++#if VCOS_HAVE_MEMPOOL ++#include "interface/vcos/vcos_mempool.h" ++#endif ++ ++#if VCOS_HAVE_ISR ++#include "interface/vcos/vcos_isr.h" ++#endif ++ ++#if VCOS_HAVE_ATOMIC_FLAGS ++#include "interface/vcos/vcos_atomic_flags.h" ++#endif ++ ++#if VCOS_HAVE_ONCE ++#include "interface/vcos/vcos_once.h" ++#endif ++ ++#if VCOS_HAVE_BLOCK_POOL ++#include "interface/vcos/vcos_blockpool.h" ++#endif ++ ++#if VCOS_HAVE_FILE ++#include "interface/vcos/vcos_file.h" ++#endif ++ ++#if VCOS_HAVE_CFG ++#include "interface/vcos/vcos_cfg.h" ++#endif ++ ++#if VCOS_HAVE_CMD ++#include "interface/vcos/vcos_cmd.h" ++#endif ++ ++#endif /* VCOS_H */ ++ +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_assert.h b/drivers/misc/vc04_services/interface/vcos/vcos_assert.h +new file mode 100644 +index 0000000..1e72dff +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_assert.h @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -22929,9 +23377,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_assert.h +#endif + +#endif /* VCOS_ASSERT_H */ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h 2012-06-10 05:51:05.188407972 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h b/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h +new file mode 100644 +index 0000000..317abf3 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23016,9 +23466,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_atomic_fl +#endif + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h 2012-06-10 05:51:05.188407972 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h b/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h +new file mode 100644 +index 0000000..f3817f6 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23043,9 +23495,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_build_inf +const char *vcos_get_build_time( void ); +const char *vcos_get_build_date( void ); + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h 2012-06-10 05:51:05.165407507 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h b/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h +new file mode 100644 +index 0000000..4423051 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h @@ -0,0 +1,113 @@ +/***************************************************************************** +* Copyright 2009 - 2011 Broadcom Corporation. All rights reserved. @@ -23160,9 +23614,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h lin +#endif +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h 2012-06-10 05:51:05.166407527 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h b/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h +new file mode 100644 +index 0000000..29d5315 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h @@ -0,0 +1,98 @@ +/***************************************************************************** +* Copyright 2009 - 2011 Broadcom Corporation. All rights reserved. @@ -23262,9 +23718,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h lin + +#endif /* VCOS_CMD_H */ + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h 2012-06-10 05:51:05.188407972 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h b/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h +new file mode 100644 +index 0000000..a270de8 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23306,9 +23764,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h l + +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h 2012-06-10 05:51:05.189407992 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h b/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h +new file mode 100644 +index 0000000..0a683c0b +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23390,9 +23850,125 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h l +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h 2012-06-10 05:51:05.190408012 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_event.h b/drivers/misc/vc04_services/interface/vcos/vcos_event.h +new file mode 100644 +index 0000000..38612f9 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_event.h +@@ -0,0 +1,108 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++/*============================================================================= ++VideoCore OS Abstraction Layer - public header file for events ++=============================================================================*/ ++ ++#ifndef VCOS_EVENT_H ++#define VCOS_EVENT_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include "interface/vcos/vcos_types.h" ++#include "vcos_platform.h" ++ ++/** ++ * \file ++ * ++ * An event is akin to the Win32 auto-reset event. ++ * ++ * ++ * Signalling an event will wake up one waiting thread only. Once one ++ * thread has been woken the event atomically returns to the unsignalled ++ * state. ++ * ++ * If no threads are waiting on the event when it is signalled it remains ++ * signalled. ++ * ++ * This is almost, but not quite, completely unlike the "event flags" ++ * object based on Nucleus event groups and ThreadX event flags. ++ * ++ * In particular, it should be similar in speed to a semaphore, unlike ++ * the event flags. ++ */ ++ ++/** ++ * Create an event instance. ++ * ++ * @param event Filled in with constructed event. ++ * @param name Name of the event (for debugging) ++ * ++ * @return VCOS_SUCCESS on success, or error code. ++ */ ++VCOS_INLINE_DECL ++VCOS_STATUS_T vcos_event_create(VCOS_EVENT_T *event, const char *name); ++ ++#ifndef vcos_event_signal ++ ++/** ++ * Signal the event. The event will return to being unsignalled ++ * after exactly one waiting thread has been woken up. If no ++ * threads are waiting it remains signalled. ++ * ++ * @param event The event to signal ++ */ ++VCOS_INLINE_DECL ++void vcos_event_signal(VCOS_EVENT_T *event); ++ ++/** ++ * Wait for the event. ++ * ++ * @param event The event to wait for ++ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the wait was interrupted. ++ */ ++VCOS_INLINE_DECL ++VCOS_STATUS_T vcos_event_wait(VCOS_EVENT_T *event); ++ ++/** ++ * Try event, but don't block. ++ * ++ * @param event The event to try ++ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the event is not currently signalled ++ */ ++VCOS_INLINE_DECL ++VCOS_STATUS_T vcos_event_try(VCOS_EVENT_T *event); ++ ++#endif ++ ++/* ++ * Destroy an event. ++ */ ++VCOS_INLINE_DECL ++void vcos_event_delete(VCOS_EVENT_T *event); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif ++ ++ +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h b/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h +new file mode 100644 +index 0000000..9eee410 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23503,337 +24079,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_event_fla + +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_event.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_event.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_event.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_event.h 2012-06-10 05:51:05.189407992 +0200 -@@ -0,0 +1,108 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+/*============================================================================= -+VideoCore OS Abstraction Layer - public header file for events -+=============================================================================*/ -+ -+#ifndef VCOS_EVENT_H -+#define VCOS_EVENT_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include "interface/vcos/vcos_types.h" -+#include "vcos_platform.h" -+ -+/** -+ * \file -+ * -+ * An event is akin to the Win32 auto-reset event. -+ * -+ * -+ * Signalling an event will wake up one waiting thread only. Once one -+ * thread has been woken the event atomically returns to the unsignalled -+ * state. -+ * -+ * If no threads are waiting on the event when it is signalled it remains -+ * signalled. -+ * -+ * This is almost, but not quite, completely unlike the "event flags" -+ * object based on Nucleus event groups and ThreadX event flags. -+ * -+ * In particular, it should be similar in speed to a semaphore, unlike -+ * the event flags. -+ */ -+ -+/** -+ * Create an event instance. -+ * -+ * @param event Filled in with constructed event. -+ * @param name Name of the event (for debugging) -+ * -+ * @return VCOS_SUCCESS on success, or error code. -+ */ -+VCOS_INLINE_DECL -+VCOS_STATUS_T vcos_event_create(VCOS_EVENT_T *event, const char *name); -+ -+#ifndef vcos_event_signal -+ -+/** -+ * Signal the event. The event will return to being unsignalled -+ * after exactly one waiting thread has been woken up. If no -+ * threads are waiting it remains signalled. -+ * -+ * @param event The event to signal -+ */ -+VCOS_INLINE_DECL -+void vcos_event_signal(VCOS_EVENT_T *event); -+ -+/** -+ * Wait for the event. -+ * -+ * @param event The event to wait for -+ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the wait was interrupted. -+ */ -+VCOS_INLINE_DECL -+VCOS_STATUS_T vcos_event_wait(VCOS_EVENT_T *event); -+ -+/** -+ * Try event, but don't block. -+ * -+ * @param event The event to try -+ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the event is not currently signalled -+ */ -+VCOS_INLINE_DECL -+VCOS_STATUS_T vcos_event_try(VCOS_EVENT_T *event); -+ -+#endif -+ -+/* -+ * Destroy an event. -+ */ -+VCOS_INLINE_DECL -+void vcos_event_delete(VCOS_EVENT_T *event); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -+ -+ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos.h 2012-06-10 05:51:05.187407951 +0200 -@@ -0,0 +1,212 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+/*============================================================================= -+VideoCore OS Abstraction Layer - public header file -+=============================================================================*/ -+ -+/** -+ * \mainpage OS Abstraction Layer -+ * -+ * \section intro Introduction -+ * -+ * This abstraction layer is here to allow the underlying OS to be easily changed (e.g. from -+ * Nucleus to ThreadX) and to aid in porting host applications to new targets. -+ * -+ * \subsection error Error handling -+ * -+ * Wherever possible, VCOS functions assert internally and return void. The only exceptions -+ * are creation functions (which might fail due to lack of resources) and functions that -+ * might timeout or fail due to lack of space. Errors that might be reported by the underlying -+ * OS API (e.g. invalid mutex) are treated as a programming error, and are merely asserted on. -+ * -+ * \section thread_synch Threads and synchronisation -+ * -+ * \subsection thread Threads -+ * -+ * The thread API is somewhat different to that found in Nucleus. In particular, threads -+ * cannot just be destroyed at arbitrary times and nor can they merely exit. This is so -+ * that the same API can be implemented across all interesting platforms without too much -+ * difficulty. See vcos_thread.h for details. Thread attributes are configured via -+ * the VCOS_THREAD_ATTR_T structure, found in vcos_thread_attr.h. -+ * -+ * \subsection sema Semaphores -+ * -+ * Counted semaphores (c.f. Nucleus NU_SEMAPHORE) are created with VCOS_SEMAPHORE_T. -+ * Under ThreadX on VideoCore, semaphores are implemented using VideoCore spinlocks, and -+ * so are quite a lot faster than ordinary ThreadX semaphores. See vcos_semaphore.h. -+ * -+ * \subsection mtx Mutexes -+ * -+ * Mutexes are used for locking. Attempts to take a mutex twice, or to unlock it -+ * in a different thread to the one in which it was locked should be expected to fail. -+ * Mutexes are not re-entrant (see vcos_reentrant_mutex.h for a slightly slower -+ * re-entrant mutex). -+ * -+ * \subsection evflags Event flags -+ * -+ * Event flags (the ThreadX name - also known as event groups under Nucleus) provide -+ * 32 flags which can be waited on by multiple clients, and signalled by multiple clients. -+ * A timeout can be specified. See vcos_event_flags.h. An alternative to this is the -+ * VCOS_EVENT_T (see vcos_event.h) which is akin to the Win32 auto-reset event, or a -+ * saturating counted semaphore. -+ * -+ * \subsection event Events -+ * -+ * A VCOS_EVENT_T is a bit like a saturating semaphore. No matter how many times it -+ * is signalled, the waiter will only wake up once. See vcos_event.h. You might think this -+ * is useful if you suspect that the cost of reading the semaphore count (perhaps via a -+ * system call) is expensive on your platform. -+ * -+ * \subsection tls Thread local storage -+ * -+ * Thread local storage is supported using vcos_tls.h. This is emulated on Nucleus -+ * and ThreadX. -+ * -+ * \section int Interrupts -+ * -+ * The legacy LISR/HISR scheme found in Nucleus is supported via the legacy ISR API, -+ * which is also supported on ThreadX. New code should avoid this, and old code should -+ * be migrated away from it, since it is slow. See vcos_legacy_isr.h. -+ * -+ * Registering an interrupt handler, and disabling/restoring interrupts, is handled -+ * using the functions in vcos_isr.h. -+ * -+ */ -+ -+/** -+ * \file vcos.h -+ * -+ * This is the top level header file. Clients include this. It pulls in the platform-specific -+ * header file (vcos_platform.h) together with header files defining the expected APIs, such -+ * as vcos_mutex.h, vcos_semaphore.h, etc. It is also possible to include these header files -+ * directly. -+ * -+ */ -+ -+#ifndef VCOS_H -+#define VCOS_H -+ -+#include "interface/vcos/vcos_assert.h" -+#include "vcos_types.h" -+#include "vcos_platform.h" -+ -+#ifndef VCOS_INIT_H -+#include "interface/vcos/vcos_init.h" -+#endif -+ -+#ifndef VCOS_SEMAPHORE_H -+#include "interface/vcos/vcos_semaphore.h" -+#endif -+ -+#ifndef VCOS_THREAD_H -+#include "interface/vcos/vcos_thread.h" -+#endif -+ -+#ifndef VCOS_MUTEX_H -+#include "interface/vcos/vcos_mutex.h" -+#endif -+ -+#ifndef VCOS_MEM_H -+#include "interface/vcos/vcos_mem.h" -+#endif -+ -+#ifndef VCOS_LOGGING_H -+#include "interface/vcos/vcos_logging.h" -+#endif -+ -+#ifndef VCOS_STRING_H -+#include "interface/vcos/vcos_string.h" -+#endif -+ -+#ifndef VCOS_EVENT_H -+#include "interface/vcos/vcos_event.h" -+#endif -+ -+#ifndef VCOS_THREAD_ATTR_H -+#include "interface/vcos/vcos_thread_attr.h" -+#endif -+ -+#ifndef VCOS_TLS_H -+#include "interface/vcos/vcos_tls.h" -+#endif -+ -+#ifndef VCOS_REENTRANT_MUTEX_H -+#include "interface/vcos/vcos_reentrant_mutex.h" -+#endif -+ -+#ifndef VCOS_NAMED_SEMAPHORE_H -+#include "interface/vcos/vcos_named_semaphore.h" -+#endif -+ -+#ifndef VCOS_QUICKSLOW_MUTEX_H -+#include "interface/vcos/vcos_quickslow_mutex.h" -+#endif -+ -+/* Headers with predicates */ -+ -+#if VCOS_HAVE_EVENT_FLAGS -+#include "interface/vcos/vcos_event_flags.h" -+#endif -+ -+#if VCOS_HAVE_QUEUE -+#include "interface/vcos/vcos_queue.h" -+#endif -+ -+#if VCOS_HAVE_LEGACY_ISR -+#include "interface/vcos/vcos_legacy_isr.h" -+#endif -+ -+#if VCOS_HAVE_TIMER -+#include "interface/vcos/vcos_timer.h" -+#endif -+ -+#if VCOS_HAVE_MEMPOOL -+#include "interface/vcos/vcos_mempool.h" -+#endif -+ -+#if VCOS_HAVE_ISR -+#include "interface/vcos/vcos_isr.h" -+#endif -+ -+#if VCOS_HAVE_ATOMIC_FLAGS -+#include "interface/vcos/vcos_atomic_flags.h" -+#endif -+ -+#if VCOS_HAVE_ONCE -+#include "interface/vcos/vcos_once.h" -+#endif -+ -+#if VCOS_HAVE_BLOCK_POOL -+#include "interface/vcos/vcos_blockpool.h" -+#endif -+ -+#if VCOS_HAVE_FILE -+#include "interface/vcos/vcos_file.h" -+#endif -+ -+#if VCOS_HAVE_CFG -+#include "interface/vcos/vcos_cfg.h" -+#endif -+ -+#if VCOS_HAVE_CMD -+#include "interface/vcos/vcos_cmd.h" -+#endif -+ -+#endif /* VCOS_H */ -+ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_init.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_init.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_init.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_init.h 2012-06-10 05:51:05.190408012 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_init.h b/drivers/misc/vc04_services/interface/vcos/vcos_init.h +new file mode 100644 +index 0000000..9fc5eca +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_init.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23889,9 +24139,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_init.h li +} +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_logging.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_logging.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_logging.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_logging.h 2012-06-10 05:51:05.191408032 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_logging.h b/drivers/misc/vc04_services/interface/vcos/vcos_logging.h +new file mode 100644 +index 0000000..9702822 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_logging.h @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24183,9 +24435,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_logging.h +#endif /* VCOS_LOGGING_H */ + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h 2012-06-10 05:51:05.191408032 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h b/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h +new file mode 100644 +index 0000000..9473cec +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24305,9 +24559,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_ +#endif +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_mem.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_mem.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_mem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_mem.h 2012-06-10 05:51:05.192408052 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_mem.h b/drivers/misc/vc04_services/interface/vcos/vcos_mem.h +new file mode 100644 +index 0000000..af16208 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_mem.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24401,9 +24657,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_mem.h lin +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h 2012-06-10 05:51:05.192408052 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h b/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h +new file mode 100644 +index 0000000..f0ef70b +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24573,9 +24831,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue. +#endif + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h 2012-06-10 05:51:05.193408072 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h b/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h +new file mode 100644 +index 0000000..14387a8 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24680,9 +24940,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h l +} +#endif +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_once.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_once.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_once.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_once.h 2012-06-10 05:51:05.193408072 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_once.h b/drivers/misc/vc04_services/interface/vcos/vcos_once.h +new file mode 100644 +index 0000000..0533c10 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_once.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24737,9 +24999,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_once.h li +#endif +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h 2012-06-10 05:51:05.194408092 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h b/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h +new file mode 100644 +index 0000000..2760dd7 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24867,9 +25131,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_semaphore +#endif +#endif + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h 2012-06-10 05:51:05.194408092 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h b/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h +new file mode 100644 +index 0000000..3c7669d +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24905,9 +25171,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h +#endif /* __cplusplus */ + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h 2012-06-10 05:51:05.195408112 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h b/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h +new file mode 100644 +index 0000000..c9a3e02 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25112,9 +25380,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h +#endif /* VCOS_STDINT_H */ + + -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_string.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_string.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_string.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_string.h 2012-06-10 05:51:05.195408112 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_string.h b/drivers/misc/vc04_services/interface/vcos/vcos_string.h +new file mode 100644 +index 0000000..c3d875f +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_string.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25200,100 +25470,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_string.h +} +#endif +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h 2012-06-10 05:51:05.196408132 +0200 -@@ -0,0 +1,87 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+/*============================================================================= -+VideoCore OS Abstraction Layer - thread attributes -+=============================================================================*/ -+ -+#ifndef VCOS_THREAD_ATTR_H -+#define VCOS_THREAD_ATTR_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/** -+ * \file -+ * -+ * Attributes for thread creation. -+ * -+ */ -+ -+/** Initialize thread attribute struct. This call does not allocate memory, -+ * and so cannot fail. -+ * -+ */ -+VCOSPRE_ void VCOSPOST_ vcos_thread_attr_init(VCOS_THREAD_ATTR_T *attrs); -+ -+/** Set the stack address and size. If not set, a stack will be allocated automatically. -+ * -+ * This can only be set on some platforms. It will always be possible to set the stack -+ * address on VideoCore, but on host platforms, support may well not be available. -+ */ -+#if VCOS_CAN_SET_STACK_ADDR -+VCOS_INLINE_DECL -+void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attrs, void *addr, VCOS_UNSIGNED sz); -+#endif -+ -+/** Set the stack size. If not set, a default size will be used. Attempting to call this after having -+ * set the stack location with vcos_thread_attr_setstack() will result in undefined behaviour. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED sz); -+ -+/** Set the task priority. If not set, a default value will be used. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED pri); -+ -+/** Set the task cpu affinity. If not set, the default will be used. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED aff); -+ -+/** Set the timeslice. If not set the default will be used. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts); -+ -+/** The thread entry function takes (argc,argv), as per Nucleus, with -+ * argc being 0. This may be withdrawn in a future release and should not -+ * be used in new code. -+ */ -+VCOS_INLINE_DECL -+void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy); -+ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart); -+ -+#ifdef __cplusplus -+} -+#endif -+#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_thread.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_thread.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread.h 2012-06-10 05:51:05.196408132 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_thread.h b/drivers/misc/vc04_services/interface/vcos/vcos_thread.h +new file mode 100644 +index 0000000..ee34648 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_thread.h @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25565,9 +25746,104 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_thread.h +} +#endif +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_timer.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_timer.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_timer.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_timer.h 2012-06-10 05:51:05.197408152 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h b/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h +new file mode 100644 +index 0000000..375dd01 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h +@@ -0,0 +1,87 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++/*============================================================================= ++VideoCore OS Abstraction Layer - thread attributes ++=============================================================================*/ ++ ++#ifndef VCOS_THREAD_ATTR_H ++#define VCOS_THREAD_ATTR_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/** ++ * \file ++ * ++ * Attributes for thread creation. ++ * ++ */ ++ ++/** Initialize thread attribute struct. This call does not allocate memory, ++ * and so cannot fail. ++ * ++ */ ++VCOSPRE_ void VCOSPOST_ vcos_thread_attr_init(VCOS_THREAD_ATTR_T *attrs); ++ ++/** Set the stack address and size. If not set, a stack will be allocated automatically. ++ * ++ * This can only be set on some platforms. It will always be possible to set the stack ++ * address on VideoCore, but on host platforms, support may well not be available. ++ */ ++#if VCOS_CAN_SET_STACK_ADDR ++VCOS_INLINE_DECL ++void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attrs, void *addr, VCOS_UNSIGNED sz); ++#endif ++ ++/** Set the stack size. If not set, a default size will be used. Attempting to call this after having ++ * set the stack location with vcos_thread_attr_setstack() will result in undefined behaviour. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED sz); ++ ++/** Set the task priority. If not set, a default value will be used. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED pri); ++ ++/** Set the task cpu affinity. If not set, the default will be used. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED aff); ++ ++/** Set the timeslice. If not set the default will be used. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts); ++ ++/** The thread entry function takes (argc,argv), as per Nucleus, with ++ * argc being 0. This may be withdrawn in a future release and should not ++ * be used in new code. ++ */ ++VCOS_INLINE_DECL ++void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy); ++ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_timer.h b/drivers/misc/vc04_services/interface/vcos/vcos_timer.h +new file mode 100644 +index 0000000..1612334 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_timer.h @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25675,9 +25951,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_timer.h l +} +#endif +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_types.h linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_types.h ---- linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_types.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/interface/vcos/vcos_types.h 2012-06-10 05:51:05.197408152 +0200 +diff --git a/drivers/misc/vc04_services/interface/vcos/vcos_types.h b/drivers/misc/vc04_services/interface/vcos/vcos_types.h +new file mode 100644 +index 0000000..25de671 +--- /dev/null ++++ b/drivers/misc/vc04_services/interface/vcos/vcos_types.h @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25890,46 +26168,11 @@ diff -Naur linux-3.2.19/drivers/misc/vc04_services/interface/vcos/vcos_types.h l +typedef vcos_fourcc_t FOURCC_T; + +#endif -diff -Naur linux-3.2.19/drivers/misc/vc04_services/Kconfig linux-3.2.19.patch/drivers/misc/vc04_services/Kconfig ---- linux-3.2.19/drivers/misc/vc04_services/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/Kconfig 2012-06-10 05:51:05.129406780 +0200 -@@ -0,0 +1,7 @@ -+config BCM2708_VCHIQ -+ tristate "Videocore VCHIQ" -+ depends on MACH_BCM2708 -+ default y -+ help -+ Helper for communication for VideoCore. -+ -diff -Naur linux-3.2.19/drivers/misc/vc04_services/Makefile linux-3.2.19.patch/drivers/misc/vc04_services/Makefile ---- linux-3.2.19/drivers/misc/vc04_services/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/misc/vc04_services/Makefile 2012-06-10 05:51:05.219408596 +0200 -@@ -0,0 +1,21 @@ -+obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o -+ -+vchiq-objs := \ -+ interface/vchiq_arm/vchiq_core.o \ -+ interface/vchiq_arm/vchiq_shim.o \ -+ interface/vchiq_arm/vchiq_util.o \ -+ interface/vchiq_arm/vchiq_arm.o \ -+ interface/vchiq_arm/vchiq_kern_lib.o \ -+ interface/vchiq_arm/vchiq_2835_arm.o \ -+ interface/vcos/linuxkernel/vcos_linuxkernel.o \ -+ interface/vcos/linuxkernel/vcos_thread_map.o \ -+ interface/vcos/linuxkernel/vcos_linuxkernel_cfg.o \ -+ interface/vcos/generic/vcos_generic_event_flags.o \ -+ interface/vcos/generic/vcos_logcat.o \ -+ interface/vcos/generic/vcos_mem_from_malloc.o \ -+ interface/vcos/generic/vcos_cmd.o -+ -+EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -+ -+ -+ -diff -Naur linux-3.2.19/drivers/mmc/card/block.c linux-3.2.19.patch/drivers/mmc/card/block.c ---- linux-3.2.19/drivers/mmc/card/block.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/mmc/card/block.c 2012-06-10 05:51:05.363411499 +0200 -@@ -1062,6 +1062,16 @@ +diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c +index 34416d4..57fd0db 100644 +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -1062,6 +1062,16 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, if (brq->data.blocks > 1) { /* @@ -25946,9 +26189,100 @@ diff -Naur linux-3.2.19/drivers/mmc/card/block.c linux-3.2.19.patch/drivers/mmc/ * After a read error, we redo the request one sector * at a time in order to accurately determine which * sectors can be read successfully. -diff -Naur linux-3.2.19/drivers/mmc/host/bcm2708_mci.c linux-3.2.19.patch/drivers/mmc/host/bcm2708_mci.c ---- linux-3.2.19/drivers/mmc/host/bcm2708_mci.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/mmc/host/bcm2708_mci.c 2012-06-10 05:51:05.064405470 +0200 +diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c +index 411a994..ad08933 100644 +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -514,10 +514,14 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) + + if (data->flags & MMC_DATA_WRITE) + /* +- * The limit is really 250 ms, but that is +- * insufficient for some crappy cards. ++ * The MMC spec "It is strongly recommended ++ * for hosts to implement more than 500ms ++ * timeout value even if the card indicates ++ * the 250ms maximum busy length." Even the ++ * previous value of 300ms is known to be ++ * insufficient for some cards. + */ +- limit_us = 300000; ++ limit_us = 3000000; + else + limit_us = 100000; + +diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig +index cf444b0..f8feea6 100644 +--- a/drivers/mmc/host/Kconfig ++++ b/drivers/mmc/host/Kconfig +@@ -229,6 +229,27 @@ config MMC_SDHCI_S3C_DMA + + YMMV. + ++config MMC_SDHCI_BCM2708 ++ tristate "SDHCI support on BCM2708" ++ depends on MMC_SDHCI && MACH_BCM2708 ++ select MMC_SDHCI_IO_ACCESSORS ++ help ++ This selects the Secure Digital Host Controller Interface (SDHCI) ++ often referrered to as the eMMC block. ++ ++ If you have a controller with this interface, say Y or M here. ++ ++ If unsure, say N. ++ ++config MMC_SDHCI_BCM2708_DMA ++ bool "DMA support on BCM2708 Arasan controller" ++ depends on MMC_SDHCI_BCM2708 && EXPERIMENTAL ++ help ++ Enable DMA support on the Arasan SDHCI controller in Broadcom 2708 ++ based chips. ++ ++ If unsure, say N. ++ + config MMC_OMAP + tristate "TI OMAP Multimedia Card Interface support" + depends on ARCH_OMAP +@@ -296,6 +317,14 @@ config MMC_ATMELMCI + If unsure, say N. + + endchoice ++config MMC_BCM2708 ++ tristate "BCM2708 Multimedia Card Interface support" ++ help ++ This selects the BCM2708 Multimedia Card Interface driver. If ++ you have a BCM2708 platform with a Multimedia Card ++ slot, say Y or M here. ++ ++ If unsure, say N. + + config MMC_ATMELMCI_DMA + bool "Atmel MCI DMA support" +diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile +index b4b83f3..eeb683c 100644 +--- a/drivers/mmc/host/Makefile ++++ b/drivers/mmc/host/Makefile +@@ -13,6 +13,7 @@ obj-$(CONFIG_MMC_SDHCI_PXAV3) += sdhci-pxav3.o + obj-$(CONFIG_MMC_SDHCI_PXAV2) += sdhci-pxav2.o + obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o + obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o ++obj-$(CONFIG_MMC_SDHCI_BCM2708) += sdhci-bcm2708.o + obj-$(CONFIG_MMC_WBSD) += wbsd.o + obj-$(CONFIG_MMC_AU1X) += au1xmmc.o + obj-$(CONFIG_MMC_OMAP) += omap.o +@@ -36,6 +37,7 @@ tmio_mmc_core-$(subst m,y,$(CONFIG_MMC_SDHI)) += tmio_mmc_dma.o + obj-$(CONFIG_MMC_SDHI) += sh_mobile_sdhi.o + obj-$(CONFIG_MMC_CB710) += cb710-mmc.o + obj-$(CONFIG_MMC_VIA_SDMMC) += via-sdmmc.o ++obj-$(CONFIG_MMC_BCM2708) += bcm2708_mci.o + obj-$(CONFIG_SDH_BFIN) += bfin_sdh.o + obj-$(CONFIG_MMC_DW) += dw_mmc.o + obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o +diff --git a/drivers/mmc/host/bcm2708_mci.c b/drivers/mmc/host/bcm2708_mci.c +new file mode 100644 +index 0000000..3c7de96 +--- /dev/null ++++ b/drivers/mmc/host/bcm2708_mci.c @@ -0,0 +1,889 @@ +/* + * linux/drivers/mmc/host/bcm2708_mci.c - Broadcom BCM2708 MCI driver @@ -26839,9 +27173,11 @@ diff -Naur linux-3.2.19/drivers/mmc/host/bcm2708_mci.c linux-3.2.19.patch/driver +MODULE_DESCRIPTION("BCM2708 Multimedia Card Interface driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:bcm2708_mci"); -diff -Naur linux-3.2.19/drivers/mmc/host/bcm2708_mci.h linux-3.2.19.patch/drivers/mmc/host/bcm2708_mci.h ---- linux-3.2.19/drivers/mmc/host/bcm2708_mci.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/mmc/host/bcm2708_mci.h 2012-06-10 05:51:05.065405491 +0200 +diff --git a/drivers/mmc/host/bcm2708_mci.h b/drivers/mmc/host/bcm2708_mci.h +new file mode 100644 +index 0000000..b2851d9 +--- /dev/null ++++ b/drivers/mmc/host/bcm2708_mci.h @@ -0,0 +1,101 @@ +/* + * linux/drivers/mmc/host/bcm2708_mci.c - Broadcom BCM2708 MCI driver @@ -26944,75 +27280,12 @@ diff -Naur linux-3.2.19/drivers/mmc/host/bcm2708_mci.h linux-3.2.19.patch/driver + kunmap_atomic(buffer, KM_BIO_SRC_IRQ); +// local_irq_restore(*flags); +} -diff -Naur linux-3.2.19/drivers/mmc/host/Kconfig linux-3.2.19.patch/drivers/mmc/host/Kconfig ---- linux-3.2.19/drivers/mmc/host/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/mmc/host/Kconfig 2012-06-10 05:51:05.062405429 +0200 -@@ -229,6 +229,27 @@ - - YMMV. - -+config MMC_SDHCI_BCM2708 -+ tristate "SDHCI support on BCM2708" -+ depends on MMC_SDHCI && MACH_BCM2708 -+ select MMC_SDHCI_IO_ACCESSORS -+ help -+ This selects the Secure Digital Host Controller Interface (SDHCI) -+ often referrered to as the eMMC block. -+ -+ If you have a controller with this interface, say Y or M here. -+ -+ If unsure, say N. -+ -+config MMC_SDHCI_BCM2708_DMA -+ bool "DMA support on BCM2708 Arasan controller" -+ depends on MMC_SDHCI_BCM2708 && EXPERIMENTAL -+ help -+ Enable DMA support on the Arasan SDHCI controller in Broadcom 2708 -+ based chips. -+ -+ If unsure, say N. -+ - config MMC_OMAP - tristate "TI OMAP Multimedia Card Interface support" - depends on ARCH_OMAP -@@ -296,6 +317,14 @@ - If unsure, say N. - - endchoice -+config MMC_BCM2708 -+ tristate "BCM2708 Multimedia Card Interface support" -+ help -+ This selects the BCM2708 Multimedia Card Interface driver. If -+ you have a BCM2708 platform with a Multimedia Card -+ slot, say Y or M here. -+ -+ If unsure, say N. - - config MMC_ATMELMCI_DMA - bool "Atmel MCI DMA support" -diff -Naur linux-3.2.19/drivers/mmc/host/Makefile linux-3.2.19.patch/drivers/mmc/host/Makefile ---- linux-3.2.19/drivers/mmc/host/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/mmc/host/Makefile 2012-06-10 05:51:05.063405449 +0200 -@@ -13,6 +13,7 @@ - obj-$(CONFIG_MMC_SDHCI_PXAV2) += sdhci-pxav2.o - obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o - obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o -+obj-$(CONFIG_MMC_SDHCI_BCM2708) += sdhci-bcm2708.o - obj-$(CONFIG_MMC_WBSD) += wbsd.o - obj-$(CONFIG_MMC_AU1X) += au1xmmc.o - obj-$(CONFIG_MMC_OMAP) += omap.o -@@ -36,6 +37,7 @@ - obj-$(CONFIG_MMC_SDHI) += sh_mobile_sdhi.o - obj-$(CONFIG_MMC_CB710) += cb710-mmc.o - obj-$(CONFIG_MMC_VIA_SDMMC) += via-sdmmc.o -+obj-$(CONFIG_MMC_BCM2708) += bcm2708_mci.o - obj-$(CONFIG_SDH_BFIN) += bfin_sdh.o - obj-$(CONFIG_MMC_DW) += dw_mmc.o - obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o -diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/drivers/mmc/host/sdhci-bcm2708.c ---- linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/mmc/host/sdhci-bcm2708.c 2012-06-10 05:51:05.367411579 +0200 -@@ -0,0 +1,1466 @@ +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +new file mode 100644 +index 0000000..2151ec6 +--- /dev/null ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -0,0 +1,1473 @@ +/* + * sdhci-bcm2708.c Support for SDHCI device on BCM2708 + * Copyright (c) 2010 Broadcom @@ -27086,6 +27359,9 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv + +#define BCM2708_SDHCI_SLEEP_TIMEOUT 1000 /* msecs */ + ++/* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */ ++#define BCM2708_EMMC_CLOCK_FREQ 50000000 ++ +#define POWER_OFF 0 +#define POWER_LAZY_OFF 1 +#define POWER_ON 2 @@ -27145,6 +27421,8 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv + return (unsigned long)((hptime() - t) * HPTIME_CLK_NS); +} + ++static bool allow_highspeed = 1; ++ +#if 0 +static void hptime_test(void) +{ @@ -27343,12 +27621,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv + +static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host) +{ -+ return 100000000; // this value is in Hz (100MHz/4) -+} -+ -+static unsigned int sdhci_bcm2708_get_timeout_clock(struct sdhci_host *host) -+{ -+ return 100000; // this value is in kHz (100MHz/4) ++ return BCM2708_EMMC_CLOCK_FREQ; +} + +/*****************************************************************************\ @@ -27826,7 +28099,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv + 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=1000; ++ int timeout=5000; + + DBG("PDMA over - sync card\n"); + if (data->flags & MMC_DATA_READ) @@ -27837,7 +28110,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv + while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE) + & state_mask) && --timeout > 0) + { -+ udelay(100); ++ udelay(30); + continue; + } + if (timeout <= 0) @@ -28237,11 +28510,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv +#else +#error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set +#endif -+ //.enable_dma = NULL, -+ //.set_clock = NULL, + .get_max_clock = sdhci_bcm2708_get_max_clock, -+ //.get_min_clock = NULL, -+ .get_timeout_clock = sdhci_bcm2708_get_timeout_clock, + + .enable = sdhci_bcm2708_enable, + .disable = sdhci_bcm2708_disable, @@ -28302,7 +28571,11 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv + host->irq = platform_get_irq(pdev, 0); + + host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | -+ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; ++ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | ++ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | ++ SDHCI_QUIRK_MISSING_CAPS | ++ SDHCI_QUIRK_NO_HISPD_BIT; ++ +#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA + host->flags = SDHCI_USE_PLATDMA; +#endif @@ -28369,6 +28642,9 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv + host_priv->cb_base, (unsigned)host_priv->cb_handle, + host_priv->dma_chan, host_priv->dma_chan_base, + host_priv->dma_irq); ++ ++ if (allow_highspeed) ++ host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; +#endif + + ret = sdhci_add_host(host); @@ -28474,14 +28750,19 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.19.patch/driv +module_init(sdhci_drv_init); +module_exit(sdhci_drv_exit); + ++module_param(allow_highspeed, bool, 0444); ++ +MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); +MODULE_AUTHOR("Broadcom "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:"DRIVER_NAME); + -diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/host/sdhci.c ---- linux-3.2.19/drivers/mmc/host/sdhci.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/mmc/host/sdhci.c 2012-06-10 05:51:05.368411600 +0200 ++MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes"); ++ +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c +index 6ce32a7..4cfad2e 100644 +--- a/drivers/mmc/host/sdhci.c ++++ b/drivers/mmc/host/sdhci.c @@ -27,6 +27,7 @@ #include @@ -28490,7 +28771,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ #include "sdhci.h" -@@ -296,7 +297,7 @@ +@@ -296,7 +297,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) u32 uninitialized_var(scratch); u8 *buf; @@ -28499,7 +28780,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ blksize = host->data->blksz; chunk = 0; -@@ -341,7 +342,7 @@ +@@ -341,7 +342,7 @@ static void sdhci_write_block_pio(struct sdhci_host *host) u32 scratch; u8 *buf; @@ -28508,7 +28789,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ blksize = host->data->blksz; chunk = 0; -@@ -380,19 +381,28 @@ +@@ -380,19 +381,28 @@ static void sdhci_write_block_pio(struct sdhci_host *host) local_irq_restore(flags); } @@ -28540,7 +28821,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ /* * Some controllers (JMicron JMB38x) mess up the buffer bits -@@ -403,7 +413,7 @@ +@@ -403,7 +413,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host) (host->data->blocks == 1)) mask = ~0; @@ -28549,7 +28830,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ if (host->quirks & SDHCI_QUIRK_PIO_NEEDS_DELAY) udelay(100); -@@ -415,9 +425,11 @@ +@@ -415,9 +425,11 @@ static void sdhci_transfer_pio(struct sdhci_host *host) host->blocks--; if (host->blocks == 0) break; @@ -28562,7 +28843,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ } static char *sdhci_kmap_atomic(struct scatterlist *sg, unsigned long *flags) -@@ -690,7 +702,9 @@ +@@ -690,7 +702,9 @@ static void sdhci_set_transfer_irqs(struct sdhci_host *host) u32 pio_irqs = SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL; u32 dma_irqs = SDHCI_INT_DMA_END | SDHCI_INT_ADMA_ERROR; @@ -28573,7 +28854,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ sdhci_clear_set_irqs(host, pio_irqs, dma_irqs); else sdhci_clear_set_irqs(host, dma_irqs, pio_irqs); -@@ -722,44 +736,25 @@ +@@ -722,44 +736,25 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) host->data_early = 0; host->data->bytes_xfered = 0; @@ -28626,7 +28907,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ int broken, i; struct scatterlist *sg; -@@ -818,7 +813,8 @@ +@@ -818,7 +813,8 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) */ WARN_ON(1); host->flags &= ~SDHCI_REQ_USE_DMA; @@ -28636,7 +28917,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ WARN_ON(sg_cnt != 1); sdhci_writel(host, sg_dma_address(data->sg), SDHCI_DMA_ADDRESS); -@@ -834,11 +830,13 @@ +@@ -834,11 +830,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) if (host->version >= SDHCI_SPEC_200) { ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); ctrl &= ~SDHCI_CTRL_DMA_MASK; @@ -28655,7 +28936,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); } -@@ -890,7 +888,8 @@ +@@ -890,7 +888,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, if (data->flags & MMC_DATA_READ) mode |= SDHCI_TRNS_READ; @@ -28665,7 +28946,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ mode |= SDHCI_TRNS_DMA; sdhci_writew(host, mode, SDHCI_TRANSFER_MODE); -@@ -906,13 +905,16 @@ +@@ -906,13 +905,16 @@ static void sdhci_finish_data(struct sdhci_host *host) host->data = NULL; if (host->flags & SDHCI_REQ_USE_DMA) { @@ -28686,7 +28967,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ } /* -@@ -965,6 +967,12 @@ +@@ -965,6 +967,12 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY)) mask |= SDHCI_DATA_INHIBIT; @@ -28699,7 +28980,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ /* We shouldn't wait for data inihibit for stop commands, even though they might use busy signaling */ if (host->mrq->data && (cmd == host->mrq->data->stop)) -@@ -982,10 +990,16 @@ +@@ -982,10 +990,16 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) timeout--; mdelay(1); } @@ -28716,7 +28997,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ sdhci_prepare_data(host, cmd); -@@ -1218,6 +1232,35 @@ +@@ -1218,6 +1232,35 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) mdelay(10); } @@ -28752,7 +29033,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ /*****************************************************************************\ * * * MMC callbacks * -@@ -1298,6 +1341,7 @@ +@@ -1298,6 +1341,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) { unsigned long flags; u8 ctrl; @@ -28760,7 +29041,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ spin_lock_irqsave(&host->lock, flags); -@@ -1356,7 +1400,7 @@ +@@ -1356,7 +1400,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) else ctrl &= ~SDHCI_CTRL_HISPD; @@ -28769,7 +29050,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ u16 clk, ctrl_2; unsigned int clock; -@@ -1445,6 +1489,12 @@ +@@ -1445,6 +1489,12 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) out: mmiowb(); spin_unlock_irqrestore(&host->lock, flags); @@ -28782,7 +29063,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ } static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) -@@ -1888,6 +1938,8 @@ +@@ -1888,6 +1938,8 @@ static const struct mmc_host_ops sdhci_ops = { .start_signal_voltage_switch = sdhci_start_signal_voltage_switch, .execute_tuning = sdhci_execute_tuning, .enable_preset_value = sdhci_enable_preset_value, @@ -28791,7 +29072,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ }; /*****************************************************************************\ -@@ -2000,7 +2052,7 @@ +@@ -2000,7 +2052,7 @@ static void sdhci_timeout_timer(unsigned long data) if (host->mrq) { pr_err("%s: Timeout waiting for hardware " @@ -28800,7 +29081,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ sdhci_dumpregs(host); if (host->data) { -@@ -2045,10 +2097,13 @@ +@@ -2045,10 +2097,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) BUG_ON(intmask == 0); if (!host->cmd) { @@ -28818,7 +29099,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ return; } -@@ -2118,6 +2173,19 @@ +@@ -2118,6 +2173,19 @@ static void sdhci_show_adma_error(struct sdhci_host *host) static void sdhci_show_adma_error(struct sdhci_host *host) { } #endif @@ -28838,7 +29119,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) { BUG_ON(intmask == 0); -@@ -2144,34 +2212,57 @@ +@@ -2144,34 +2212,57 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) return; } } @@ -28911,7 +29192,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ /* * We currently don't do anything fancy with DMA -@@ -2200,18 +2291,8 @@ +@@ -2200,18 +2291,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) sdhci_writel(host, dmanow, SDHCI_DMA_ADDRESS); } @@ -28932,7 +29213,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ } } -@@ -2266,6 +2347,22 @@ +@@ -2266,6 +2347,22 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) tasklet_schedule(&host->card_tasklet); } @@ -28955,7 +29236,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ if (intmask & SDHCI_INT_CMD_MASK) { sdhci_writel(host, intmask & SDHCI_INT_CMD_MASK, SDHCI_INT_STATUS); -@@ -2280,7 +2377,13 @@ +@@ -2280,7 +2377,13 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); @@ -28970,7 +29251,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ if (intmask & SDHCI_INT_BUS_POWER) { pr_err("%s: Card is consuming too much power!\n", -@@ -2363,7 +2466,8 @@ +@@ -2363,7 +2466,8 @@ int sdhci_resume_host(struct sdhci_host *host) return ret; } @@ -28980,7 +29261,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ if (host->ops->enable_dma) host->ops->enable_dma(host); } -@@ -2570,14 +2674,16 @@ +@@ -2570,14 +2674,16 @@ int sdhci_add_host(struct sdhci_host *host) host->flags &= ~SDHCI_USE_ADMA; } @@ -28999,7 +29280,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ } } } -@@ -2688,7 +2794,7 @@ +@@ -2688,7 +2794,7 @@ int sdhci_add_host(struct sdhci_host *host) /* Auto-CMD23 stuff only works in ADMA or PIO. */ if ((host->version >= SDHCI_SPEC_300) && ((host->flags & SDHCI_USE_ADMA) || @@ -29008,17 +29289,20 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ host->flags |= SDHCI_AUTO_CMD23; DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); } else { -@@ -2821,6 +2927,9 @@ +@@ -2821,6 +2927,12 @@ int sdhci_add_host(struct sdhci_host *host) mmc->caps |= MMC_CAP_MAX_CURRENT_200; } -+ if(host->ops->voltage_broken) ++ if(host->ops->voltage_broken) { + ocr_avail |= MMC_VDD_29_30 | MMC_VDD_30_31; ++ // Cannot support UHS modes is we are stuck at 3.3V; ++ mmc->caps &= ~(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50); ++ } + mmc->ocr_avail = ocr_avail; mmc->ocr_avail_sdio = ocr_avail; if (host->ocr_avail_sdio) -@@ -2953,6 +3062,7 @@ +@@ -2953,6 +3065,7 @@ int sdhci_add_host(struct sdhci_host *host) pr_info("%s: SDHCI controller on %s [%s] using %s\n", mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)), @@ -29026,10 +29310,11 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.c linux-3.2.19.patch/drivers/mmc/ (host->flags & SDHCI_USE_ADMA) ? "ADMA" : (host->flags & SDHCI_USE_SDMA) ? "DMA" : "PIO"); -diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.h linux-3.2.19.patch/drivers/mmc/host/sdhci.h ---- linux-3.2.19/drivers/mmc/host/sdhci.h 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/mmc/host/sdhci.h 2012-06-10 05:51:05.340411035 +0200 -@@ -273,6 +273,25 @@ +diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h +index a04d4d0..4cc7b4b 100644 +--- a/drivers/mmc/host/sdhci.h ++++ b/drivers/mmc/host/sdhci.h +@@ -273,6 +273,25 @@ struct sdhci_ops { void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); @@ -29055,7 +29340,7 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.h linux-3.2.19.patch/drivers/mmc/ void (*hw_reset)(struct sdhci_host *host); }; -@@ -379,6 +398,29 @@ +@@ -379,6 +398,29 @@ extern int sdhci_resume_host(struct sdhci_host *host); extern void sdhci_enable_irq_wakeups(struct sdhci_host *host); #endif @@ -29085,9 +29370,10 @@ diff -Naur linux-3.2.19/drivers/mmc/host/sdhci.h linux-3.2.19.patch/drivers/mmc/ #ifdef CONFIG_PM_RUNTIME extern int sdhci_runtime_suspend_host(struct sdhci_host *host); extern int sdhci_runtime_resume_host(struct sdhci_host *host); -diff -Naur linux-3.2.19/drivers/net/usb/smsc95xx.c linux-3.2.19.patch/drivers/net/usb/smsc95xx.c ---- linux-3.2.19/drivers/net/usb/smsc95xx.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/net/usb/smsc95xx.c 2012-06-10 05:51:05.331410854 +0200 +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 55b3218..5d2fec2 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c @@ -46,6 +46,7 @@ #define SMSC95XX_INTERNAL_PHY_ID (1) #define SMSC95XX_TX_OVERHEAD (8) @@ -29096,7 +29382,7 @@ diff -Naur linux-3.2.19/drivers/net/usb/smsc95xx.c linux-3.2.19.patch/drivers/ne struct smsc95xx_priv { u32 mac_cr; -@@ -63,6 +64,10 @@ +@@ -63,6 +64,10 @@ static int turbo_mode = true; module_param(turbo_mode, bool, 0644); MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); @@ -29107,7 +29393,7 @@ diff -Naur linux-3.2.19/drivers/net/usb/smsc95xx.c linux-3.2.19.patch/drivers/ne static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) { u32 *buf = kmalloc(4, GFP_KERNEL); -@@ -600,8 +605,59 @@ +@@ -600,8 +605,59 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); } @@ -29167,7 +29453,7 @@ diff -Naur linux-3.2.19/drivers/net/usb/smsc95xx.c linux-3.2.19.patch/drivers/ne /* try reading mac address from EEPROM */ if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -@@ -1016,6 +1072,7 @@ +@@ -1016,6 +1072,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->ethtool_ops = &smsc95xx_ethtool_ops; dev->net->flags |= IFF_MULTICAST; dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM; @@ -29175,10 +29461,11 @@ diff -Naur linux-3.2.19/drivers/net/usb/smsc95xx.c linux-3.2.19.patch/drivers/ne return 0; } -diff -Naur linux-3.2.19/drivers/spi/Kconfig linux-3.2.19.patch/drivers/spi/Kconfig ---- linux-3.2.19/drivers/spi/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/spi/Kconfig 2012-06-10 05:51:05.351411257 +0200 -@@ -74,6 +74,14 @@ +diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig +index 7587796..4153631 100644 +--- a/drivers/spi/Kconfig ++++ b/drivers/spi/Kconfig +@@ -74,6 +74,14 @@ config SPI_ATMEL This selects a driver for the Atmel SPI Controller, present on many AT32 (AVR32) and AT91 (ARM) chips. @@ -29193,10 +29480,11 @@ diff -Naur linux-3.2.19/drivers/spi/Kconfig linux-3.2.19.patch/drivers/spi/Kconf config SPI_BFIN tristate "SPI controller driver for ADI Blackfin5xx" depends on BLACKFIN -diff -Naur linux-3.2.19/drivers/spi/Makefile linux-3.2.19.patch/drivers/spi/Makefile ---- linux-3.2.19/drivers/spi/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/spi/Makefile 2012-06-10 05:51:05.351411257 +0200 -@@ -14,6 +14,7 @@ +diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile +index 61c3261..2ff2985 100644 +--- a/drivers/spi/Makefile ++++ b/drivers/spi/Makefile +@@ -14,6 +14,7 @@ obj-$(CONFIG_SPI_ALTERA) += spi-altera.o obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o obj-$(CONFIG_SPI_ATH79) += spi-ath79.o obj-$(CONFIG_SPI_AU1550) += spi-au1550.o @@ -29204,9 +29492,11 @@ diff -Naur linux-3.2.19/drivers/spi/Makefile linux-3.2.19.patch/drivers/spi/Make obj-$(CONFIG_SPI_BFIN) += spi-bfin5xx.o obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o obj-$(CONFIG_SPI_BITBANG) += spi-bitbang.o -diff -Naur linux-3.2.19/drivers/spi/spi-bcm2708.c linux-3.2.19.patch/drivers/spi/spi-bcm2708.c ---- linux-3.2.19/drivers/spi/spi-bcm2708.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/spi/spi-bcm2708.c 2012-06-10 05:51:05.363411499 +0200 +diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c +new file mode 100644 +index 0000000..b32dda5 +--- /dev/null ++++ b/drivers/spi/spi-bcm2708.c @@ -0,0 +1,579 @@ +/* + * Driver for Broadcom BCM2708 SPI Controllers @@ -29787,10 +30077,23 @@ diff -Naur linux-3.2.19/drivers/spi/spi-bcm2708.c linux-3.2.19.patch/drivers/spi +MODULE_AUTHOR("Chris Boot "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -diff -Naur linux-3.2.19/drivers/usb/core/generic.c linux-3.2.19.patch/drivers/usb/core/generic.c ---- linux-3.2.19/drivers/usb/core/generic.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/core/generic.c 2012-06-10 05:51:04.877401700 +0200 -@@ -149,6 +149,7 @@ +diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile +index 75eca76..a6b7e41 100644 +--- a/drivers/usb/Makefile ++++ b/drivers/usb/Makefile +@@ -23,6 +23,7 @@ obj-$(CONFIG_USB_U132_HCD) += host/ + obj-$(CONFIG_USB_R8A66597_HCD) += host/ + obj-$(CONFIG_USB_HWA_HCD) += host/ + obj-$(CONFIG_USB_ISP1760_HCD) += host/ ++obj-$(CONFIG_USB_DWCOTG) += host/ + obj-$(CONFIG_USB_IMX21_HCD) += host/ + obj-$(CONFIG_USB_FSL_MPH_DR_OF) += host/ + +diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c +index 69ecd3c..0431b4e 100644 +--- a/drivers/usb/core/generic.c ++++ b/drivers/usb/core/generic.c +@@ -149,6 +149,7 @@ int usb_choose_configuration(struct usb_device *udev) dev_warn(&udev->dev, "no configuration chosen from %d choice%s\n", num_configs, plural(num_configs)); @@ -29798,10 +30101,11 @@ diff -Naur linux-3.2.19/drivers/usb/core/generic.c linux-3.2.19.patch/drivers/us } return i; } -diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/core/hub.c ---- linux-3.2.19/drivers/usb/core/hub.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/core/hub.c 2012-06-10 05:51:04.879401740 +0200 -@@ -1075,6 +1075,8 @@ +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 52d27ed..34eb283 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -1075,6 +1075,8 @@ static int hub_configure(struct usb_hub *hub, INIT_WORK(&hub->tt.clear_work, hub_tt_work); switch (hdev->descriptor.bDeviceProtocol) { case 0: @@ -29810,7 +30114,7 @@ diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/co break; case 1: dev_dbg(hub_dev, "Single TT\n"); -@@ -1091,6 +1093,7 @@ +@@ -1091,6 +1093,7 @@ static int hub_configure(struct usb_hub *hub, hub->tt.hub = hdev; break; case 3: @@ -29818,7 +30122,7 @@ diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/co /* USB 3.0 hubs don't have a TT */ break; default: -@@ -1720,6 +1723,12 @@ +@@ -1720,6 +1723,12 @@ static inline void announce_device(struct usb_device *udev) { } #endif #ifdef CONFIG_USB_OTG @@ -29831,7 +30135,7 @@ diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/co #include "otg_whitelist.h" #endif -@@ -1774,9 +1783,15 @@ +@@ -1774,9 +1783,15 @@ static int usb_enumerate_device_otg(struct usb_device *udev) dev_info(&udev->dev, "can't set HNP mode: %d\n", err); @@ -29848,7 +30152,7 @@ diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/co } } -@@ -1785,12 +1800,27 @@ +@@ -1785,12 +1800,27 @@ static int usb_enumerate_device_otg(struct usb_device *udev) /* Maybe it can talk to us, though we can't talk to it. * (Includes HNP test device.) */ @@ -29879,7 +30183,7 @@ diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/co goto fail; } fail: -@@ -2981,7 +3011,9 @@ +@@ -2981,7 +3011,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, buf->bMaxPacketSize0 = 0; r = usb_control_msg(udev, usb_rcvaddr0pipe(), USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, @@ -29890,7 +30194,7 @@ diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/co buf, GET_DESCRIPTOR_BUFSIZE, initial_descriptor_timeout); switch (buf->bMaxPacketSize0) { -@@ -3427,8 +3459,10 @@ +@@ -3427,8 +3459,10 @@ loop: release_devnum(udev); hub_free_dev(udev); usb_put_dev(udev); @@ -29903,10 +30207,11 @@ diff -Naur linux-3.2.19/drivers/usb/core/hub.c linux-3.2.19.patch/drivers/usb/co } if (hub->hdev->parent || !hcd->driver->port_handed_over || -diff -Naur linux-3.2.19/drivers/usb/core/message.c linux-3.2.19.patch/drivers/usb/core/message.c ---- linux-3.2.19/drivers/usb/core/message.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/core/message.c 2012-06-10 05:51:04.880401760 +0200 -@@ -1837,6 +1837,85 @@ +diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c +index ca717da..4148a1b 100644 +--- a/drivers/usb/core/message.c ++++ b/drivers/usb/core/message.c +@@ -1837,6 +1837,85 @@ free_interfaces: if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) cp->string = usb_cache_string(dev, cp->desc.iConfiguration); @@ -29992,9 +30297,10 @@ diff -Naur linux-3.2.19/drivers/usb/core/message.c linux-3.2.19.patch/drivers/us /* Now that all the interfaces are set up, register them * to trigger binding of drivers to interfaces. probe() -diff -Naur linux-3.2.19/drivers/usb/core/otg_whitelist.h linux-3.2.19.patch/drivers/usb/core/otg_whitelist.h ---- linux-3.2.19/drivers/usb/core/otg_whitelist.h 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/core/otg_whitelist.h 2012-06-10 05:51:04.881401780 +0200 +diff --git a/drivers/usb/core/otg_whitelist.h b/drivers/usb/core/otg_whitelist.h +index e8cdce5..3a0da17 100644 +--- a/drivers/usb/core/otg_whitelist.h ++++ b/drivers/usb/core/otg_whitelist.h @@ -19,33 +19,82 @@ static struct usb_device_id whitelist_table [] = { @@ -30084,20 +30390,14 @@ diff -Naur linux-3.2.19/drivers/usb/core/otg_whitelist.h linux-3.2.19.patch/driv static int is_targeted(struct usb_device *dev) { struct usb_device_id *id = whitelist_table; -@@ -55,58 +104,83 @@ +@@ -55,58 +104,83 @@ static int is_targeted(struct usb_device *dev) return 1; /* HNP test device is _never_ targeted (see OTG spec 6.6.6) */ - if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a && - le16_to_cpu(dev->descriptor.idProduct) == 0xbadd)) - return 0; -+ if (dev->descriptor.idVendor == 0x1a0a && -+ dev->descriptor.idProduct == 0xbadd) { -+ return 0; -+ } else if (!enable_whitelist) { -+ return 1; -+ } else { - +- - /* NOTE: can't use usb_match_id() since interface caches - * aren't set up yet. this is cut/paste from that code. - */ @@ -30131,6 +30431,13 @@ diff -Naur linux-3.2.19/drivers/usb/core/otg_whitelist.h linux-3.2.19.patch/driv - if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) && - (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol)) - continue; ++ if (dev->descriptor.idVendor == 0x1a0a && ++ dev->descriptor.idProduct == 0xbadd) { ++ return 0; ++ } else if (!enable_whitelist) { ++ return 1; ++ } else { ++ +#ifdef DEBUG + dev_dbg(&dev->dev, "device V:%04x P:%04x DC:%04x SC:%04x PR:%04x \n", + dev->descriptor.idVendor, @@ -30210,10 +30517,28 @@ diff -Naur linux-3.2.19/drivers/usb/core/otg_whitelist.h linux-3.2.19.patch/driv #endif } -diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/drivers/usb/gadget/file_storage.c ---- linux-3.2.19/drivers/usb/gadget/file_storage.c 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/gadget/file_storage.c 2012-06-10 05:51:04.884401840 +0200 -@@ -573,8 +573,37 @@ +diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig +index 23a4473..12d27d2 100644 +--- a/drivers/usb/gadget/Kconfig ++++ b/drivers/usb/gadget/Kconfig +@@ -552,6 +552,12 @@ config USB_GADGET_SUPERSPEED + depends on USB_GADGET + depends on USB_GADGET_DUALSPEED + ++config USB_DWC_OTG_LPM ++ boolean "Enable LPM support" ++ depends on USB && EXPERIMENTAL ++ help ++ Enables LPM support. ++ + # + # USB Gadget Drivers + # +diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c +index db2d607..5090ae6 100644 +--- a/drivers/usb/gadget/file_storage.c ++++ b/drivers/usb/gadget/file_storage.c +@@ -573,8 +573,37 @@ config_desc = { .iConfiguration = FSG_STRING_CONFIG, .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, .bMaxPower = CONFIG_USB_GADGET_VBUS_DRAW / 2, @@ -30251,7 +30576,7 @@ diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/dri static struct usb_qualifier_descriptor dev_qualifier = { -@@ -984,13 +1013,29 @@ +@@ -984,13 +1013,29 @@ get_config: break; case USB_DT_BOS: @@ -30282,7 +30607,7 @@ diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/dri break; /* One config, two speeds */ -@@ -2640,6 +2685,9 @@ +@@ -2640,6 +2685,9 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) fsg_set_halt(fsg, fsg->bulk_out); halt_bulk_in_endpoint(fsg); } @@ -30292,7 +30617,7 @@ diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/dri return -EINVAL; } -@@ -2991,7 +3039,8 @@ +@@ -2991,7 +3039,8 @@ static void handle_exception(struct fsg_dev *fsg) * bulk endpoint, clear the halt now. (The SuperH UDC * requires this.) */ if (test_and_clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags)) @@ -30302,7 +30627,7 @@ diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/dri if (transport_is_bbb()) { if (fsg->ep0_req_tag == exception_req_tag) -@@ -3065,6 +3114,9 @@ +@@ -3065,6 +3114,9 @@ static int fsg_main_thread(void *fsg_) * that expects a __user pointer and it will work okay. */ set_fs(get_ds()); @@ -30312,7 +30637,7 @@ diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/dri /* The main loop */ while (fsg->state != FSG_STATE_TERMINATED) { if (exception_in_progress(fsg) || signal_pending(current)) { -@@ -3212,6 +3264,13 @@ +@@ -3212,6 +3264,13 @@ static int __init check_parameters(struct fsg_dev *fsg) gcnum = usb_gadget_controller_number(fsg->gadget); if (gcnum >= 0) mod_data.release = 0x0300 + gcnum; @@ -30326,7 +30651,7 @@ diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/dri else { WARNING(fsg, "controller '%s' not recognized\n", fsg->gadget->name); -@@ -3473,6 +3532,13 @@ +@@ -3473,6 +3532,13 @@ static int __init fsg_bind(struct usb_gadget *gadget) rc = -ENOMEM; @@ -30340,25 +30665,142 @@ diff -Naur linux-3.2.19/drivers/usb/gadget/file_storage.c linux-3.2.19.patch/dri /* Allocate the request and buffer for endpoint 0 */ fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL); if (!req) -diff -Naur linux-3.2.19/drivers/usb/gadget/Kconfig linux-3.2.19.patch/drivers/usb/gadget/Kconfig ---- linux-3.2.19/drivers/usb/gadget/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/gadget/Kconfig 2012-06-10 05:51:05.261409443 +0200 -@@ -552,6 +552,12 @@ - depends on USB_GADGET - depends on USB_GADGET_DUALSPEED +diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig +index 060e0e2..c03ee48 100644 +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -556,6 +556,19 @@ config USB_HWA_HCD + To compile this driver a module, choose M here: the module + will be called "hwa-hc". -+config USB_DWC_OTG_LPM -+ boolean "Enable LPM support" -+ depends on USB && EXPERIMENTAL ++config USB_DWCOTG ++ tristate "Synopsis DWC host support" ++ depends on USB + help -+ Enables LPM support. ++ The Synopsis DWC controller is a dual-role ++ host/peripheral/OTG ("On The Go") USB controllers. + - # - # USB Gadget Drivers - # -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_cc.c linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_cc.c ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_cc.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_cc.c 2012-06-10 05:51:04.887401901 +0200 ++ Enable this option to support this IP in host controller mode. ++ If unsure, say N. ++ ++ To compile this driver as a module, choose M here: the ++ modules built will be called dwc_otg and dwc_common_port. ++ + config USB_IMX21_HCD + tristate "i.MX21 HCD support" + depends on USB && ARM && ARCH_MXC +diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile +index 7ca290f..802dda6 100644 +--- a/drivers/usb/host/Makefile ++++ b/drivers/usb/host/Makefile +@@ -33,6 +33,8 @@ obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o + obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o + obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o + obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o ++ ++obj-$(CONFIG_USB_DWCOTG) += dwc_otg/ dwc_common_port/ + obj-$(CONFIG_USB_IMX21_HCD) += imx21-hcd.o + obj-$(CONFIG_USB_FSL_MPH_DR_OF) += fsl-mph-dr-of.o + obj-$(CONFIG_USB_OCTEON2_COMMON) += octeon2-common.o +diff --git a/drivers/usb/host/dwc_common_port/Makefile b/drivers/usb/host/dwc_common_port/Makefile +new file mode 100644 +index 0000000..b593b08 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/Makefile +@@ -0,0 +1,46 @@ ++# ++# Makefile for DWC_common library ++# ++ ++ifneq ($(KERNELRELEASE),) ++ ++#CPPFLAGS += -DDEBUG_MEMORY ++ ++ifeq ($(CONFIG_USB_DEBUG),y) ++CPPFLAGS += -DDEBUG ++endif ++CPPFLAGS += -DDWC_LINUX ++ ++obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o ++dwc_common_port_lib-objs := dwc_cc.o \ ++ dwc_notifier.o \ ++ dwc_common_linux.o dwc_mem.o ++ ++kernrelwd := $(subst ., ,$(KERNELRELEASE)) ++kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) ++ ++ifneq ($(kernrel3),2.6.20) ++# grayg - I only know that we use EXTRA_CFLAGS in 2.6.31 actually ++EXTRA_CFLAGS += $(CPPFLAGS) ++endif ++ ++else ++ ++ifeq ($(DOXYGEN),) ++DOXYGEN := $(DOXYGEN) ++endif ++ ++default: ++ $(MAKE) -C$(KDIR) M=$(PWD) modules ++ ++docs: $(wildcard *.[hc]) doc/doxygen.cfg ++ $(DOXYGEN) doc/doxygen.cfg ++ ++tags: $(wildcard *.[hc]) ++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) ++ ++endif ++ ++clean: ++ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers ++ +diff --git a/drivers/usb/host/dwc_common_port/Makefile.linux b/drivers/usb/host/dwc_common_port/Makefile.linux +new file mode 100644 +index 0000000..a553a9d +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/Makefile.linux +@@ -0,0 +1,36 @@ ++# ++# Makefile for DWC_common library ++# ++ifneq ($(KERNELRELEASE),) ++ ++#CPPFLAGS += -DDEBUG_MEMORY ++ ++#CPPFLAGS += -DDEBUG ++CPPFLAGS += -DDWC_LINUX ++ ++obj-m := dwc_common_port_lib.o ++dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \ ++ dwc_crypto.o dwc_notifier.o \ ++ dwc_common_linux.o dwc_mem.o ++ ++else ++ ++ ++ifeq ($(DOXYGEN),) ++DOXYGEN := $(DOXYGEN) ++endif ++ ++default: ++ $(MAKE) -C$(KDIR) M=$(PWD) modules ++ ++docs: $(wildcard *.[hc]) doc/doxygen.cfg ++ $(DOXYGEN) doc/doxygen.cfg ++ ++tags: $(wildcard *.[hc]) ++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) ++ ++endif ++ ++clean: ++ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers ++ +diff --git a/drivers/usb/host/dwc_common_port/dwc_cc.c b/drivers/usb/host/dwc_common_port/dwc_cc.c +new file mode 100644 +index 0000000..3a7dd71 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_cc.c @@ -0,0 +1,506 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_cc.c $ @@ -30866,9 +31308,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_cc.c linux-3.2.19.p + + return retval; +} -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_cc.h linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_cc.h ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_cc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_cc.h 2012-06-10 05:51:04.888401922 +0200 +diff --git a/drivers/usb/host/dwc_common_port/dwc_cc.h b/drivers/usb/host/dwc_common_port/dwc_cc.h +new file mode 100644 +index 0000000..6b46419 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_cc.h @@ -0,0 +1,209 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_cc.h $ @@ -31079,9 +31523,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_cc.h linux-3.2.19.p + +#endif /* _DWC_CC_H_ */ + -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_common_linux.c linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_common_linux.c ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_common_linux.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_common_linux.c 2012-06-10 05:51:05.264409503 +0200 +diff --git a/drivers/usb/host/dwc_common_port/dwc_common_linux.c b/drivers/usb/host/dwc_common_port/dwc_common_linux.c +new file mode 100644 +index 0000000..fbf9dfb +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_common_linux.c @@ -0,0 +1,1138 @@ +#include "dwc_cc.h" +#include "dwc_notifier.h" @@ -32221,9 +32667,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_common_linux.c linu + DWC_WAITQ_TRIGGER(wq); +} +EXPORT_SYMBOL(DWC_WAITQ_ABORT); -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_list.h linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_list.h ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_list.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_list.h 2012-06-10 05:51:04.893402022 +0200 +diff --git a/drivers/usb/host/dwc_common_port/dwc_list.h b/drivers/usb/host/dwc_common_port/dwc_list.h +new file mode 100644 +index 0000000..b29afe0 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_list.h @@ -0,0 +1,616 @@ +/* $OpenBSD: queue.h,v 1.26 2004/05/04 16:59:32 grange Exp $ */ +/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ @@ -32841,9 +33289,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_list.h linux-3.2.19 +} while (0) + +#endif /* !_SYS_QUEUE_H_ */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_mem.c linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_mem.c ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_mem.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_mem.c 2012-06-10 05:51:04.893402022 +0200 +diff --git a/drivers/usb/host/dwc_common_port/dwc_mem.c b/drivers/usb/host/dwc_common_port/dwc_mem.c +new file mode 100644 +index 0000000..f2f9bc6 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_mem.c @@ -0,0 +1,172 @@ +#include "dwc_os.h" +#include "dwc_list.h" @@ -33017,9 +33467,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_mem.c linux-3.2.19. +} + +#endif /* DEBUG_MEMORY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_notifier.c ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_notifier.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_notifier.c 2012-06-10 05:51:04.895402062 +0200 +diff --git a/drivers/usb/host/dwc_common_port/dwc_notifier.c b/drivers/usb/host/dwc_common_port/dwc_notifier.c +new file mode 100644 +index 0000000..e44bb81 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_notifier.c @@ -0,0 +1,256 @@ +#include "dwc_notifier.h" +#include "dwc_list.h" @@ -33277,9 +33729,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-3. + } +} + -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_notifier.h ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_notifier.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_notifier.h 2012-06-10 05:51:04.933402829 +0200 +diff --git a/drivers/usb/host/dwc_common_port/dwc_notifier.h b/drivers/usb/host/dwc_common_port/dwc_notifier.h +new file mode 100644 +index 0000000..a1388d1 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_notifier.h @@ -0,0 +1,112 @@ + +#ifndef __DWC_NOTIFIER_H__ @@ -33393,9 +33847,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-3. +void dwc_notify(dwc_notifier_t *notifier, char *notification, void *notification_data); + +#endif /* __DWC_NOTIFIER_H__ */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_os.h linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_os.h ---- linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_os.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/dwc_os.h 2012-06-10 05:51:05.210408414 +0200 +diff --git a/drivers/usb/host/dwc_common_port/dwc_os.h b/drivers/usb/host/dwc_common_port/dwc_os.h +new file mode 100644 +index 0000000..453966a +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/dwc_os.h @@ -0,0 +1,925 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_os.h $ @@ -34322,99 +34778,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/dwc_os.h linux-3.2.19.p + * threading should be able to be implemented with the defined behavior. + * + */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/Makefile linux-3.2.19.patch/drivers/usb/host/dwc_common_port/Makefile ---- linux-3.2.19/drivers/usb/host/dwc_common_port/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/Makefile 2012-06-10 05:51:05.264409503 +0200 -@@ -0,0 +1,46 @@ -+# -+# Makefile for DWC_common library -+# -+ -+ifneq ($(KERNELRELEASE),) -+ -+#CPPFLAGS += -DDEBUG_MEMORY -+ -+ifeq ($(CONFIG_USB_DEBUG),y) -+CPPFLAGS += -DDEBUG -+endif -+CPPFLAGS += -DDWC_LINUX -+ -+obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o -+dwc_common_port_lib-objs := dwc_cc.o \ -+ dwc_notifier.o \ -+ dwc_common_linux.o dwc_mem.o -+ -+kernrelwd := $(subst ., ,$(KERNELRELEASE)) -+kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) -+ -+ifneq ($(kernrel3),2.6.20) -+# grayg - I only know that we use EXTRA_CFLAGS in 2.6.31 actually -+EXTRA_CFLAGS += $(CPPFLAGS) -+endif -+ -+else -+ -+ifeq ($(DOXYGEN),) -+DOXYGEN := $(DOXYGEN) -+endif -+ -+default: -+ $(MAKE) -C$(KDIR) M=$(PWD) modules -+ -+docs: $(wildcard *.[hc]) doc/doxygen.cfg -+ $(DOXYGEN) doc/doxygen.cfg -+ -+tags: $(wildcard *.[hc]) -+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) -+ -+endif -+ -+clean: -+ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers -+ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/Makefile.linux linux-3.2.19.patch/drivers/usb/host/dwc_common_port/Makefile.linux ---- linux-3.2.19/drivers/usb/host/dwc_common_port/Makefile.linux 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/Makefile.linux 2012-06-10 05:51:04.886401880 +0200 -@@ -0,0 +1,36 @@ -+# -+# Makefile for DWC_common library -+# -+ifneq ($(KERNELRELEASE),) -+ -+#CPPFLAGS += -DDEBUG_MEMORY -+ -+#CPPFLAGS += -DDEBUG -+CPPFLAGS += -DDWC_LINUX -+ -+obj-m := dwc_common_port_lib.o -+dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \ -+ dwc_crypto.o dwc_notifier.o \ -+ dwc_common_linux.o dwc_mem.o -+ -+else -+ -+ -+ifeq ($(DOXYGEN),) -+DOXYGEN := $(DOXYGEN) -+endif -+ -+default: -+ $(MAKE) -C$(KDIR) M=$(PWD) modules -+ -+docs: $(wildcard *.[hc]) doc/doxygen.cfg -+ $(DOXYGEN) doc/doxygen.cfg -+ -+tags: $(wildcard *.[hc]) -+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) -+ -+endif -+ -+clean: -+ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers -+ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/usb.h linux-3.2.19.patch/drivers/usb/host/dwc_common_port/usb.h ---- linux-3.2.19/drivers/usb/host/dwc_common_port/usb.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_common_port/usb.h 2012-06-10 05:51:04.944403050 +0200 +diff --git a/drivers/usb/host/dwc_common_port/usb.h b/drivers/usb/host/dwc_common_port/usb.h +new file mode 100644 +index 0000000..2ee4252 +--- /dev/null ++++ b/drivers/usb/host/dwc_common_port/usb.h @@ -0,0 +1,850 @@ +/* + * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -35266,9 +35634,97 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_common_port/usb.h linux-3.2.19.patc + + +#endif /* _USB_H_ */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dummy_audio.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dummy_audio.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dummy_audio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dummy_audio.c 2012-06-10 05:51:04.950403172 +0200 +diff --git a/drivers/usb/host/dwc_otg/Makefile b/drivers/usb/host/dwc_otg/Makefile +new file mode 100644 +index 0000000..fed13f4 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/Makefile +@@ -0,0 +1,80 @@ ++# ++# Makefile for DWC_otg Highspeed USB controller driver ++# ++ ++ifneq ($(KERNELRELEASE),) ++ ++ifeq ($(BUS_INTERFACE),) ++ # BUS_INTERFACE = -DLM_INTERFACE ++ BUS_INTERFACE = -DPLATFORM_INTERFACE=1 ++endif ++ ++ifeq ($(CONFIG_USB_DEBUG),y) ++CPPFLAGS += -DDEBUG ++endif ++ ++# Use one of the following flags to compile the software in host-only or ++# device-only mode. ++#CPPFLAGS += -DDWC_HOST_ONLY ++#CPPFLAGS += -DDWC_DEVICE_ONLY ++ ++CPPFLAGS += -Dlinux -DDWC_HS_ELECT_TST ++#CGG: CPPFLAGS += -DDWC_EN_ISOC ++CPPFLAGS += -I$(obj)/../dwc_common_port ++#CPPFLAGS += -I$(PORTLIB) ++CPPFLAGS += -DDWC_LINUX ++CPPFLAGS += $(CFI) ++CPPFLAGS += $(BUS_INTERFACE) ++ ++obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o ++ ++dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o ++dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o ++dwc_otg-objs += dwc_otg_pcd_linux.o dwc_otg_pcd.o dwc_otg_pcd_intr.o ++dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_linux.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o dwc_otg_hcd_ddma.o ++ifneq ($(CFI),) ++dwc_otg-objs += dwc_otg_cfi.o ++endif ++ ++kernrelwd := $(subst ., ,$(KERNELRELEASE)) ++kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) ++ ++ifneq ($(kernrel3),2.6.20) ++EXTRA_CFLAGS += $(CPPFLAGS) ++endif ++ ++else ++ ++PWD := $(shell pwd) ++PORTLIB := $(PWD)/../dwc_common_port ++ ++# Command paths ++CTAGS := $(CTAGS) ++DOXYGEN := $(DOXYGEN) ++ ++default: portlib ++ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules ++ ++install: default ++ifneq ($(INSTALL_MOD_PATH),) ++ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install ++ $(MAKE) -C$(KDIR) M=$(PWD) modules_install ++else ++ @echo "No install path defined" ++endif ++ ++portlib: ++ $(MAKE) -C$(KDIR) M=$(PORTLIB) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules ++ cp $(PORTLIB)/Module.symvers $(PWD)/ ++ ++docs: $(wildcard *.[hc]) doc/doxygen.cfg ++ $(DOXYGEN) doc/doxygen.cfg ++ ++tags: $(wildcard *.[hc]) ++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) ++ ++ ++clean: ++ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions ++ ++endif +diff --git a/drivers/usb/host/dwc_otg/dummy_audio.c b/drivers/usb/host/dwc_otg/dummy_audio.c +new file mode 100644 +index 0000000..530ac8b +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dummy_audio.c @@ -0,0 +1,1575 @@ +/* + * zero.c -- Gadget Zero, for USB development @@ -36845,9 +37301,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dummy_audio.c linux-3.2.19.patc + remove_proc_entry("isoc_test", NULL); +} +module_exit (cleanup); -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_cfi_common.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_cfi_common.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_cfi_common.h 2012-06-10 05:51:04.950403172 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_cfi_common.h b/drivers/usb/host/dwc_otg/dwc_cfi_common.h +new file mode 100644 +index 0000000..be56af4 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_cfi_common.h @@ -0,0 +1,142 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -36991,9 +37449,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-3.2.19.p +typedef struct cfi_string cfi_string_t; + +#endif -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_attr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.c 2012-06-10 05:51:04.952403212 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_attr.c b/drivers/usb/host/dwc_otg/dwc_otg_attr.c +new file mode 100644 +index 0000000..26ff76f +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_attr.c @@ -0,0 +1,1316 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.c $ @@ -38311,9 +38771,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-3.2.19.pat + device_remove_file(&dev->dev, &dev_attr_sleep_status); +#endif +} -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_attr.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.h 2012-06-10 05:51:04.953403232 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_attr.h b/drivers/usb/host/dwc_otg/dwc_otg_attr.h +new file mode 100644 +index 0000000..b59651d +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_attr.h @@ -0,0 +1,88 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.h $ @@ -38403,9 +38865,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-3.2.19.pat +#endif + ); +#endif -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 2012-06-10 05:51:04.955403272 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cfi.c b/drivers/usb/host/dwc_otg/dwc_otg_cfi.c +new file mode 100644 +index 0000000..7fe7255 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cfi.c @@ -0,0 +1,1876 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -40283,9 +40747,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-3.2.19.patc +} + +#endif //DWC_UTE_CFI -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 2012-06-10 05:51:04.956403292 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cfi.h b/drivers/usb/host/dwc_otg/dwc_otg_cfi.h +new file mode 100644 +index 0000000..0215224 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cfi.h @@ -0,0 +1,319 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -40606,9 +41072,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-3.2.19.patc +int cfi_setup(struct dwc_otg_pcd *pcd, struct cfi_usb_ctrlrequest *ctrl); + +#endif /* (__DWC_OTG_CFI_H__) */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.c 2012-06-10 05:51:04.975403676 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil.c b/drivers/usb/host/dwc_otg/dwc_otg_cil.c +new file mode 100644 +index 0000000..ccfe6b5 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cil.c @@ -0,0 +1,5410 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.c $ @@ -46020,9 +46488,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-3.2.19.patc +{ + return dwc_read_reg32(&core_if->core_global_regs->hptxfsiz); +} -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.h 2012-06-10 05:51:04.977403717 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil.h b/drivers/usb/host/dwc_otg/dwc_otg_cil.h +new file mode 100644 +index 0000000..1176166 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cil.h @@ -0,0 +1,1143 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.h $ @@ -47167,9 +47637,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-3.2.19.patc + void *_p); + +#endif -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 2012-06-10 05:51:04.979403757 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c +new file mode 100644 +index 0000000..b8b2740 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c @@ -0,0 +1,846 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil_intr.c $ @@ -48017,9 +48489,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-3.2.19 + } + return retval; +} -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_core_if.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 2012-06-10 05:51:04.980403777 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_core_if.h b/drivers/usb/host/dwc_otg/dwc_otg_core_if.h +new file mode 100644 +index 0000000..4a78b03 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_core_if.h @@ -0,0 +1,641 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_core_if.h $ @@ -48662,9 +49136,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-3.2.19. +/** @} */ + +#endif /* __DWC_CORE_IF_H__ */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_dbg.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 2012-06-10 05:51:04.980403777 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_dbg.h b/drivers/usb/host/dwc_otg/dwc_otg_dbg.h +new file mode 100644 +index 0000000..e81d093 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_dbg.h @@ -0,0 +1,113 @@ +/* ========================================================================== + * @@ -48779,9 +49255,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-3.2.19.patc + +#endif /*DEBUG*/ +#endif -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_driver.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.c 2012-06-10 05:51:04.983403837 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +new file mode 100644 +index 0000000..0e22013 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c @@ -0,0 +1,1577 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.c $ @@ -50360,9 +50838,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-3.2.19.p + + +*/ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_driver.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.h 2012-06-10 05:51:04.983403837 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.h b/drivers/usb/host/dwc_otg/dwc_otg_driver.h +new file mode 100644 +index 0000000..f37d3ac +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.h @@ -0,0 +1,101 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.h $ @@ -50465,9 +50945,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-3.2.19.p +#endif + +#endif -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 2012-06-10 05:51:05.253409281 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +new file mode 100644 +index 0000000..f07bb72 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c @@ -0,0 +1,3334 @@ + +/* ========================================================================== @@ -53803,9 +54285,821 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-3.2.19.patc +} + +#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 2012-06-10 05:51:04.991403998 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +new file mode 100644 +index 0000000..f6e7870 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +@@ -0,0 +1,804 @@ ++/* ========================================================================== ++ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $ ++ * $Revision: #52 $ ++ * $Date: 2009/04/21 $ ++ * $Change: 1237472 $ ++ * ++ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, ++ * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless ++ * otherwise expressly agreed to in writing between Synopsys and you. ++ * ++ * The Software IS NOT an item of Licensed Software or Licensed Product under ++ * any End User Software License Agreement or Agreement for Licensed Product ++ * with Synopsys or any supplement thereto. You are permitted to use and ++ * redistribute this Software in source and binary forms, with or without ++ * modification, provided that redistributions of source code must retain this ++ * notice. You may not view, use, disclose, copy or distribute this file or ++ * any information contained herein except pursuant to this license grant from ++ * Synopsys. If you do not agree with this notice, including the disclaimer ++ * below, then you are not authorized to use the Software. ++ * ++ * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS ++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT, ++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ++ * DAMAGE. ++ * ========================================================================== */ ++#ifndef DWC_DEVICE_ONLY ++#ifndef __DWC_HCD_H__ ++#define __DWC_HCD_H__ ++ ++#include ++#include "dwc_otg_hcd_if.h" ++#include "dwc_otg_core_if.h" ++#include "dwc_list.h" ++#include "dwc_otg_cil.h" ++ ++/** ++ * @file ++ * ++ * This file contains the structures, constants, and interfaces for ++ * the Host Contoller Driver (HCD). ++ * ++ * The Host Controller Driver (HCD) is responsible for translating requests ++ * from the USB Driver into the appropriate actions on the DWC_otg controller. ++ * It isolates the USBD from the specifics of the controller by providing an ++ * API to the USBD. ++ */ ++ ++struct dwc_otg_hcd_pipe_info { ++ uint8_t dev_addr; ++ uint8_t ep_num; ++ uint8_t pipe_type; ++ uint8_t pipe_dir; ++ uint16_t mps; ++}; ++ ++struct dwc_otg_hcd_iso_packet_desc { ++ uint32_t offset; ++ uint32_t length; ++ uint32_t actual_length; ++ uint32_t status; ++}; ++ ++struct dwc_otg_qtd; ++ ++struct dwc_otg_hcd_urb { ++ void *priv; ++ struct dwc_otg_qtd *qtd; ++ void *buf; ++ dwc_dma_t dma; ++ void *setup_packet; ++ dwc_dma_t setup_dma; ++ uint32_t length; ++ uint32_t actual_length; ++ uint32_t status; ++ uint32_t error_count; ++ uint32_t packet_count; ++ uint32_t flags; ++ uint16_t interval; ++ struct dwc_otg_hcd_pipe_info pipe_info; ++ struct dwc_otg_hcd_iso_packet_desc iso_descs[0]; ++}; ++ ++static inline uint8_t dwc_otg_hcd_get_ep_num(struct dwc_otg_hcd_pipe_info *pipe) ++{ ++ return pipe->ep_num; ++} ++ ++static inline uint8_t dwc_otg_hcd_get_pipe_type(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return pipe->pipe_type; ++} ++ ++static inline uint16_t dwc_otg_hcd_get_mps(struct dwc_otg_hcd_pipe_info *pipe) ++{ ++ return pipe->mps; ++} ++ ++static inline uint8_t dwc_otg_hcd_get_dev_addr(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return pipe->dev_addr; ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_isoc(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_ISOCHRONOUS); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_int(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_INTERRUPT); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_bulk(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_BULK); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_control(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_CONTROL); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_in(struct dwc_otg_hcd_pipe_info *pipe) ++{ ++ return (pipe->pipe_dir == UE_DIR_IN); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_out(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (!dwc_otg_hcd_is_pipe_in(pipe)); ++} ++ ++static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe, ++ uint8_t devaddr, uint8_t ep_num, ++ uint8_t pipe_type, uint8_t pipe_dir, ++ uint16_t mps) ++{ ++ pipe->dev_addr = devaddr; ++ pipe->ep_num = ep_num; ++ pipe->pipe_type = pipe_type; ++ pipe->pipe_dir = pipe_dir; ++ pipe->mps = mps; ++} ++ ++/** ++ * Phases for control transfers. ++ */ ++typedef enum dwc_otg_control_phase { ++ DWC_OTG_CONTROL_SETUP, ++ DWC_OTG_CONTROL_DATA, ++ DWC_OTG_CONTROL_STATUS ++} dwc_otg_control_phase_e; ++ ++/** Transaction types. */ ++typedef enum dwc_otg_transaction_type { ++ 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; ++ ++/** ++ * A Queue Transfer Descriptor (QTD) holds the state of a bulk, control, ++ * interrupt, or isochronous transfer. A single QTD is created for each URB ++ * (of one of these types) submitted to the HCD. The transfer associated with ++ * a QTD may require one or multiple transactions. ++ * ++ * A QTD is linked to a Queue Head, which is entered in either the ++ * non-periodic or periodic schedule for execution. When a QTD is chosen for ++ * execution, some or all of its transactions may be executed. After ++ * execution, the state of the QTD is updated. The QTD may be retired if all ++ * its transactions are complete or if an error occurred. Otherwise, it ++ * remains in the schedule so more transactions can be executed later. ++ */ ++typedef struct dwc_otg_qtd { ++ /** ++ * Determines the PID of the next data packet for the data phase of ++ * control transfers. Ignored for other transfer types.
++ * One of the following values: ++ * - DWC_OTG_HC_PID_DATA0 ++ * - DWC_OTG_HC_PID_DATA1 ++ */ ++ uint8_t data_toggle; ++ ++ /** Current phase for control transfers (Setup, Data, or Status). */ ++ dwc_otg_control_phase_e control_phase; ++ ++ /** Keep track of the current split type ++ * for FS/LS endpoints on a HS Hub */ ++ uint8_t complete_split; ++ ++ /** How many bytes transferred during SSPLIT OUT */ ++ uint32_t ssplit_out_xfer_count; ++ ++ /** ++ * Holds the number of bus errors that have occurred for a transaction ++ * within this transfer. ++ */ ++ uint8_t error_count; ++ ++ /** ++ * Index of the next frame descriptor for an isochronous transfer. A ++ * frame descriptor describes the buffer position and length of the ++ * data to be transferred in the next scheduled (micro)frame of an ++ * isochronous transfer. It also holds status for that transaction. ++ * The frame index starts at 0. ++ */ ++ uint16_t isoc_frame_index; ++ ++ /** Position of the ISOC split on full/low speed */ ++ uint8_t isoc_split_pos; ++ ++ /** Position of the ISOC split in the buffer for the current frame */ ++ uint16_t isoc_split_offset; ++ ++ /** URB for this transfer */ ++ struct dwc_otg_hcd_urb *urb; ++ ++ struct dwc_otg_qh *qh; ++ ++ /** This list of QTDs */ ++ DWC_CIRCLEQ_ENTRY(dwc_otg_qtd) qtd_list_entry; ++ ++ /** Indicates if this QTD is currently processed by HW. */ ++ uint8_t in_process; ++ ++ /** Number of DMA descriptors for this QTD */ ++ uint8_t n_desc; ++ ++ /** ++ * Last activated frame(packet) index. ++ * Used in Descriptor DMA mode only. ++ */ ++ uint16_t isoc_frame_index_last; ++ ++} dwc_otg_qtd_t; ++ ++DWC_CIRCLEQ_HEAD(dwc_otg_qtd_list, dwc_otg_qtd); ++ ++/** ++ * A Queue Head (QH) holds the static characteristics of an endpoint and ++ * maintains a list of transfers (QTDs) for that endpoint. A QH structure may ++ * be entered in either the non-periodic or periodic schedule. ++ */ ++typedef struct dwc_otg_qh { ++ /** ++ * Endpoint type. ++ * One of the following values: ++ * - UE_CONTROL ++ * - UE_BULK ++ * - UE_INTERRUPT ++ * - UE_ISOCHRONOUS ++ */ ++ uint8_t ep_type; ++ uint8_t ep_is_in; ++ ++ /** wMaxPacketSize Field of Endpoint Descriptor. */ ++ uint16_t maxp; ++ ++ /** ++ * Device speed. ++ * One of the following values: ++ * - DWC_OTG_EP_SPEED_LOW ++ * - DWC_OTG_EP_SPEED_FULL ++ * - DWC_OTG_EP_SPEED_HIGH ++ */ ++ uint8_t dev_speed; ++ ++ /** ++ * Determines the PID of the next data packet for non-control ++ * transfers. Ignored for control transfers.
++ * One of the following values: ++ * - DWC_OTG_HC_PID_DATA0 ++ * - DWC_OTG_HC_PID_DATA1 ++ */ ++ uint8_t data_toggle; ++ ++ /** Ping state if 1. */ ++ uint8_t ping_state; ++ ++ /** ++ * List of QTDs for this QH. ++ */ ++ struct dwc_otg_qtd_list qtd_list; ++ ++ /** Host channel currently processing transfers for this QH. */ ++ struct dwc_hc *channel; ++ ++ /** Full/low speed endpoint on high-speed hub requires split. */ ++ uint8_t do_split; ++ ++ /** @name Periodic schedule information */ ++ /** @{ */ ++ ++ /** Bandwidth in microseconds per (micro)frame. */ ++ uint16_t usecs; ++ ++ /** Interval between transfers in (micro)frames. */ ++ uint16_t interval; ++ ++ /** ++ * (micro)frame to initialize a periodic transfer. The transfer ++ * executes in the following (micro)frame. ++ */ ++ uint16_t sched_frame; ++ ++ /** (micro)frame at which last start split was initialized. */ ++ uint16_t start_split_frame; ++ ++ /** @} */ ++ ++ /** ++ * Used instead of original buffer if ++ * it(physical address) is not dword-aligned. ++ */ ++ uint8_t *dw_align_buf; ++ dwc_dma_t dw_align_buf_dma; ++ ++ /** Entry for QH in either the periodic or non-periodic schedule. */ ++ dwc_list_link_t qh_list_entry; ++ ++ /** @name Descriptor DMA support */ ++ /** @{ */ ++ ++ /** Descriptor List. */ ++ dwc_otg_host_dma_desc_t *desc_list; ++ ++ /** Descriptor List physical address. */ ++ dwc_dma_t desc_list_dma; ++ ++ /** ++ * Xfer Bytes array. ++ * Each element corresponds to a descriptor and indicates ++ * original XferSize size value for the descriptor. ++ */ ++ uint32_t *n_bytes; ++ ++ /** Actual number of transfer descriptors in a list. */ ++ uint16_t ntd; ++ ++ /** First activated isochronous transfer descriptor index. */ ++ uint8_t td_first; ++ /** Last activated isochronous transfer descriptor index. */ ++ uint8_t td_last; ++ ++ /** @} */ ++ ++} dwc_otg_qh_t; ++ ++DWC_CIRCLEQ_HEAD(hc_list, dwc_hc); ++ ++#ifdef HW2937_WORKAROUND ++ ++typedef enum { ++ HW2937_XFER_MODE_IDLE, ++ HW2937_XFER_MODE_IN, ++ HW2937_XFER_MODE_OUT, ++ HW2937_XFER_MODE_PAUSEIN /* Transitioning from IN to IDLE */ ++} hw2937_xfer_mode_t; ++#endif ++ ++/** ++ * This structure holds the state of the HCD, including the non-periodic and ++ * periodic schedules. ++ */ ++struct dwc_otg_hcd { ++ /** DWC OTG Core Interface Layer */ ++ dwc_otg_core_if_t *core_if; ++ ++ /** Function HCD driver callbacks */ ++ struct dwc_otg_hcd_function_ops *fops; ++ ++ /** Internal DWC HCD Flags */ ++ volatile union dwc_otg_hcd_internal_flags { ++ uint32_t d32; ++ struct { ++ unsigned port_connect_status_change:1; ++ unsigned port_connect_status:1; ++ unsigned port_reset_change:1; ++ unsigned port_enable_change:1; ++ unsigned port_suspend_change:1; ++ unsigned port_over_current_change:1; ++ unsigned port_l1_change:1; ++ unsigned reserved:26; ++ } b; ++ } flags; ++ ++ /** ++ * Inactive items in the non-periodic schedule. This is a list of ++ * Queue Heads. Transfers associated with these Queue Heads are not ++ * currently assigned to a host channel. ++ */ ++ dwc_list_link_t non_periodic_sched_inactive; ++ ++ /** ++ * Active items in the non-periodic schedule. This is a list of ++ * Queue Heads. Transfers associated with these Queue Heads are ++ * currently assigned to a host channel. ++ */ ++ dwc_list_link_t non_periodic_sched_active; ++ ++ /** ++ * Pointer to the next Queue Head to process in the active ++ * non-periodic schedule. ++ */ ++ dwc_list_link_t *non_periodic_qh_ptr; ++ ++ /** ++ * Inactive items in the periodic schedule. This is a list of QHs for ++ * periodic transfers that are _not_ scheduled for the next frame. ++ * Each QH in the list has an interval counter that determines when it ++ * needs to be scheduled for execution. This scheduling mechanism ++ * allows only a simple calculation for periodic bandwidth used (i.e. ++ * must assume that all periodic transfers may need to execute in the ++ * same frame). However, it greatly simplifies scheduling and should ++ * be sufficient for the vast majority of OTG hosts, which need to ++ * connect to a small number of peripherals at one time. ++ * ++ * Items move from this list to periodic_sched_ready when the QH ++ * interval counter is 0 at SOF. ++ */ ++ dwc_list_link_t periodic_sched_inactive; ++ ++ /** ++ * List of periodic QHs that are ready for execution in the next ++ * frame, but have not yet been assigned to host channels. ++ * ++ * Items move from this list to periodic_sched_assigned as host ++ * channels become available during the current frame. ++ */ ++ dwc_list_link_t periodic_sched_ready; ++ ++ /** ++ * List of periodic QHs to be executed in the next frame that are ++ * assigned to host channels. ++ * ++ * Items move from this list to periodic_sched_queued as the ++ * transactions for the QH are queued to the DWC_otg controller. ++ */ ++ dwc_list_link_t periodic_sched_assigned; ++ ++ /** ++ * List of periodic QHs that have been queued for execution. ++ * ++ * Items move from this list to either periodic_sched_inactive or ++ * periodic_sched_ready when the channel associated with the transfer ++ * is released. If the interval for the QH is 1, the item moves to ++ * periodic_sched_ready because it must be rescheduled for the next ++ * frame. Otherwise, the item moves to periodic_sched_inactive. ++ */ ++ dwc_list_link_t periodic_sched_queued; ++ ++ /** ++ * Total bandwidth claimed so far for periodic transfers. This value ++ * is in microseconds per (micro)frame. The assumption is that all ++ * periodic transfers may occur in the same (micro)frame. ++ */ ++ uint16_t periodic_usecs; ++ ++ /** ++ * Frame number read from the core at SOF. The value ranges from 0 to ++ * DWC_HFNUM_MAX_FRNUM. ++ */ ++ uint16_t frame_number; ++ ++ /** ++ * Free host channels in the controller. This is a list of ++ * dwc_hc_t items. ++ */ ++ struct hc_list free_hc_list; ++ /** ++ * Number of host channels assigned to periodic transfers. Currently ++ * assuming that there is a dedicated host channel for each periodic ++ * transaction and at least one host channel available for ++ * non-periodic transactions. ++ */ ++ int periodic_channels; ++ ++ /** ++ * Number of host channels assigned to non-periodic transfers. ++ */ ++ int non_periodic_channels; ++ ++ /** ++ * Array of pointers to the host channel descriptors. Allows accessing ++ * a host channel descriptor given the host channel number. This is ++ * useful in interrupt handlers. ++ */ ++ struct dwc_hc *hc_ptr_array[MAX_EPS_CHANNELS]; ++ ++ /** ++ * Buffer to use for any data received during the status phase of a ++ * control transfer. Normally no data is transferred during the status ++ * phase. This buffer is used as a bit bucket. ++ */ ++ uint8_t *status_buf; ++ ++ /** ++ * DMA address for status_buf. ++ */ ++ dma_addr_t status_buf_dma; ++#define DWC_OTG_HCD_STATUS_BUF_SIZE 64 ++ ++ /** ++ * Connection timer. An OTG host must display a message if the device ++ * does not connect. Started when the VBus power is turned on via ++ * sysfs attribute "buspower". ++ */ ++ dwc_timer_t *conn_timer; ++ ++ /* Tasket to do a reset */ ++ dwc_tasklet_t *reset_tasklet; ++ ++ /* */ ++ dwc_spinlock_t *lock; ++ ++ /** ++ * Private data that could be used by OS wrapper. ++ */ ++ void *priv; ++ ++ uint8_t otg_port; ++ ++ /** Frame List */ ++ uint32_t *frame_list; ++ ++ /** Frame List DMA address */ ++ dma_addr_t frame_list_dma; ++ ++#ifdef HW2937_WORKAROUND ++ /** Current transfer mode (IN, OUT, or IDLE) */ ++ hw2937_xfer_mode_t hw2937_xfer_mode; ++ ++ /** Mask of channels assigned to the current mode */ ++ uint32_t hw2937_assigned_channels; ++#endif ++ ++#ifdef DEBUG ++ uint32_t frrem_samples; ++ uint64_t frrem_accum; ++ ++ uint32_t hfnum_7_samples_a; ++ uint64_t hfnum_7_frrem_accum_a; ++ uint32_t hfnum_0_samples_a; ++ uint64_t hfnum_0_frrem_accum_a; ++ uint32_t hfnum_other_samples_a; ++ uint64_t hfnum_other_frrem_accum_a; ++ ++ uint32_t hfnum_7_samples_b; ++ uint64_t hfnum_7_frrem_accum_b; ++ uint32_t hfnum_0_samples_b; ++ uint64_t hfnum_0_frrem_accum_b; ++ uint32_t hfnum_other_samples_b; ++ uint64_t hfnum_other_frrem_accum_b; ++#endif ++}; ++ ++/** @name Transaction Execution Functions */ ++/** @{ */ ++extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t ++ * hcd); ++extern void dwc_otg_hcd_queue_transactions(dwc_otg_hcd_t * hcd, ++ dwc_otg_transaction_type_e tr_type); ++ ++/** @} */ ++ ++/** @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_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 * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_perio_tx_fifo_empty_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_incomplete_periodic_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_conn_id_status_change_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_disconnect_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, ++ uint32_t num); ++extern int32_t dwc_otg_hcd_handle_session_req_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_wakeup_detected_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++/** @} */ ++ ++/** @name Schedule Queue Functions */ ++/** @{ */ ++ ++/* Implemented in dwc_otg_hcd_queue.c */ ++extern dwc_otg_qh_t *dwc_otg_hcd_qh_create(dwc_otg_hcd_t * hcd, ++ dwc_otg_hcd_urb_t * urb); ++extern void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_qh_remove(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, ++ int sched_csplit); ++ ++/** Remove and free a QH */ ++static inline void dwc_otg_hcd_qh_remove_and_free(dwc_otg_hcd_t * hcd, ++ dwc_otg_qh_t * qh) ++{ ++ dwc_otg_hcd_qh_remove(hcd, qh); ++ dwc_otg_hcd_qh_free(hcd, qh); ++} ++ ++/** Allocates memory for a QH structure. ++ * @return Returns the memory allocate or NULL on error. */ ++static inline dwc_otg_qh_t *dwc_otg_hcd_qh_alloc(void) ++{ ++ return (dwc_otg_qh_t *) dwc_alloc_atomic(sizeof(dwc_otg_qh_t)); ++} ++ ++extern dwc_otg_qtd_t *dwc_otg_hcd_qtd_create(dwc_otg_hcd_urb_t * urb); ++extern void dwc_otg_hcd_qtd_init(dwc_otg_qtd_t * qtd, dwc_otg_hcd_urb_t * urb); ++extern int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, dwc_otg_hcd_t * dwc_otg_hcd, ++ dwc_otg_qh_t ** qh); ++ ++/** Allocates memory for a QTD structure. ++ * @return Returns the memory allocate or NULL on error. */ ++static inline dwc_otg_qtd_t *dwc_otg_hcd_qtd_alloc(void) ++{ ++ return (dwc_otg_qtd_t *) dwc_alloc_atomic(sizeof(dwc_otg_qtd_t)); ++} ++ ++/** Frees the memory for a QTD structure. QTD should already be removed from ++ * list. ++ * @param qtd QTD to free.*/ ++static inline void dwc_otg_hcd_qtd_free(dwc_otg_qtd_t * qtd) ++{ ++ dwc_free(qtd); ++} ++ ++/** Removes a QTD from list. ++ * @param hcd HCD instance. ++ * @param qtd QTD to remove from list. ++ * @param qh QTD belongs to. ++ */ ++static inline void dwc_otg_hcd_qtd_remove(dwc_otg_hcd_t * hcd, ++ dwc_otg_qtd_t * qtd, ++ dwc_otg_qh_t * qh) ++{ ++ uint64_t flags; ++ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); ++ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry); ++ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); ++} ++ ++/** Remove and free a QTD */ ++static inline void dwc_otg_hcd_qtd_remove_and_free(dwc_otg_hcd_t * hcd, ++ dwc_otg_qtd_t * qtd, ++ dwc_otg_qh_t * qh) ++{ ++ dwc_otg_hcd_qtd_remove(hcd, qtd, qh); ++ dwc_otg_hcd_qtd_free(qtd); ++} ++ ++/** @} */ ++ ++/** @name Descriptor DMA Supporting Functions */ ++/** @{ */ ++ ++extern void dwc_otg_hcd_start_xfer_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_complete_xfer_ddma(dwc_otg_hcd_t * hcd, ++ dwc_hc_t * hc, ++ dwc_otg_hc_regs_t * hc_regs, ++ dwc_otg_halt_status_e halt_status); ++ ++extern int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_qh_free_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++ ++/** @} */ ++ ++/** @name Internal Functions */ ++/** @{ */ ++dwc_otg_qh_t *dwc_urb_to_qh(dwc_otg_hcd_urb_t * urb); ++/** @} */ ++ ++#ifdef CONFIG_USB_DWC_OTG_LPM ++extern int dwc_otg_hcd_get_hc_for_lpm_tran(dwc_otg_hcd_t * hcd, ++ uint8_t devaddr); ++extern void dwc_otg_hcd_free_hc_from_lpm(dwc_otg_hcd_t * hcd); ++#endif ++ ++/** Gets the QH that contains the list_head */ ++#define dwc_list_to_qh(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qh_t, qh_list_entry) ++ ++/** Gets the QTD that contains the list_head */ ++#define dwc_list_to_qtd(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qtd_t, qtd_list_entry) ++ ++/** Check if QH is non-periodic */ ++#define dwc_qh_is_non_per(_qh_ptr_) ((_qh_ptr_->ep_type == UE_BULK) || \ ++ (_qh_ptr_->ep_type == UE_CONTROL)) ++ ++/** High bandwidth multiplier as encoded in highspeed endpoint descriptors */ ++#define dwc_hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03)) ++ ++/** Packet size for any kind of endpoint descriptor */ ++#define dwc_max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff) ++ ++/** ++ * Returns true if _frame1 is less than or equal to _frame2. The comparison is ++ * done modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the ++ * frame number when the max frame number is reached. ++ */ ++static inline int dwc_frame_num_le(uint16_t frame1, uint16_t frame2) ++{ ++ return ((frame2 - frame1) & DWC_HFNUM_MAX_FRNUM) <= ++ (DWC_HFNUM_MAX_FRNUM >> 1); ++} ++ ++/** ++ * Returns true if _frame1 is greater than _frame2. The comparison is done ++ * modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the frame ++ * number when the max frame number is reached. ++ */ ++static inline int dwc_frame_num_gt(uint16_t frame1, uint16_t frame2) ++{ ++ return (frame1 != frame2) && ++ (((frame1 - frame2) & DWC_HFNUM_MAX_FRNUM) < ++ (DWC_HFNUM_MAX_FRNUM >> 1)); ++} ++ ++/** ++ * Increments _frame by the amount specified by _inc. The addition is done ++ * modulo DWC_HFNUM_MAX_FRNUM. Returns the incremented value. ++ */ ++static inline uint16_t dwc_frame_num_inc(uint16_t frame, uint16_t inc) ++{ ++ return (frame + inc) & DWC_HFNUM_MAX_FRNUM; ++} ++ ++static inline uint16_t dwc_full_frame_num(uint16_t frame) ++{ ++ return (frame & DWC_HFNUM_MAX_FRNUM) >> 3; ++} ++ ++static inline uint16_t dwc_micro_frame_num(uint16_t frame) ++{ ++ return frame & 0x7; ++} ++ ++void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc, ++ dwc_otg_hc_regs_t * hc_regs, ++ dwc_otg_qtd_t * qtd); ++ ++#ifdef DEBUG ++/** ++ * Macro to sample the remaining PHY clocks left in the current frame. This ++ * may be used during debugging to determine the average time it takes to ++ * execute sections of code. There are two possible sample points, "a" and ++ * "b", so the _letter argument must be one of these values. ++ * ++ * To dump the average sample times, read the "hcd_frrem" sysfs attribute. For ++ * example, "cat /sys/devices/lm0/hcd_frrem". ++ */ ++#define dwc_sample_frrem(_hcd, _qh, _letter) \ ++{ \ ++ hfnum_data_t hfnum; \ ++ dwc_otg_qtd_t *qtd; \ ++ qtd = list_entry(_qh->qtd_list.next, dwc_otg_qtd_t, qtd_list_entry); \ ++ if (usb_pipeint(qtd->urb->pipe) && _qh->start_split_frame != 0 && !qtd->complete_split) { \ ++ hfnum.d32 = dwc_read_reg32(&_hcd->core_if->host_if->host_global_regs->hfnum); \ ++ switch (hfnum.b.frnum & 0x7) { \ ++ case 7: \ ++ _hcd->hfnum_7_samples_##_letter++; \ ++ _hcd->hfnum_7_frrem_accum_##_letter += hfnum.b.frrem; \ ++ break; \ ++ case 0: \ ++ _hcd->hfnum_0_samples_##_letter++; \ ++ _hcd->hfnum_0_frrem_accum_##_letter += hfnum.b.frrem; \ ++ break; \ ++ default: \ ++ _hcd->hfnum_other_samples_##_letter++; \ ++ _hcd->hfnum_other_frrem_accum_##_letter += hfnum.b.frrem; \ ++ break; \ ++ } \ ++ } \ ++} ++#else ++#define dwc_sample_frrem(_hcd, _qh, _letter) ++#endif ++#endif ++#endif /* DWC_DEVICE_ONLY */ +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c +new file mode 100644 +index 0000000..21d1ab1 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c @@ -0,0 +1,1106 @@ +/*========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_ddma.c $ @@ -54913,817 +56207,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-3.2.19 +} + +#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 2012-06-10 05:51:05.283409886 +0200 -@@ -0,0 +1,804 @@ -+/* ========================================================================== -+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $ -+ * $Revision: #52 $ -+ * $Date: 2009/04/21 $ -+ * $Change: 1237472 $ -+ * -+ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, -+ * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless -+ * otherwise expressly agreed to in writing between Synopsys and you. -+ * -+ * The Software IS NOT an item of Licensed Software or Licensed Product under -+ * any End User Software License Agreement or Agreement for Licensed Product -+ * with Synopsys or any supplement thereto. You are permitted to use and -+ * redistribute this Software in source and binary forms, with or without -+ * modification, provided that redistributions of source code must retain this -+ * notice. You may not view, use, disclose, copy or distribute this file or -+ * any information contained herein except pursuant to this license grant from -+ * Synopsys. If you do not agree with this notice, including the disclaimer -+ * below, then you are not authorized to use the Software. -+ * -+ * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT, -+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -+ * DAMAGE. -+ * ========================================================================== */ -+#ifndef DWC_DEVICE_ONLY -+#ifndef __DWC_HCD_H__ -+#define __DWC_HCD_H__ -+ -+#include -+#include "dwc_otg_hcd_if.h" -+#include "dwc_otg_core_if.h" -+#include "dwc_list.h" -+#include "dwc_otg_cil.h" -+ -+/** -+ * @file -+ * -+ * This file contains the structures, constants, and interfaces for -+ * the Host Contoller Driver (HCD). -+ * -+ * The Host Controller Driver (HCD) is responsible for translating requests -+ * from the USB Driver into the appropriate actions on the DWC_otg controller. -+ * It isolates the USBD from the specifics of the controller by providing an -+ * API to the USBD. -+ */ -+ -+struct dwc_otg_hcd_pipe_info { -+ uint8_t dev_addr; -+ uint8_t ep_num; -+ uint8_t pipe_type; -+ uint8_t pipe_dir; -+ uint16_t mps; -+}; -+ -+struct dwc_otg_hcd_iso_packet_desc { -+ uint32_t offset; -+ uint32_t length; -+ uint32_t actual_length; -+ uint32_t status; -+}; -+ -+struct dwc_otg_qtd; -+ -+struct dwc_otg_hcd_urb { -+ void *priv; -+ struct dwc_otg_qtd *qtd; -+ void *buf; -+ dwc_dma_t dma; -+ void *setup_packet; -+ dwc_dma_t setup_dma; -+ uint32_t length; -+ uint32_t actual_length; -+ uint32_t status; -+ uint32_t error_count; -+ uint32_t packet_count; -+ uint32_t flags; -+ uint16_t interval; -+ struct dwc_otg_hcd_pipe_info pipe_info; -+ struct dwc_otg_hcd_iso_packet_desc iso_descs[0]; -+}; -+ -+static inline uint8_t dwc_otg_hcd_get_ep_num(struct dwc_otg_hcd_pipe_info *pipe) -+{ -+ return pipe->ep_num; -+} -+ -+static inline uint8_t dwc_otg_hcd_get_pipe_type(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return pipe->pipe_type; -+} -+ -+static inline uint16_t dwc_otg_hcd_get_mps(struct dwc_otg_hcd_pipe_info *pipe) -+{ -+ return pipe->mps; -+} -+ -+static inline uint8_t dwc_otg_hcd_get_dev_addr(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return pipe->dev_addr; -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_isoc(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_ISOCHRONOUS); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_int(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_INTERRUPT); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_bulk(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_BULK); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_control(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_CONTROL); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_in(struct dwc_otg_hcd_pipe_info *pipe) -+{ -+ return (pipe->pipe_dir == UE_DIR_IN); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_out(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (!dwc_otg_hcd_is_pipe_in(pipe)); -+} -+ -+static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe, -+ uint8_t devaddr, uint8_t ep_num, -+ uint8_t pipe_type, uint8_t pipe_dir, -+ uint16_t mps) -+{ -+ pipe->dev_addr = devaddr; -+ pipe->ep_num = ep_num; -+ pipe->pipe_type = pipe_type; -+ pipe->pipe_dir = pipe_dir; -+ pipe->mps = mps; -+} -+ -+/** -+ * Phases for control transfers. -+ */ -+typedef enum dwc_otg_control_phase { -+ DWC_OTG_CONTROL_SETUP, -+ DWC_OTG_CONTROL_DATA, -+ DWC_OTG_CONTROL_STATUS -+} dwc_otg_control_phase_e; -+ -+/** Transaction types. */ -+typedef enum dwc_otg_transaction_type { -+ 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; -+ -+/** -+ * A Queue Transfer Descriptor (QTD) holds the state of a bulk, control, -+ * interrupt, or isochronous transfer. A single QTD is created for each URB -+ * (of one of these types) submitted to the HCD. The transfer associated with -+ * a QTD may require one or multiple transactions. -+ * -+ * A QTD is linked to a Queue Head, which is entered in either the -+ * non-periodic or periodic schedule for execution. When a QTD is chosen for -+ * execution, some or all of its transactions may be executed. After -+ * execution, the state of the QTD is updated. The QTD may be retired if all -+ * its transactions are complete or if an error occurred. Otherwise, it -+ * remains in the schedule so more transactions can be executed later. -+ */ -+typedef struct dwc_otg_qtd { -+ /** -+ * Determines the PID of the next data packet for the data phase of -+ * control transfers. Ignored for other transfer types.
-+ * One of the following values: -+ * - DWC_OTG_HC_PID_DATA0 -+ * - DWC_OTG_HC_PID_DATA1 -+ */ -+ uint8_t data_toggle; -+ -+ /** Current phase for control transfers (Setup, Data, or Status). */ -+ dwc_otg_control_phase_e control_phase; -+ -+ /** Keep track of the current split type -+ * for FS/LS endpoints on a HS Hub */ -+ uint8_t complete_split; -+ -+ /** How many bytes transferred during SSPLIT OUT */ -+ uint32_t ssplit_out_xfer_count; -+ -+ /** -+ * Holds the number of bus errors that have occurred for a transaction -+ * within this transfer. -+ */ -+ uint8_t error_count; -+ -+ /** -+ * Index of the next frame descriptor for an isochronous transfer. A -+ * frame descriptor describes the buffer position and length of the -+ * data to be transferred in the next scheduled (micro)frame of an -+ * isochronous transfer. It also holds status for that transaction. -+ * The frame index starts at 0. -+ */ -+ uint16_t isoc_frame_index; -+ -+ /** Position of the ISOC split on full/low speed */ -+ uint8_t isoc_split_pos; -+ -+ /** Position of the ISOC split in the buffer for the current frame */ -+ uint16_t isoc_split_offset; -+ -+ /** URB for this transfer */ -+ struct dwc_otg_hcd_urb *urb; -+ -+ struct dwc_otg_qh *qh; -+ -+ /** This list of QTDs */ -+ DWC_CIRCLEQ_ENTRY(dwc_otg_qtd) qtd_list_entry; -+ -+ /** Indicates if this QTD is currently processed by HW. */ -+ uint8_t in_process; -+ -+ /** Number of DMA descriptors for this QTD */ -+ uint8_t n_desc; -+ -+ /** -+ * Last activated frame(packet) index. -+ * Used in Descriptor DMA mode only. -+ */ -+ uint16_t isoc_frame_index_last; -+ -+} dwc_otg_qtd_t; -+ -+DWC_CIRCLEQ_HEAD(dwc_otg_qtd_list, dwc_otg_qtd); -+ -+/** -+ * A Queue Head (QH) holds the static characteristics of an endpoint and -+ * maintains a list of transfers (QTDs) for that endpoint. A QH structure may -+ * be entered in either the non-periodic or periodic schedule. -+ */ -+typedef struct dwc_otg_qh { -+ /** -+ * Endpoint type. -+ * One of the following values: -+ * - UE_CONTROL -+ * - UE_BULK -+ * - UE_INTERRUPT -+ * - UE_ISOCHRONOUS -+ */ -+ uint8_t ep_type; -+ uint8_t ep_is_in; -+ -+ /** wMaxPacketSize Field of Endpoint Descriptor. */ -+ uint16_t maxp; -+ -+ /** -+ * Device speed. -+ * One of the following values: -+ * - DWC_OTG_EP_SPEED_LOW -+ * - DWC_OTG_EP_SPEED_FULL -+ * - DWC_OTG_EP_SPEED_HIGH -+ */ -+ uint8_t dev_speed; -+ -+ /** -+ * Determines the PID of the next data packet for non-control -+ * transfers. Ignored for control transfers.
-+ * One of the following values: -+ * - DWC_OTG_HC_PID_DATA0 -+ * - DWC_OTG_HC_PID_DATA1 -+ */ -+ uint8_t data_toggle; -+ -+ /** Ping state if 1. */ -+ uint8_t ping_state; -+ -+ /** -+ * List of QTDs for this QH. -+ */ -+ struct dwc_otg_qtd_list qtd_list; -+ -+ /** Host channel currently processing transfers for this QH. */ -+ struct dwc_hc *channel; -+ -+ /** Full/low speed endpoint on high-speed hub requires split. */ -+ uint8_t do_split; -+ -+ /** @name Periodic schedule information */ -+ /** @{ */ -+ -+ /** Bandwidth in microseconds per (micro)frame. */ -+ uint16_t usecs; -+ -+ /** Interval between transfers in (micro)frames. */ -+ uint16_t interval; -+ -+ /** -+ * (micro)frame to initialize a periodic transfer. The transfer -+ * executes in the following (micro)frame. -+ */ -+ uint16_t sched_frame; -+ -+ /** (micro)frame at which last start split was initialized. */ -+ uint16_t start_split_frame; -+ -+ /** @} */ -+ -+ /** -+ * Used instead of original buffer if -+ * it(physical address) is not dword-aligned. -+ */ -+ uint8_t *dw_align_buf; -+ dwc_dma_t dw_align_buf_dma; -+ -+ /** Entry for QH in either the periodic or non-periodic schedule. */ -+ dwc_list_link_t qh_list_entry; -+ -+ /** @name Descriptor DMA support */ -+ /** @{ */ -+ -+ /** Descriptor List. */ -+ dwc_otg_host_dma_desc_t *desc_list; -+ -+ /** Descriptor List physical address. */ -+ dwc_dma_t desc_list_dma; -+ -+ /** -+ * Xfer Bytes array. -+ * Each element corresponds to a descriptor and indicates -+ * original XferSize size value for the descriptor. -+ */ -+ uint32_t *n_bytes; -+ -+ /** Actual number of transfer descriptors in a list. */ -+ uint16_t ntd; -+ -+ /** First activated isochronous transfer descriptor index. */ -+ uint8_t td_first; -+ /** Last activated isochronous transfer descriptor index. */ -+ uint8_t td_last; -+ -+ /** @} */ -+ -+} dwc_otg_qh_t; -+ -+DWC_CIRCLEQ_HEAD(hc_list, dwc_hc); -+ -+#ifdef HW2937_WORKAROUND -+ -+typedef enum { -+ HW2937_XFER_MODE_IDLE, -+ HW2937_XFER_MODE_IN, -+ HW2937_XFER_MODE_OUT, -+ HW2937_XFER_MODE_PAUSEIN /* Transitioning from IN to IDLE */ -+} hw2937_xfer_mode_t; -+#endif -+ -+/** -+ * This structure holds the state of the HCD, including the non-periodic and -+ * periodic schedules. -+ */ -+struct dwc_otg_hcd { -+ /** DWC OTG Core Interface Layer */ -+ dwc_otg_core_if_t *core_if; -+ -+ /** Function HCD driver callbacks */ -+ struct dwc_otg_hcd_function_ops *fops; -+ -+ /** Internal DWC HCD Flags */ -+ volatile union dwc_otg_hcd_internal_flags { -+ uint32_t d32; -+ struct { -+ unsigned port_connect_status_change:1; -+ unsigned port_connect_status:1; -+ unsigned port_reset_change:1; -+ unsigned port_enable_change:1; -+ unsigned port_suspend_change:1; -+ unsigned port_over_current_change:1; -+ unsigned port_l1_change:1; -+ unsigned reserved:26; -+ } b; -+ } flags; -+ -+ /** -+ * Inactive items in the non-periodic schedule. This is a list of -+ * Queue Heads. Transfers associated with these Queue Heads are not -+ * currently assigned to a host channel. -+ */ -+ dwc_list_link_t non_periodic_sched_inactive; -+ -+ /** -+ * Active items in the non-periodic schedule. This is a list of -+ * Queue Heads. Transfers associated with these Queue Heads are -+ * currently assigned to a host channel. -+ */ -+ dwc_list_link_t non_periodic_sched_active; -+ -+ /** -+ * Pointer to the next Queue Head to process in the active -+ * non-periodic schedule. -+ */ -+ dwc_list_link_t *non_periodic_qh_ptr; -+ -+ /** -+ * Inactive items in the periodic schedule. This is a list of QHs for -+ * periodic transfers that are _not_ scheduled for the next frame. -+ * Each QH in the list has an interval counter that determines when it -+ * needs to be scheduled for execution. This scheduling mechanism -+ * allows only a simple calculation for periodic bandwidth used (i.e. -+ * must assume that all periodic transfers may need to execute in the -+ * same frame). However, it greatly simplifies scheduling and should -+ * be sufficient for the vast majority of OTG hosts, which need to -+ * connect to a small number of peripherals at one time. -+ * -+ * Items move from this list to periodic_sched_ready when the QH -+ * interval counter is 0 at SOF. -+ */ -+ dwc_list_link_t periodic_sched_inactive; -+ -+ /** -+ * List of periodic QHs that are ready for execution in the next -+ * frame, but have not yet been assigned to host channels. -+ * -+ * Items move from this list to periodic_sched_assigned as host -+ * channels become available during the current frame. -+ */ -+ dwc_list_link_t periodic_sched_ready; -+ -+ /** -+ * List of periodic QHs to be executed in the next frame that are -+ * assigned to host channels. -+ * -+ * Items move from this list to periodic_sched_queued as the -+ * transactions for the QH are queued to the DWC_otg controller. -+ */ -+ dwc_list_link_t periodic_sched_assigned; -+ -+ /** -+ * List of periodic QHs that have been queued for execution. -+ * -+ * Items move from this list to either periodic_sched_inactive or -+ * periodic_sched_ready when the channel associated with the transfer -+ * is released. If the interval for the QH is 1, the item moves to -+ * periodic_sched_ready because it must be rescheduled for the next -+ * frame. Otherwise, the item moves to periodic_sched_inactive. -+ */ -+ dwc_list_link_t periodic_sched_queued; -+ -+ /** -+ * Total bandwidth claimed so far for periodic transfers. This value -+ * is in microseconds per (micro)frame. The assumption is that all -+ * periodic transfers may occur in the same (micro)frame. -+ */ -+ uint16_t periodic_usecs; -+ -+ /** -+ * Frame number read from the core at SOF. The value ranges from 0 to -+ * DWC_HFNUM_MAX_FRNUM. -+ */ -+ uint16_t frame_number; -+ -+ /** -+ * Free host channels in the controller. This is a list of -+ * dwc_hc_t items. -+ */ -+ struct hc_list free_hc_list; -+ /** -+ * Number of host channels assigned to periodic transfers. Currently -+ * assuming that there is a dedicated host channel for each periodic -+ * transaction and at least one host channel available for -+ * non-periodic transactions. -+ */ -+ int periodic_channels; -+ -+ /** -+ * Number of host channels assigned to non-periodic transfers. -+ */ -+ int non_periodic_channels; -+ -+ /** -+ * Array of pointers to the host channel descriptors. Allows accessing -+ * a host channel descriptor given the host channel number. This is -+ * useful in interrupt handlers. -+ */ -+ struct dwc_hc *hc_ptr_array[MAX_EPS_CHANNELS]; -+ -+ /** -+ * Buffer to use for any data received during the status phase of a -+ * control transfer. Normally no data is transferred during the status -+ * phase. This buffer is used as a bit bucket. -+ */ -+ uint8_t *status_buf; -+ -+ /** -+ * DMA address for status_buf. -+ */ -+ dma_addr_t status_buf_dma; -+#define DWC_OTG_HCD_STATUS_BUF_SIZE 64 -+ -+ /** -+ * Connection timer. An OTG host must display a message if the device -+ * does not connect. Started when the VBus power is turned on via -+ * sysfs attribute "buspower". -+ */ -+ dwc_timer_t *conn_timer; -+ -+ /* Tasket to do a reset */ -+ dwc_tasklet_t *reset_tasklet; -+ -+ /* */ -+ dwc_spinlock_t *lock; -+ -+ /** -+ * Private data that could be used by OS wrapper. -+ */ -+ void *priv; -+ -+ uint8_t otg_port; -+ -+ /** Frame List */ -+ uint32_t *frame_list; -+ -+ /** Frame List DMA address */ -+ dma_addr_t frame_list_dma; -+ -+#ifdef HW2937_WORKAROUND -+ /** Current transfer mode (IN, OUT, or IDLE) */ -+ hw2937_xfer_mode_t hw2937_xfer_mode; -+ -+ /** Mask of channels assigned to the current mode */ -+ uint32_t hw2937_assigned_channels; -+#endif -+ -+#ifdef DEBUG -+ uint32_t frrem_samples; -+ uint64_t frrem_accum; -+ -+ uint32_t hfnum_7_samples_a; -+ uint64_t hfnum_7_frrem_accum_a; -+ uint32_t hfnum_0_samples_a; -+ uint64_t hfnum_0_frrem_accum_a; -+ uint32_t hfnum_other_samples_a; -+ uint64_t hfnum_other_frrem_accum_a; -+ -+ uint32_t hfnum_7_samples_b; -+ uint64_t hfnum_7_frrem_accum_b; -+ uint32_t hfnum_0_samples_b; -+ uint64_t hfnum_0_frrem_accum_b; -+ uint32_t hfnum_other_samples_b; -+ uint64_t hfnum_other_frrem_accum_b; -+#endif -+}; -+ -+/** @name Transaction Execution Functions */ -+/** @{ */ -+extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t -+ * hcd); -+extern void dwc_otg_hcd_queue_transactions(dwc_otg_hcd_t * hcd, -+ dwc_otg_transaction_type_e tr_type); -+ -+/** @} */ -+ -+/** @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_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 * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_perio_tx_fifo_empty_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_incomplete_periodic_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_conn_id_status_change_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_disconnect_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, -+ uint32_t num); -+extern int32_t dwc_otg_hcd_handle_session_req_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_wakeup_detected_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+/** @} */ -+ -+/** @name Schedule Queue Functions */ -+/** @{ */ -+ -+/* Implemented in dwc_otg_hcd_queue.c */ -+extern dwc_otg_qh_t *dwc_otg_hcd_qh_create(dwc_otg_hcd_t * hcd, -+ dwc_otg_hcd_urb_t * urb); -+extern void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_qh_remove(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, -+ int sched_csplit); -+ -+/** Remove and free a QH */ -+static inline void dwc_otg_hcd_qh_remove_and_free(dwc_otg_hcd_t * hcd, -+ dwc_otg_qh_t * qh) -+{ -+ dwc_otg_hcd_qh_remove(hcd, qh); -+ dwc_otg_hcd_qh_free(hcd, qh); -+} -+ -+/** Allocates memory for a QH structure. -+ * @return Returns the memory allocate or NULL on error. */ -+static inline dwc_otg_qh_t *dwc_otg_hcd_qh_alloc(void) -+{ -+ return (dwc_otg_qh_t *) dwc_alloc_atomic(sizeof(dwc_otg_qh_t)); -+} -+ -+extern dwc_otg_qtd_t *dwc_otg_hcd_qtd_create(dwc_otg_hcd_urb_t * urb); -+extern void dwc_otg_hcd_qtd_init(dwc_otg_qtd_t * qtd, dwc_otg_hcd_urb_t * urb); -+extern int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, dwc_otg_hcd_t * dwc_otg_hcd, -+ dwc_otg_qh_t ** qh); -+ -+/** Allocates memory for a QTD structure. -+ * @return Returns the memory allocate or NULL on error. */ -+static inline dwc_otg_qtd_t *dwc_otg_hcd_qtd_alloc(void) -+{ -+ return (dwc_otg_qtd_t *) dwc_alloc_atomic(sizeof(dwc_otg_qtd_t)); -+} -+ -+/** Frees the memory for a QTD structure. QTD should already be removed from -+ * list. -+ * @param qtd QTD to free.*/ -+static inline void dwc_otg_hcd_qtd_free(dwc_otg_qtd_t * qtd) -+{ -+ dwc_free(qtd); -+} -+ -+/** Removes a QTD from list. -+ * @param hcd HCD instance. -+ * @param qtd QTD to remove from list. -+ * @param qh QTD belongs to. -+ */ -+static inline void dwc_otg_hcd_qtd_remove(dwc_otg_hcd_t * hcd, -+ dwc_otg_qtd_t * qtd, -+ dwc_otg_qh_t * qh) -+{ -+ uint64_t flags; -+ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); -+ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry); -+ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); -+} -+ -+/** Remove and free a QTD */ -+static inline void dwc_otg_hcd_qtd_remove_and_free(dwc_otg_hcd_t * hcd, -+ dwc_otg_qtd_t * qtd, -+ dwc_otg_qh_t * qh) -+{ -+ dwc_otg_hcd_qtd_remove(hcd, qtd, qh); -+ dwc_otg_hcd_qtd_free(qtd); -+} -+ -+/** @} */ -+ -+/** @name Descriptor DMA Supporting Functions */ -+/** @{ */ -+ -+extern void dwc_otg_hcd_start_xfer_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_complete_xfer_ddma(dwc_otg_hcd_t * hcd, -+ dwc_hc_t * hc, -+ dwc_otg_hc_regs_t * hc_regs, -+ dwc_otg_halt_status_e halt_status); -+ -+extern int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_qh_free_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+ -+/** @} */ -+ -+/** @name Internal Functions */ -+/** @{ */ -+dwc_otg_qh_t *dwc_urb_to_qh(dwc_otg_hcd_urb_t * urb); -+/** @} */ -+ -+#ifdef CONFIG_USB_DWC_OTG_LPM -+extern int dwc_otg_hcd_get_hc_for_lpm_tran(dwc_otg_hcd_t * hcd, -+ uint8_t devaddr); -+extern void dwc_otg_hcd_free_hc_from_lpm(dwc_otg_hcd_t * hcd); -+#endif -+ -+/** Gets the QH that contains the list_head */ -+#define dwc_list_to_qh(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qh_t, qh_list_entry) -+ -+/** Gets the QTD that contains the list_head */ -+#define dwc_list_to_qtd(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qtd_t, qtd_list_entry) -+ -+/** Check if QH is non-periodic */ -+#define dwc_qh_is_non_per(_qh_ptr_) ((_qh_ptr_->ep_type == UE_BULK) || \ -+ (_qh_ptr_->ep_type == UE_CONTROL)) -+ -+/** High bandwidth multiplier as encoded in highspeed endpoint descriptors */ -+#define dwc_hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03)) -+ -+/** Packet size for any kind of endpoint descriptor */ -+#define dwc_max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff) -+ -+/** -+ * Returns true if _frame1 is less than or equal to _frame2. The comparison is -+ * done modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the -+ * frame number when the max frame number is reached. -+ */ -+static inline int dwc_frame_num_le(uint16_t frame1, uint16_t frame2) -+{ -+ return ((frame2 - frame1) & DWC_HFNUM_MAX_FRNUM) <= -+ (DWC_HFNUM_MAX_FRNUM >> 1); -+} -+ -+/** -+ * Returns true if _frame1 is greater than _frame2. The comparison is done -+ * modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the frame -+ * number when the max frame number is reached. -+ */ -+static inline int dwc_frame_num_gt(uint16_t frame1, uint16_t frame2) -+{ -+ return (frame1 != frame2) && -+ (((frame1 - frame2) & DWC_HFNUM_MAX_FRNUM) < -+ (DWC_HFNUM_MAX_FRNUM >> 1)); -+} -+ -+/** -+ * Increments _frame by the amount specified by _inc. The addition is done -+ * modulo DWC_HFNUM_MAX_FRNUM. Returns the incremented value. -+ */ -+static inline uint16_t dwc_frame_num_inc(uint16_t frame, uint16_t inc) -+{ -+ return (frame + inc) & DWC_HFNUM_MAX_FRNUM; -+} -+ -+static inline uint16_t dwc_full_frame_num(uint16_t frame) -+{ -+ return (frame & DWC_HFNUM_MAX_FRNUM) >> 3; -+} -+ -+static inline uint16_t dwc_micro_frame_num(uint16_t frame) -+{ -+ return frame & 0x7; -+} -+ -+void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc, -+ dwc_otg_hc_regs_t * hc_regs, -+ dwc_otg_qtd_t * qtd); -+ -+#ifdef DEBUG -+/** -+ * Macro to sample the remaining PHY clocks left in the current frame. This -+ * may be used during debugging to determine the average time it takes to -+ * execute sections of code. There are two possible sample points, "a" and -+ * "b", so the _letter argument must be one of these values. -+ * -+ * To dump the average sample times, read the "hcd_frrem" sysfs attribute. For -+ * example, "cat /sys/devices/lm0/hcd_frrem". -+ */ -+#define dwc_sample_frrem(_hcd, _qh, _letter) \ -+{ \ -+ hfnum_data_t hfnum; \ -+ dwc_otg_qtd_t *qtd; \ -+ qtd = list_entry(_qh->qtd_list.next, dwc_otg_qtd_t, qtd_list_entry); \ -+ if (usb_pipeint(qtd->urb->pipe) && _qh->start_split_frame != 0 && !qtd->complete_split) { \ -+ hfnum.d32 = dwc_read_reg32(&_hcd->core_if->host_if->host_global_regs->hfnum); \ -+ switch (hfnum.b.frnum & 0x7) { \ -+ case 7: \ -+ _hcd->hfnum_7_samples_##_letter++; \ -+ _hcd->hfnum_7_frrem_accum_##_letter += hfnum.b.frrem; \ -+ break; \ -+ case 0: \ -+ _hcd->hfnum_0_samples_##_letter++; \ -+ _hcd->hfnum_0_frrem_accum_##_letter += hfnum.b.frrem; \ -+ break; \ -+ default: \ -+ _hcd->hfnum_other_samples_##_letter++; \ -+ _hcd->hfnum_other_frrem_accum_##_letter += hfnum.b.frrem; \ -+ break; \ -+ } \ -+ } \ -+} -+#else -+#define dwc_sample_frrem(_hcd, _qh, _letter) -+#endif -+#endif -+#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 2012-06-10 05:51:04.992404018 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h +new file mode 100644 +index 0000000..d5a903b +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h @@ -0,0 +1,393 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_if.h $ @@ -56118,9 +56606,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-3.2.19.p + +#endif /* __DWC_HCD_IF_H__ */ +#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 2012-06-10 05:51:04.995404078 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +new file mode 100644 +index 0000000..6e4bc60 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c @@ -0,0 +1,2065 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_intr.c $ @@ -58187,9 +58677,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-3.2.19 +} + +#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 2012-06-10 05:51:05.340411035 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +new file mode 100644 +index 0000000..2a3b689 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c @@ -0,0 +1,848 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_linux.c $ @@ -59039,9 +59531,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-3.2.1 +} + +#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 2012-06-10 05:51:04.998404140 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +new file mode 100644 +index 0000000..cfed807 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c @@ -0,0 +1,732 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_queue.c $ @@ -59775,9 +60269,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-3.2.1 +} + +#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 2012-06-10 05:51:05.001404200 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd.c +new file mode 100644 +index 0000000..6043b99 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd.c @@ -0,0 +1,2067 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.c $ @@ -61846,9 +62342,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-3.2.19.patc +} + +#endif /* DWC_HOST_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 2012-06-10 05:51:05.001404200 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd.h b/drivers/usb/host/dwc_otg/dwc_otg_pcd.h +new file mode 100644 +index 0000000..d38e169 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd.h @@ -0,0 +1,216 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.h $ @@ -62066,9 +62564,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-3.2.19.patc +extern void do_test_mode(void *data); +#endif +#endif /* DWC_HOST_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 2012-06-10 05:51:05.002404220 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h b/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h +new file mode 100644 +index 0000000..66e9db7 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h @@ -0,0 +1,333 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_if.h $ @@ -62403,9 +62903,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-3.2.19.p +#endif /* __DWC_PCD_IF_H__ */ + +#endif /* DWC_HOST_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 2012-06-10 05:51:05.008404340 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c +new file mode 100644 +index 0000000..f89e878 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c @@ -0,0 +1,4077 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_intr.c $ @@ -66484,9 +66986,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-3.2.19 +} + +#endif /* DWC_HOST_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 2012-06-10 05:51:05.010404382 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c +new file mode 100644 +index 0000000..aae78a7 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c @@ -0,0 +1,1288 @@ + /* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_linux.c $ @@ -67776,9 +68280,11 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-3.2.1 +EXPORT_SYMBOL(usb_gadget_unregister_driver); + +#endif /* DWC_HOST_ONLY */ -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_regs.h ---- linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_regs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/dwc_otg_regs.h 2012-06-10 05:51:05.013404442 +0200 +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_regs.h b/drivers/usb/host/dwc_otg/dwc_otg_regs.h +new file mode 100644 +index 0000000..e8220ad +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/dwc_otg_regs.h @@ -0,0 +1,2237 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_regs.h $ @@ -70017,139 +70523,751 @@ diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-3.2.19.pat +} pcgcctl_data_t; + +#endif -diff -Naur linux-3.2.19/drivers/usb/host/dwc_otg/Makefile linux-3.2.19.patch/drivers/usb/host/dwc_otg/Makefile ---- linux-3.2.19/drivers/usb/host/dwc_otg/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/usb/host/dwc_otg/Makefile 2012-06-10 05:51:05.211408434 +0200 -@@ -0,0 +1,80 @@ +diff --git a/drivers/usb/host/dwc_otg/test/Makefile b/drivers/usb/host/dwc_otg/test/Makefile +new file mode 100644 +index 0000000..fc45375 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/test/Makefile +@@ -0,0 +1,16 @@ ++ ++PERL=/usr/bin/perl ++PL_TESTS=test_sysfs.pl test_mod_param.pl ++ ++.PHONY : test ++test : perl_tests ++ ++perl_tests : ++ @echo ++ @echo Running perl tests ++ @for test in $(PL_TESTS); do \ ++ if $(PERL) ./$$test ; then \ ++ echo "=======> $$test, PASSED" ; \ ++ else echo "=======> $$test, FAILED" ; \ ++ fi \ ++ done +diff --git a/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm b/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm +new file mode 100644 +index 0000000..233b04a +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm +@@ -0,0 +1,337 @@ ++package dwc_otg_test; ++ ++use strict; ++use Exporter (); ++ ++use vars qw(@ISA @EXPORT ++$sysfsdir $paramdir $errors $params ++); ++ ++@ISA = qw(Exporter); ++ +# -+# Makefile for DWC_otg Highspeed USB controller driver ++# Globals +# ++$sysfsdir = "/sys/devices/lm0"; ++$paramdir = "/sys/module/dwc_otg"; ++$errors = 0; + -+ifneq ($(KERNELRELEASE),) -+ -+ifeq ($(BUS_INTERFACE),) -+ # BUS_INTERFACE = -DLM_INTERFACE -+ BUS_INTERFACE = -DPLATFORM_INTERFACE=1 -+endif -+ -+ifeq ($(CONFIG_USB_DEBUG),y) -+CPPFLAGS += -DDEBUG -+endif -+ -+# Use one of the following flags to compile the software in host-only or -+# device-only mode. -+#CPPFLAGS += -DDWC_HOST_ONLY -+#CPPFLAGS += -DDWC_DEVICE_ONLY -+ -+CPPFLAGS += -Dlinux -DDWC_HS_ELECT_TST -+#CGG: CPPFLAGS += -DDWC_EN_ISOC -+CPPFLAGS += -I$(obj)/../dwc_common_port -+#CPPFLAGS += -I$(PORTLIB) -+CPPFLAGS += -DDWC_LINUX -+CPPFLAGS += $(CFI) -+CPPFLAGS += $(BUS_INTERFACE) -+ -+obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o -+ -+dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o -+dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o -+dwc_otg-objs += dwc_otg_pcd_linux.o dwc_otg_pcd.o dwc_otg_pcd_intr.o -+dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_linux.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o dwc_otg_hcd_ddma.o -+ifneq ($(CFI),) -+dwc_otg-objs += dwc_otg_cfi.o -+endif -+ -+kernrelwd := $(subst ., ,$(KERNELRELEASE)) -+kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) -+ -+ifneq ($(kernrel3),2.6.20) -+EXTRA_CFLAGS += $(CPPFLAGS) -+endif -+ -+else -+ -+PWD := $(shell pwd) -+PORTLIB := $(PWD)/../dwc_common_port -+ -+# Command paths -+CTAGS := $(CTAGS) -+DOXYGEN := $(DOXYGEN) -+ -+default: portlib -+ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules -+ -+install: default -+ifneq ($(INSTALL_MOD_PATH),) -+ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install -+ $(MAKE) -C$(KDIR) M=$(PWD) modules_install -+else -+ @echo "No install path defined" -+endif -+ -+portlib: -+ $(MAKE) -C$(KDIR) M=$(PORTLIB) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules -+ cp $(PORTLIB)/Module.symvers $(PWD)/ -+ -+docs: $(wildcard *.[hc]) doc/doxygen.cfg -+ $(DOXYGEN) doc/doxygen.cfg -+ -+tags: $(wildcard *.[hc]) -+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) ++$params = [ ++ { ++ NAME => "otg_cap", ++ DEFAULT => 0, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 2 ++ }, ++ { ++ NAME => "dma_enable", ++ DEFAULT => 0, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 1 ++ }, ++ { ++ NAME => "dma_burst_size", ++ DEFAULT => 32, ++ ENUM => [1, 4, 8, 16, 32, 64, 128, 256], ++ LOW => 1, ++ HIGH => 256 ++ }, ++ { ++ NAME => "host_speed", ++ DEFAULT => 0, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 1 ++ }, ++ { ++ NAME => "host_support_fs_ls_low_power", ++ DEFAULT => 0, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 1 ++ }, ++ { ++ NAME => "host_ls_low_power_phy_clk", ++ DEFAULT => 0, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 1 ++ }, ++ { ++ NAME => "dev_speed", ++ DEFAULT => 0, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 1 ++ }, ++ { ++ NAME => "enable_dynamic_fifo", ++ DEFAULT => 1, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 1 ++ }, ++ { ++ NAME => "data_fifo_size", ++ DEFAULT => 8192, ++ ENUM => [], ++ LOW => 32, ++ HIGH => 32768 ++ }, ++ { ++ NAME => "dev_rx_fifo_size", ++ DEFAULT => 1064, ++ ENUM => [], ++ LOW => 16, ++ HIGH => 32768 ++ }, ++ { ++ NAME => "dev_nperio_tx_fifo_size", ++ DEFAULT => 1024, ++ ENUM => [], ++ LOW => 16, ++ HIGH => 32768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_1", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_2", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_3", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_4", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_5", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_6", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_7", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_8", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_9", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_10", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_11", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_12", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_13", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_14", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "dev_perio_tx_fifo_size_15", ++ DEFAULT => 256, ++ ENUM => [], ++ LOW => 4, ++ HIGH => 768 ++ }, ++ { ++ NAME => "host_rx_fifo_size", ++ DEFAULT => 1024, ++ ENUM => [], ++ LOW => 16, ++ HIGH => 32768 ++ }, ++ { ++ NAME => "host_nperio_tx_fifo_size", ++ DEFAULT => 1024, ++ ENUM => [], ++ LOW => 16, ++ HIGH => 32768 ++ }, ++ { ++ NAME => "host_perio_tx_fifo_size", ++ DEFAULT => 1024, ++ ENUM => [], ++ LOW => 16, ++ HIGH => 32768 ++ }, ++ { ++ NAME => "max_transfer_size", ++ DEFAULT => 65535, ++ ENUM => [], ++ LOW => 2047, ++ HIGH => 65535 ++ }, ++ { ++ NAME => "max_packet_count", ++ DEFAULT => 511, ++ ENUM => [], ++ LOW => 15, ++ HIGH => 511 ++ }, ++ { ++ NAME => "host_channels", ++ DEFAULT => 12, ++ ENUM => [], ++ LOW => 1, ++ HIGH => 16 ++ }, ++ { ++ NAME => "dev_endpoints", ++ DEFAULT => 6, ++ ENUM => [], ++ LOW => 1, ++ HIGH => 15 ++ }, ++ { ++ NAME => "phy_type", ++ DEFAULT => 1, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 2 ++ }, ++ { ++ NAME => "phy_utmi_width", ++ DEFAULT => 16, ++ ENUM => [8, 16], ++ LOW => 8, ++ HIGH => 16 ++ }, ++ { ++ NAME => "phy_ulpi_ddr", ++ DEFAULT => 0, ++ ENUM => [], ++ LOW => 0, ++ HIGH => 1 ++ }, ++ ]; + + -+clean: -+ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions ++# ++# ++sub check_arch { ++ $_ = `uname -m`; ++ chomp; ++ unless (m/armv4tl/) { ++ warn "# \n# Can't execute on $_. Run on integrator platform.\n# \n"; ++ return 0; ++ } ++ return 1; ++} + -+endif -diff -Naur linux-3.2.19/drivers/usb/host/Kconfig linux-3.2.19.patch/drivers/usb/host/Kconfig ---- linux-3.2.19/drivers/usb/host/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/host/Kconfig 2012-06-10 05:51:04.885401860 +0200 -@@ -556,6 +556,19 @@ - To compile this driver a module, choose M here: the module - will be called "hwa-hc". ++# ++# ++sub load_module { ++ my $params = shift; ++ print "\nRemoving Module\n"; ++ system "rmmod dwc_otg"; ++ print "Loading Module\n"; ++ if ($params ne "") { ++ print "Module Parameters: $params\n"; ++ } ++ if (system("modprobe dwc_otg $params")) { ++ warn "Unable to load module\n"; ++ return 0; ++ } ++ return 1; ++} ++ ++# ++# ++sub test_status { ++ my $arg = shift; ++ ++ print "\n"; ++ ++ if (defined $arg) { ++ warn "WARNING: $arg\n"; ++ } ++ ++ if ($errors > 0) { ++ warn "TEST FAILED with $errors errors\n"; ++ return 0; ++ } else { ++ print "TEST PASSED\n"; ++ return 0 if (defined $arg); ++ } ++ return 1; ++} ++ ++# ++# ++@EXPORT = qw( ++$sysfsdir ++$paramdir ++$params ++$errors ++check_arch ++load_module ++test_status ++); ++ ++1; +diff --git a/drivers/usb/host/dwc_otg/test/test_mod_param.pl b/drivers/usb/host/dwc_otg/test/test_mod_param.pl +new file mode 100644 +index 0000000..e887dce +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/test/test_mod_param.pl +@@ -0,0 +1,133 @@ ++#!/usr/bin/perl -w ++# ++# Run this program on the integrator. ++# ++# - Tests module parameter default values. ++# - Tests setting of valid module parameter values via modprobe. ++# - Tests invalid module parameter values. ++# ----------------------------------------------------------------------------- ++use strict; ++use dwc_otg_test; ++ ++check_arch() or die; ++ ++# ++# ++sub test { ++ my ($param,$expected) = @_; ++ my $value = get($param); ++ ++ if ($value == $expected) { ++ print "$param = $value, okay\n"; ++ } ++ ++ else { ++ warn "ERROR: value of $param != $expected, $value\n"; ++ $errors ++; ++ } ++} ++ ++# ++# ++sub get { ++ my $param = shift; ++ my $tmp = `cat $paramdir/$param`; ++ chomp $tmp; ++ return $tmp; ++} ++ ++# ++# ++sub test_main { ++ ++ print "\nTesting Module Parameters\n"; ++ ++ load_module("") or die; ++ ++ # Test initial values ++ print "\nTesting Default Values\n"; ++ foreach (@{$params}) { ++ test ($_->{NAME}, $_->{DEFAULT}); ++ } ++ ++ # Test low value ++ print "\nTesting Low Value\n"; ++ my $cmd_params = ""; ++ foreach (@{$params}) { ++ $cmd_params = $cmd_params . "$_->{NAME}=$_->{LOW} "; ++ } ++ load_module($cmd_params) or die; ++ ++ foreach (@{$params}) { ++ test ($_->{NAME}, $_->{LOW}); ++ } ++ ++ # Test high value ++ print "\nTesting High Value\n"; ++ $cmd_params = ""; ++ foreach (@{$params}) { ++ $cmd_params = $cmd_params . "$_->{NAME}=$_->{HIGH} "; ++ } ++ load_module($cmd_params) or die; ++ ++ foreach (@{$params}) { ++ test ($_->{NAME}, $_->{HIGH}); ++ } ++ ++ # Test Enum ++ print "\nTesting Enumerated\n"; ++ foreach (@{$params}) { ++ if (defined $_->{ENUM}) { ++ my $value; ++ foreach $value (@{$_->{ENUM}}) { ++ $cmd_params = "$_->{NAME}=$value"; ++ load_module($cmd_params) or die; ++ test ($_->{NAME}, $value); ++ } ++ } ++ } ++ ++ # Test Invalid Values ++ print "\nTesting Invalid Values\n"; ++ $cmd_params = ""; ++ foreach (@{$params}) { ++ $cmd_params = $cmd_params . sprintf "$_->{NAME}=%d ", $_->{LOW}-1; ++ } ++ load_module($cmd_params) or die; ++ ++ foreach (@{$params}) { ++ test ($_->{NAME}, $_->{DEFAULT}); ++ } ++ ++ $cmd_params = ""; ++ foreach (@{$params}) { ++ $cmd_params = $cmd_params . sprintf "$_->{NAME}=%d ", $_->{HIGH}+1; ++ } ++ load_module($cmd_params) or die; ++ ++ foreach (@{$params}) { ++ test ($_->{NAME}, $_->{DEFAULT}); ++ } ++ ++ print "\nTesting Enumerated\n"; ++ foreach (@{$params}) { ++ if (defined $_->{ENUM}) { ++ my $value; ++ foreach $value (@{$_->{ENUM}}) { ++ $value = $value + 1; ++ $cmd_params = "$_->{NAME}=$value"; ++ load_module($cmd_params) or die; ++ test ($_->{NAME}, $_->{DEFAULT}); ++ $value = $value - 2; ++ $cmd_params = "$_->{NAME}=$value"; ++ load_module($cmd_params) or die; ++ test ($_->{NAME}, $_->{DEFAULT}); ++ } ++ } ++ } ++ ++ test_status() or die; ++} ++ ++test_main(); ++0; +diff --git a/drivers/usb/host/dwc_otg/test/test_sysfs.pl b/drivers/usb/host/dwc_otg/test/test_sysfs.pl +new file mode 100644 +index 0000000..abcf284 +--- /dev/null ++++ b/drivers/usb/host/dwc_otg/test/test_sysfs.pl +@@ -0,0 +1,193 @@ ++#!/usr/bin/perl -w ++# ++# Run this program on the integrator ++# - Tests select sysfs attributes. ++# - Todo ... test more attributes, hnp/srp, buspower/bussuspend, etc. ++# ----------------------------------------------------------------------------- ++use strict; ++use dwc_otg_test; ++ ++check_arch() or die; ++ ++# ++# ++sub test { ++ my ($attr,$expected) = @_; ++ my $string = get($attr); ++ ++ if ($string eq $expected) { ++ printf("$attr = $string, okay\n"); ++ } ++ else { ++ warn "ERROR: value of $attr != $expected, $string\n"; ++ $errors ++; ++ } ++} ++ ++# ++# ++sub set { ++ my ($reg, $value) = @_; ++ system "echo $value > $sysfsdir/$reg"; ++} ++ ++# ++# ++sub get { ++ my $attr = shift; ++ my $string = `cat $sysfsdir/$attr`; ++ chomp $string; ++ if ($string =~ m/\s\=\s/) { ++ my $tmp; ++ ($tmp, $string) = split /\s=\s/, $string; ++ } ++ return $string; ++} ++ ++# ++# ++sub test_main { ++ print("\nTesting Sysfs Attributes\n"); ++ ++ load_module("") or die; ++ ++ # Test initial values of regoffset/regvalue/guid/gsnpsid ++ print("\nTesting Default Values\n"); ++ ++ test("regoffset", "0xffffffff"); ++ test("regvalue", "invalid offset"); ++ test("guid", "0x12345678"); # this will fail if it has been changed ++ test("gsnpsid", "0x4f54200a"); ++ ++ # Test operation of regoffset/regvalue ++ print("\nTesting regoffset\n"); ++ set('regoffset', '5a5a5a5a'); ++ test("regoffset", "0xffffffff"); ++ ++ set('regoffset', '0'); ++ test("regoffset", "0x00000000"); ++ ++ set('regoffset', '40000'); ++ test("regoffset", "0x00000000"); ++ ++ set('regoffset', '3ffff'); ++ test("regoffset", "0x0003ffff"); ++ ++ set('regoffset', '1'); ++ test("regoffset", "0x00000001"); ++ ++ print("\nTesting regvalue\n"); ++ set('regoffset', '3c'); ++ test("regvalue", "0x12345678"); ++ set('regvalue', '5a5a5a5a'); ++ test("regvalue", "0x5a5a5a5a"); ++ set('regvalue','a5a5a5a5'); ++ test("regvalue", "0xa5a5a5a5"); ++ set('guid','12345678'); ++ ++ # Test HNP Capable ++ print("\nTesting HNP Capable bit\n"); ++ set('hnpcapable', '1'); ++ test("hnpcapable", "0x1"); ++ set('hnpcapable','0'); ++ test("hnpcapable", "0x0"); ++ ++ set('regoffset','0c'); ++ ++ my $old = get('gusbcfg'); ++ print("setting hnpcapable\n"); ++ set('hnpcapable', '1'); ++ test("hnpcapable", "0x1"); ++ test('gusbcfg', sprintf "0x%08x", (oct ($old) | (1<<9))); ++ test('regvalue', sprintf "0x%08x", (oct ($old) | (1<<9))); ++ ++ $old = get('gusbcfg'); ++ print("clearing hnpcapable\n"); ++ set('hnpcapable', '0'); ++ test("hnpcapable", "0x0"); ++ test ('gusbcfg', sprintf "0x%08x", oct ($old) & (~(1<<9))); ++ test ('regvalue', sprintf "0x%08x", oct ($old) & (~(1<<9))); ++ ++ # Test SRP Capable ++ print("\nTesting SRP Capable bit\n"); ++ set('srpcapable', '1'); ++ test("srpcapable", "0x1"); ++ set('srpcapable','0'); ++ test("srpcapable", "0x0"); ++ ++ set('regoffset','0c'); ++ ++ $old = get('gusbcfg'); ++ print("setting srpcapable\n"); ++ set('srpcapable', '1'); ++ test("srpcapable", "0x1"); ++ test('gusbcfg', sprintf "0x%08x", (oct ($old) | (1<<8))); ++ test('regvalue', sprintf "0x%08x", (oct ($old) | (1<<8))); ++ ++ $old = get('gusbcfg'); ++ print("clearing srpcapable\n"); ++ set('srpcapable', '0'); ++ test("srpcapable", "0x0"); ++ test('gusbcfg', sprintf "0x%08x", oct ($old) & (~(1<<8))); ++ test('regvalue', sprintf "0x%08x", oct ($old) & (~(1<<8))); ++ ++ # Test GGPIO ++ print("\nTesting GGPIO\n"); ++ set('ggpio','5a5a5a5a'); ++ test('ggpio','0x5a5a0000'); ++ set('ggpio','a5a5a5a5'); ++ test('ggpio','0xa5a50000'); ++ set('ggpio','11110000'); ++ test('ggpio','0x11110000'); ++ set('ggpio','00001111'); ++ test('ggpio','0x00000000'); ++ ++ # Test DEVSPEED ++ print("\nTesting DEVSPEED\n"); ++ set('regoffset','800'); ++ $old = get('regvalue'); ++ set('devspeed','0'); ++ test('devspeed','0x0'); ++ test('regvalue',sprintf("0x%08x", oct($old) & ~(0x3))); ++ set('devspeed','1'); ++ test('devspeed','0x1'); ++ test('regvalue',sprintf("0x%08x", oct($old) & ~(0x3) | 1)); ++ set('devspeed','2'); ++ test('devspeed','0x2'); ++ test('regvalue',sprintf("0x%08x", oct($old) & ~(0x3) | 2)); ++ set('devspeed','3'); ++ test('devspeed','0x3'); ++ test('regvalue',sprintf("0x%08x", oct($old) & ~(0x3) | 3)); ++ set('devspeed','4'); ++ test('devspeed','0x0'); ++ test('regvalue',sprintf("0x%08x", oct($old) & ~(0x3))); ++ set('devspeed','5'); ++ test('devspeed','0x1'); ++ test('regvalue',sprintf("0x%08x", oct($old) & ~(0x3) | 1)); ++ ++ ++ # mode Returns the current mode:0 for device mode1 for host mode Read ++ # hnp Initiate the Host Negotiation Protocol. Read returns the status. Read/Write ++ # srp Initiate the Session Request Protocol. Read returns the status. Read/Write ++ # buspower Get or Set the Power State of the bus (0 - Off or 1 - On) Read/Write ++ # bussuspend Suspend the USB bus. Read/Write ++ # busconnected Get the connection status of the bus Read ++ ++ # gotgctl Get or set the Core Control Status Register. Read/Write ++ ## gusbcfg Get or set the Core USB Configuration Register Read/Write ++ # grxfsiz Get or set the Receive FIFO Size Register Read/Write ++ # gnptxfsiz Get or set the non-periodic Transmit Size Register Read/Write ++ # gpvndctl Get or set the PHY Vendor Control Register Read/Write ++ ## ggpio Get the value in the lower 16-bits of the General Purpose IO Register or Set the upper 16 bits. Read/Write ++ ## guid Get or set the value of the User ID Register Read/Write ++ ## gsnpsid Get the value of the Synopsys ID Regester Read ++ ## devspeed Get or set the device speed setting in the DCFG register Read/Write ++ # enumspeed Gets the device enumeration Speed. Read ++ # hptxfsiz Get the value of the Host Periodic Transmit FIFO Read ++ # hprt0 Get or Set the value in the Host Port Control and Status Register Read/Write ++ ++ test_status("TEST NYI") or die; ++} ++ ++test_main(); ++0; +diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig +index d83e967..a488cd7 100644 +--- a/drivers/video/Kconfig ++++ b/drivers/video/Kconfig +@@ -312,6 +312,20 @@ config FB_PM2_FIFO_DISCONNECT + help + Support the Permedia2 FIFO disconnect feature. -+config USB_DWCOTG -+ tristate "Synopsis DWC host support" -+ depends on USB ++config FB_BCM2708 ++ tristate "BCM2708 framebuffer support" ++ depends on FB && ARM ++ select FB_CFB_FILLRECT ++ select FB_CFB_COPYAREA ++ select FB_CFB_IMAGEBLIT + help -+ The Synopsis DWC controller is a dual-role -+ host/peripheral/OTG ("On The Go") USB controllers. ++ This framebuffer device driver is for the BCM2708 framebuffer. + -+ Enable this option to support this IP in host controller mode. -+ If unsure, say N. ++ If you want to compile this as a module (=code which can be ++ inserted into and removed from the running kernel), say M ++ here and read . The module ++ will be called bcm2708_fb. + -+ To compile this driver as a module, choose M here: the -+ modules built will be called dwc_otg and dwc_common_port. -+ - config USB_IMX21_HCD - tristate "i.MX21 HCD support" - depends on USB && ARM && ARCH_MXC -diff -Naur linux-3.2.19/drivers/usb/host/Makefile linux-3.2.19.patch/drivers/usb/host/Makefile ---- linux-3.2.19/drivers/usb/host/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/host/Makefile 2012-06-10 05:51:04.885401860 +0200 -@@ -33,6 +33,8 @@ - obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o - obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o - obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o -+ -+obj-$(CONFIG_USB_DWCOTG) += dwc_otg/ dwc_common_port/ - obj-$(CONFIG_USB_IMX21_HCD) += imx21-hcd.o - obj-$(CONFIG_USB_FSL_MPH_DR_OF) += fsl-mph-dr-of.o - obj-$(CONFIG_USB_OCTEON2_COMMON) += octeon2-common.o -diff -Naur linux-3.2.19/drivers/usb/Makefile linux-3.2.19.patch/drivers/usb/Makefile ---- linux-3.2.19/drivers/usb/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/usb/Makefile 2012-06-10 05:51:04.876401680 +0200 -@@ -23,6 +23,7 @@ - obj-$(CONFIG_USB_R8A66597_HCD) += host/ - obj-$(CONFIG_USB_HWA_HCD) += host/ - obj-$(CONFIG_USB_ISP1760_HCD) += host/ -+obj-$(CONFIG_USB_DWCOTG) += host/ - obj-$(CONFIG_USB_IMX21_HCD) += host/ - obj-$(CONFIG_USB_FSL_MPH_DR_OF) += host/ - -diff -Naur linux-3.2.19/drivers/video/bcm2708_fb.c linux-3.2.19.patch/drivers/video/bcm2708_fb.c ---- linux-3.2.19/drivers/video/bcm2708_fb.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/video/bcm2708_fb.c 2012-06-10 05:51:05.342411075 +0200 + config FB_ARMCLCD + tristate "ARM PrimeCell PL110 support" + depends on FB && ARM && ARM_AMBA +diff --git a/drivers/video/Makefile b/drivers/video/Makefile +index 9b9d8ff..6e9e8e9 100644 +--- a/drivers/video/Makefile ++++ b/drivers/video/Makefile +@@ -96,6 +96,7 @@ obj-$(CONFIG_FB_ATMEL) += atmel_lcdfb.o + obj-$(CONFIG_FB_PVR2) += pvr2fb.o + obj-$(CONFIG_FB_VOODOO1) += sstfb.o + obj-$(CONFIG_FB_ARMCLCD) += amba-clcd.o ++obj-$(CONFIG_FB_BCM2708) += bcm2708_fb.o + obj-$(CONFIG_FB_68328) += 68328fb.o + obj-$(CONFIG_FB_GBE) += gbefb.o + obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o +diff --git a/drivers/video/bcm2708_fb.c b/drivers/video/bcm2708_fb.c +new file mode 100644 +index 0000000..8d67e86 +--- /dev/null ++++ b/drivers/video/bcm2708_fb.c @@ -0,0 +1,473 @@ +/* + * linux/drivers/video/bcm2708_fb.c @@ -70624,33 +71742,10 @@ diff -Naur linux-3.2.19/drivers/video/bcm2708_fb.c linux-3.2.19.patch/drivers/vi +MODULE_PARM_DESC(fbwidth, "Width of ARM Framebuffer"); +MODULE_PARM_DESC(fbheight, "Height of ARM Framebuffer"); +MODULE_PARM_DESC(fbdepth, "Bit depth of ARM Framebuffer"); -diff -Naur linux-3.2.19/drivers/video/Kconfig linux-3.2.19.patch/drivers/video/Kconfig ---- linux-3.2.19/drivers/video/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/video/Kconfig 2012-06-10 05:51:05.121406620 +0200 -@@ -312,6 +312,20 @@ - help - Support the Permedia2 FIFO disconnect feature. - -+config FB_BCM2708 -+ tristate "BCM2708 framebuffer support" -+ depends on FB && ARM -+ select FB_CFB_FILLRECT -+ select FB_CFB_COPYAREA -+ select FB_CFB_IMAGEBLIT -+ help -+ This framebuffer device driver is for the BCM2708 framebuffer. -+ -+ If you want to compile this as a module (=code which can be -+ inserted into and removed from the running kernel), say M -+ here and read . The module -+ will be called bcm2708_fb. -+ - config FB_ARMCLCD - tristate "ARM PrimeCell PL110 support" - depends on FB && ARM && ARM_AMBA -diff -Naur linux-3.2.19/drivers/video/logo/logo_linux_clut224.ppm linux-3.2.19.patch/drivers/video/logo/logo_linux_clut224.ppm ---- linux-3.2.19/drivers/video/logo/logo_linux_clut224.ppm 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/video/logo/logo_linux_clut224.ppm 2012-06-10 05:51:05.127406740 +0200 +diff --git a/drivers/video/logo/logo_linux_clut224.ppm b/drivers/video/logo/logo_linux_clut224.ppm +index 3c14e43..7626beb 100644 +--- a/drivers/video/logo/logo_linux_clut224.ppm ++++ b/drivers/video/logo/logo_linux_clut224.ppm @@ -1,1604 +1,883 @@ P3 -# Standard 224-color Linux logo @@ -73137,20 +74232,40 @@ diff -Naur linux-3.2.19/drivers/video/logo/logo_linux_clut224.ppm linux-3.2.19.p +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -diff -Naur linux-3.2.19/drivers/video/Makefile linux-3.2.19.patch/drivers/video/Makefile ---- linux-3.2.19/drivers/video/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/video/Makefile 2012-06-10 05:51:05.121406620 +0200 -@@ -96,6 +96,7 @@ - obj-$(CONFIG_FB_PVR2) += pvr2fb.o - obj-$(CONFIG_FB_VOODOO1) += sstfb.o - obj-$(CONFIG_FB_ARMCLCD) += amba-clcd.o -+obj-$(CONFIG_FB_BCM2708) += bcm2708_fb.o - obj-$(CONFIG_FB_68328) += 68328fb.o - obj-$(CONFIG_FB_GBE) += gbefb.o - obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o -diff -Naur linux-3.2.19/drivers/watchdog/bcm2708_wdog.c linux-3.2.19.patch/drivers/watchdog/bcm2708_wdog.c ---- linux-3.2.19/drivers/watchdog/bcm2708_wdog.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/drivers/watchdog/bcm2708_wdog.c 2012-06-10 05:51:05.119406580 +0200 +diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig +index 79fd606..bd76a65 100644 +--- a/drivers/watchdog/Kconfig ++++ b/drivers/watchdog/Kconfig +@@ -343,6 +343,12 @@ config IMX2_WDT + To compile this driver as a module, choose M here: the + module will be called imx2_wdt. + ++config BCM2708_WDT ++ tristate "BCM2708 Watchdog" ++ depends on ARCH_BCM2708 ++ help ++ Enables BCM2708 watchdog support. ++ + # AVR32 Architecture + + config AT32AP700X_WDT +diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile +index fe893e9..897ab01 100644 +--- a/drivers/watchdog/Makefile ++++ b/drivers/watchdog/Makefile +@@ -53,6 +53,7 @@ obj-$(CONFIG_STMP3XXX_WATCHDOG) += stmp3xxx_wdt.o + obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o + obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o + obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o ++obj-$(CONFIG_BCM2708_WDT) += bcm2708_wdog.o + + # AVR32 Architecture + obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o +diff --git a/drivers/watchdog/bcm2708_wdog.c b/drivers/watchdog/bcm2708_wdog.c +new file mode 100644 +index 0000000..dd33c35 +--- /dev/null ++++ b/drivers/watchdog/bcm2708_wdog.c @@ -0,0 +1,385 @@ +/* + * Broadcom BCM2708 watchdog driver. @@ -73537,37 +74652,11 @@ diff -Naur linux-3.2.19/drivers/watchdog/bcm2708_wdog.c linux-3.2.19.patch/drive +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); + -diff -Naur linux-3.2.19/drivers/watchdog/Kconfig linux-3.2.19.patch/drivers/watchdog/Kconfig ---- linux-3.2.19/drivers/watchdog/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/watchdog/Kconfig 2012-06-10 05:51:05.111406415 +0200 -@@ -343,6 +343,12 @@ - To compile this driver as a module, choose M here: the - module will be called imx2_wdt. - -+config BCM2708_WDT -+ tristate "BCM2708 Watchdog" -+ depends on ARCH_BCM2708 -+ help -+ Enables BCM2708 watchdog support. -+ - # AVR32 Architecture - - config AT32AP700X_WDT -diff -Naur linux-3.2.19/drivers/watchdog/Makefile linux-3.2.19.patch/drivers/watchdog/Makefile ---- linux-3.2.19/drivers/watchdog/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/drivers/watchdog/Makefile 2012-06-10 05:51:05.112406435 +0200 -@@ -53,6 +53,7 @@ - obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o - obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o - obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o -+obj-$(CONFIG_BCM2708_WDT) += bcm2708_wdog.o - - # AVR32 Architecture - obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o -diff -Naur linux-3.2.19/include/linux/mmc/sdhci.h linux-3.2.19.patch/include/linux/mmc/sdhci.h ---- linux-3.2.19/include/linux/mmc/sdhci.h 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/include/linux/mmc/sdhci.h 2012-06-10 05:51:05.071405611 +0200 -@@ -121,6 +121,7 @@ +diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h +index e4b6935..99b7eef 100644 +--- a/include/linux/mmc/sdhci.h ++++ b/include/linux/mmc/sdhci.h +@@ -121,6 +121,7 @@ struct sdhci_host { #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ @@ -73575,7 +74664,7 @@ diff -Naur linux-3.2.19/include/linux/mmc/sdhci.h linux-3.2.19.patch/include/lin unsigned int version; /* SDHCI spec. version */ -@@ -135,6 +136,7 @@ +@@ -135,6 +136,7 @@ struct sdhci_host { struct mmc_request *mrq; /* Current request */ struct mmc_command *cmd; /* Current command */ @@ -73583,437 +74672,42 @@ diff -Naur linux-3.2.19/include/linux/mmc/sdhci.h linux-3.2.19.patch/include/lin struct mmc_data *data; /* Current data request */ unsigned int data_early:1; /* Data finished before cmd */ -diff -Naur linux-3.2.19/sound/arm/bcm2835.c linux-3.2.19.patch/sound/arm/bcm2835.c ---- linux-3.2.19/sound/arm/bcm2835.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/sound/arm/bcm2835.c 2012-06-10 05:51:05.332410874 +0200 -@@ -0,0 +1,424 @@ -+/***************************************************************************** -+* Copyright 2011 Broadcom Corporation. All rights reserved. -+* -+* Unless you and Broadcom execute a separate written software license -+* agreement governing use of this software, this software is licensed to you -+* under the terms of the GNU General Public License version 2, available at -+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). -+* -+* Notwithstanding the above, under no circumstances may you combine this -+* software in any way with any other Broadcom software provided under a -+* license other than the GPL, without Broadcom's express prior written -+* consent. -+*****************************************************************************/ +diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig +index 885683a..3577572 100644 +--- a/sound/arm/Kconfig ++++ b/sound/arm/Kconfig +@@ -39,5 +39,12 @@ config SND_PXA2XX_AC97 + Say Y or M if you want to support any AC97 codec attached to + the PXA2xx AC97 interface. + ++config SND_BCM2835 ++ tristate "BCM2835 ALSA driver" ++ depends on ARCH_BCM2708 && SND ++ select SND_PCM ++ help ++ Say Y or M if you want to support BCM2835 Alsa pcm card driver + -+#include + endif # SND_ARM + +diff --git a/sound/arm/Makefile b/sound/arm/Makefile +index 8c0c851..181cb57 100644 +--- a/sound/arm/Makefile ++++ b/sound/arm/Makefile +@@ -14,3 +14,9 @@ snd-pxa2xx-lib-$(CONFIG_SND_PXA2XX_LIB_AC97) += pxa2xx-ac97-lib.o + + obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o + snd-pxa2xx-ac97-objs := pxa2xx-ac97.o + -+#include -+#include -+#include ++obj-$(CONFIG_SND_BCM2835) += snd-bcm2835.o ++snd-bcm2835-objs := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o + -+#include "bcm2835.h" ++EXTRA_CFLAGS += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000 + -+/* module parameters (see "Module Parameters") */ -+/* SNDRV_CARDS: maximum number of cards supported by this module */ -+static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1 }; -+static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL }; -+static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1 }; -+ -+/* HACKY global pointers needed for successive probes to work : ssp -+ * But compared against the changes we will have to do in VC audio_ipc code -+ * to export 8 audio_ipc devices as a single IPC device and then monitor all -+ * four devices in a thread, this gets things done quickly and should be easier -+ * to debug if we run into issues -+ */ -+ -+static struct snd_card *g_card = NULL; -+static bcm2835_chip_t *g_chip = NULL; -+ -+static int snd_bcm2835_free(bcm2835_chip_t * chip) -+{ -+ kfree(chip); -+ return 0; -+} -+ -+/* component-destructor -+ * (see "Management of Cards and Components") -+ */ -+static int snd_bcm2835_dev_free(struct snd_device *device) -+{ -+ return snd_bcm2835_free(device->device_data); -+} -+ -+/* chip-specific constructor -+ * (see "Management of Cards and Components") -+ */ -+static int __devinit snd_bcm2835_create(struct snd_card *card, -+ struct platform_device *pdev, -+ bcm2835_chip_t ** rchip) -+{ -+ bcm2835_chip_t *chip; -+ int err; -+ static struct snd_device_ops ops = { -+ .dev_free = snd_bcm2835_dev_free, -+ }; -+ -+ *rchip = NULL; -+ -+ chip = kzalloc(sizeof(*chip), GFP_KERNEL); -+ if (chip == NULL) -+ return -ENOMEM; -+ -+ chip->card = card; -+ -+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); -+ if (err < 0) { -+ snd_bcm2835_free(chip); -+ return err; -+ } -+ -+ *rchip = chip; -+ return 0; -+} -+ -+static int __devinit snd_bcm2835_alsa_probe(struct platform_device *pdev) -+{ -+ static int dev; -+ bcm2835_chip_t *chip; -+ struct snd_card *card; -+ int err; -+ printk(KERN_INFO "### snd_bcm2835_alsa_probe %p ###", pdev); -+ -+ printk -+ ("############ PROBING FOR bcm2835 ALSA device (%d):(%d) ###############\n", -+ dev, enable[dev]); -+ -+ if (dev >= MAX_SUBSTREAMS) -+ return -ENODEV; -+ -+ if (!enable[dev]) { -+ dev++; -+ return -ENOENT; -+ } -+ -+ if (dev > 0) -+ goto add_register_map; -+ -+ printk("Creating card...\n"); -+ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &g_card); -+ if (err < 0) -+ goto out; -+ -+ snd_card_set_dev(g_card, &pdev->dev); -+ strcpy(g_card->driver, "BRCM bcm2835 ALSA Driver"); -+ strcpy(g_card->shortname, "bcm2835 ALSA"); -+ sprintf(g_card->longname, "%s", g_card->shortname); -+ -+ printk("Creating device/chip ..\n"); -+ err = snd_bcm2835_create(g_card, pdev, &chip); -+ if (err < 0) { -+ printk(KERN_ERR "Failed to create bcm2835 chip\n"); -+ goto out_bcm2835_create; -+ } -+ -+ g_chip = chip; -+ err = snd_bcm2835_new_pcm(chip); -+ if (err < 0) { -+ printk(KERN_ERR "Failed to create new BCM2835 pcm device\n"); -+ goto out_bcm2835_new_pcm; -+ } -+ -+ printk("Adding controls ..\n"); -+ err = snd_bcm2835_new_ctl(chip); -+ if (err < 0) { -+ printk(KERN_ERR "Failed to create new BCM2835 ctl\n"); -+ goto out_bcm2835_new_ctl; -+ } -+ -+add_register_map: -+ card = g_card; -+ chip = g_chip; -+ -+ BUG_ON(!(card && chip)); -+ -+ chip->avail_substreams |= (1 << dev); -+ chip->pdev[dev] = pdev; -+ -+ if (dev == 0) { -+ printk("Registering card ....\n"); -+ err = snd_card_register(card); -+ if (err < 0) { -+ printk(KERN_ERR -+ "Failed to register bcm2835 ALSA card \n"); -+ goto out_card_register; -+ } -+ platform_set_drvdata(pdev, card); -+ printk("bcm2835 ALSA CARD CREATED!\n"); -+ } else { -+ printk("bcm2835 ALSA CHIP CREATED!\n"); -+ platform_set_drvdata(pdev, (void *)dev); -+ } -+ -+ dev++; -+ -+ return 0; -+ -+out_card_register: -+out_bcm2835_new_ctl: -+out_bcm2835_new_pcm: -+out_bcm2835_create: -+ BUG_ON(!g_card); -+ if (snd_card_free(g_card)) -+ printk(KERN_ERR "Failed to free Registered alsa card\n"); -+ g_card = NULL; -+out: -+ dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */ -+ printk(KERN_ERR "BCM2835 ALSA Probe failed !!\n"); -+ return err; -+} -+ -+static int snd_bcm2835_alsa_remove(struct platform_device *pdev) -+{ -+ uint32_t idx; -+ void *drv_data; -+ -+ drv_data = platform_get_drvdata(pdev); -+ -+ if (drv_data == (void *)g_card) { -+ /* This is the card device */ -+ snd_card_free((struct snd_card *)drv_data); -+ g_card = NULL; -+ g_chip = NULL; -+ } else { -+ idx = (uint32_t) drv_data; -+ if (g_card != NULL) { -+ BUG_ON(!g_chip); -+ /* We pass chip device numbers in audio ipc devices -+ * other than the one we registered our card with -+ */ -+ idx = (uint32_t) drv_data; -+ BUG_ON(!idx || idx > MAX_SUBSTREAMS); -+ g_chip->avail_substreams &= ~(1 << idx); -+ /* There should be atleast one substream registered -+ * after we are done here, as it wil be removed when -+ * the *remove* is called for the card device -+ */ -+ BUG_ON(!g_chip->avail_substreams); -+ } -+ } -+ -+ platform_set_drvdata(pdev, NULL); -+ -+ return 0; -+} -+ -+#ifdef CONFIG_PM -+static int snd_bcm2835_alsa_suspend(struct platform_device *pdev, -+ pm_message_t state) -+{ -+ return 0; -+} -+ -+static int snd_bcm2835_alsa_resume(struct platform_device *pdev) -+{ -+ return 0; -+} -+ -+#endif -+ -+static struct platform_driver bcm2835_alsa0_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD0", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa1_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD1", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa2_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD2", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa3_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD3", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa4_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD4", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa5_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD5", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa6_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD6", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa7_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD7", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static int __devinit bcm2835_alsa_device_init(void) -+{ -+ int err; -+ err = platform_driver_register(&bcm2835_alsa0_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa0_driver %d .\n", err); -+ goto out; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa1_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa1_driver %d .\n", err); -+ goto unregister_0; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa2_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa2_driver %d .\n", err); -+ goto unregister_1; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa3_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa3_driver %d .\n", err); -+ goto unregister_2; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa4_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa4_driver %d .\n", err); -+ goto unregister_3; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa5_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa5_driver %d .\n", err); -+ goto unregister_4; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa6_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa6_driver %d .\n", err); -+ goto unregister_5; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa7_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa7_driver %d .\n", err); -+ goto unregister_6; -+ } -+ printk(KERN_INFO "### BCM2835 ALSA driver init %s ### \n", -+ err ? "FAILED" : "OK"); -+ -+ return 0; -+ -+unregister_6: -+ platform_driver_unregister(&bcm2835_alsa6_driver); -+unregister_5: -+ platform_driver_unregister(&bcm2835_alsa5_driver); -+unregister_4: -+ platform_driver_unregister(&bcm2835_alsa4_driver); -+unregister_3: -+ platform_driver_unregister(&bcm2835_alsa3_driver); -+unregister_2: -+ platform_driver_unregister(&bcm2835_alsa2_driver); -+unregister_1: -+ platform_driver_unregister(&bcm2835_alsa1_driver); -+unregister_0: -+ platform_driver_unregister(&bcm2835_alsa0_driver); -+out: -+ return err; -+} -+ -+static void __devexit bcm2835_alsa_device_exit(void) -+{ -+ platform_driver_unregister(&bcm2835_alsa0_driver); -+ platform_driver_unregister(&bcm2835_alsa1_driver); -+ platform_driver_unregister(&bcm2835_alsa2_driver); -+ platform_driver_unregister(&bcm2835_alsa3_driver); -+ platform_driver_unregister(&bcm2835_alsa4_driver); -+ platform_driver_unregister(&bcm2835_alsa5_driver); -+ platform_driver_unregister(&bcm2835_alsa6_driver); -+ platform_driver_unregister(&bcm2835_alsa7_driver); -+} -+ -+late_initcall(bcm2835_alsa_device_init); -+module_exit(bcm2835_alsa_device_exit); -+ -+MODULE_AUTHOR("Dom Cobley"); -+MODULE_DESCRIPTION("Alsa driver for BCM2835 chip"); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS("platform:bcm2835_alsa"); -diff -Naur linux-3.2.19/sound/arm/bcm2835-ctl.c linux-3.2.19.patch/sound/arm/bcm2835-ctl.c ---- linux-3.2.19/sound/arm/bcm2835-ctl.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/sound/arm/bcm2835-ctl.c 2012-06-10 05:51:05.240409019 +0200 +diff --git a/sound/arm/bcm2835-ctl.c b/sound/arm/bcm2835-ctl.c +new file mode 100755 +index 0000000..c0546e35 +--- /dev/null ++++ b/sound/arm/bcm2835-ctl.c @@ -0,0 +1,172 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -74187,255 +74881,11 @@ diff -Naur linux-3.2.19/sound/arm/bcm2835-ctl.c linux-3.2.19.patch/sound/arm/bcm + } + return 0; +} -diff -Naur linux-3.2.19/sound/arm/bcm2835.h linux-3.2.19.patch/sound/arm/bcm2835.h ---- linux-3.2.19/sound/arm/bcm2835.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/sound/arm/bcm2835.h 2012-06-10 05:51:05.249409200 +0200 -@@ -0,0 +1,242 @@ -+/***************************************************************************** -+* Copyright 2011 Broadcom Corporation. All rights reserved. -+* -+* Unless you and Broadcom execute a separate written software license -+* agreement governing use of this software, this software is licensed to you -+* under the terms of the GNU General Public License version 2, available at -+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). -+* -+* Notwithstanding the above, under no circumstances may you combine this -+* software in any way with any other Broadcom software provided under a -+* license other than the GPL, without Broadcom's express prior written -+* consent. -+*****************************************************************************/ -+ -+#ifndef __SOUND_ARM_BCM2835_H -+#define __SOUND_ARM_BCM2835_H -+ -+#define SUBSTREAM_NUM 1 -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* #define DUMP_RAW_DATA */ -+//#define AUDIO_DEBUG_ENABLE -+//#define AUDIO_VERBOSE_DEBUG_ENABLE -+ -+/* Debug macros */ -+#ifdef AUDIO_DEBUG_ENABLE -+ -+#ifdef AUDIO_VERBOSE_DEBUG_ENABLE -+ -+#define audio_debug(fmt, arg...) \ -+ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define audio_info(fmt, arg...) \ -+ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#else -+ -+#define audio_debug(fmt, arg...) do {} while (0) -+ -+#define audio_info(fmt, arg...) do {} while (0) -+ -+#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */ -+ -+#else -+ -+#define audio_debug(fmt, arg...) do {} while (0) -+ -+#define audio_info(fmt, arg...) do {} while (0) -+ -+#endif /* AUDIO_DEBUG_ENABLE */ -+ -+#define audio_error(fmt, arg...) \ -+ printk(KERN_ERR"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define audio_warning(fmt, arg...) \ -+ printk(KERN_WARNING"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define audio_alert(fmt, arg...) \ -+ printk(KERN_ALERT"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define MAX_SUBSTREAMS (8) -+#define AVAIL_SUBSTREAMS_MASK (0xff) -+ -+#define AUDIO_IPC_BLOCK_NUM_BUFFERS (8) -+#define AUDIO_IPC_BLOCK_BUFFER_SIZE (1024*8) -+ -+#define AUDIO_CONTROL_OFFSET (0x00) -+#define CTRL_EN_SHIFT (0) -+#define CTRL_EN_MASK (0x00000001) -+#define CTRL_PLAY_SHIFT (1) -+#define CTRL_PLAY_MASK (0x00000002) -+#define CTRL_MUTE_SHIFT (2) -+#define CTRL_MUTE_MASK (0x00000004) -+#define CTRL_SETUP_SHIFT (3) -+#define CTRL_SETUP_MASK (0x00000008) -+#define CTRL_FLUSH_SHIFT (4) -+#define CTRL_FLUSH_MASK (0x00000010) -+#define CTRL_STOPMODE_SHIFT (5) -+#define CTRL_STOPMODE_MASK (0x00000020) -+ -+#define AUDIO_STATUS_OFFSET (0x04) -+#define STAT_EN_SHIFT (0) -+#define STAT_EN_MASK (0x00000001) -+#define STAT_PLAY_SHIFT (1) -+#define STAT_PLAY_MASK (0x00000002) -+#define STAT_MUTE_SHIFT (2) -+#define STAT_MUTE_MASK (0x00000004) -+#define STAT_SETUP_SHIFT (3) -+#define STAT_SETUP_MASK (0x00000008) -+#define STAT_FLUSH_SHIFT (4) -+#define STAT_FLUSH_MASK (0x00000010) -+#define STAT_STOPMODE_SHIFT (5) -+#define STAT_STOPMODE_MASK (0x00000020) -+ -+/* Interrupt status */ -+#define AUDIO_INTSTAT_OFFSET (0x08) -+#define INTSTAT_CONTROL_SHIFT (0) -+#define INTSTAT_CONTROL_MASK (0x0000000f) -+#define INTSTAT_FIFO_SHIFT (4) -+#define INTSTAT_FIFO_MASK (0x000000f0) -+ -+/* Configuration */ -+#define AUDIO_DESTINATION_OFFSET (0x0C) -+#define AUDIO_SAMPLE_RATE_OFFSET (0x10) -+#define AUDIO_BIT_RATE_OFFSET (0x14) -+#define AUDIO_VOLUME_OFFSET (0x18) -+#define AUDIO_CHANNELS_OFFSET (0x1C) -+ -+/* Implemention of peterson's algorithm for shared memory semaphores */ -+#define AUDIO_FLAG0_OFFSET (0x20) -+#define AUDIO_FLAG1_OFFSET (0x24) -+#define AUDIO_TURN_OFFSET (0x28) -+ -+/* Fifo registers */ -+#define AUDIO_IN_WRITE_PTR_OFFSET (0x30) -+#define AUDIO_IN_READ_PTR_OFFSET (0x34) -+#define AUDIO_IN_FIFO_SIZE_OFFSET (0x38) -+#define AUDIO_IN_FIFO_ENTRY_OFFSET (0x3C) -+#define AUDIO_IN_FIFO_START_OFFSET (0x40) -+ -+/* 8 entries here of 4 words each = 0x80 gap from 0x50 */ -+#define AUDIO_IN_FIFO_OFFSET (0x50) -+ -+#define AUDIO_OUT_WRITE_PTR_OFFSET (0xD0) -+#define AUDIO_OUT_READ_PTR_OFFSET (0xD4) -+#define AUDIO_OUT_FIFO_SIZE_OFFSET (0xD8) -+#define AUDIO_OUT_FIFO_ENTRY_OFFSET (0xDC) -+#define AUDIO_OUT_FIFO_START_OFFSET (0xE0) -+ -+/* 8 entries here of 4 words each = 0x80 gap from 0xF0 */ -+#define AUDIO_OUT_FIFO_OFFSET (0xF0) -+ -+/* Some constants for values .. */ -+typedef enum { -+ AUDIO_DEST_AUTO = 0, -+ AUDIO_DEST_HEADPHONES = 1, -+ AUDIO_DEST_HDMI = 2, -+ AUDIO_DEST_MAX, -+} SND_BCM2835_ROUTE_T; -+ -+typedef enum { -+ PCM_PLAYBACK_VOLUME, -+ PCM_PLAYBACK_MUTE, -+ PCM_PLAYBACK_DEVICE, -+} SND_BCM2835_CTRL_T; -+ -+/* this struct is tightly packed - its size is 16bytes */ -+typedef struct { -+ uint32_t buffer_id; -+ uint32_t buffer_size; -+ uint32_t buffer_ptr; -+ uint32_t spare; -+ -+} AUDIO_FIFO_ENTRY_T; -+ -+/* definition of the chip-specific record */ -+typedef struct bcm2835_chip { -+ struct snd_card *card; -+ struct snd_pcm *pcm; -+ /* Bitmat for valid reg_base and irq numbers */ -+ uint32_t avail_substreams; -+ struct platform_device *pdev[MAX_SUBSTREAMS]; -+ struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS]; -+ -+ int volume; -+ int dest; -+ int mute; -+} bcm2835_chip_t; -+ -+typedef struct bcm2835_audio_buffer { -+ uint32_t buffer_id; -+ phys_addr_t bus_addr; -+ uint8_t __iomem *start; -+ uint32_t size; -+ uint32_t data_left; -+ struct list_head link; -+ -+} bcm2835_audio_buffer_t; -+ -+typedef struct bcm2835_alsa_stream { -+ bcm2835_chip_t *chip; -+ struct snd_pcm_substream *substream; -+ -+ struct semaphore buffers_update_sem; -+ struct semaphore control_sem; -+ spinlock_t lock; -+ volatile uint32_t control; -+ volatile uint32_t status; -+ -+ int open; -+ int running; -+ int draining; -+ -+#ifdef DUMP_RAW_DATA -+ /* for debug */ -+ int file; -+#endif -+ unsigned int pos; -+ unsigned int buffer_size; -+ unsigned int period_size; -+ -+ uint32_t enable_fifo_irq; -+ irq_handler_t fifo_irq_handler; -+ -+ atomic_t retrieved; -+ struct opaque_AUDIO_INSTANCE_T *instance; -+ struct workqueue_struct *my_wq; -+ int idx; -+} bcm2835_alsa_stream_t; -+ -+int snd_bcm2835_new_ctl(bcm2835_chip_t * chip); -+int snd_bcm2835_new_pcm(bcm2835_chip_t * chip); -+ -+void bcm2835_audio_fifo_get_lock(bcm2835_alsa_stream_t * alsa_stream); -+void bcm2835_audio_fifo_put_lock(bcm2835_alsa_stream_t * alsa_stream); -+ -+int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream, -+ uint32_t channels, uint32_t samplerate, -+ uint32_t bps); -+int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_set_ctls(bcm2835_chip_t * chip); -+int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count, -+ void *src); -+//uint32_t bcm2835_audio_buffers_consumed_bytes(bcm2835_alsa_stream_t *alsa_stream); -+uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream); -+void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream); -+void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream); -+ -+#endif /* __SOUND_ARM_BCM2835_H */ -diff -Naur linux-3.2.19/sound/arm/bcm2835-pcm.c linux-3.2.19.patch/sound/arm/bcm2835-pcm.c ---- linux-3.2.19/sound/arm/bcm2835-pcm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/sound/arm/bcm2835-pcm.c 2012-06-10 05:51:05.247409160 +0200 +diff --git a/sound/arm/bcm2835-pcm.c b/sound/arm/bcm2835-pcm.c +new file mode 100755 +index 0000000..40a9fb5 +--- /dev/null ++++ b/sound/arm/bcm2835-pcm.c @@ -0,0 +1,424 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -74861,9 +75311,11 @@ diff -Naur linux-3.2.19/sound/arm/bcm2835-pcm.c linux-3.2.19.patch/sound/arm/bcm + + return 0; +} -diff -Naur linux-3.2.19/sound/arm/bcm2835-vchiq.c linux-3.2.19.patch/sound/arm/bcm2835-vchiq.c ---- linux-3.2.19/sound/arm/bcm2835-vchiq.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/sound/arm/bcm2835-vchiq.c 2012-06-10 05:51:05.250409220 +0200 +diff --git a/sound/arm/bcm2835-vchiq.c b/sound/arm/bcm2835-vchiq.c +new file mode 100755 +index 0000000..820063a +--- /dev/null ++++ b/sound/arm/bcm2835-vchiq.c @@ -0,0 +1,818 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -75683,38 +76135,689 @@ diff -Naur linux-3.2.19/sound/arm/bcm2835-vchiq.c linux-3.2.19.patch/sound/arm/b + atomic_sub(count, &alsa_stream->retrieved); + return count; +} -diff -Naur linux-3.2.19/sound/arm/Kconfig linux-3.2.19.patch/sound/arm/Kconfig ---- linux-3.2.19/sound/arm/Kconfig 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/sound/arm/Kconfig 2012-06-10 05:51:05.233408878 +0200 -@@ -39,5 +39,12 @@ - Say Y or M if you want to support any AC97 codec attached to - the PXA2xx AC97 interface. - -+config SND_BCM2835 -+ tristate "BCM2835 ALSA driver" -+ depends on ARCH_BCM2708 && SND -+ select SND_PCM -+ help -+ Say Y or M if you want to support BCM2835 Alsa pcm card driver +diff --git a/sound/arm/bcm2835.c b/sound/arm/bcm2835.c +new file mode 100755 +index 0000000..3f6b0ea +--- /dev/null ++++ b/sound/arm/bcm2835.c +@@ -0,0 +1,424 @@ ++/***************************************************************************** ++* Copyright 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ + - endif # SND_ARM - -diff -Naur linux-3.2.19/sound/arm/Makefile linux-3.2.19.patch/sound/arm/Makefile ---- linux-3.2.19/sound/arm/Makefile 2012-05-31 01:44:12.000000000 +0200 -+++ linux-3.2.19.patch/sound/arm/Makefile 2012-06-10 05:51:05.342411075 +0200 -@@ -14,3 +14,9 @@ - - obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o - snd-pxa2xx-ac97-objs := pxa2xx-ac97.o ++#include + -+obj-$(CONFIG_SND_BCM2835) += snd-bcm2835.o -+snd-bcm2835-objs := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o ++#include ++#include ++#include + -+EXTRA_CFLAGS += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000 ++#include "bcm2835.h" + -diff -Naur linux-3.2.19/sound/arm/vc_vchi_audioserv_defs.h linux-3.2.19.patch/sound/arm/vc_vchi_audioserv_defs.h ---- linux-3.2.19/sound/arm/vc_vchi_audioserv_defs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.2.19.patch/sound/arm/vc_vchi_audioserv_defs.h 2012-06-10 05:51:05.246409140 +0200 ++/* module parameters (see "Module Parameters") */ ++/* SNDRV_CARDS: maximum number of cards supported by this module */ ++static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1 }; ++static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL }; ++static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1 }; ++ ++/* HACKY global pointers needed for successive probes to work : ssp ++ * But compared against the changes we will have to do in VC audio_ipc code ++ * to export 8 audio_ipc devices as a single IPC device and then monitor all ++ * four devices in a thread, this gets things done quickly and should be easier ++ * to debug if we run into issues ++ */ ++ ++static struct snd_card *g_card = NULL; ++static bcm2835_chip_t *g_chip = NULL; ++ ++static int snd_bcm2835_free(bcm2835_chip_t * chip) ++{ ++ kfree(chip); ++ return 0; ++} ++ ++/* component-destructor ++ * (see "Management of Cards and Components") ++ */ ++static int snd_bcm2835_dev_free(struct snd_device *device) ++{ ++ return snd_bcm2835_free(device->device_data); ++} ++ ++/* chip-specific constructor ++ * (see "Management of Cards and Components") ++ */ ++static int __devinit snd_bcm2835_create(struct snd_card *card, ++ struct platform_device *pdev, ++ bcm2835_chip_t ** rchip) ++{ ++ bcm2835_chip_t *chip; ++ int err; ++ static struct snd_device_ops ops = { ++ .dev_free = snd_bcm2835_dev_free, ++ }; ++ ++ *rchip = NULL; ++ ++ chip = kzalloc(sizeof(*chip), GFP_KERNEL); ++ if (chip == NULL) ++ return -ENOMEM; ++ ++ chip->card = card; ++ ++ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); ++ if (err < 0) { ++ snd_bcm2835_free(chip); ++ return err; ++ } ++ ++ *rchip = chip; ++ return 0; ++} ++ ++static int __devinit snd_bcm2835_alsa_probe(struct platform_device *pdev) ++{ ++ static int dev; ++ bcm2835_chip_t *chip; ++ struct snd_card *card; ++ int err; ++ printk(KERN_INFO "### snd_bcm2835_alsa_probe %p ###", pdev); ++ ++ printk ++ ("############ PROBING FOR bcm2835 ALSA device (%d):(%d) ###############\n", ++ dev, enable[dev]); ++ ++ if (dev >= MAX_SUBSTREAMS) ++ return -ENODEV; ++ ++ if (!enable[dev]) { ++ dev++; ++ return -ENOENT; ++ } ++ ++ if (dev > 0) ++ goto add_register_map; ++ ++ printk("Creating card...\n"); ++ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &g_card); ++ if (err < 0) ++ goto out; ++ ++ snd_card_set_dev(g_card, &pdev->dev); ++ strcpy(g_card->driver, "BRCM bcm2835 ALSA Driver"); ++ strcpy(g_card->shortname, "bcm2835 ALSA"); ++ sprintf(g_card->longname, "%s", g_card->shortname); ++ ++ printk("Creating device/chip ..\n"); ++ err = snd_bcm2835_create(g_card, pdev, &chip); ++ if (err < 0) { ++ printk(KERN_ERR "Failed to create bcm2835 chip\n"); ++ goto out_bcm2835_create; ++ } ++ ++ g_chip = chip; ++ err = snd_bcm2835_new_pcm(chip); ++ if (err < 0) { ++ printk(KERN_ERR "Failed to create new BCM2835 pcm device\n"); ++ goto out_bcm2835_new_pcm; ++ } ++ ++ printk("Adding controls ..\n"); ++ err = snd_bcm2835_new_ctl(chip); ++ if (err < 0) { ++ printk(KERN_ERR "Failed to create new BCM2835 ctl\n"); ++ goto out_bcm2835_new_ctl; ++ } ++ ++add_register_map: ++ card = g_card; ++ chip = g_chip; ++ ++ BUG_ON(!(card && chip)); ++ ++ chip->avail_substreams |= (1 << dev); ++ chip->pdev[dev] = pdev; ++ ++ if (dev == 0) { ++ printk("Registering card ....\n"); ++ err = snd_card_register(card); ++ if (err < 0) { ++ printk(KERN_ERR ++ "Failed to register bcm2835 ALSA card \n"); ++ goto out_card_register; ++ } ++ platform_set_drvdata(pdev, card); ++ printk("bcm2835 ALSA CARD CREATED!\n"); ++ } else { ++ printk("bcm2835 ALSA CHIP CREATED!\n"); ++ platform_set_drvdata(pdev, (void *)dev); ++ } ++ ++ dev++; ++ ++ return 0; ++ ++out_card_register: ++out_bcm2835_new_ctl: ++out_bcm2835_new_pcm: ++out_bcm2835_create: ++ BUG_ON(!g_card); ++ if (snd_card_free(g_card)) ++ printk(KERN_ERR "Failed to free Registered alsa card\n"); ++ g_card = NULL; ++out: ++ dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */ ++ printk(KERN_ERR "BCM2835 ALSA Probe failed !!\n"); ++ return err; ++} ++ ++static int snd_bcm2835_alsa_remove(struct platform_device *pdev) ++{ ++ uint32_t idx; ++ void *drv_data; ++ ++ drv_data = platform_get_drvdata(pdev); ++ ++ if (drv_data == (void *)g_card) { ++ /* This is the card device */ ++ snd_card_free((struct snd_card *)drv_data); ++ g_card = NULL; ++ g_chip = NULL; ++ } else { ++ idx = (uint32_t) drv_data; ++ if (g_card != NULL) { ++ BUG_ON(!g_chip); ++ /* We pass chip device numbers in audio ipc devices ++ * other than the one we registered our card with ++ */ ++ idx = (uint32_t) drv_data; ++ BUG_ON(!idx || idx > MAX_SUBSTREAMS); ++ g_chip->avail_substreams &= ~(1 << idx); ++ /* There should be atleast one substream registered ++ * after we are done here, as it wil be removed when ++ * the *remove* is called for the card device ++ */ ++ BUG_ON(!g_chip->avail_substreams); ++ } ++ } ++ ++ platform_set_drvdata(pdev, NULL); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_PM ++static int snd_bcm2835_alsa_suspend(struct platform_device *pdev, ++ pm_message_t state) ++{ ++ return 0; ++} ++ ++static int snd_bcm2835_alsa_resume(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++#endif ++ ++static struct platform_driver bcm2835_alsa0_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD0", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa1_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD1", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa2_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD2", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa3_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD3", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa4_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD4", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa5_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD5", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa6_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD6", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa7_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD7", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __devinit bcm2835_alsa_device_init(void) ++{ ++ int err; ++ err = platform_driver_register(&bcm2835_alsa0_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa0_driver %d .\n", err); ++ goto out; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa1_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa1_driver %d .\n", err); ++ goto unregister_0; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa2_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa2_driver %d .\n", err); ++ goto unregister_1; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa3_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa3_driver %d .\n", err); ++ goto unregister_2; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa4_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa4_driver %d .\n", err); ++ goto unregister_3; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa5_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa5_driver %d .\n", err); ++ goto unregister_4; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa6_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa6_driver %d .\n", err); ++ goto unregister_5; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa7_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa7_driver %d .\n", err); ++ goto unregister_6; ++ } ++ printk(KERN_INFO "### BCM2835 ALSA driver init %s ### \n", ++ err ? "FAILED" : "OK"); ++ ++ return 0; ++ ++unregister_6: ++ platform_driver_unregister(&bcm2835_alsa6_driver); ++unregister_5: ++ platform_driver_unregister(&bcm2835_alsa5_driver); ++unregister_4: ++ platform_driver_unregister(&bcm2835_alsa4_driver); ++unregister_3: ++ platform_driver_unregister(&bcm2835_alsa3_driver); ++unregister_2: ++ platform_driver_unregister(&bcm2835_alsa2_driver); ++unregister_1: ++ platform_driver_unregister(&bcm2835_alsa1_driver); ++unregister_0: ++ platform_driver_unregister(&bcm2835_alsa0_driver); ++out: ++ return err; ++} ++ ++static void __devexit bcm2835_alsa_device_exit(void) ++{ ++ platform_driver_unregister(&bcm2835_alsa0_driver); ++ platform_driver_unregister(&bcm2835_alsa1_driver); ++ platform_driver_unregister(&bcm2835_alsa2_driver); ++ platform_driver_unregister(&bcm2835_alsa3_driver); ++ platform_driver_unregister(&bcm2835_alsa4_driver); ++ platform_driver_unregister(&bcm2835_alsa5_driver); ++ platform_driver_unregister(&bcm2835_alsa6_driver); ++ platform_driver_unregister(&bcm2835_alsa7_driver); ++} ++ ++late_initcall(bcm2835_alsa_device_init); ++module_exit(bcm2835_alsa_device_exit); ++ ++MODULE_AUTHOR("Dom Cobley"); ++MODULE_DESCRIPTION("Alsa driver for BCM2835 chip"); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:bcm2835_alsa"); +diff --git a/sound/arm/bcm2835.h b/sound/arm/bcm2835.h +new file mode 100755 +index 0000000..134a483 +--- /dev/null ++++ b/sound/arm/bcm2835.h +@@ -0,0 +1,242 @@ ++/***************************************************************************** ++* Copyright 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ ++ ++#ifndef __SOUND_ARM_BCM2835_H ++#define __SOUND_ARM_BCM2835_H ++ ++#define SUBSTREAM_NUM 1 ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* #define DUMP_RAW_DATA */ ++//#define AUDIO_DEBUG_ENABLE ++//#define AUDIO_VERBOSE_DEBUG_ENABLE ++ ++/* Debug macros */ ++#ifdef AUDIO_DEBUG_ENABLE ++ ++#ifdef AUDIO_VERBOSE_DEBUG_ENABLE ++ ++#define audio_debug(fmt, arg...) \ ++ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define audio_info(fmt, arg...) \ ++ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#else ++ ++#define audio_debug(fmt, arg...) do {} while (0) ++ ++#define audio_info(fmt, arg...) do {} while (0) ++ ++#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */ ++ ++#else ++ ++#define audio_debug(fmt, arg...) do {} while (0) ++ ++#define audio_info(fmt, arg...) do {} while (0) ++ ++#endif /* AUDIO_DEBUG_ENABLE */ ++ ++#define audio_error(fmt, arg...) \ ++ printk(KERN_ERR"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define audio_warning(fmt, arg...) \ ++ printk(KERN_WARNING"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define audio_alert(fmt, arg...) \ ++ printk(KERN_ALERT"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define MAX_SUBSTREAMS (8) ++#define AVAIL_SUBSTREAMS_MASK (0xff) ++ ++#define AUDIO_IPC_BLOCK_NUM_BUFFERS (8) ++#define AUDIO_IPC_BLOCK_BUFFER_SIZE (1024*8) ++ ++#define AUDIO_CONTROL_OFFSET (0x00) ++#define CTRL_EN_SHIFT (0) ++#define CTRL_EN_MASK (0x00000001) ++#define CTRL_PLAY_SHIFT (1) ++#define CTRL_PLAY_MASK (0x00000002) ++#define CTRL_MUTE_SHIFT (2) ++#define CTRL_MUTE_MASK (0x00000004) ++#define CTRL_SETUP_SHIFT (3) ++#define CTRL_SETUP_MASK (0x00000008) ++#define CTRL_FLUSH_SHIFT (4) ++#define CTRL_FLUSH_MASK (0x00000010) ++#define CTRL_STOPMODE_SHIFT (5) ++#define CTRL_STOPMODE_MASK (0x00000020) ++ ++#define AUDIO_STATUS_OFFSET (0x04) ++#define STAT_EN_SHIFT (0) ++#define STAT_EN_MASK (0x00000001) ++#define STAT_PLAY_SHIFT (1) ++#define STAT_PLAY_MASK (0x00000002) ++#define STAT_MUTE_SHIFT (2) ++#define STAT_MUTE_MASK (0x00000004) ++#define STAT_SETUP_SHIFT (3) ++#define STAT_SETUP_MASK (0x00000008) ++#define STAT_FLUSH_SHIFT (4) ++#define STAT_FLUSH_MASK (0x00000010) ++#define STAT_STOPMODE_SHIFT (5) ++#define STAT_STOPMODE_MASK (0x00000020) ++ ++/* Interrupt status */ ++#define AUDIO_INTSTAT_OFFSET (0x08) ++#define INTSTAT_CONTROL_SHIFT (0) ++#define INTSTAT_CONTROL_MASK (0x0000000f) ++#define INTSTAT_FIFO_SHIFT (4) ++#define INTSTAT_FIFO_MASK (0x000000f0) ++ ++/* Configuration */ ++#define AUDIO_DESTINATION_OFFSET (0x0C) ++#define AUDIO_SAMPLE_RATE_OFFSET (0x10) ++#define AUDIO_BIT_RATE_OFFSET (0x14) ++#define AUDIO_VOLUME_OFFSET (0x18) ++#define AUDIO_CHANNELS_OFFSET (0x1C) ++ ++/* Implemention of peterson's algorithm for shared memory semaphores */ ++#define AUDIO_FLAG0_OFFSET (0x20) ++#define AUDIO_FLAG1_OFFSET (0x24) ++#define AUDIO_TURN_OFFSET (0x28) ++ ++/* Fifo registers */ ++#define AUDIO_IN_WRITE_PTR_OFFSET (0x30) ++#define AUDIO_IN_READ_PTR_OFFSET (0x34) ++#define AUDIO_IN_FIFO_SIZE_OFFSET (0x38) ++#define AUDIO_IN_FIFO_ENTRY_OFFSET (0x3C) ++#define AUDIO_IN_FIFO_START_OFFSET (0x40) ++ ++/* 8 entries here of 4 words each = 0x80 gap from 0x50 */ ++#define AUDIO_IN_FIFO_OFFSET (0x50) ++ ++#define AUDIO_OUT_WRITE_PTR_OFFSET (0xD0) ++#define AUDIO_OUT_READ_PTR_OFFSET (0xD4) ++#define AUDIO_OUT_FIFO_SIZE_OFFSET (0xD8) ++#define AUDIO_OUT_FIFO_ENTRY_OFFSET (0xDC) ++#define AUDIO_OUT_FIFO_START_OFFSET (0xE0) ++ ++/* 8 entries here of 4 words each = 0x80 gap from 0xF0 */ ++#define AUDIO_OUT_FIFO_OFFSET (0xF0) ++ ++/* Some constants for values .. */ ++typedef enum { ++ AUDIO_DEST_AUTO = 0, ++ AUDIO_DEST_HEADPHONES = 1, ++ AUDIO_DEST_HDMI = 2, ++ AUDIO_DEST_MAX, ++} SND_BCM2835_ROUTE_T; ++ ++typedef enum { ++ PCM_PLAYBACK_VOLUME, ++ PCM_PLAYBACK_MUTE, ++ PCM_PLAYBACK_DEVICE, ++} SND_BCM2835_CTRL_T; ++ ++/* this struct is tightly packed - its size is 16bytes */ ++typedef struct { ++ uint32_t buffer_id; ++ uint32_t buffer_size; ++ uint32_t buffer_ptr; ++ uint32_t spare; ++ ++} AUDIO_FIFO_ENTRY_T; ++ ++/* definition of the chip-specific record */ ++typedef struct bcm2835_chip { ++ struct snd_card *card; ++ struct snd_pcm *pcm; ++ /* Bitmat for valid reg_base and irq numbers */ ++ uint32_t avail_substreams; ++ struct platform_device *pdev[MAX_SUBSTREAMS]; ++ struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS]; ++ ++ int volume; ++ int dest; ++ int mute; ++} bcm2835_chip_t; ++ ++typedef struct bcm2835_audio_buffer { ++ uint32_t buffer_id; ++ phys_addr_t bus_addr; ++ uint8_t __iomem *start; ++ uint32_t size; ++ uint32_t data_left; ++ struct list_head link; ++ ++} bcm2835_audio_buffer_t; ++ ++typedef struct bcm2835_alsa_stream { ++ bcm2835_chip_t *chip; ++ struct snd_pcm_substream *substream; ++ ++ struct semaphore buffers_update_sem; ++ struct semaphore control_sem; ++ spinlock_t lock; ++ volatile uint32_t control; ++ volatile uint32_t status; ++ ++ int open; ++ int running; ++ int draining; ++ ++#ifdef DUMP_RAW_DATA ++ /* for debug */ ++ int file; ++#endif ++ unsigned int pos; ++ unsigned int buffer_size; ++ unsigned int period_size; ++ ++ uint32_t enable_fifo_irq; ++ irq_handler_t fifo_irq_handler; ++ ++ atomic_t retrieved; ++ struct opaque_AUDIO_INSTANCE_T *instance; ++ struct workqueue_struct *my_wq; ++ int idx; ++} bcm2835_alsa_stream_t; ++ ++int snd_bcm2835_new_ctl(bcm2835_chip_t * chip); ++int snd_bcm2835_new_pcm(bcm2835_chip_t * chip); ++ ++void bcm2835_audio_fifo_get_lock(bcm2835_alsa_stream_t * alsa_stream); ++void bcm2835_audio_fifo_put_lock(bcm2835_alsa_stream_t * alsa_stream); ++ ++int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream, ++ uint32_t channels, uint32_t samplerate, ++ uint32_t bps); ++int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_set_ctls(bcm2835_chip_t * chip); ++int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count, ++ void *src); ++//uint32_t bcm2835_audio_buffers_consumed_bytes(bcm2835_alsa_stream_t *alsa_stream); ++uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream); ++void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream); ++void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream); ++ ++#endif /* __SOUND_ARM_BCM2835_H */ +diff --git a/sound/arm/vc_vchi_audioserv_defs.h b/sound/arm/vc_vchi_audioserv_defs.h +new file mode 100644 +index 0000000..d610734 +--- /dev/null ++++ b/sound/arm/vc_vchi_audioserv_defs.h @@ -0,0 +1,112 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. diff --git a/packages/linux/patches/linux-3.2.19-716_mm-zero_swappiness.patch b/packages/linux/patches/linux-3.2.20-716_mm-zero_swappiness.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-716_mm-zero_swappiness.patch rename to packages/linux/patches/linux-3.2.20-716_mm-zero_swappiness.patch diff --git a/packages/linux/patches/linux-3.2.19-901_broken_bluetooth.patch b/packages/linux/patches/linux-3.2.20-901_broken_bluetooth.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-901_broken_bluetooth.patch rename to packages/linux/patches/linux-3.2.20-901_broken_bluetooth.patch diff --git a/packages/linux/patches/linux-3.2.19-920_add_rtl8168.patch b/packages/linux/patches/linux-3.2.20-920_add_rtl8168.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-920_add_rtl8168.patch rename to packages/linux/patches/linux-3.2.20-920_add_rtl8168.patch diff --git a/packages/linux/patches/linux-3.2.19-990-xc5000_add_support_for_get_if_frequency.patch b/packages/linux/patches/linux-3.2.20-990-xc5000_add_support_for_get_if_frequency.patch similarity index 100% rename from packages/linux/patches/linux-3.2.19-990-xc5000_add_support_for_get_if_frequency.patch rename to packages/linux/patches/linux-3.2.20-990-xc5000_add_support_for_get_if_frequency.patch