linux.git
7 years agoMLK-11356 ARM: imx_v7_defconfig: add sim
Gao Pan [Fri, 7 Aug 2015 07:36:19 +0000 (15:36 +0800)]
MLK-11356 ARM: imx_v7_defconfig: add sim

Enable CONFIG_MXC_SIM to imx_v7_defconfig.

Signed-off-by: Gao Pan <b54642@freescale.com>
7 years agoMLK-11355 driver/mxc: add mxc special driver
Gao Pan [Fri, 7 Aug 2015 07:13:56 +0000 (15:13 +0800)]
MLK-11355 driver/mxc: add mxc special driver

Add mxc in driver/Konfig and driver/Makefile.

Signed-off-by: Gao Pan <b54642@freescale.com>
7 years agoMLK-11354 sim: imx: relapce devm_request_and_ioremap with devm_ioremap_resource
Gao Pan [Fri, 7 Aug 2015 06:41:00 +0000 (14:41 +0800)]
MLK-11354 sim: imx: relapce devm_request_and_ioremap with devm_ioremap_resource

The API devm_request_and_ioremap meets compile error
on branch imx_4.1.y. It is recommend to replace the api
with devm_ioremap_resource.

Signed-off-by: Gao Pan <b54642@freescale.com>
7 years agoMLK-11353 ARM: dts: imx6ul-14x14-evk.dts: add sim1
Gao Pan [Fri, 7 Aug 2015 06:32:26 +0000 (14:32 +0800)]
MLK-11353 ARM: dts: imx6ul-14x14-evk.dts: add sim1

Add dts support for sim1 on imx_4.1.y branch.

Signed-off-by: Gao Pan <b54642@freescale.com>
7 years agoMLK-10600-2: mxc: sim: Add an option to enable SIM driver build.
Luwei Zhou [Wed, 8 Apr 2015 06:44:51 +0000 (14:44 +0800)]
MLK-10600-2: mxc: sim: Add an option to enable SIM driver build.

Add the option to enable SIM driver build.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Gao Pan <b45643@freescale.com>
(cherry picked from 0f7a6fa3c141bfc7333d9056639b7a5b1154ed1d)

7 years agoMLK-10976: mxc: sim: Using timer interrupt to implement precise timing.
Luwei Zhou [Tue, 26 May 2015 08:49:06 +0000 (16:49 +0800)]
MLK-10976: mxc: sim: Using timer interrupt to implement precise timing.

The EMV4.3 has strict requirement about the reset sequence. The old code use the mdelay, udelay to
achievet, which is not precise enough. Replace it with the timer interrupt. The EMV4.3 requires
40000~45000 clock cycles duration when reset is low.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from a006fe283c8b97f0a711cb0829bfbdaaf4a5f31f)

7 years agoMLK-10968: mxc: sim: Add the init delay detection function in the driver.
Luwei Zhou [Mon, 25 May 2015 07:16:34 +0000 (15:16 +0800)]
MLK-10968: mxc: sim: Add the init delay detection function in the driver.

In EMV4.3 after warm/cold reset, there would be a receiving window. The receiving
window would be 42000 clock length.If the receiving window expires without receiving
one byte, IFD need to take actions as EMV4.3 spec. The driver need to support this
to identify the sequence of the receiving window expiring event and the receiving event.
Since theinterrupt latency in linux OS is not certain, we need to tune this setting to
pass the cases. Current tuning parameter can work.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from faf1d8d881a6ad2c6b88fdf312cef142996937c1)

7 years agoMLK-10959: mxc: sim: Disable cwt timer when tx and enable in rx.
Luwei Zhou [Thu, 21 May 2015 08:56:22 +0000 (16:56 +0800)]
MLK-10959: mxc: sim: Disable cwt timer when tx and enable in rx.

The CWT timer is used to detect the the character interval in the data traffic.
When tx, SIM IP can guarantee the interval based our setting. When RX, we need
to enalbe the CWT timer to check whether the interval is in the range. This patch
fix this.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 9c92dfd070e7427eb1e0166f368b89b4a7ac1bff)

7 years agoMLK-10913-1: mxc: sim: Add the SIM driver support for i.MX6UL-EVK platform.
Luwei Zhou [Mon, 18 May 2015 06:16:26 +0000 (14:16 +0800)]
MLK-10913-1: mxc: sim: Add the SIM driver support for i.MX6UL-EVK platform.

Modify the driver to support the SIM on i.MX6UL-EVK platform. The main modification is:
1. Add port index to support different port on platform.
2. Add POS-CARD support. The POS card has external IC to assert when SVEN to low. Add support.
3. Using a function to calculate the strict timing delay.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 17d1315b0704e2db63ee6bd7aaefa0c796f53104)

7 years agoMLK-10600-1: mxc: sim: Add SIM IP driver support on the i.MX7d-12x12-arm2 platform.
Luwei Zhou [Wed, 8 Apr 2015 06:05:52 +0000 (14:05 +0800)]
MLK-10600-1: mxc: sim: Add SIM IP driver support on the i.MX7d-12x12-arm2 platform.

This driver is based on the current code which runs the the EMV test on the i.MX258 platform.
Since there are still many cases that can't pass on the i.MX258 and i.MX7d platform. The
driver will need to be improved after per-test work. Just check in as a base code. There
would be definitly some timing improvement work to do in the future.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 3ac1ad5b2a68ecb052ccacca4ac7459ead04415e)

7 years agoMLK-11357-2 ARM: imx: add cpuidle support for imx7d
Anson Huang [Wed, 12 Aug 2015 06:18:37 +0000 (14:18 +0800)]
MLK-11357-2 ARM: imx: add cpuidle support for imx7d

Enable cpuidle for i.MX7D, total 3 level idle supported:

1. ARM WFI;
2. WAIT mode;
3. Low power idle with ARM/SCU platform power off.

Only when system in low bus freq mode, system is able to
enter low power idle, and only when both of 2 cores are
in low power idle, ARM/SCU platform will be powered off.

DDR will be put into low power mode when low power idle
is entered.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11357-1 ARM: dts: imx7d: debug uart clk better to be from OSC
Anson Huang [Fri, 14 Aug 2015 03:09:38 +0000 (11:09 +0800)]
MLK-11357-1 ARM: dts: imx7d: debug uart clk better to be from OSC

To achieve low power, debug uart clk should be from OSC, so that
it does NOT need to keep PLL on, especially for low power idle
case.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11344-11: spi: spi-imx: enable dma support for i.mx6dl
Robin Gong [Thu, 13 Aug 2015 08:39:06 +0000 (16:39 +0800)]
MLK-11344-11: spi: spi-imx: enable dma support for i.mx6dl

There is official workaound for TKT238285, so remove the limitation
for i.mx6dl.

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-11344-10: ARM: dts: imx7d-12x12-lpddr3-arm2-ecspi: add ecspi support
Robin Gong [Thu, 13 Aug 2015 08:14:42 +0000 (16:14 +0800)]
MLK-11344-10: ARM: dts: imx7d-12x12-lpddr3-arm2-ecspi: add ecspi support

Enable ecspi dtb for imx7d-12x12-lpddr3-arm2 board.

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-9986-5 spi: spi-imx: decrease tx fifo wartermark level
Robin Gong [Thu, 18 Dec 2014 04:51:28 +0000 (12:51 +0800)]
MLK-9986-5 spi: spi-imx: decrease tx fifo wartermark level

We set both wartermark of txfifo and rxfifo 32 as half of fifo length 64.
That will cause easy rxfifo overflow:
If there is 31 bytes in rxfifo, rx script will wait the next dma request
(the 32th data come into the rxfifo) and schedule out to tx script. Once
tx script start to run, the rx script need to wait tx script finish even
if its priority higher than tx. Meanwhile, spi slave device may input
data continous, plus the rx data which triggered by new tx script(32 bytes).
That will quickly consume whole 64 bytes fifo, so we keep 16bytes availbale
even in the worst case new tx script triggered during two rx transfer. That
may slow down tx slightly, but better than overflow and RX DMA timeout.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 16043ad0ad96aa04a90614e473aa17980af4b8af)
(cherry picked from commit 819efee83b7b1f47685dca6fad6bbe17f1c42092)
(cherry picked from commit 5c4c7d05bbba0ea2b26ef2f3ae83119d5eada235)

7 years agoMLK-11248: dmaengine: imx-sdma: add new api for sync with dma and substream
Shengjiu Wang [Mon, 13 Jul 2015 11:19:15 +0000 (19:19 +0800)]
MLK-11248: dmaengine: imx-sdma: add new api for sync with dma and substream

There is occasion that dma callback come late after the substream is released.
Then there will be kernel dump.

[<805866b0>] (imx_pcm_dma_complete) from [<802fad9c>] (sdma_handle_channel_loop.isra.25+0x48/0x54)
[<802fad9c>] (sdma_handle_channel_loop.isra.25) from [<802fae48>] (sdma_tasklet+0xa0/0x1d4)
[<802fae48>] (sdma_tasklet) from [<800356e0>] (tasklet_action+0x64/0xf8)
[<800356e0>] (tasklet_action) from [<80034ea0>] (__do_softirq+0x104/0x218)
[<80034ea0>] (__do_softirq) from [<80035220>] (irq_exit+0xa8/0xec)
[<80035220>] (irq_exit) from [<8000ed44>] (handle_IRQ+0x3c/0x90)
[<8000ed44>] (handle_IRQ) from [<80008578>] (gic_handle_irq+0x28/0x5c)
[<80008578>] (gic_handle_irq) from [<80012100>] (__irq_svc+0x40/0x70)

