summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denys@ti.com>2014-02-21 11:06:35 -0500
committerDenys Dmytriyenko <denys@ti.com>2014-02-21 11:06:35 -0500
commitb5216d7f9c8b2153f5878c0f1320a32f77e733e5 (patch)
tree7eacc64d6477257062f967a45ced4ea4c1981f01
parent2c86c1957c8aab9231fbcb78772d2c4f2d745739 (diff)
downloadmeta-ti-b5216d7f9c8b2153f5878c0f1320a32f77e733e5.tar.gz
linux-ti-staging: add latest critical fixes locally for now
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-rw-r--r--recipes-kernel/linux/linux-ti-staging/0001-Revert-usb-musb-musb_cppi41-Revert-the-Advisory-1.0..patch158
-rw-r--r--recipes-kernel/linux/linux-ti-staging/0002-ARM-config-Add-HAVE_ARM_SCU-for-AM43XX.patch37
-rw-r--r--recipes-kernel/linux/linux-ti-staging/0003-ARM-OMAP-Kill-warning-in-CPUIDLE-code-with-CONFIG_SM.patch49
-rw-r--r--recipes-kernel/linux/linux-ti-staging/0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch43
-rw-r--r--recipes-kernel/linux/linux-ti-staging_3.12.bb11
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 @@
1From f576e148cd15f10224e4ce13b6773717682f9a5a Mon Sep 17 00:00:00 2001
2From: Chase Maupin <Chase.Maupin@ti.com>
3Date: Fri, 21 Feb 2014 09:05:48 -0600
4Subject: [PATCH 1/4] Revert "usb: musb: musb_cppi41: Revert the Advisory 1.0.13 workaround"
5
6This reverts commit c424ef3e2beb89488e7e597446b4c6bc8f1852c5.
7---
8 drivers/usb/musb/musb_cppi41.c | 96 +++++++++++++++++++++++++++++++++-------
9 1 files changed, 79 insertions(+), 17 deletions(-)
10
11diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
12index 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--
1571.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 @@
1From 5b2aa64ccdeef659a9688730753199ba5b8e60b1 Mon Sep 17 00:00:00 2001
2From: Dave Gerlach <d-gerlach@ti.com>
3Date: Fri, 21 Feb 2014 10:25:33 +0000
4Subject: [PATCH 2/4] ARM: config: Add HAVE_ARM_SCU for AM43XX
5
6CONFIG_HAVE_ARM_SCU only gets selected if CONFIG_SMP is selected in an OMAP
7system however AM43XX needs this option regardless of CONFIG_SMP as it is
8important for controlling power in the SoC. Without this suspend will
9not work as scu_power_mode becomes an empty function.
10
11AM43XX requires SCU CPU Power Status bits for A9 core to be set to off mode
12in order for the MSTANDBY signal to be asserted from the MPU during WFI.
13This signal is used by the PRCM to determine when it is appropriate to
14clock gate the MPU clock domain and also trigger M3_IRQ2 to tell the wkup_m3
15firmware to put the part into the desired sleep more.
16
17Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
18Tested-by: Sekhar Nori <nsekhar@ti.com>
19---
20 arch/arm/mach-omap2/Kconfig | 1 +
21 1 files changed, 1 insertions(+), 0 deletions(-)
22
23diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
24index 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--
361.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 @@
1From 9b76ff20919fa939eed3fdffe05af8bcf1ec1ac5 Mon Sep 17 00:00:00 2001
2From: Santosh Shilimkar <santosh.shilimkar@ti.com>
3Date: Wed, 12 Feb 2014 16:42:39 -0500
4Subject: [PATCH 3/4] ARM: OMAP: Kill warning in CPUIDLE code with !CONFIG_SMP
5
6for non SMP build, NR_CPUS is 1 and hence the code complains with below
7warnings.
8
9arch/arm/mach-omap2/cpuidle44xx.c:207:8: warning: array subscript is above array bounds [-Warray-bounds]
10arch/arm/mach-omap2/cpuidle44xx.c:212:11: warning: array subscript is above array bounds [-Warray-bounds]
11
12Kill it by making array size fixed.
13
14Signed-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
19diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
20index 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--
481.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 @@
1From 89783143b64210e8f159fd875b23aa9af1fd51b0 Mon Sep 17 00:00:00 2001
2From: Santosh Shilimkar <santosh.shilimkar@ti.com>
3Date: Thu, 13 Feb 2014 08:52:41 -0500
4Subject: [PATCH 4/4] Not-for-merge: ARM: config: omap: Disable SMP for AM335x build
5
6SMP and SMP_ON_UP introduces some extra barriers and code many fast paths
7including kernel lock functions.
8
9Performance sensitive usecases like networking gets impacted because of this.
10In typical production kernel which is targeted for single core device
11like AM335x family, you don't want to take this hit.
12
13Ideally one should just create a device specific config feed as done by all
14typical distro's. Other option is to apply this specifically during build
15time using recipe.
16
17Whichever option, one definitely don't want this overhead for performance
18critical usecases.
19
20Disabling SMP in the build introduces one warining in cpuidle44xx.c driver
21and fix is included in the series
22
23Signed-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
28diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
29index 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--
421.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"
40PV = "3.12.10" 40PV = "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
43MACHINE_KERNEL_PR_append = "g+gitr${SRCPV}" 43MACHINE_KERNEL_PR_append = "h+gitr${SRCPV}"
44PR = "${MACHINE_KERNEL_PR}" 44PR = "${MACHINE_KERNEL_PR}"
45 45
46SRC_URI = "git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git;protocol=git;branch=${BRANCH} \ 46SRC_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
51SRC_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
56SRC_URI_append_ti33x = "file://0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch"
57SRC_URI_append_ti43x = "file://0004-Not-for-merge-ARM-config-omap-Disable-SMP-for-AM335x.patch"