diff options
| author | Denys Dmytriyenko <denys@ti.com> | 2014-02-21 11:06:35 -0500 |
|---|---|---|
| committer | Denys Dmytriyenko <denys@ti.com> | 2014-02-21 12:05:10 -0500 |
| commit | f6e604d7ebe63c03a534c24ffb6ed32671581140 (patch) | |
| tree | 646ad4ddc827971c16e8fbd36db920512558b932 | |
| parent | 881c9b5b49455423805df10ae044068a41d53140 (diff) | |
| download | meta-ti-f6e604d7ebe63c03a534c24ffb6ed32671581140.tar.gz | |
linux-ti-staging: add latest critical fixes locally for now
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
5 files changed, 297 insertions, 1 deletions
diff --git a/recipes-kernel/linux/linux-ti-staging/0001-Revert-usb-musb-musb_cppi41-Revert-the-Advisory-1.0..patch b/recipes-kernel/linux/linux-ti-staging/0001-Revert-usb-musb-musb_cppi41-Revert-the-Advisory-1.0..patch new file mode 100644 index 00000000..dcb33226 --- /dev/null +++ b/recipes-kernel/linux/linux-ti-staging/0001-Revert-usb-musb-musb_cppi41-Revert-the-Advisory-1.0..patch | |||
| @@ -0,0 +1,158 @@ | |||
| 1 | From f576e148cd15f10224e4ce13b6773717682f9a5a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chase Maupin <Chase.Maupin@ti.com> | ||
| 3 | Date: Fri, 21 Feb 2014 09:05:48 -0600 | ||
| 4 | Subject: [PATCH 1/4] Revert "usb: musb: musb_cppi41: Revert the Advisory 1.0.13 workaround" | ||
| 5 | |||
| 6 | This reverts commit c424ef3e2beb89488e7e597446b4c6bc8f1852c5. | ||
| 7 | --- | ||
| 8 | drivers/usb/musb/musb_cppi41.c | 96 +++++++++++++++++++++++++++++++++------- | ||
| 9 | 1 files changed, 79 insertions(+), 17 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c | ||
| 12 | index d02facc..01df8f9 100644 | ||
| 13 | --- a/drivers/usb/musb/musb_cppi41.c | ||
| 14 | +++ b/drivers/usb/musb/musb_cppi41.c | ||
| 15 | @@ -31,6 +31,7 @@ struct cppi41_dma_channel { | ||
| 16 | u8 port_num; | ||
| 17 | u8 is_tx; | ||
| 18 | u8 is_allocated; | ||
| 19 | + u8 usb_toggle; | ||
| 20 | |||
| 21 | dma_addr_t buf_addr; | ||
| 22 | u32 total_len; | ||
| 23 | @@ -55,6 +56,50 @@ struct cppi41_dma_controller { | ||
| 24 | u32 auto_req; | ||
| 25 | }; | ||
| 26 | |||
| 27 | +static void save_rx_toggle(struct cppi41_dma_channel *cppi41_channel) | ||
| 28 | +{ | ||
| 29 | + u16 csr; | ||
| 30 | + u8 toggle; | ||
| 31 | + | ||
| 32 | + if (cppi41_channel->is_tx) | ||
| 33 | + return; | ||
| 34 | + if (!is_host_active(cppi41_channel->controller->musb)) | ||
| 35 | + return; | ||
| 36 | + | ||
| 37 | + csr = musb_readw(cppi41_channel->hw_ep->regs, MUSB_RXCSR); | ||
| 38 | + toggle = csr & MUSB_RXCSR_H_DATATOGGLE ? 1 : 0; | ||
| 39 | + | ||
| 40 | + cppi41_channel->usb_toggle = toggle; | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +static void update_rx_toggle(struct cppi41_dma_channel *cppi41_channel) | ||
| 44 | +{ | ||
| 45 | + u16 csr; | ||
| 46 | + u8 toggle; | ||
| 47 | + | ||
| 48 | + if (cppi41_channel->is_tx) | ||
| 49 | + return; | ||
| 50 | + if (!is_host_active(cppi41_channel->controller->musb)) | ||
| 51 | + return; | ||
| 52 | + | ||
| 53 | + csr = musb_readw(cppi41_channel->hw_ep->regs, MUSB_RXCSR); | ||
| 54 | + toggle = csr & MUSB_RXCSR_H_DATATOGGLE ? 1 : 0; | ||
| 55 | + | ||
| 56 | + /* | ||
| 57 | + * AM335x Advisory 1.0.13: Due to internal synchronisation error the | ||
| 58 | + * data toggle may reset from DATA1 to DATA0 during receiving data from | ||
| 59 | + * more than one endpoint. | ||
| 60 | + */ | ||
| 61 | + if (!toggle && toggle == cppi41_channel->usb_toggle) { | ||
| 62 | + csr |= MUSB_RXCSR_H_DATATOGGLE | MUSB_RXCSR_H_WR_DATATOGGLE; | ||
| 63 | + musb_writew(cppi41_channel->hw_ep->regs, MUSB_RXCSR, csr); | ||
| 64 | + dev_dbg(cppi41_channel->controller->musb->controller, | ||
| 65 | + "Restoring DATA1 toggle.\n"); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + cppi41_channel->usb_toggle = toggle; | ||
| 69 | +} | ||
| 70 | + | ||
| 71 | static bool musb_is_tx_fifo_empty(struct musb_hw_ep *hw_ep) | ||
| 72 | { | ||
| 73 | u8 epnum = hw_ep->epnum; | ||
| 74 | @@ -217,6 +262,8 @@ static void cppi41_dma_callback(void *private_data) | ||
| 75 | hw_ep->epnum, cppi41_channel->transferred, | ||
| 76 | cppi41_channel->total_len); | ||
| 77 | |||
| 78 | + update_rx_toggle(cppi41_channel); | ||
| 79 | + | ||
| 80 | if (cppi41_channel->transferred == cppi41_channel->total_len || | ||
| 81 | transferred < cppi41_channel->packet_sz) | ||
| 82 | cppi41_channel->prog_len = 0; | ||
| 83 | @@ -347,6 +394,7 @@ static bool cppi41_configure_channel(struct dma_channel *channel, | ||
| 84 | struct dma_async_tx_descriptor *dma_desc; | ||
| 85 | enum dma_transfer_direction direction; | ||
| 86 | struct musb *musb = cppi41_channel->controller->musb; | ||
| 87 | + unsigned use_gen_rndis = 0; | ||
| 88 | |||
| 89 | dev_dbg(musb->controller, | ||
| 90 | "configure ep%d/%x packet_sz=%d, mode=%d, dma_addr=0x%llx, len=%d is_tx=%d\n", | ||
| 91 | @@ -359,26 +407,39 @@ static bool cppi41_configure_channel(struct dma_channel *channel, | ||
| 92 | cppi41_channel->transferred = 0; | ||
| 93 | cppi41_channel->packet_sz = packet_sz; | ||
| 94 | |||
| 95 | - /* RNDIS mode */ | ||
| 96 | - if (len > packet_sz) { | ||
| 97 | - musb_writel(musb->ctrl_base, | ||
| 98 | - RNDIS_REG(cppi41_channel->port_num), len); | ||
| 99 | - /* gen rndis */ | ||
| 100 | - cppi41_set_dma_mode(cppi41_channel, | ||
| 101 | - EP_MODE_DMA_GEN_RNDIS); | ||
| 102 | - | ||
| 103 | - /* auto req */ | ||
| 104 | - cppi41_set_autoreq_mode(cppi41_channel, | ||
| 105 | + /* | ||
| 106 | + * Due to AM335x' Advisory 1.0.13 we are not allowed to transfer more | ||
| 107 | + * than max packet size at a time. | ||
| 108 | + */ | ||
| 109 | + if (cppi41_channel->is_tx) | ||
| 110 | + use_gen_rndis = 1; | ||
| 111 | + | ||
| 112 | + if (use_gen_rndis) { | ||
| 113 | + /* RNDIS mode */ | ||
| 114 | + if (len > packet_sz) { | ||
| 115 | + musb_writel(musb->ctrl_base, | ||
| 116 | + RNDIS_REG(cppi41_channel->port_num), len); | ||
| 117 | + /* gen rndis */ | ||
| 118 | + cppi41_set_dma_mode(cppi41_channel, | ||
| 119 | + EP_MODE_DMA_GEN_RNDIS); | ||
| 120 | + | ||
| 121 | + /* auto req */ | ||
| 122 | + cppi41_set_autoreq_mode(cppi41_channel, | ||
| 123 | EP_MODE_AUTOREG_ALL_NEOP); | ||
| 124 | - } else { | ||
| 125 | - musb_writel(musb->ctrl_base, | ||
| 126 | - RNDIS_REG(cppi41_channel->port_num), 0); | ||
| 127 | - cppi41_set_dma_mode(cppi41_channel, | ||
| 128 | - EP_MODE_DMA_TRANSPARENT); | ||
| 129 | - cppi41_set_autoreq_mode(cppi41_channel, | ||
| 130 | + } else { | ||
| 131 | + musb_writel(musb->ctrl_base, | ||
| 132 | + RNDIS_REG(cppi41_channel->port_num), 0); | ||
| 133 | + cppi41_set_dma_mode(cppi41_channel, | ||
| 134 | + EP_MODE_DMA_TRANSPARENT); | ||
| 135 | + cppi41_set_autoreq_mode(cppi41_channel, | ||
| 136 | EP_MODE_AUTOREG_NONE); | ||
| 137 | + } | ||
| 138 | + } else { | ||
| 139 | + /* fallback mode */ | ||
| 140 | + cppi41_set_dma_mode(cppi41_channel, EP_MODE_DMA_TRANSPARENT); | ||
| 141 | + cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREG_NONE); | ||
| 142 | + len = min_t(u32, packet_sz, len); | ||
| 143 | } | ||
| 144 | - | ||
| 145 | cppi41_channel->prog_len = len; | ||
| 146 | direction = cppi41_channel->is_tx ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; | ||
| 147 | dma_desc = dmaengine_prep_slave_single(dc, dma_addr, len, direction, | ||
| 148 | @@ -390,6 +451,7 @@ static bool cppi41_configure_channel(struct dma_channel *channel, | ||
| 149 | dma_desc->callback_param = channel; | ||
| 150 | cppi41_channel->cookie = dma_desc->tx_submit(dma_desc); | ||
| 151 | |||
| 152 | + save_rx_toggle(cppi41_channel); | ||
| 153 | dma_async_issue_pending(dc); | ||
| 154 | return true; | ||
| 155 | } | ||
| 156 | -- | ||
| 157 | 1.7.0.4 | ||
| 158 | |||
diff --git a/recipes-kernel/linux/linux-ti-staging/0002-ARM-config-Add-HAVE_ARM_SCU-for-AM43XX.patch b/recipes-kernel/linux/linux-ti-staging/0002-ARM-config-Add-HAVE_ARM_SCU-for-AM43XX.patch new file mode 100644 index 00000000..8137bb30 --- /dev/null +++ b/recipes-kernel/linux/linux-ti-staging/0002-ARM-config-Add-HAVE_ARM_SCU-for-AM43XX.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | From 5b2aa64ccdeef659a9688730753199ba5b8e60b1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Dave Gerlach <d-gerlach@ti.com> | ||
| 3 | Date: Fri, 21 Feb 2014 10:25:33 +0000 | ||
| 4 | Subject: [PATCH 2/4] ARM: config: Add HAVE_ARM_SCU for AM43XX | ||
| 5 | |||
| 6 | CONFIG_HAVE_ARM_SCU only gets selected if CONFIG_SMP is selected in an OMAP | ||
| 7 | system however AM43XX needs this option regardless of CONFIG_SMP as it is | ||
| 8 | important for controlling power in the SoC. Without this suspend will | ||
| 9 | not work as scu_power_mode becomes an empty function. | ||
| 10 | |||
| 11 | AM43XX requires SCU CPU Power Status bits for A9 core to be set to off mode | ||
| 12 | in order for the MSTANDBY signal to be asserted from the MPU during WFI. | ||
| 13 | This signal is used by the PRCM to determine when it is appropriate to | ||
| 14 | clock gate the MPU clock domain and also trigger M3_IRQ2 to tell the wkup_m3 | ||
| 15 | firmware to put the part into the desired sleep more. | ||
| 16 | |||
| 17 | Signed-off-by: Dave Gerlach <d-gerlach@ti.com> | ||
| 18 | Tested-by: Sekhar Nori <nsekhar@ti.com> | ||
| 19 | --- | ||
| 20 | arch/arm/mach-omap2/Kconfig | 1 + | ||
| 21 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig | ||
| 24 | index 959f6fc..373d576 100644 | ||
| 25 | --- a/arch/arm/mach-omap2/Kconfig | ||
| 26 | +++ b/arch/arm/mach-omap2/Kconfig | ||
| 27 | @@ -85,6 +85,7 @@ config SOC_AM43XX | ||
| 28 | depends on ARCH_MULTI_V7 | ||
| 29 | select CPU_V7 | ||
| 30 | select ARCH_OMAP2PLUS | ||
| 31 | + select HAVE_ARM_SCU | ||
| 32 | select MULTI_IRQ_HANDLER | ||
| 33 | select ARM_GIC | ||
| 34 | select COMMON_CLK | ||
| 35 | -- | ||
| 36 | 1.7.0.4 | ||
| 37 | |||
diff --git a/recipes-kernel/linux/linux-ti-staging/0003-ARM-OMAP-Kill-warning-in-CPUIDLE-code-with-CONFIG_SM.patch b/recipes-kernel/linux/linux-ti-staging/0003-ARM-OMAP-Kill-warning-in-CPUIDLE-code-with-CONFIG_SM.patch new file mode 100644 index 00000000..f79b045d --- /dev/null +++ b/recipes-kernel/linux/linux-ti-staging/0003-ARM-OMAP-Kill-warning-in-CPUIDLE-code-with-CONFIG_SM.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From 9b76ff20919fa939eed3fdffe05af8bcf1ec1ac5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 3 | Date: Wed, 12 Feb 2014 16:42:39 -0500 | ||
| 4 | Subject: [PATCH 3/4] ARM: OMAP: Kill warning in CPUIDLE code with !CONFIG_SMP | ||
| 5 | |||
| 6 | for non SMP build, NR_CPUS is 1 and hence the code complains with below | ||
| 7 | warnings. | ||
| 8 | |||
| 9 | arch/arm/mach-omap2/cpuidle44xx.c:207:8: warning: array subscript is above array bounds [-Warray-bounds] | ||
| 10 | arch/arm/mach-omap2/cpuidle44xx.c:212:11: warning: array subscript is above array bounds [-Warray-bounds] | ||
| 11 | |||
| 12 | Kill it by making array size fixed. | ||
| 13 | |||
| 14 | Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 15 | --- | ||
| 16 | arch/arm/mach-omap2/cpuidle44xx.c | 8 +++++--- | ||
| 17 | 1 files changed, 5 insertions(+), 3 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c | ||
| 20 | index 4c8982a..5e85f1e 100644 | ||
| 21 | --- a/arch/arm/mach-omap2/cpuidle44xx.c | ||
| 22 | +++ b/arch/arm/mach-omap2/cpuidle44xx.c | ||
| 23 | @@ -23,6 +23,8 @@ | ||
| 24 | #include "prm.h" | ||
| 25 | #include "clockdomain.h" | ||
| 26 | |||
| 27 | +#define MAX_CPUS 2 | ||
| 28 | + | ||
| 29 | /* Machine specific information */ | ||
| 30 | struct idle_statedata { | ||
| 31 | u32 cpu_state; | ||
| 32 | @@ -48,11 +50,11 @@ static struct idle_statedata omap4_idle_data[] = { | ||
| 33 | }, | ||
| 34 | }; | ||
| 35 | |||
| 36 | -static struct powerdomain *mpu_pd, *cpu_pd[NR_CPUS]; | ||
| 37 | -static struct clockdomain *cpu_clkdm[NR_CPUS]; | ||
| 38 | +static struct powerdomain *mpu_pd, *cpu_pd[MAX_CPUS]; | ||
| 39 | +static struct clockdomain *cpu_clkdm[MAX_CPUS]; | ||
| 40 | |||
| 41 | static atomic_t abort_barrier; | ||
| 42 | -static bool cpu_done[NR_CPUS]; | ||
| 43 | +static bool cpu_done[MAX_CPUS]; | ||
| 44 | static struct idle_statedata *state_ptr = &omap4_idle_data[0]; | ||
| 45 | |||
| 46 | /* Private functions */ | ||
| 47 | -- | ||
| 48 | 1.7.0.4 | ||
| 49 | |||
diff --git a/recipes-kernel/linux/linux-ti-staging/0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch b/recipes-kernel/linux/linux-ti-staging/0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch new file mode 100644 index 00000000..b01c4d0c --- /dev/null +++ b/recipes-kernel/linux/linux-ti-staging/0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 89783143b64210e8f159fd875b23aa9af1fd51b0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 3 | Date: Thu, 13 Feb 2014 08:52:41 -0500 | ||
| 4 | Subject: [PATCH 4/4] Not-for-merge: ARM: config: omap: Disable SMP for AM335x build | ||
| 5 | |||
| 6 | SMP and SMP_ON_UP introduces some extra barriers and code many fast paths | ||
| 7 | including kernel lock functions. | ||
| 8 | |||
| 9 | Performance sensitive usecases like networking gets impacted because of this. | ||
| 10 | In typical production kernel which is targeted for single core device | ||
| 11 | like AM335x family, you don't want to take this hit. | ||
| 12 | |||
| 13 | Ideally one should just create a device specific config feed as done by all | ||
| 14 | typical distro's. Other option is to apply this specifically during build | ||
| 15 | time using recipe. | ||
| 16 | |||
| 17 | Whichever option, one definitely don't want this overhead for performance | ||
| 18 | critical usecases. | ||
| 19 | |||
| 20 | Disabling SMP in the build introduces one warining in cpuidle44xx.c driver | ||
| 21 | and fix is included in the series | ||
| 22 | |||
| 23 | Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 24 | --- | ||
| 25 | arch/arm/configs/omap2plus_defconfig | 2 -- | ||
| 26 | 1 files changed, 0 insertions(+), 2 deletions(-) | ||
| 27 | |||
| 28 | diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig | ||
| 29 | index 3975b08..cfbc2d0 100644 | ||
| 30 | --- a/arch/arm/configs/omap2plus_defconfig | ||
| 31 | +++ b/arch/arm/configs/omap2plus_defconfig | ||
| 32 | @@ -36,8 +36,6 @@ CONFIG_OMAP4_ERRATA_I688=y | ||
| 33 | CONFIG_ARM_THUMBEE=y | ||
| 34 | CONFIG_ARM_ERRATA_411920=y | ||
| 35 | CONFIG_PCIE_DRA7XX=y | ||
| 36 | -CONFIG_SMP=y | ||
| 37 | -CONFIG_NR_CPUS=2 | ||
| 38 | CONFIG_PREEMPT=y | ||
| 39 | CONFIG_CMA=y | ||
| 40 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 41 | -- | ||
| 42 | 1.7.0.4 | ||
| 43 | |||
diff --git a/recipes-kernel/linux/linux-ti-staging_3.12.bb b/recipes-kernel/linux/linux-ti-staging_3.12.bb index 0b4815ed..32cc5c5d 100644 --- a/recipes-kernel/linux/linux-ti-staging_3.12.bb +++ b/recipes-kernel/linux/linux-ti-staging_3.12.bb | |||
| @@ -40,9 +40,18 @@ SRCREV = "d5e4bfd196e114c885c5c42cf0a7b3edc7e54829" | |||
| 40 | PV = "3.12.10" | 40 | PV = "3.12.10" |
| 41 | 41 | ||
| 42 | # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild | 42 | # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild |
| 43 | MACHINE_KERNEL_PR_append = "g+gitr${SRCPV}" | 43 | MACHINE_KERNEL_PR_append = "h+gitr${SRCPV}" |
| 44 | PR = "${MACHINE_KERNEL_PR}" | 44 | PR = "${MACHINE_KERNEL_PR}" |
| 45 | 45 | ||
| 46 | SRC_URI = "git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git;protocol=git;branch=${BRANCH} \ | 46 | SRC_URI = "git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git;protocol=git;branch=${BRANCH} \ |
| 47 | file://defconfig \ | 47 | file://defconfig \ |
| 48 | " | 48 | " |
| 49 | |||
| 50 | # Latest critical fixes | ||
| 51 | SRC_URI += "file://0001-Revert-usb-musb-musb_cppi41-Revert-the-Advisory-1.0..patch \ | ||
| 52 | file://0002-ARM-config-Add-HAVE_ARM_SCU-for-AM43XX.patch \ | ||
| 53 | file://0003-ARM-OMAP-Kill-warning-in-CPUIDLE-code-with-CONFIG_SM.patch \ | ||
| 54 | " | ||
| 55 | |||
| 56 | SRC_URI_append_ti33x = "file://0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch" | ||
| 57 | SRC_URI_append_ti43x = "file://0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch" | ||