The reason is the sdma tasklet is async with audio substream release. ALSA
think when terminate dma, the dma should be stopped and no callback be called.

This patch is to add new api dma_sync_wait_tasklet(), which is called in
snd_dmaengine_pcm_close(). It will make sure the callback not be called
after this funtion. Tasklet_kill is to wait scheduled tasklet end.

Tasklet_kill can't be added to terminate dma function, because terminate dma
function may be called in interrupt, but tasklet_kill can't be called in
interrupt context.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 9815881b6acaa72a705e1fa3c26a852fc81bfce5)

7 years agoMLK-11259-1: dmaengine: imx-sdma: support dual fifo for DEV_TO_DEV
Shengjiu Wang [Fri, 17 Jul 2015 05:52:37 +0000 (13:52 +0800)]
MLK-11259-1: dmaengine: imx-sdma: support dual fifo for DEV_TO_DEV

As SSI has dual fifo, add src_dualfifo and dst_dualfifo in imx_dma_data
to support dual fifo in DMA_DEV_TO_DEV.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit cfde1308f170166a0099ca39ee8733895f9626f0)

7 years agoMLK-11122: dma: imx-sdma: use late system sleep pm ops
Robin Gong [Thu, 18 Jun 2015 01:40:58 +0000 (09:40 +0800)]
MLK-11122: dma: imx-sdma: use late system sleep pm ops

Use SET_LATE_SYSTEM_SLEEP_PM_OPS rather than the common sleep pm ops to ensure
sdma has resumed back before all other module drivers which use sdma resume
back.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit a7f8725509b494c3073b1bcca63252d5c61bb80d)

7 years agoMLK-10450: dma: imx-sdma: enable Mega/Fast support for i.mx7d
Robin Gong [Fri, 20 Mar 2015 07:05:55 +0000 (15:05 +0800)]
MLK-10450: dma: imx-sdma: enable Mega/Fast support for i.mx7d

Enable Mega/Fast support for i.mx7d. Need save and restore SDMA registers.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 4e1ea64c5d360ebc4f8168c1fcdee314b547bd13)

7 years agoMLK-10405 dma: imx-sdma: fix uart6 rx not working
Robin Gong [Wed, 11 Mar 2015 07:39:11 +0000 (15:39 +0800)]
MLK-10405 dma: imx-sdma: fix uart6 rx not working

The SDMA driver not consider the case of event_id0 is 0. That make uart6 rx
not working.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit dbcacbcb3a885d7569e9e415035b1dd06c4a117b)
(cherry picked from commit 6dfdbe41a7d6ab7e6fae5d6fb4d73435839beff3)

7 years agoMLK-9986-4 dma: imx-sdma: add new ecspi tx script
Robin Gong [Thu, 18 Dec 2014 04:41:16 +0000 (12:41 +0800)]
MLK-9986-4 dma: imx-sdma: add new ecspi tx script

Current ecspi rom script didn't take care of rxfifo overflow risk. Add new
ecspi tx script to check the rxfifo status, if it is near to full(>=48 bytes),
do not copy data to txfifo which will trigger data push into rxfifo. Because
rx script may not read rxfifo in time, we have to consider it.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 17f472aa698aba0af5da4566df447e23306f4289)
(cherry picked from commit 90c929d7d1a3f8e196641b5ed7a33d2ee03bd63c)
(cherry picked from commit 6d76bdcf2097e4198217edf27363cf6ba2e6542a)

7 years agoMLK-11344-8: dma: imx-sdma: support sdma restore from mega/fast power down status
Robin Gong [Tue, 6 May 2014 07:18:26 +0000 (15:18 +0800)]
MLK-11344-8: dma: imx-sdma: support sdma restore from mega/fast power down status

cherry-pick below patch from v3.14.y:
 ENGR00319473: dma: imx-sdma: support sdma restore from
 mega/fast power down status

Support sdma suspend and resume interface to restore from mega/fast power down.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 682fd1f47ab9cb69382fa0e8d20a830ae99c26fc)
(cherry picked from commit dd17fa18b9a0c11f8bce3b87f792775d96e461c1)

7 years agoMLK-10050 dma: imx-sdma: add support for sdma memory copy
Robin Gong [Tue, 23 Dec 2014 05:39:23 +0000 (13:39 +0800)]
MLK-10050 dma: imx-sdma: add support for sdma memory copy

This patch is just created by so many confilict while cherry-pick
from v3.10 a6a6cf911f85a3a09f763195478d422c571b9565.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit c070364148de0331152700850f5cb5577dbb504e)

7 years agoMLK-11344-7: dma: imx-sdma: Add hdmi audio support in sdma
Shengjiu Wang [Fri, 5 Sep 2014 10:51:36 +0000 (18:51 +0800)]
MLK-11344-7: dma: imx-sdma: Add hdmi audio support in sdma

cherry-pick below patch from v3.14.y:
ENGR00329948-3: dma: imx-sdma: Add hdmi audio support
 in sdma

There's a missing script for hdmi audio support in current sdma driver,
thus add it.

This HDMI script doesn't use bd to copy memory like a normal one does
but only to update the memory address for HDMI internal AHB DMA and
then trigger its procedure automatically.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit dafddac916a03ae4477e2de7c1b7ad291f956f68)

7 years agoMLK-11344-6: dma: imx-sdma: allocate memory from iram
Nicolin Chen [Tue, 5 Nov 2013 11:19:07 +0000 (19:19 +0800)]
MLK-11344-6: dma: imx-sdma: allocate memory from iram

ENGR00286273-1 dma: imx-sdma: allocate memory from iram

We try to allocate memory from SoC internal SRAM so that we can turn off
voltage of external DDR to save power. Surely, if we failed to get the
iram DT node or allocate memory due to no enough SRAM space, we would
allow SDMA driver to allocate memory in a traditional way.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit f6924fbdb90d1f01266fc018caff953457e04d34)
(cherry picked from commit 7b643e5c9119ac43b937816fd1b785d2b859b05f)

7 years agoMLK-9768: dma: imx-sdma: fix UART loopback random failed
Robin Gong [Mon, 8 Dec 2014 09:30:40 +0000 (17:30 +0800)]
MLK-9768: dma: imx-sdma: fix UART loopback random failed

For UART, we need use old chn_real_count to know the real rx count even in
cylic dma mode, because UART driver use cyclic mode to increase performance
without any data loss.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 398cee2ad110c4f183e553af0564fbdcbe8548cb)

7 years agoMLK-11344-5: dmaengine: imx: fix loop mode issue
Fugang Duan [Fri, 10 Oct 2014 07:31:11 +0000 (15:31 +0800)]
MLK-11344-5: dmaengine: imx: fix loop mode issue

cherry-pick below patch from v3.14.y:

ENGR00329822-01 dmaengine: imx: fix loop mode issue

Fix loop mode issue that calling dmaengine_tx_status() can get
right state.residue value.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 37e17f10b35c34317def08704e4b4edf5aa23894)
(cherry picked from commit 00cc7021317ac6efb460eb1b9bc3bd8aa6ad73c2)

7 years agoMLK-11344-3: platform_data: dma-imx-sdma: add new scripts
Robin Gong [Tue, 11 Aug 2015 07:57:11 +0000 (15:57 +0800)]
MLK-11344-3: platform_data: dma-imx-sdma: add new scripts

Add new ecspi and qspi script.

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-11344-2: firmware: imx: sdma: add sdma firmware for i.mx6 and i.mx7d
Robin Gong [Tue, 11 Aug 2015 07:55:00 +0000 (15:55 +0800)]
MLK-11344-2: firmware: imx: sdma: add sdma firmware for i.mx6 and i.mx7d

add sdma firmware for i.mx6 and i.mx7d

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-11344-1: ARM: dts: imx7d-12x12-lpddr3-arm2: correct "cpu0" node
Robin Gong [Tue, 11 Aug 2015 06:37:00 +0000 (14:37 +0800)]
MLK-11344-1: ARM: dts: imx7d-12x12-lpddr3-arm2: correct "cpu0" node

Correct "cpu0" node in alphabetical sequence.

Signed-off-by: Robin Gong <b38343@freescale.com>
7 years agoMLK-10461: arm: imx7: set the PFD override bit before system entering low power mode
Bai Ping [Wed, 25 Mar 2015 10:14:40 +0000 (18:14 +0800)]
MLK-10461: arm: imx7: set the PFD override bit before system entering low power mode

the PFD override bit must be set before system entering any low power mode.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11349-4 ARM: imx: need to make sure GPT1 clk root enabled
Anson Huang [Thu, 13 Aug 2015 09:57:03 +0000 (17:57 +0800)]
MLK-11349-4 ARM: imx: need to make sure GPT1 clk root enabled

GPT1 clk root must be enabled, as GPT1 is system's clk
source.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11349-3 ARM: imx: update clk driver for imx7d
Anson Huang [Thu, 13 Aug 2015 06:35:32 +0000 (14:35 +0800)]
MLK-11349-3 ARM: imx: update clk driver for imx7d

This patch updates all clk driver from L3.14.y, as
cherry-pick all clk related patch needs to handle
about 40 patches conflicts, so just copy it from
L3.14.y as it is an independent driver, for commit
log, please refer to L3.14.y.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoclk: imx6: Fix procedure to switch the parent of LDB_DI_CLK
Fabio Estevam [Tue, 18 Oct 2016 00:29:14 +0000 (22:29 -0200)]
clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK

Due to incorrect placement of the clock gate cell in the ldb_di[x]_clk
tree, the glitchy parent mux of ldb_di[x]_clk can cause a glitch to
enter the ldb_di_ipu_div divider. If the divider gets locked up, no
ldb_di[x]_clk is generated, and the LVDS display will hang when the
ipu_di_clk is sourced from ldb_di_clk.

To fix the problem, both the new and current parent of the ldb_di_clk
should be disabled before the switch. This patch ensures that correct
steps are followed when ldb_di_clk parent is switched in the beginning
of boot. The glitchy muxes are then registered as read-only. The clock
parent can be selected using the assigned-clocks and
assigned-clock-parents properties of the ccm device tree node:

        &clks {
                assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
                                  <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
                assigned-clock-parents = <&clks IMX6QDL_CLK_MMDC_CH1_AXI>,
                                         <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>;
        };

The issue is explained in detail in EB821 ("LDB Clock Switch Procedure &
i.MX6 Asynchronous Clock Switching Guidelines") [1].

[1] http://www.nxp.com/files/32bit/doc/eng_bulletin/EB821.pdf

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Akshay Bhat <akshay.bhat@timesys.com>
Tested-by Joshua Clayton <stillcompiling@gmail.com>
Tested-by: Charles Kang <Charles.Kang@advantech.com.tw>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
7 years agoclk: imx6: Make the LDB_DI0 and LDB_DI1 clocks read-only
Philipp Zabel [Tue, 18 Oct 2016 00:29:13 +0000 (22:29 -0200)]
clk: imx6: Make the LDB_DI0 and LDB_DI1 clocks read-only

Due to incorrect placement of the clock gate cell in the ldb_di[x]_clk
tree, the glitchy parent mux of ldb_di[x]_clk can cause a glitch to
enter the ldb_di_ipu_div divider. If the divider gets locked up, no
ldb_di[x]_clk is generated, and the LVDS display will hang when the
ipu_di_clk is sourced from ldb_di_clk.

To fix the problem, both the new and current parent of the ldb_di_clk
should be disabled before the switch. As this can not be guaranteed by
the clock framework during runtime, make the ldb_di[x]_sel muxes read-only.
A workaround to set the muxes once during boot could be added to the
kernel or bootloader.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
7 years agoclk: imx6: Mask mmdc_ch1 handshake for periph2_sel and mmdc_ch1_axi_podf
Philipp Zabel [Tue, 18 Oct 2016 00:29:12 +0000 (22:29 -0200)]
clk: imx6: Mask mmdc_ch1 handshake for periph2_sel and mmdc_ch1_axi_podf

MMDC CH1 is not used on i.MX6Q, so the handshake needed to change the
parent of periph2_sel or the divider of mmdc_ch1_axi_podf will never
succeed.
Disable the handshake mechanism to allow changing the frequency of
mmdc_ch1_axi, allowing to use it as a possible source for the LDB DI
clock.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
7 years agoMLK-11349-2 ARM: dts: disable apbh dma on imx7d
Anson Huang [Thu, 13 Aug 2015 06:35:18 +0000 (14:35 +0800)]
MLK-11349-2 ARM: dts: disable apbh dma on imx7d

APBH DMA needs NAND clk to be enabled, its driver
does NOT handle this clk very well, so kernel
will boot up fail without NAND clk enabled, so
disable APBH DMA by default.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11349-1 ARM: imx: add busfreq support for imx7d lpddr3 board
Anson Huang [Wed, 12 Aug 2015 05:41:51 +0000 (13:41 +0800)]
MLK-11349-1 ARM: imx: add busfreq support for imx7d lpddr3 board

This patch adds busfreq support for i.MX7D 12x12-lpddr3-arm2
board, the busfreq setpoint definition is same as imx7d-sdb
board.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11352-3 media: pxp-v4l2-output: porting the driver to imx_4.1.y
Fancy Fang [Wed, 12 Aug 2015 08:23:03 +0000 (16:23 +0800)]
MLK-11352-3 media: pxp-v4l2-output: porting the driver to imx_4.1.y

Porting the pxp-v4l2 output driver to imx_4.1.y branch.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11352-2 ARM: dts: imx7d-sdb: add dts support for pxp-v4l2-output
Fancy Fang [Wed, 12 Aug 2015 08:21:01 +0000 (16:21 +0800)]
MLK-11352-2 ARM: dts: imx7d-sdb: add dts support for pxp-v4l2-output

Add dts support for pxp-v4l2-output module for
imx7d-sdb board.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11352-1 ARM: dts: imx7d-12x12-lpddr3: add dts support for pxp-v4l2-output
Fancy Fang [Wed, 12 Aug 2015 08:20:42 +0000 (16:20 +0800)]
MLK-11352-1 ARM: dts: imx7d-12x12-lpddr3: add dts support for pxp-v4l2-output

Add dts support for pxp-v4l2-output module for
imx7d-12x12-lpddr3 board.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11350 ARM: dts: imx7d/imx6ul: fix sd card gpio polarity specified in device tree
Haibo Chen [Wed, 12 Aug 2015 07:02:28 +0000 (15:02 +0800)]
MLK-11350 ARM: dts: imx7d/imx6ul: fix sd card gpio polarity specified in device tree

cd-gpios polarity should be changed to GPIO_ACTIVE_LOW and wp-gpios
should be changed to GPIO_ACTIVE_HIGH.
Otherwise, the SD may not work properly due to wrong polarity inversion
specified in DT after switch to common parsing function mmc_of_parse().

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
7 years agoMLK-9786 net: fec: Add busfreq support to the driver
Fugang Duan [Tue, 4 Nov 2014 05:23:34 +0000 (13:23 +0800)]
MLK-9786 net: fec: Add busfreq support to the driver

Add request_bus_freq() and release_bus_freq() calls to the
various drivers to ensure that the DDR and AHB are the requested
frequency before the driver starts its task.

Signed-off-by: Fugang Duan <B38611@freescale.com>
7 years agoMLK-10699 ARM: imx: correct ahb clk parent select
Anson Huang [Mon, 20 Apr 2015 03:25:54 +0000 (11:25 +0800)]
MLK-10699 ARM: imx: correct ahb clk parent select

Design team change the ahb's clk parent options but
did NOT update the DOC accordingly in time, so the
AHB/IPG's clk rate in clk tree is incorrect, AHB is
67.5MHz and IPG is 33.75MHz, but using scope to
monitor them, they are actually 135MHz and 67.5MHz,
update the clk parent option to make clk tree info
correct.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-11338-2 ARM: imx: add busfreq support for imx7d sdb board
Anson Huang [Mon, 10 Aug 2015 05:42:57 +0000 (13:42 +0800)]
MLK-11338-2 ARM: imx: add busfreq support for imx7d sdb board

This patch adds busfreq support for i.MX7D SDB
board with DDR3 memory, 3 setpoints supported:

HIGH: DRAM CLK = 533MHz, AXI = 332MHz, AHB = 135MHz;
AUDIO: DRAM CLK = 100MHz; AXI = 24MHz, AHB = 24MHz;
LOW: DRAM CLK = 24MHz; AXI = 24MHz, AHB = 24MHz;

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agoMLK-10500: arm: imx: clk-pllv3: fix AV pll num denom offsets
Adrian Alonso [Mon, 30 Mar 2015 21:11:53 +0000 (16:11 -0500)]
MLK-10500: arm: imx: clk-pllv3: fix AV pll num denom offsets

* Fix PLL Audio/Video Numerator/Denominator register offsets
* In imx7d pll register CCM_ANALOG_PLL_VIDEO_NUM and
  CCM_ANALOG_PLL_VIDEO_DENOM offset is different with imx6.
  For imx7D the correct setting should be:
  PLL_NUM_OFFSET         0x20
  PLL_DENOM_OFFSET       0x30
* Add additional macros to handle imx7d audio/video
  pll num/demom offset settings.

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
[Octavian: use IMX_PLLV3_AV_IMX7 instead of cpu_is_imx7d()]
Signed-off-by: Octavian Purdila <octavian.purdila@nxp.com>
7 years agoMLK-10547-2 ARM: imx: correct dram pll type
Anson Huang [Thu, 2 Apr 2015 02:51:55 +0000 (10:51 +0800)]
MLK-10547-2 ARM: imx: correct dram pll type

DRAM PLL is a audio/video type PLL, need to correct
it to get correct ops of PLL.

There is a test_div placed before DRAM PLL's gate, so
add this test div clk.

Signed-off-by: Anson Huang <b20788@freescale.com>
7 years agommc: block: don't use parameter prefix if built as module
Andy Shevchenko [Wed, 24 Jun 2015 11:32:21 +0000 (14:32 +0300)]
mmc: block: don't use parameter prefix if built as module

It's excessive to use prefix for the parameters when you do
modprobe mmc-block mmcblk.perdev_minors=16

Make this available only for built-in case.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 5b67cd9c5ee0722022cba7d20552320325457434)

7 years agoMLK-11340-43 usb: chipidea: imx: fix usb charger detection init NULL pointer
Li Jun [Tue, 11 Aug 2015 07:52:10 +0000 (15:52 +0800)]
MLK-11340-43 usb: chipidea: imx: fix usb charger detection init NULL pointer

Dereference the charger->psy after the power_supply is created to fix the
null pointer issue.

Signed-off-by: Li Jun <b47624@freescale.com>
7 years agoMLK-11345 ARM: dts: imx7d-12x12-lpddr3-arm2: correct lcdif pinctrl settings
Fancy Fang [Tue, 11 Aug 2015 07:16:00 +0000 (15:16 +0800)]
MLK-11345 ARM: dts: imx7d-12x12-lpddr3-arm2: correct lcdif pinctrl settings

Correct the lcdif pinctrl settings to make it work
correctly.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
7 years agoMLK-11342 cpufreq: imx: remove a duplicated pm notify
Bai Ping [Tue, 11 Aug 2015 10:48:03 +0000 (18:48 +0800)]
MLK-11342 cpufreq: imx:  remove a duplicated pm notify

remove a duplicated pm notify.

Signed-off-by: Bai Ping <b51503@freescale.com>
7 years agoMLK-11272 usb: chipidea: otg: data pulse detection work around for imx7d
Li Jun [Wed, 22 Jul 2015 05:59:50 +0000 (13:59 +0800)]
MLK-11272 usb: chipidea: otg: data pulse detection work around for imx7d

i.MX7D has a silicon issue on full speed termination after A device ends
a session, which causes it can not detect data pulse from B device if
A device isn't in low power mode, this patch work around it by override
Termsel bit to be 1 for FS mode termination. After A device detects data
pulse or turns on vbus, this override will be cleared and disabled.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 1ec37968c892efbb1925784446a75d35e8bda228)

7 years agoMLK-11319-5 usb: chipidea: usbmisc_imx: add imx7d usb charger detection support
Li Jun [Mon, 10 Aug 2015 08:35:08 +0000 (16:35 +0800)]
MLK-11319-5 usb: chipidea: usbmisc_imx: add imx7d usb charger detection support

Adds imx7d usb charger detection support.

Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-11123-31 ARM: dts: disable otg features for imx7d-sdb board
Li Jun [Fri, 3 Jul 2015 06:14:00 +0000 (14:14 +0800)]
MLK-11123-31 ARM: dts: disable otg features for imx7d-sdb board

Disable all otg features for otg1 port of imx7d-sdb board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 3c59511b7eac99da8c9bd373b82ddcbf61d1ef8a)

7 years agoMLK-11123-30 ARM: dts: disable otg features for imx7d-12x12-lpddr3-arm2 board
Li Jun [Fri, 3 Jul 2015 06:13:30 +0000 (14:13 +0800)]
MLK-11123-30 ARM: dts: disable otg features for imx7d-12x12-lpddr3-arm2 board

Disable all otg features for otg1 port of imx7d-12x12-lpddr3-arm2 board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 8d19fb5979522032cf4d96909d609aceac0dde85)

7 years agoMLK-11123-28 ARM: dts: disable otg features for imx6sx-sdb board
Li Jun [Fri, 3 Jul 2015 06:12:25 +0000 (14:12 +0800)]
MLK-11123-28 ARM: dts: disable otg features for imx6sx-sdb board

Disable all otg features for otg1 port of imx6sx-sdb board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit e8d32c2cc5daab7e22f6190a02c88981aa14df7e)

7 years agoMLK-11123-27 ARM: dts: add usb support for for imx6sx-sabreauto board
Li Jun [Fri, 3 Jul 2015 06:11:53 +0000 (14:11 +0800)]
MLK-11123-27 ARM: dts: add usb support for for imx6sx-sabreauto board

Add usb otg1 and otg2 port for imx6sx-sabreauto board, and disable all otg
features for otg1 port of imx6sx-sabreauto board, then the otg port can only
do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-11123-24 ARM: dts: disable otg features for imx6sl-evk board
Li Jun [Fri, 3 Jul 2015 06:09:48 +0000 (14:09 +0800)]
MLK-11123-24 ARM: dts: disable otg features for imx6sl-evk board

Disable all otg features for otg1 port of imx6sl-evk board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 855c996b52317760e114e7884810a0b438b6e3ee)

7 years agoMLK-11123-23 ARM: dts: disable otg features for imx6qdl-sabresd board
Li Jun [Fri, 3 Jul 2015 06:09:08 +0000 (14:09 +0800)]
MLK-11123-23 ARM: dts: disable otg features for imx6qdl-sabresd board

Disable all otg features for otg1 port of imx6qdl-sabresd board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 71ed636ea10843cc2aac46711adf2350a34fa7b0)

7 years agoMLK-11123-22 ARM: dts: disable otg features for imx6qdl-sabreauto board
Li Jun [Fri, 3 Jul 2015 06:08:21 +0000 (14:08 +0800)]
MLK-11123-22 ARM: dts: disable otg features for imx6qdl-sabreauto board

Disable all otg features for otg1 port of imx6qdl-sabreauto board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit b4082a9456f735b664fd125e2e6964963ac9c8d0)

7 years agoMLK-11123-21 ARM: dts: disable otg features for imx6qdl-sabrelite board
Li Jun [Mon, 10 Aug 2015 07:35:45 +0000 (15:35 +0800)]
MLK-11123-21 ARM: dts: disable otg features for imx6qdl-sabrelite board

Disable all otg features for otg1 port of imx6q-sabrelite board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
7 years agoMLK-11123-20 ARM: dts: disable otg features for imx6q-arm2 board
Li Jun [Fri, 3 Jul 2015 06:03:53 +0000 (14:03 +0800)]
MLK-11123-20 ARM: dts: disable otg features for imx6q-arm2 board

Disable all otg features for otg1 port of imx6q-arm2 board, then
the otg port can only do role swtich by ID pin state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 70c4fe93ac7064f5128ae2275b766fb00c4cd6ef)

7 years agoMLK-11269-2 usb: chipidea: host: avoid check PORT_SUSPEND wrongly
Peter Chen [Tue, 21 Jul 2015 06:41:59 +0000 (14:41 +0800)]
MLK-11269-2 usb: chipidea: host: avoid check PORT_SUSPEND wrongly

At some situations, the ehci_bus_suspend may not set PORT_SUSPEND
due to port is not enabled, so add flag ehci->bus_suspended to
check if ehci_bus_suspend set PORT_SUSPEND or not.

We see "ci_hdrc ci_hdrc.0: timeout waiting for SUSPEND" wrongly when
plug in an unsupported usb device, in that case, the PORT_PE is cleared
and bus_suspend is called.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 82cfe6c31ee55e5aab1a057a5aaf853b7bb6cd07)
(cherry picked from commit a4fe7e55e84944962d6a7be7bd404865d376811e)

7 years agoMLK-11269-1 ARM: imx_v7_defconfig: update USB certification configurations
Peter Chen [Tue, 21 Jul 2015 05:32:23 +0000 (13:32 +0800)]
MLK-11269-1 ARM: imx_v7_defconfig: update USB certification configurations

- Add CONFIG_USB_OTG_WHITELIST and CONFIG_USB_HCD_TEST_MODE
- Change CONFIG_USB_EHSET_TEST_FIXTURE from 'm' to 'y'

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 40f0d728339fb460a108bc8b133207dd5a17dda8)
(cherry picked from commit d6d4e687fb65cddf3343806424e51e9fdc31c140)

7 years agoMLK-11183-2 usb: chipidea: otg: disable otg interrupt before flush_workqueue
Peter Chen [Thu, 2 Jul 2015 01:41:04 +0000 (09:41 +0800)]
MLK-11183-2 usb: chipidea: otg: disable otg interrupt before flush_workqueue

We do not want (care) the interrupt during we remove the otg function,
so move it beforehand.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 9ae22c687fd161dfff2e81512b50143fa154b9bb)

7 years agoMLK-11183-1 usb: chipidea: host: fix NULL pointer problem for fast load/unload module
Peter Chen [Thu, 2 Jul 2015 01:41:03 +0000 (09:41 +0800)]
MLK-11183-1 usb: chipidea: host: fix NULL pointer problem for fast load/unload module

The interrupt may occur (due to remove process may block interrupt)
after we remove hcd, in that case, we should not call hcd's interrupt
handler, otherwise, below NULL pointer dereference will occur, the reason
for this is we call free_irq later than hcd's. So after hcd has been
removed, we should not call hcd interrupt handler.

ci_hdrc ci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1
ci_hdrc ci_hdrc.0: USB bus 1 deregistered
[<800691e8>] (handle_irq_event) from [<8006c02c>] (handle_fasteoi_irq+0x84/0x14c)
[<8006c02c>] (handle_fasteoi_irq) from [<800687f4>] (generic_handle_irq+0x2c/0x3c)
[<800687f4>] (generic_handle_irq) from [<8000ed4c>] (handle_IRQ+0x40/0x90)
[<8000ed4c>] (handle_IRQ) from [<8000856c>] (gic_handle_irq+0x2c/0x5c)
[<8000856c>] (gic_handle_irq) from [<80012240>] (__irq_svc+0x40/0x70)
Exception stack(0x80db1f18 to 0x80db1f60)
1f00: 80db1f60 3b9aca00
1f20: 06f86934 0000000d 80dbe1c8 80dbe1c8 ee71e0d0 00000000 06f5bb01 0000000d
1f40: 80db0000 00000000 00000017 80db1f60 00000009 8049c19c 000d0013 ffffffff
[<80012240>] (__irq_svc) from [<8049c19c>] (cpuidle_enter_state+0x54/0xe4)
[<8049c19c>] (cpuidle_enter_state) from [<8049c2e0>] (cpuidle_idle_call+0xb4/0x14c)
[<8049c2e0>] (cpuidle_idle_call) from [<8000f07c>] (arch_cpu_idle+0x8/0x44)
[<8000f07c>] (arch_cpu_idle) from [<8006876c>] (cpu_startup_entry+0x100/0x14c)
[<8006876c>] (cpu_startup_entry) from [<80d52b10>] (start_kernel+0x350/0x35c)
--[ end trace 1160f590a7b228b3 ]--
Unable to handle kernel NULL pointer dereference at virtual address 000000b0
pgd = 80004000
[000000b0] *pgd=00000000
Internal error: Oops: 17 1 PREEMPT SMP ARM
Modules linked in: ci_hdrc_imx usbmisc_imx ci_hdrc udc_core ehci_hcd phy_mxs_usb mxc_v4l2_capture ipu_bg_overlay_sdc ipu_still ipu_prp_enc adv7180_tvin ipu_csi_enc v4l2_int_device ipu_fg_overlay_sdc mxc_mlb mxc_dcic evbug [last unloaded: phy_mxs_usb]
CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 3.14.38-usb-host-otg-02047-ga4dec77 #13
task: 80dbbae8 ti: 80db0000 task.ti: 80db0000
PC is at usb_hcd_irq+0x4/0x38
LR is at handle_irq_event_percpu+0x50/0x180
pc : [<8040eed8>] lr : [<8006907c>] psr: a00d0193
sp : 80db1e98 ip : fffffffa fp : 00000000
r10: 80e1f13f r9 : d8009900 r8 : 0000004b
r7 : 00000000 r6 : 00000000 r5 : d800995c r4 : d8f2dec0
r3 : d2234010 r2 : d2234010 r1 : 00000000 r0 : 0000004b
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
Control: 10c53c7d Table: 6920004a DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0x80db0238)
Stack: (0x80db1e98 to 0x80db2000)
1e80: d2234010 8006907c
1ea0: 0000004b ee71da00 d8009900 d800995c d8f2dec0 f4a00100 06f5bb01 0000000d
1ec0: 80db0000 800691e8 d8009900 d800995c 00000000 8006c02c 8006bfa8 0000004b
1ee0: 0000004b 800687f4 80dace54 8000ed4c f4a0010c 80db8970 80db1f18 8000856c
1f00: 00000009 8049c19c 000d0013 ffffffff 80db1f4c 80012240 80db1f60 3b9aca00
1f20: 06f86934 0000000d 80dbe1c8 80dbe1c8 ee71e0d0 00000000 06f5bb01 0000000d
1f40: 80db0000 00000000 00000017 80db1f60 00000009 8049c19c 000d0013 ffffffff
1f60: 06f86934 0000000d 80dc4a54 ee71e0d0 80db8574 ee71e0d0 00000000 00000000
1f80: 00000000 80e797f8 80dbe1c8 8049c2e0 00000000 80db0000 80db8574 806fe48c
1fa0: 80db0038 80e1f13d 80e1f13d 8000f07c 00000000 8006876c ffffffff 80d52b10
1fc0: ffffffff ffffffff 80d5258c 00000000 00000000 80d9ef30 00000000 10c53c7d
1fe0: 80db84fc 80d9ef2c 80dbcb80 1000406a 412fc09a 10008074 00000000 00000000
[<8040eed8>] (usb_hcd_irq) from [<8006907c>] (handle_irq_event_percpu+0x50/0x180)
[<8006907c>] (handle_irq_event_percpu) from [<800691e8>] (handle_irq_event+0x3c/0x5c)
[<800691e8>] (handle_irq_event) from [<8006c02c>] (handle_fasteoi_irq+0x84/0x14c)
[<8006c02c>] (handle_fasteoi_irq) from [<800687f4>] (generic_handle_irq+0x2c/0x3c)
[<800687f4>] (generic_handle_irq) from [<8000ed4c>] (handle_IRQ+0x40/0x90)
[<8000ed4c>] (handle_IRQ) from [<8000856c>] (gic_handle_irq+0x2c/0x5c)
[<8000856c>] (gic_handle_irq) from [<80012240>] (__irq_svc+0x40/0x70)
Exception stack(0x80db1f18 to 0x80db1f60)
1f00: 80db1f60 3b9aca00
1f20: 06f86934 0000000d 80dbe1c8 80dbe1c8 ee71e0d0 00000000 06f5bb01 0000000d
1f40: 80db0000 00000000 00000017 80db1f60 00000009 8049c19c 000d0013 ffffffff
[<80012240>] (__irq_svc) from [<8049c19c>] (cpuidle_enter_state+0x54/0xe4)
[<8049c19c>] (cpuidle_enter_state) from [<8049c2e0>] (cpuidle_idle_call+0xb4/0x14c)
[<8049c2e0>] (cpuidle_idle_call) from [<8000f07c>] (arch_cpu_idle+0x8/0x44)
[<8000f07c>] (arch_cpu_idle) from [<8006876c>] (cpu_startup_entry+0x100/0x14c)
[<8006876c>] (cpu_startup_entry) from [<80d52b10>] (start_kernel+0x350/0x35c)
Code: 11a002a0 03a00001 e12fff1e e92d4008 (e59130b0)
--[ end trace 1160f590a7b228b4 ]--
Kernel panic - not syncing: Fatal exception in interrupt
CPU2: stopping
CPU: 2 PID: 1483 Comm: modprobe Tainted: G D W 3.14.38-usb-host-otg-02047-ga4dec77 #13
[<80014a68>] (unwind_backtrace) from [<80011758>] (show_stack+0x10/0x14)
[<80011758>] (show_stack) from [<806f5fe8>] (dump_stack+0x7c/0xbc)
[<806f5fe8>] (dump_stack) from [<800139f0>] (handle_IPI+0x144/0x158)
[<800139f0>] (handle_IPI) from [<80008598>] (gic_handle_irq+0x58/0x5c)
[<80008598>] (gic_handle_irq) from [<80012240>] (__irq_svc+0x40/0x70)
Exception stack(0xd96c5dc0 to 0xd96c5e08)
5dc0: d800995c 0000004b 00000000 00072004 d8f2dec0 d8009900 d800995c 0000004b
5de0: d800995c a00f0013 00000000 010f2280 fffffffa d96c5e08 00000000 8006926c
5e00: 000f0013 ffffffff
[<80012240>] (__irq_svc) from [<8006926c>] (synchronize_irq+0x18/0xa8)
[<8006926c>] (synchronize_irq) from [<800696dc>] (__free_irq+0xfc/0x1c4)
[<800696dc>] (__free_irq) from [<80069838>] (free_irq+0x4c/0xa4)
[<80069838>] (free_irq) from [<8034b760>] (release_nodes+0x16c/0x1cc)
[<8034b760>] (release_nodes) from [<803487ec>] (__device_release_driver+0x78/0xcc)
[<803487ec>] (__device_release_driver) from [<8034885c>] (device_release_driver+0x1c/0x28)
[<8034885c>] (device_release_driver) from [<8034827c>] (bus_remove_device+0xdc/0x108)
[<8034827c>] (bus_remove_device) from [<80345788>] (device_del+0x100/0x1a4)
[<80345788>] (device_del) from [<8034a218>] (platform_device_del+0x18/0x9c)
[<8034a218>] (platform_device_del) from [<8034a2a8>] (platform_device_unregister+0xc/0x20)
[<8034a2a8>] (platform_device_unregister) from [<7f61932c>] (ci_hdrc_remove_device+0xc/0x20 [ci_hdrc])
[<7f61932c>] (ci_hdrc_remove_device [ci_hdrc]) from [<7f631260>] (ci_hdrc_imx_remove+0x2c/0xdc [ci_hdrc_imx])
[<7f631260>] (ci_hdrc_imx_remove [ci_hdrc_imx]) from [<8034a350>] (platform_drv_remove+0x18/0x30)
[<8034a350>] (platform_drv_remove) from [<803487e4>] (__device_release_driver+0x70/0xcc)
[<803487e4>] (__device_release_driver) from [<80348ef4>] (driver_detach+0xac/0xb0)
[<80348ef4>] (driver_detach) from [<803484e4>] (bus_remove_driver+0x4c/0xa0)
[<803484e4>] (bus_remove_driver) from [<80084158>] (SyS_delete_module+0x11c/0x17c)
[<80084158>] (SyS_delete_module) from [<8000e460>] (ret_fast_syscall+0x0/0x30)
CPU3: stopping
CPU: 3 PID: 0 Comm: swapper/3 Tainted: G D W 3.14.38-usb-host-otg-02047-ga4dec77 #13
[<80014a68>] (unwind_backtrace) from [<80011758>] (show_stack+0x10/0x14)
[<80011758>] (show_stack) from [<806f5fe8>] (dump_stack+0x7c/0xbc)
[<806f5fe8>] (dump_stack) from [<800139f0>] (handle_IPI+0x144/0x158)
[<800139f0>] (handle_IPI) from [<80008598>] (gic_handle_irq+0x58/0x5c)
[<80008598>] (gic_handle_irq) from [<80012240>] (__irq_svc+0x40/0x70)
Exception stack(0xd80b1f50 to 0xd80b1f98)
1f40: d80b1f98 3b9aca00 256aed09 0000000d
1f60: 80dbe1c8 80dbe1c8 ee7360d0 00000000 25477984 0000000d d80b0000 00000000
1f80: 00000017 d80b1f98 00000009 8049c19c 00070013 ffffffff
[<80012240>] (__irq_svc) from [<8049c19c>] (cpuidle_enter_state+0x54/0xe4)
[<8049c19c>] (cpuidle_enter_state) from [<8049c2e0>] (cpuidle_idle_call+0xb4/0x14c)
[<8049c2e0>] (cpuidle_idle_call) from [<8000f07c>] (arch_cpu_idle+0x8/0x44)
[<8000f07c>] (arch_cpu_idle) from [<8006876c>] (cpu_startup_entry+0x100/0x14c)
[<8006876c>] (cpu_startup_entry) from [<10008624>] (0x10008624)
CPU1: stopping

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 402f2d38e22007e931dc3dd52a69c0fed88452bf)

7 years agoMLK-11183 usb: chipidea: otg: complete state machine before cancel hrtimer
Li Jun [Thu, 2 Jul 2015 00:13:39 +0000 (08:13 +0800)]
MLK-11183 usb: chipidea: otg: complete state machine before cancel hrtimer

When do usb driver module load and unload loop test for A-device, the
hrtimer may be cancelled during otg state machine running, so after
the hrtimer is cancelled, the otg state machine may start it again by
adding a new timer, this will cause the hrtimer will be active after
its function memory is freed by module unload. This patch is to fix it
by trying to hold the fsm mutex lock before setting otg state to be
undefined, then otg hrtimer will be cancelled after current otg fsm
transition completes, and no new timer will be added.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 8c3ab4f22bc34675aeb8f9c62e69b450a179be0f)
(cherry picked from commit 95c8590c5232eeb9d054ac7504455a90a133f05a)

7 years agoMLK-11147 usb: chipidea: otg: keep irq enabled if otg work had been queued
Li Jun [Tue, 23 Jun 2015 02:46:44 +0000 (10:46 +0800)]
MLK-11147 usb: chipidea: otg: keep irq enabled if otg work had been queued

If the otg work had been queued, current code will disable irq again
but the otg work will be done only once, so the irq enable and disable
cannot be balanced, this patch is to fix this.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 0d5c0888eaec17289e40968d7d15b92b781ed34f)

7 years agoMLK-11151 usb: chipidea: otg: drive vbus off if fsm.drv_vbus is true
Peter Chen [Tue, 23 Jun 2015 08:04:57 +0000 (16:04 +0800)]
MLK-11151 usb: chipidea: otg: drive vbus off if fsm.drv_vbus is true

The current condition may not true even we have driven vbus on already.
The vbus drive operation may be async, eg through i2c gpio expendor,
so the vbus may not be valid when we unload usb module.

We meet this issue when we do fast load/unload usb module test.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit c0cdff8472c38e0fc39c597148d5534a5e9cc9b1)

7 years agoMLK-11132 usb: chipidea: otg: delay suspend for a_wait_vfall
Li Jun [Fri, 19 Jun 2015 09:18:48 +0000 (17:18 +0800)]
MLK-11132 usb: chipidea: otg: delay suspend for a_wait_vfall

While A device as peripheral ends session by a_bus_drop, it will go
back to host role by transition to a_wait_vfall state, then ehci
host driver may access portsc status after controller enters suspend
, this will result in system hang since its clock is gated off.
This patch use existing autosuspend to delay the controller suspend
if it comes to a_wait_vfall state.

Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit b140fa6803ef6ececec17e435212a960a3169cc2)

7 years agoMLK-10994-5 usb: chipidea: otg: fix NULL pointer dereference when unload module
Peter Chen [Wed, 3 Jun 2015 11:36:29 +0000 (19:36 +0800)]
MLK-10994-5 usb: chipidea: otg: fix NULL pointer dereference when unload module

With commit "95b62fe MLK-10750 usb: chipidea: otg: remove otg fsm
before destroy gdaget and host", the otg fsm will be removed first,
but when the host is removing, it will trigger pcd interrupt, and otg
work is still queued to ci_otg workqueue(otg state is OTG_STATE_A_HOST),
but at that time, ci_otg workqueue has been destroyed.

In this commit, we make sure the otg work is not queued if ci->wq is NULL,
and keep otg state is OTG_STATE_UNDEFINED after otg fsm has been removed.

The NULL pointer deference error like belows:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = a873c000
[00000000] *pgd=a90f9831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP ARM
Modules linked in: usb_f_ecm u_ether libcomposite configfs ci_hdrc_imx(-) ci_hdrc udc_core ehci_hcd mxc_vadc mx6s_capture mxc_dcic ov5640_camera usbmisc_imx phy_mxs_usb evbug [last unloaded: usb_f_rndis]
CPU: 0 PID: 162 Comm: udevd Not tainted 3.14.38-02187-g5639985-dirty #160
task: a863e880 ti: a872e000 task.ti: a872e000
PC is at __queue_work+0x68/0x268
LR is at __queue_work+0x68/0x268
pc : [<80045060>]    lr : [<80045060>]    psr: 600e0193
sp : a872fed0  ip : 00000000  fp : 00000000
r10: 00000004  r9 : a872e000  r8 : 0000004b
r7 : 80e4c804  r6 : a9295000  r5 : a87f8294  r4 : 00000000
r3 : a80690e0  r2 : 00000000  r1 : a8069108  r0 : a8003400
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: a873c04a  DAC: 00000015
Process udevd (pid: 162, stack limit = 0xa872e238)
Stack: (0xa872fed0 to 0xa8730000)
fec0:                                     00ff3d34 80743750 00000000 600e0193
fee0: a87f8294 a9295000 00000004 0000004b a8008900 80eb51ff 00ff3d34 800452a8
ff00: 00000000 a87f8010 00000000 00000000 00000000 7f060ac0 a8dfced0 a87f8010
ff20: 00002e20 7f059730 a8e7e2c0 a800895c 00000000 8006c1b4 80e46080 80e40458
ff40: a8008900 a800895c a8e7e2c0 c0802100 00fc40e8 00000000 00000048 8006c320
ff60: a8008900 a800895c 00000000 8006f1c4 8006f140 0000004b 0000004b 8006b92c
ff80: 80e40e54 8000f9cc c080210c 80e4c970 a872ffb0 8000856c 00fc4308 76d9c890
ffa0: 600e0010 ffffffff 7edef480 800130bc 00fc4308 00ff3d70 00000000 000000ff
ffc0: 00000671 00000000 00ff3b90 7edef480 00fc40e8 00000000 00000048 00ff3d34
ffe0: 000321b8 7edef140 000240a0 76d9c890 600e0010 ffffffff abf5e821 abf5ec21
[<80045060>] (__queue_work) from [<800452a8>] (queue_work_on+0x48/0x54)
[<800452a8>] (queue_work_on) from [<7f060ac0>] (ci_otg_fsm_irq+0x108/0x310 [ci_hdrc])
[<7f060ac0>] (ci_otg_fsm_irq [ci_hdrc]) from [<7f059730>] (ci_irq+0x94/0x158 [ci_hdrc])
[<7f059730>] (ci_irq [ci_hdrc]) from [<8006c1b4>] (handle_irq_event_percpu+0x50/0x180)
[<8006c1b4>] (handle_irq_event_percpu) from [<8006c320>] (handle_irq_event+0x3c/0x5c)
[<8006c320>] (handle_irq_event) from [<8006f1c4>] (handle_fasteoi_irq+0x84/0x14c)
[<8006f1c4>] (handle_fasteoi_irq) from [<8006b92c>] (generic_handle_irq+0x2c/0x3c)
[<8006b92c>] (generic_handle_irq) from [<8000f9cc>] (handle_IRQ+0x40/0x90)
[<8000f9cc>] (handle_IRQ) from [<8000856c>] (gic_handle_irq+0x2c/0x5c)
[<8000856c>] (gic_handle_irq) from [<800130bc>] (__irq_usr+0x3c/0x60)
Exception stack(0xa872ffb0 to 0xa872fff8)
ffa0:                                     00fc4308 00ff3d70 00000000 000000ff
ffc0: 00000671 00000000 00ff3b90 7edef480 00fc40e8 00000000 00000048 00ff3d34
ffe0: 000321b8 7edef140 000240a0 76d9c890 600e0010 ffffffff
Code: e5964084 e0844003 e1a00005 ebfffa14 (e5943000)
---[ end trace 53dc25e918ff7216 ]---
Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit c5b8111e4178387e1a6e9c700fdf887a944a5129)

7 years agoMLK-10051-1 usb: host: don't break clear suspend feature if otg fsm is used
Li Jun [Wed, 24 Dec 2014 10:23:04 +0000 (18:23 +0800)]
MLK-10051-1 usb: host: don't break clear suspend feature if otg fsm is used

Current code just do not do reusme signaling for clear suspend feature if it's
a OTG port with b_hnp_enable set, this result in OTG host cannot clear suspend
and resume OTG device after system resume from sleep, then host will disconnect
the OTG B-device and enumerate it again. To make OTG A-device in host state can
do clear feature of suspend like an usual host, and also be compatible legacy
OTG device, this patch adds another condition to check if OTG FSM driver is used
,as in OTG FSM driver, we need not do HNP in that case.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit f92731f787ca00ef8cd0ab9d591e4e24d5a40cc4)
(cherry picked from commit 92f5f68e853713e1179c0e30c1e84456ba11302e)

7 years agoMLK-9897-2 usb: otg-fsm: check B-device state before sending polling request
Li Jun [Tue, 25 Nov 2014 04:08:48 +0000 (12:08 +0800)]
MLK-9897-2 usb: otg-fsm: check B-device state before sending polling request

While system resume, the connected udev as B-device may not has been resumed,
if HNP polling request is sent to it, HNP polling may fail, this patch adds
check of the udev state to make sure it finished resume and to be configured
state before sending host request message, otherwise try next HNP polling
request.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 2cff5eb7bd4feb70cd28ac4655e7433e57a17938)
(cherry picked from commit b6eea060a3760bdb24d1514a5130a346daba81c9)

7 years agoMLK-9824-1 usb: chipidea: otg: clear b_conn when ends session
Li Jun [Tue, 11 Nov 2014 05:23:41 +0000 (13:23 +0800)]
MLK-9824-1 usb: chipidea: otg: clear b_conn when ends session

This patch is to clear the flag b_conn when turns off vbus to end a session.
when otg fsm is a_host -> a_suspend -> a_wait_vfall -> a_idle, current otg
fsm implementation does not handle disconnect event since the disconnection
does not happen while a_host state, so the b_conn is still set when in a_idle,
this patch clear b_conn flag after turn off vbus.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 043b79264051454de18488cb746ee617d86f3568)
(cherry picked from commit 7476c27df7a8bbc66f2269804cac58319fecf3d2)

7 years agoMLK-9794-3 usb: common: otg: HNP polling condition update for b host
Li Jun [Tue, 4 Nov 2014 12:42:16 +0000 (20:42 +0800)]
MLK-9794-3 usb: common: otg: HNP polling condition update for b host

If it's A host and b_hnp_enable is set, or B host, we can do HNP polling
because B host will not check OTG descriptor and set b_hnp_enable flag
when enumeration.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 6148c9df6d1c68dfc91cfe274101058c8edf979b)
(cherry picked from commit 8dbe217d14726d5950e91de9d98e401100357a21)

7 years agoMLK-9618-10 usb: chipidea: otg: change TA_WAIT_VFAL to be 500ms
Li Jun [Thu, 16 Oct 2014 14:18:03 +0000 (22:18 +0800)]
MLK-9618-10 usb: chipidea: otg: change TA_WAIT_VFAL to be 500ms

500ms is enough for vbus fall to VOTG_VBUS_LKG(0.7v, OTG device or EH
Leakage Voltage).

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 41295ac496aa7697585e65223797e0cb4e5fb153)
(cherry picked from commit 56a84fbabed530150787cad4f98aad414a0fee57)

7 years agoMLK-9618-9 usb: chipidea: otg: change TA_BIDL_ADIS to be 160ms
Li Jun [Thu, 16 Oct 2014 14:18:02 +0000 (22:18 +0800)]
MLK-9618-9 usb: chipidea: otg: change TA_BIDL_ADIS to be 160ms

This patch is to fix one OTG HNP timing requirement, TA_BIDL_ADIS should be
in range of 155ms~200ms per OTG spec 2.0 reverion 1.1a.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit a6de1be200984b01d784f6558229adbb67fcb380)
(cherry picked from commit a94422371328c620f4b37520868ad3f96ec2e165)

7 years agoMLK-9618-6 usb: chipidea: otg: show message for b host HNP fails
Li Jun [Mon, 4 May 2015 02:56:59 +0000 (10:56 +0800)]
MLK-9618-6 usb: chipidea: otg: show message for b host HNP fails

Show 'Device no response' message if A-device fails to connect as a peripheral.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 134a56ed85141acfa86ba0d827f654f7716405f2)

7 years agoMLK-9618-5 usb: chipidea: otg: show message device no response for SRP fail
Li Jun [Mon, 4 May 2015 02:54:20 +0000 (10:54 +0800)]
MLK-9618-5 usb: chipidea: otg: show message device no response for SRP fail

If b device does not detect vbus on after TB_SRP_FAIL of data pulse,
b device should show 'Device no response' message.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 079e1cb81b6259cb4a5e651e1c02f4c3b58a20ed)

7 years agoMLK-9618-4 usb: chipidea: otg: show message for a_wait_bcon time out
Li Jun [Thu, 16 Oct 2014 14:17:57 +0000 (22:17 +0800)]
MLK-9618-4 usb: chipidea: otg: show message for a_wait_bcon time out

When a host start a session and wait b device to connnect within
TA_WAIT_BCON, if failed, should show a message 'Device no response'
according to otg and EH compliance plan version 1.2 section 6.7.22

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 1762592ead672d27b281df8becf90f8c7d7fe61c)
(cherry picked from commit f1f68bc5f62848382646599c3609ad797bf3b5a5)

7 years agoMLK-9617-19 usb: otg: test: show warning message for unsupported otg test dev
Li Jun [Thu, 16 Oct 2014 14:17:56 +0000 (22:17 +0800)]
MLK-9617-19 usb: otg: test: show warning message for unsupported otg test dev

According to "USB On-The-Go and Embedded Host Automated Compliance Plan Version
1.2", chapter 6.7.23, unknown Device Not Supporting HNP:'Unsupported Device';
chapter 6.7.24 unknown Device Supporting HNP: 'Device No Response'

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 3fb9b462769d44073078f3b29fe68e214896ea9e)

7 years agoMLK-9617-17 usb: common: otg: clear b_bus_req in b_peripheral state
Li Jun [Thu, 16 Oct 2014 14:17:54 +0000 (22:17 +0800)]
MLK-9617-17 usb: common: otg: clear b_bus_req in b_peripheral state

This patch is clearing b_bus_req input to be 0 when entering b_peripheral state.
b_bus_req is only TRUE when b device wants to use the bus and switch to be host
role.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit eb610e73aa38bbb45aed6a79265cd79fe80cdd05)
(cherry picked from commit 427b0f80a51c50629131090c6f8b82d747fb7d24)

7 years agoMLK-9617-16 usb: common: otg: clear a_conn flag when leaves b host
Li Jun [Thu, 16 Oct 2014 14:17:53 +0000 (22:17 +0800)]
MLK-9617-16 usb: common: otg: clear a_conn flag when leaves b host

This patch is clearing a_conn flag when b device leave b_host state.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit e511cc08879fa97035900ae8626051e473f30cd9)
(cherry picked from commit e293fb467244e7068bd67e6c37a485b99944bbcf)

7 years agoMLK-9617-13 usb: core: otg: do quick bus reset after clear connection change
Li Jun [Thu, 16 Oct 2014 14:17:50 +0000 (22:17 +0800)]
MLK-9617-13 usb: core: otg: do quick bus reset after clear connection change

This patch changes bus reset time for B host enumuration, from entering B host
to the time clear USB_PORT_FEAT_C_CONNECTION, a random time after B host detect
port change for A peripheral connection may not work.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit b87d3bb0672ebcfb29c7db8708c586b2d38558d1)
(cherry picked from commit f3ec1858d5293de28476996a59287b7adb8e9cd2)

7 years agoMLK-9618-3 usb: chipidea: host: add port reset for USB OTG HNP
Li Jun [Thu, 16 Oct 2014 14:17:49 +0000 (22:17 +0800)]
MLK-9618-3 usb: chipidea: host: add port reset for USB OTG HNP

This patch adds host port reset implementation for HNP timing requirement,
which will be called when B host starts enumuration.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 5a63aca9c698a2eca09473c675ad2c40a62a27d1)

7 years agoMLK-9617-11 usb: common: otg: use a_set_b_hnp_en instead of b_hnp_enable
Li Jun [Mon, 29 Sep 2014 02:22:52 +0000 (10:22 +0800)]
MLK-9617-11 usb: common: otg: use a_set_b_hnp_en instead of b_hnp_enable

This patch replaces b_hnp_enable with a_set_b_hnp_en to comply with state diagram
of USB and EH spec.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 4734ed1f813959a7544ad744d60ab119efb04ba9)
(cherry picked from commit 853e4e0a2c59f034b177eebd3e7254efc8feffd4)

7 years agoMLK-9617-10 usb: common: otg: update condition from a_host to a_suspend
Li Jun [Sat, 27 Sep 2014 14:34:58 +0000 (22:34 +0800)]
MLK-9617-10 usb: common: otg: update condition from a_host to a_suspend

This patch updates condition from a_host to a_suspend according to On-The-Go
and Embedded Host Supplement to the USB Revision 2.0 Specification Revision
2.0 version 1.1a.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit f3acf74150683d4555c82ad32b9c669d8a0a7fb5)
(cherry picked from commit a938eb1ccabe9213c0b232d45da2caeb75f8b9fe)

7 years agoMLK-9617-9 usb: core: hub: use a_set_b_hnp_en and b_hnp_en for otg fsm mode
Li Jun [Fri, 10 Oct 2014 07:34:39 +0000 (15:34 +0800)]
MLK-9617-9 usb: core: hub: use a_set_b_hnp_en and b_hnp_en for otg fsm mode

Use a_set_b_hnp_en to identify if a host can succeed to set b_hnp_enable
for B device, use b_hnp_enable flag to identify if the connected OTG device
is HNP capable. So if the connected otg device is HNP capable but b_hnp_enable
is not set for A host, the host which support HNP polling should continue
enumeration to see if the B device can talk to it later by hnp polling.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit b715d0773eea212a25d6b8c5d94530e12935fdaf)
(cherry picked from commit 454369742ce4dec01d89c946a28c3069fc23bbea)

7 years agoMLK-9618-3 usb: chipidea: otg: enable hnp_pollinig flag
Li Jun [Mon, 29 Sep 2014 02:32:00 +0000 (10:32 +0800)]
MLK-9618-3 usb: chipidea: otg: enable hnp_pollinig flag

This patch enables hnp_polling flag for chipidea host driver in otg fsm mode.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit acb43a932263edd9b80c6d6d9ee858176c201542)
(cherry picked from commit 9e75e851370b62319fec4200b68cfd3465e12cfe)

7 years agoMLK-9617-7 usb: otg: add hnp_polling flag in struct otg_fsm
Li Jun [Mon, 29 Sep 2014 02:04:45 +0000 (10:04 +0800)]
MLK-9617-7 usb: otg: add hnp_polling flag in struct otg_fsm

This patch adds a flag hnp_polling to indicate if HNP polling is supported.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit b19d4b1110fe1fb2ec3141233781a1e016c9a9cf)
(cherry picked from commit cad8ae2986ab0b70d0f13b96c98f340564213d4c)

7 years agoMLK-9617-6 usb: core: otg: do not break otg device enumeration
Li Jun [Sat, 27 Sep 2014 14:23:39 +0000 (22:23 +0800)]
MLK-9617-6 usb: core: otg: do not break otg device enumeration

If a HNP capable device STALL b_hnp_enable set feature request, A device
as host should not break otg device enumeration, because this set feature
failure only indicates the B device does not want to be host role for the
moment, A device as host talk to it should be okay.

see charpter 6.2.2.2 of OTG and EH 2.0:
"If the a_hnp_support feature is set, but the b_hnp_enable feature is not set,
then it is likely that b_hnp_enable will be set later when the A-device is
finished using the bus."

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 51317577d16034ba151da8d502319f4befb91278)
(cherry picked from commit 3d5d5139b3aef654e8004a2ad9ce757af50aee57)

7 years agoMLK-9617-4 usb: common: otg: test: do HNP for legacy otg test device
Li Jun [Mon, 29 Sep 2014 02:47:41 +0000 (10:47 +0800)]
MLK-9617-4 usb: common: otg: test: do HNP for legacy otg test device

Since legacy OTG test device which is only compliant with OTG supplement version
1.3 or earlier, cannot support HNP polling, so directly start role switch.

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 688bbca155159978cd520923f2c3029c7778fa9c)
(cherry picked from commit 6f9edab20e2dd8794e46a0b9129c8694e81d064b)

7 years agoMLK-9638-6 usb: common: otg: test: clear otg_hnp_reqd flag when it's invalid
Li Jun [Sat, 27 Sep 2014 13:33:29 +0000 (21:33 +0800)]
MLK-9638-6 usb: common: otg: test: clear otg_hnp_reqd flag when it's invalid

This patch clears otg_hnp_reqd feature related flags when the HNP test ends.
There are two otg fsm paths to end this feature request:
- b_peripheral --> b_wait_acon --> b_idle: we clear them when entering b_idle;
- b_peripheral --> b_wait_acon --> b_host --> b_peripheral : we clear them
  when leaving b_host.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 39d25f04ed047e15f23b44e8465ce46257547df7)
(cherry picked from commit f92c4e5794a278946d3f4e7c8bc30e3e43a80c28)

7 years agoMLK-9638-5 usb: chipidea: otg: test: timer for B host hands host role back
Li Jun [Sat, 27 Sep 2014 13:44:36 +0000 (21:44 +0800)]
MLK-9638-5 usb: chipidea: otg: test: timer for B host hands host role back

This patch implements a timer for B host to start host role switch back to A
device.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 139bcc46841f73199bdc3ca308e46a5af3dd2fc1)
(cherry picked from commit d1c81fc3fa2f8cc141d688b6f627ffa6ca4a7204)

7 years agoMLK-9638-4 usb: ehset: test: start timer for B host switch role back
Li Jun [Sat, 27 Sep 2014 13:13:42 +0000 (21:13 +0800)]
MLK-9638-4 usb: ehset: test: start timer for B host switch role back

After B device as host enumerates A peripheral and sets configuration,
B host should start to hand host role back to A device when this timer
expires.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 3f4a8c8a20ef69721f9e7886b8d245036d41d91a)
(cherry picked from commit 72b535f92ea078d8c3bd73186763bcb2f39106bb)

7 years agoMLK-9638-3 usb: chipidea: udc: test: handle otg_hnp_req set feature request
Li Jun [Sat, 27 Sep 2014 13:03:55 +0000 (21:03 +0800)]
MLK-9638-3 usb: chipidea: udc: test: handle otg_hnp_req set feature request

This patch adds otg_hnp_reqd set feature request from A host for chipidea udc
driver.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 450d4a1eb40ec4284661c1130bdcc4f4d2e6c527)
(cherry picked from commit 03f3f886029fa8f25dde34fcfeb28589ead0064f)

7 years agoMLK-9638-2 usb: otg: test: add otg_hnp_reqd flag in struct otg_fsm
Li Jun [Sat, 27 Sep 2014 13:07:48 +0000 (21:07 +0800)]
MLK-9638-2 usb: otg: test: add otg_hnp_reqd flag in struct otg_fsm

This patch adds flag otg_hnp_reqd in struct otg_fsm to indicate A device
as host wants to start HNP sequence.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 92382e06c6902731b05dcbb0db4f0ebfa486969f)
(cherry picked from commit 8e3f26a58f995711a81b401af26fbe5ed12e17f4)

7 years agoMLK-9638-1 usb: test: define otg_hnp_reqd wIndex byte value
Li Jun [Sat, 27 Sep 2014 12:48:23 +0000 (20:48 +0800)]
MLK-9638-1 usb: test: define otg_hnp_reqd wIndex byte value

This patch adds otg_hnp_reqd wIndex high byte value for otg test mode.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit c334dc80bc2672aab012cad6926d819feaf4634d)
(cherry picked from commit dd95b40fa19e522353b548554f55e8c77ac9bdfe)

7 years agoMLK-9637-4 usb: chipidea: otg: test: add otg_srp_reqd timer for start srp
Li Jun [Sat, 27 Sep 2014 12:19:30 +0000 (20:19 +0800)]
MLK-9637-4 usb: chipidea: otg: test: add otg_srp_reqd timer for start srp

This patch adds a timer for chipidea otg fsm driver to start data pulse
after A host ends the session.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 35e92b59080b58925c3b96e36511056cb51d4a00)
(cherry picked from commit eeded24ce2d20b1c19d5c666e916f41995cf2385)

7 years agoMLK-9637-3 usb: chipidea: udc: test: handle otg_srp_reqd set feature request
Li Jun [Sat, 27 Sep 2014 12:10:43 +0000 (20:10 +0800)]
MLK-9637-3 usb: chipidea: udc: test: handle otg_srp_reqd set feature request

This patch adds otg_srp_reqd set feature request from A host for chipidea
udc driver.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 5edca27c518e8a69accb429c946c19243e156656)
(cherry picked from commit 14ac2f1f74ce0b02e03296472e7d170c45a31f29)