]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMLK-9910: ARM: dts: reduce the i.MX6sx AI board QSPI clock frequency
Allen Xu [Sat, 22 Nov 2014 19:35:36 +0000 (13:35 -0600)]
MLK-9910: ARM: dts: reduce the i.MX6sx AI board QSPI clock frequency

Reduced the QSPI clock from 53Mhz to 29Mhz according to spec requirement

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit ea5d6d29564c29b21d117056e9cbd1430199b4de)

9 years agoMLK-9909 ARM: dts: add imx6sx sdb revA QSPI legacy support
Allen Xu [Sat, 22 Nov 2014 19:15:19 +0000 (13:15 -0600)]
MLK-9909 ARM: dts: add imx6sx sdb revA QSPI legacy support

add sdb revA board QSPI legacy support for Spansion QSPI chip.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 3fd143ae78007e58d1dc45bc829b462a12b93cd2)

9 years agoMLK-9851 mtd: Change the mtd device driver build order for mfgtool
Allen Xu [Fri, 14 Nov 2014 16:36:07 +0000 (00:36 +0800)]
MLK-9851 mtd: Change the mtd device driver build order for mfgtool

i.MX6SX Sabreauto board enabled both NAND and QSPI1 drivrers, and by default,
NAND driver built first in kernel compiling, and it would be load first when
Kernel brought up.

Since we could not guarantee all boards mounted NAND chips, we wish the Kernel
could load QSPI driver first, when system mapped QSPI and NAND, the mtd device
index won't change dynamically, otherwise, the mfgtool may write images to the
inappropriate storage devices.

The code change moved the SPI driver at the prior position of NAND driver in
Makefile to solve this issue.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 3d2d5724f7a2968b40c2ea0a70c09a3214da1496)

9 years agoMLK-9675 ARM: dts: code change for new QSPI chip on SDB board
Allen Xu [Sun, 5 Oct 2014 19:39:31 +0000 (14:39 -0500)]
MLK-9675 ARM: dts: code change for new QSPI chip on SDB board

QSPI chip changed from spansion s25fl128s to micron n25q256a

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 56c87a201946e4582de2f574c218e43c4db7fadb)
(cherry picked from commit 628c08401cf3b6fcd477bdf118269b0c868e16d8)

9 years agoMLK-9660 ARM: dts reduce QSPI freq on imx6sx sabresd board
Allen Xu [Wed, 1 Oct 2014 22:32:34 +0000 (17:32 -0500)]
MLK-9660 ARM: dts reduce QSPI freq on imx6sx sabresd board

According to design spec on QSPI IO freq, reduce the freq to 29MHz.

Non-DQS mode:
-          SDR: 60MHz
-          DDR: 30Mhz

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit b01578a8d466d7420cbc7cfabf984998e8e31657)

9 years agoMLK-9659 ARM: dts reduce QSPI freq on imx6sx-17x17-arm2 board
Allen Xu [Wed, 1 Oct 2014 22:25:49 +0000 (17:25 -0500)]
MLK-9659 ARM: dts reduce QSPI freq on imx6sx-17x17-arm2 board

According to design spec on QSPI IO freq, reduce the freq to 29MHz.

Non-DQS mode:
-          SDR: 60MHz
-          DDR: 30Mhz

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit da5d7175b84db47b8269a531e22a919d10d4bce9)

9 years agoMLK-9650 QSPI: imx6sx: fix QSPI build warning
Allen Xu [Thu, 25 Sep 2014 21:08:16 +0000 (16:08 -0500)]
MLK-9650 QSPI: imx6sx: fix QSPI build warning

add the missed return value to fix the build warning.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit a4e7c495626ec3a0cbe9561fa5a22306a92ca2bf)

9 years agoENGR00311101 QSPI: i.MX6SX: fixed the random QSPI access failed issue
Allen Xu [Thu, 25 Sep 2014 10:39:09 +0000 (05:39 -0500)]
ENGR00311101 QSPI: i.MX6SX: fixed the random QSPI access failed issue

We found there is a low probability(5%) QSPI access timeout issue,
usually it happened on kernel boot stage, the first time kernel tried to
access QSPI chip. The READ_ID command was sent but not executed,
consequently the probe function failed.

Finally we located the issue by these steps.

1. Since the issue happened randomly and usually it cost half day to
reproduce, we add more debug code in driver, to create a timeout file if
the issue occurred.

2. Prepared an autorun script to keep rebooting the system and check if
the timeout file existed, if the file existed, stop reboot.

3. The system will stop rebooting when timeout error occurred, set the
CCM_CCOSR register and related IOMUX to measure QPSI clock, found there
is no clock output, while clock output can be measured when QSPI driver
successfully probed.

4. Check the code and found QSPI clock rate was changed while not
disabled clock gate, most of the multiplexers on i.MX6 are glitch ones,
clock glitch may occurred and propagated into downstream clock dividers

Based on the new clock flag(CLK_SET_RATE_GATE) and new framework, we
need to change the approach of seting clock rate. In current
implementation, there are several places in which the clock was touched.

1. probe function. prepare and enable clock before setting the QSPI
register, disable and unprepare the clock before exit.

2. nor_setup & nor_setup_last, since we change clock rate in these two
functions.

3. fsl_qspi_prep and fsl_qspi_unprep, clock was enabled only when got
QSPI access request.

4. resume function. Clock was required to restroe the setting after
resume, disable the clock before exit.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 04b31985952a4a8ba226d7bac474f70a95f5e674)

9 years agoENGR00331773 qspi: imx6sx: Fixed the issues when compiled QSPI as a module
Allen Xu [Fri, 12 Sep 2014 12:17:38 +0000 (07:17 -0500)]
ENGR00331773 qspi: imx6sx: Fixed the issues when compiled QSPI as a module

There were two issues when compiled QSPI as a module.

1. two functions in spi_nor.c has not been exported.
2. unregister mtd device count is wrong.

Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit f8c6c7204404864a042112cbc06b046cda43a1e4)

9 years agoMLK-10092-2 dts: Rename compatible string from ov564x to ov5640
Sandor Yu [Wed, 14 Jan 2015 07:41:43 +0000 (15:41 +0800)]
MLK-10092-2 dts: Rename compatible string from ov564x to ov5640

There are two version ov5640 driver,
one is written with v4l2 int-device architecture,
and the other is written with v4l2 subdev architecture.
Rename subdev ov5640 compatible string from ov5640x
to ov5640 to distinguish with ov5640 int-device driver.
so ov564x is used for int-device architecture and
ov5640 is used for subdev architecture.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10092-1 ov5640: Rename compatible string from ov564x to ov5640
Sandor Yu [Wed, 14 Jan 2015 07:34:22 +0000 (15:34 +0800)]
MLK-10092-1 ov5640: Rename compatible string from ov564x to ov5640

There are two version ov5640 driver,
one is written with v4l2 int-device architecture,
and the other is written with v4l2 subdev architecture.
Rename subdev ov5640 compatible string from ov5640x to ov5640
to distinguish with ov5640 int-device driver.
so ov564x is used for int-device architecture and
ov5640 is used for subdev architecture.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10084 media: mxc vout: Correct black color filling for interleaved formats
Liu Ying [Tue, 13 Jan 2015 02:19:10 +0000 (10:19 +0800)]
MLK-10084 media: mxc vout: Correct black color filling for interleaved formats

In non-linear_bypass_pp and non-tiled_bypass_pp modes, the triple fbdev frame
buffer would be rendered with video frames in turn.  We need to fill all the
three frame buffers with black color before streaming on instead of filling only
one of them.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit e0155001082abc2432ec54ac86f56abbbb744fd3)

9 years agoMLK-10098 ARM: imx: fix 1588 clock init
Fugang Duan [Wed, 14 Jan 2015 08:18:58 +0000 (16:18 +0800)]
MLK-10098 ARM: imx: fix 1588 clock init

The enet clock define is changed as there has no "enet_ref" clock name.
If the tx_clk is sourced from SOC anatop PLL, user define the clock id
in devicetree. So we only to judge the ptp clock valid and then set the
related GPR bit.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10097 ARM: dts: imx6sl: add FEC sleep pinctrl for evk board
Fugang Duan [Wed, 14 Jan 2015 07:55:19 +0000 (15:55 +0800)]
MLK-10097 ARM: dts: imx6sl: add FEC sleep pinctrl for evk board

Add FEC sleep pinctrl setting for evk board.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10096 ARM: dts: imx6qdl: add enet ENET_REF_CLK pin set for sabreauto board
Fugang Duan [Wed, 14 Jan 2015 07:36:47 +0000 (15:36 +0800)]
MLK-10096 ARM: dts: imx6qdl: add enet ENET_REF_CLK pin set for sabreauto board

Add enet RGMII ENET_REF_CLK pin set for sabreauto board.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10095 ARM: dts: imx6sx: correct sdb board enet pin group setting
Fugang Duan [Wed, 14 Jan 2015 07:21:26 +0000 (15:21 +0800)]
MLK-10095 ARM: dts: imx6sx: correct sdb board enet pin group setting

Correct i.MX6SX sdb board enet pin group setting.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10094 ARM: dts: imx6sx: correct the uart compatible string
Fugang Duan [Wed, 14 Jan 2015 07:10:56 +0000 (15:10 +0800)]
MLK-10094 ARM: dts: imx6sx: correct the uart compatible string

Correct the uart compatible string.

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoENGR00278822 ARM: imx_v7_defconfig: disable CONFIG_SWP_EMULATE
Shengjiu Wang [Mon, 9 Sep 2013 10:54:25 +0000 (18:54 +0800)]
ENGR00278822 ARM: imx_v7_defconfig: disable CONFIG_SWP_EMULATE

According to the help text in the config SWP_EMULATE in arch/arm/mm/Kconfig:

"In some older versions of glibc [<=2.8] SWP is used during futex trylock()
operations with the assumption that the code will not be preempted. This
invalid assumption may be more likely to fail with SWP emulation enabled,
leading to deadlock of the user application."

The audio codec toolchain version is gcc-4.1.1-glibc-2.4, we need turn off
the CONFIG_SWP_EMULATE in the imx_v7_defconfig.

Signed-off-by: Shengjiu Wang <b02247@freescale.com>
(cherry picked from commit d001efd7f21307fc9ac64ead791fcac161180663)

9 years agoMGS-304-2 [#1461] Do not leave garbase in outside pointer
Xianzhong [Wed, 14 Jan 2015 04:45:35 +0000 (12:45 +0800)]
MGS-304-2 [#1461] Do not leave garbase in outside pointer

this is the enhanced fix for gpu kernel panic issue based on previous:
gpu causes kernel panic when running bonnie++ with suspend/resume.

Date: Jan 14, 2015
Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Jason Liu
9 years agoMLK-9951 Update CAAM driver era interface
Victoria Milhoan [Thu, 20 Nov 2014 18:28:28 +0000 (11:28 -0700)]
MLK-9951 Update CAAM driver era interface

Add more CAAM era values to the CAAM driver's caam_get_era()
function. Read only 32 bits of data since the data required
to identify the IP_ID and MAJ_REV is located in the first 32
bits of the register. And, update the function for use with
ARM/Little Endian devices.

[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit 6050d7faf2d0c063195aa9454c130548a9f8058f)

9 years agoMLK-9769-22 caam: improve initalization for context state saves
Steve Cornelius [Tue, 14 Aug 2012 22:04:11 +0000 (15:04 -0700)]
MLK-9769-22 caam: improve initalization for context state saves

Multiple function in asynchronous hashing use a saved-state block,
a.k.a. struct caam_hash_state, which holds a stash of information
between requests (init/update/final). Certain values in this state
block are loaded for processing using an inline-if, and when this
is done, the potential for uninitialized data can pose conflicts.
Therefore, this patch improves initialization of state data to
prevent false assignments using uninitialized data in the state block.

This patch addresses the following traceback, originating in
ahash_final_ctx(), although a problem like this could certainly
exhibit other symptoms:

kernel BUG at arch/arm/mm/dma-mapping.c:465!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = 80004000
[00000000] *pgd=00000000
Internal error: Oops: 805 [#1] PREEMPT SMP
Modules linked in:
CPU: 0    Not tainted  (3.0.15-01752-gdd441b9-dirty #40)
PC is at __bug+0x1c/0x28
LR is at __bug+0x18/0x28
pc : [<80043240>]    lr : [<8004323c>]    psr: 60000013
sp : e423fd98  ip : 60000013  fp : 0000001c
r10: e4191b84  r9 : 00000020  r8 : 00000009
r7 : 88005038  r6 : 00000001  r5 : 2d676572  r4 : e4191a60
r3 : 00000000  r2 : 00000001  r1 : 60000093  r0 : 00000033
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 1000404a  DAC: 00000015
Process cryptomgr_test (pid: 1306, stack limit = 0xe423e2f0)
Stack: (0xe423fd98 to 0xe4240000)
fd80:                                                       11807fd1 80048544
fda0: 88005000 e4191a00 e5178040 8039dda0 00000000 00000014 2d676572 e4191008
fdc0: 88005018 e4191a60 00100100 e4191a00 00000000 8039ce0c e423fea8 00000007
fde0: e4191a00 e4227000 e5178000 8039ce18 e419183c 80203808 80a94a44 00000006
fe00: 00000000 80207180 00000000 00000006 e423ff08 00000000 00000007 e5178000
fe20: e41918a4 80a949b4 8c4844e2 00000000 00000049 74227000 8c4844e2 00000e90
fe40: 0000000e 74227e90 ffff8c58 80ac29e0 e423fed4 8006a350 8c81625c e423ff5c
fe60: 00008576 e4002500 00000003 00030010 e4002500 00000003 e5180000 e4002500
fe80: e5178000 800e6d24 007fffff 00000000 00000010 e4001280 e4002500 60000013
fea0: 000000d0 804df078 00000000 00000000 00000000 00000000 00000000 00000000
fec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
fee0: 00000000 00000000 e4227000 e4226000 e4753000 e4752000 e40a5000 e40a4000
ff00: e41e7000 e41e6000 00000000 00000000 00000000 e423ff14 e423ff14 00000000
ff20: 00000400 804f9080 e5178000 e4db0b40 00000000 e4db0b80 0000047c 00000400
ff40: 00000000 8020758c 00000400 ffffffff 0000008a 00000000 e4db0b40 80206e00
ff60: e4049dbc 00000000 00000000 00000003 e423ffa4 80062978 e41a8bfc 00000000
ff80: 00000000 e4049db4 00000013 e4049db0 00000013 00000000 00000000 00000000
ffa0: e4db0b40 e4db0b40 80204cbc 00000013 00000000 00000000 00000000 80204cfc
ffc0: e4049da0 80089544 80040a40 00000000 e4db0b40 00000000 00000000 00000000
ffe0: e423ffe0 e423ffe0 e4049da0 800894c4 80040a40 80040a40 00000000 00000000
[<80043240>] (__bug+0x1c/0x28) from [<80048544>] (___dma_single_dev_to_cpu+0x84)
[<80048544>] (___dma_single_dev_to_cpu+0x84/0x94) from [<8039dda0>] (ahash_fina)
[<8039dda0>] (ahash_final_ctx+0x180/0x428) from [<8039ce18>] (ahash_final+0xc/0)
[<8039ce18>] (ahash_final+0xc/0x10) from [<80203808>] (crypto_ahash_op+0x28/0xc)
[<80203808>] (crypto_ahash_op+0x28/0xc0) from [<80207180>] (test_hash+0x214/0x5)
[<80207180>] (test_hash+0x214/0x5b8) from [<8020758c>] (alg_test_hash+0x68/0x8c)
[<8020758c>] (alg_test_hash+0x68/0x8c) from [<80206e00>] (alg_test+0x7c/0x1b8)
[<80206e00>] (alg_test+0x7c/0x1b8) from [<80204cfc>] (cryptomgr_test+0x40/0x48)
[<80204cfc>] (cryptomgr_test+0x40/0x48) from [<80089544>] (kthread+0x80/0x88)
[<80089544>] (kthread+0x80/0x88) from [<80040a40>] (kernel_thread_exit+0x0/0x8)
Code: e59f0010 e1a01003 eb126a8d e3a03000 (e5833000)
---[ end trace d52a403a1d1eaa86 ]---

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
9 years agoMLK-9710-5 Unregister Secure Memory platform device upon shutdown
Victoria Milhoan [Mon, 3 Nov 2014 22:28:10 +0000 (15:28 -0700)]
MLK-9710-5 Unregister Secure Memory platform device upon shutdown

Unregister Secure Memory platform device when the Secure Memory
module is shut down.  This allows the Secure Memory module to
be inserted again successfully.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit 785456f38234e64618ee9c74ab4258f39f00e73c)

9 years agoMLK-9769-22 Detect HW features during alg registration
Steve Cornelius [Mon, 17 Nov 2014 18:24:14 +0000 (11:24 -0700)]
MLK-9769-22 Detect HW features during alg registration

i.MX6 instantiates a CAAM with a low-power MDHA block, which does not
compute digests larger than 256 bits. Since the driver installs handlers
for hashes longer than 256 bits in several places, added the ability to
read and interpret the CHA version and instantiations registers, and then
only register handlers that it can support.

[<vicki.milhoan@freescale.com>: Edited to include only caamhash changes]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-21 Modify Freescale CAAM driver Scatter Gather entry definition
Victoria Milhoan [Mon, 17 Nov 2014 18:02:31 +0000 (11:02 -0700)]
MLK-9769-21 Modify Freescale CAAM driver Scatter Gather entry definition

Modify the Scatter-Gather entry definitions for the Freescale
CAAM driver.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-20 Limit AXI pipeline to a depth of one in CAAM for i.MX6 devices
Victoria Milhoan (b42089) [Tue, 26 Mar 2013 21:11:32 +0000 (14:11 -0700)]
MLK-9769-20 Limit AXI pipeline to a depth of one in CAAM for i.MX6 devices

i.MX6 devices have an issue wherein AXI bus transactions may not occur
in the correct order. This isn't a problem running single descriptors,
but can be if running multiple concurrent descriptors. Reworking the CAAM
driver to throttle to single requests is impractical, so this patch limits
the AXI pipeline to a depth of one (from a default of four) to preclude
this situation from occurring.

Signed-off-by: Victoria Milhoan (b42089) <vicki.milhoan@freescale.com>
9 years agoMLK-9769-19 Add ARC4-ECB support for CAAM in i.MX6 family
Winston Hudson [Mon, 17 Nov 2014 17:17:35 +0000 (10:17 -0700)]
MLK-9769-19 Add ARC4-ECB support for CAAM in i.MX6 family

Adds ARC4-ECB Mode support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
9 years agoMLK-9769-18 Add 3DES-ECB-EDE support for CAAM in i.MX6 family
Winston Hudson (b45308) [Thu, 27 Jun 2013 04:08:30 +0000 (21:08 -0700)]
MLK-9769-18 Add 3DES-ECB-EDE support for CAAM in i.MX6 family

Adds 3DES-ECB-EDE Mode support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
9 years agoMLK-9769-17 Add AES-ECB support for CAAM in i.MX6 family
Winston Hudson (b45308) [Thu, 27 Jun 2013 03:49:36 +0000 (20:49 -0700)]
MLK-9769-17 Add AES-ECB support for CAAM in i.MX6 family

Adds AES-ECB (Electronic Codebook) support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
9 years agoMLK-9769-16 Add DES-ECB support for CAAM in i.MX6 family
Winston Hudson [Mon, 17 Nov 2014 16:27:30 +0000 (09:27 -0700)]
MLK-9769-16 Add DES-ECB support for CAAM in i.MX6 family

Adds DES-ECB Mode support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
9 years agoMLK-9769-15 Register only crypto algorithms supported by the Freescale CAAM hardware
Victoria Milhoan [Fri, 14 Nov 2014 22:32:20 +0000 (15:32 -0700)]
MLK-9769-15 Register only crypto algorithms supported by the Freescale CAAM hardware

This patch enhances the CAAM driver's registration of crypto
algorithms into the Crypto API by only registering algorithms
supported by the CAAM hardware available.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-14 Add CRYPTO_ALG_KERN_DRIVER_ONLY flag to Freescale CAAM driver
Victoria Milhoan (b42089) [Fri, 29 Mar 2013 07:13:14 +0000 (00:13 -0700)]
MLK-9769-14 Add CRYPTO_ALG_KERN_DRIVER_ONLY flag to Freescale CAAM driver

The CRYPTO_ALG_KERN_DRIVER_ONLY flag is used to indicate that
the crypto algorithm is only available via a kernel driver.
This patch adds the flag only when the flag is available in the
kernel.  Utilizing the flag based on it's availability in the
kernel allows the driver to compile on older kernel versions.

The original community patch is located at
http://permalink.gmane.org/gmane.linux.kernel.cryptoapi/6547
for reference.

Signed-off-by: Victoria Milhoan (b42089) <vicki.milhoan@freescale.com>
9 years agoMLK-9769-13 Add AES-CTR support for CAAM in i.MX6 family
Winston Hudson (b45308) [Thu, 27 Jun 2013 03:37:17 +0000 (20:37 -0700)]
MLK-9769-13 Add AES-CTR support for CAAM in i.MX6 family

Adds AES-CTR (Counter Mode) support to the CAAM crypto accelerator core in
the i.MX6 family of SoC devices.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9937 Use job ring 0 for secure memory access
Victoria Milhoan [Fri, 7 Nov 2014 17:48:32 +0000 (10:48 -0700)]
MLK-9937 Use job ring 0 for secure memory access

By default, job ring 0 is the owner of the Secure Memory area
within CAAM.  This patch modifies the Secure Memory module to
use job ring 0 for all accesses.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit bb447bfb241d34492365bf881257b1a742a29c02)

9 years agoMLK-9710-16 Cache-invalidate deferred RNG buffer fill
Steve Cornelius [Fri, 21 Feb 2014 17:40:52 +0000 (10:40 -0700)]
MLK-9710-16 Cache-invalidate deferred RNG buffer fill

CAAM's kernel random generator adaptor (feeding /dev/hwrng) manages
a pair of data buffers that fill with RNG-sourced data for consumption.
While one buffer is being drained through the dev, the other is filling
in the background to be used on "standby".

In the case where the completion of the buffer fill is deferred, a
cache invalidate call is required before the buffer can be put into use.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit b7f4221beefdc2cc38aeaadbd4b152d6a97c6e8e)

9 years agoMLK-9710-15 Correct size of padded key buffers
Steve Cornelius [Fri, 2 Aug 2013 21:19:27 +0000 (14:19 -0700)]
MLK-9710-15 Correct size of padded key buffers

Correct size of padded key buffers for the Secure Memory test module.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit da77cf5583c064deefd09a5e91851ab4398701a0)

9 years agoMLK-9710-14 Un-pad cache sizes for blob export/import
Steve Cornelius [Fri, 2 Aug 2013 03:08:19 +0000 (20:08 -0700)]
MLK-9710-14 Un-pad cache sizes for blob export/import

Blob exportation and importation functions were adding padding to
the buffer mapping and cache control functions, which resulted in
incorrect CPU-level views into a DMA-ed blob.

Also, corrected descriptor constructors to use symbolic form of
blob overhead calculation.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit c5f2cbb1fa51b0142742de77fe0a37c290bd04a0)

9 years agoMLK-9710-13 Correct size in BLOB_OVERHEAD definition
Steve Cornelius [Fri, 2 Aug 2013 03:06:05 +0000 (20:06 -0700)]
MLK-9710-13 Correct size in BLOB_OVERHEAD definition

Increase the size of BLOB_OVERHEAD.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit 32aced88dedf1c1c11170d125d3cc546ffefb366)

9 years agoMLK-9710-12 Adapt sm_test as a black-key handling example
Steve Cornelius [Wed, 24 Jul 2013 03:56:08 +0000 (20:56 -0700)]
MLK-9710-12 Adapt sm_test as a black-key handling example

Converted sm_test to an example that can show:
- key covering
- secret encapsulation as external memory blob
- secret decapsulation from external memory blob
- checks and displays of the handling of key content

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit 45818b72fc4b3fe3fff755b1f9a27cd5519ca2cf)

9 years agoMLK-9710-11 Add internal key cover and external blob export/import to prototype SM-API
Steve Cornelius [Wed, 24 Jul 2013 03:49:29 +0000 (20:49 -0700)]
MLK-9710-11 Add internal key cover and external blob export/import to prototype SM-API

Extended/amended the prototype SM-API with the following functions:
- Added key covering (blackening) function in-place to a keyslot
- Added export operation to encapsulate data to external memory as a
  secure memory blob (including descriptor capable of secure memory or
  general memory blob generation)
- Removed in-place blob encapsulation
- Added import operation to decapsulate a blob from external memory into
  secure memory (including descriptor capable of general memory or secure
  memory content decapsulation)
- Removed in-place blob decapsulation

[<vicki.milhoan@freescale.com>: Edited to apply to 3.10]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit c577769ed0347bb4e3428b5696fb7f209af0a7ad)

9 years agoMLK-9769-12 caam secvio - use explicit includes for OF header files
Victoria Milhoan [Fri, 14 Nov 2014 20:31:29 +0000 (13:31 -0700)]
MLK-9769-12 caam secvio - use explicit includes for OF header files

Add explicit includes for OF header files.  This patch is based on
upstream commit 5af5073004071cedd0343eee51d77955037ec6f3.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9710-18 snvs - make SECVIO module device tree correct
Steve Cornelius [Thu, 25 Sep 2014 23:34:11 +0000 (16:34 -0700)]
MLK-9710-18 snvs - make SECVIO module device tree correct

Converted the prototype 3.0.x SNVS Security Violation Handler
subsystem to be device tree correct/compliant under 3.10 for ARM
platforms. Also, separated out SNVS property detection so as to make
it independent of CAAM, and corrected function namespace accordingly.

Later releases of this subsystem are likely to be separate from the
kernel's CAAM driver space.

[<vicki.milhoan@freescale.com>: Edited to apply to latest 3.10 kernel]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit c8c128086eae012ced0c96d66f21f36bcbd14f66)

9 years agoMLK-9769-11 Add SM register defs, and expanded driver-private storage.
Steve Cornelius [Fri, 19 Oct 2012 21:43:41 +0000 (14:43 -0700)]
MLK-9769-11 Add SM register defs, and expanded driver-private storage.

These add changes to the driver private areas for the CAAM
controller and CAAM Secure Memory subsystems, and expand register
definitions to include the Secure Memory subsystems as reflected
in multiple areas (controller, rings, secure memory itself).

[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-10 Add Blob command bitdefs.
Steve Cornelius [Fri, 19 Oct 2012 21:37:12 +0000 (14:37 -0700)]
MLK-9769-10 Add Blob command bitdefs.

Add bit definitions for Blob protocol protinfo field.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
9 years agoENGR00289885 [iMX6Q] Add Secure Memory and SECVIO support.
Dan Douglass [Wed, 27 Nov 2013 09:40:44 +0000 (03:40 -0600)]
ENGR00289885 [iMX6Q] Add Secure Memory and SECVIO support.

1. Pull in secure memory support from 3.0.35 kernel.
2. Pull in SECVIO support from 3.0.35 kernel.
3. Make changes to support device tree.
4. Add device tree setting for SECVIO sources.

[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Dan Douglass <b41520@freescale.com>
(cherry picked from commit f3bfd42e2db3af8326734bebf750e94e74734f6e)
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9710-10 Add CCM defs for FIFO_STORE instruction
Steve Cornelius [Wed, 24 Jul 2013 03:47:32 +0000 (20:47 -0700)]
MLK-9710-10 Add CCM defs for FIFO_STORE instruction

Added definitions to enable FIFO_STORE to encode options for storing
keys in AES-CCM mode

[<vicki.milhoan@freescale.com>: Edited to apply to 3.14]
Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
(cherry picked from commit a3cd8e5fad274f33fc6f0030413f89a6339b1d5a)
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9710-9 Fix for tcrypt test_ahash_speed function
Winston Hudson [Sun, 21 Jul 2013 22:18:38 +0000 (15:18 -0700)]
MLK-9710-9 Fix for tcrypt test_ahash_speed function

This patch adds a null pointer check and explicitly frees memory in the
tcrypt.c function test_ahash_speed.

Signed-off-by: Winston Hudson <winston.hudson@freescale.com>
(cherry picked from commit 9bea544c31565260e5cbec2da14f4b2e89d21656)

9 years agoMLK-9710-8 tcrypt: change memory allocation for test_ahash_speed output buffer
Victoria Milhoan [Wed, 5 Nov 2014 12:13:05 +0000 (05:13 -0700)]
MLK-9710-8 tcrypt: change memory allocation for test_ahash_speed output buffer

Change allocation of the tcrypt module's test_ahash_speed() output buffer to
use kmalloc().  This avoids a segmentation fault when the buffer is used in a
dma_map_*() call.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
(cherry picked from commit 3c8c56d1bd82433af6a565d183bdb632fd01a13a)

9 years agoMLK-9710-7 AEAD CBC DES DES3_EDE SHA* Support
Winston Hudson (b45308) [Wed, 18 Sep 2013 16:04:19 +0000 (09:04 -0700)]
MLK-9710-7 AEAD CBC DES DES3_EDE SHA* Support

This patch has been backported to the 3.5.7 kernel for use with i.MX6.

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such
as QorIQ). Thus the property names are often tied to the sec-4.0+ nomenclature.

The original patch can be found at the following link:
http://marc.info/?l=linux-crypto-vger&m=135771601829617&w=2

Test vectors were taken from existing test for CBC(DES3_EDE).
Associated data has been added to test vectors.
HMAC computed with Crypto++ has been used.
Following algos have been covered.

(a) "authenc(hmac(sha1),cbc(des))"
(b) "authenc(hmac(sha1),cbc(des3_ede))"
(c) "authenc(hmac(sha224),cbc(des))"
(d) "authenc(hmac(sha224),cbc(des3_ede))"
(e) "authenc(hmac(sha256),cbc(des))"
(f) "authenc(hmac(sha256),cbc(des3_ede))"
(g) "authenc(hmac(sha384),cbc(des))"
(h) "authenc(hmac(sha384),cbc(des3_ede))"
(i) "authenc(hmac(sha512),cbc(des))"
(j) "authenc(hmac(sha512),cbc(des3_ede))"

Signed-off-by: Vakul Garg <vakul@freescale.com>
Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
(cherry picked from commit 486265888badc647ef4d386310f0c1d895211d00)

9 years agoMLK-9710-6 AEAD CBC AES MD5 Test Support
Winston Hudson (b45308) [Wed, 18 Sep 2013 15:45:43 +0000 (08:45 -0700)]
MLK-9710-6 AEAD CBC AES MD5 Test Support

This patch adds support for the following tcrypt test:
(a) "authenc(hmac(md5),cbc(aes))"

Note that CAAM also goes by sec-4.0 or sec-5.0 in other product families (such as QorIQ).
Thus the property names are often tied to the sec-4.0+ nomenclature.

Signed-off-by: Winston Hudson (b45308) <winston.h.hudson@freescale.com>
(cherry picked from commit a8ad8329282f7381c7768b7f3d544864b8e9df33)

9 years agoMLK-9769-9 Adjust RNG timing to support more devices
Victoria Milhoan [Wed, 12 Nov 2014 16:58:24 +0000 (09:58 -0700)]
MLK-9769-9 Adjust RNG timing to support more devices

Adjust RNG timing parameters to support more i.MX6 devices.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-8 Add a test for the Freescale CAAM Random Number Generator
Victoria Milhoan (b42089) [Fri, 17 Oct 2014 23:30:56 +0000 (16:30 -0700)]
MLK-9769-8 Add a test for the Freescale CAAM Random Number Generator

Freescale's CAAM includes a Random Number Generator.  This change adds
a kernel configuration option to test the RNG's capabilities via the
hw_random framework.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-7 Add LKM support to the CAAM RNG module
Victoria Milhoan (b42089) [Fri, 17 Oct 2014 23:16:54 +0000 (16:16 -0700)]
MLK-9769-7 Add LKM support to the CAAM RNG module

This patch allocates memory for the CAAM RNG context information, to enable
the RNG module to be loaded and unloaded as a Linux Kernel Module.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-6 Add CAAM support to i.MX6SX device tree
Victoria Milhoan (b42089) [Thu, 16 Oct 2014 22:13:04 +0000 (15:13 -0700)]
MLK-9769-6 Add CAAM support to i.MX6SX device tree

Add support for CAAM job rings, Secure Memory, and SNVS
to the i.MX6SX device tree.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-5 Enable and disable clocks for the Freescale CAAM device on i.MX platforms
Victoria Milhoan (b42089) [Fri, 17 Oct 2014 21:56:36 +0000 (14:56 -0700)]
MLK-9769-5 Enable and disable clocks for the Freescale CAAM device on i.MX platforms

ARM-based systems may disable clocking to the CAAM device on the
Freescale i.MX platform for power management purposes.  This patch
enables the required clocks when the CAAM module is initialized and
disables the required clocks when the CAAM module is shut down.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-4 Add CAAM driver cache coherency support
Victoria Milhoan (b42089) [Thu, 16 Oct 2014 22:44:18 +0000 (15:44 -0700)]
MLK-9769-4 Add CAAM driver cache coherency support

i.MX6 ARM platforms do not support hardware cache coherency.  This patch
adds cache coherency support to the CAAM driver.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-3 caam: Add register I/O primitives for ARM compatibility
Steve Cornelius [Wed, 18 Apr 2012 20:59:05 +0000 (13:59 -0700)]
MLK-9769-3 caam: Add register I/O primitives for ARM compatibility

Add appropriate read/write register and set/clear 32-bit primitives
for compatibility with ARM devices.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-2 Enable MXC devices to select CAAM driver in Kconfig
Steve Cornelius [Tue, 13 Mar 2012 21:51:17 +0000 (14:51 -0700)]
MLK-9769-2 Enable MXC devices to select CAAM driver in Kconfig

Allow CAAM to be selected in the kernel for i.MX6 devices if
ARCH_MXC is enabled.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-1 caam: remove incorrect comment from job ring module
Victoria Milhoan [Wed, 29 Oct 2014 18:23:05 +0000 (11:23 -0700)]
MLK-9769-1 caam: remove incorrect comment from job ring module

The caam_jr_register() function is no longer part of the CAAM
driver.  This patch removes a comment referencing the function.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-10082: vadc: Add suspend/resume function
Sandor Yu [Fri, 9 Jan 2015 08:55:59 +0000 (16:55 +0800)]
MLK-10082: vadc: Add suspend/resume function

Add suspend/resume function in vadc driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10081: csi: Add pm_runtime function
Sandor Yu [Fri, 9 Jan 2015 08:55:11 +0000 (16:55 +0800)]
MLK-10081: csi: Add pm_runtime function

Add pm_runtime function in csi driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
9 years agoMLK-10087 ARM: imx: sabreauto: enable USB function
Peter Chen [Wed, 4 Sep 2013 08:45:48 +0000 (16:45 +0800)]
MLK-10087 ARM: imx: sabreauto: enable USB function

Enable OTG and host 1 USB function.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10088-18 usb: chipidea: Add errata for revision 2.40a
Sanchayan Maity [Fri, 19 Dec 2014 09:55:29 +0000 (15:25 +0530)]
MLK-10088-18 usb: chipidea: Add errata for revision 2.40a

At chipidea revision 2.40a, there is a below errata:

9000531823  B2-Medium  Adding a dTD to a Primed Endpoint May Not Get Recognized

Title: Adding a dTD to a Primed Endpoint May Not Get Recognized

Impacted Configuration: All device mode configurations.

Description:
There is an issue with the add dTD tripwire semaphore (ATDTW bit in USBCMD register)
that can cause the controller to ignore a dTD that is added to a primed endpoint.
When this happens, the software can read the tripwire bit and the status bit at '1'
even though the endpoint is unprimed.

After executing a dTD, the device controller endpoint state machine executes a final
read of the dTD terminate bit to check if the application added a dTD to the linked
list at the last moment. This read is done in the finpkt_read_latest_next_td (44) state.
After the read is performed, if the terminate bit is still set, the state machine moves
to unprime the endpoint. The decision to unprime the endpoint is done in the
checkqh_decision (59) state, based on the value of the terminate bit.
Before reaching the checkqh_decision state, the state machine traverses the
writeqhtd_status (57), writeqh_status (56), and release_prime_mask (42) states.
As shown in the waveform, the ep_addtd_tripwire_clr signal is not set to clear
the tripwire bit in these states.

Workaround:
The software must implement a periodic poll cycle, and check for each dTD
pending on execution (Active = 1), if the enpoint is primed. It can do this by reading
the corresponding bits in the ENDPTPRIME and ENDPTSTAT registers. If these bits are
read at 0, the software needs to re-prime the endpoint by writing 1 to the corresponding
bit in the ENDPTPRIME register. This can be done for every microframe, every frame or
with a larger interval, depending on the urgency of transfer execution for the application.

Tested-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
9 years agoMLK-10088-17 usb: chipidea: add chipidea revision information
Peter Chen [Wed, 17 Dec 2014 06:16:54 +0000 (14:16 +0800)]
MLK-10088-17 usb: chipidea: add chipidea revision information

Define ci_get_revision API to know the controller revision
information according to chipidea 1.1a, 2.0a and 2.5a spec.
Besides, add one entry at struct ci_hdrc to indicate revision
information, it can be used for adding different code for
revisions, eg kinds of errata.

Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-16 usb: chipidea: add identification registers access APIs
Peter Chen [Wed, 17 Dec 2014 04:30:00 +0000 (12:30 +0800)]
MLK-10088-16 usb: chipidea: add identification registers access APIs

Using hw_write_id_reg and hw_read_id_reg to write and read identification
registers contents, they can be used to get controller information, change
some system configurations, and so on.

Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-15 usb: phy: phy-mxs-usb: do not depend on speed for disconnect notifier
Peter Chen [Sun, 26 Oct 2014 05:49:02 +0000 (13:49 +0800)]
MLK-10088-15 usb: phy: phy-mxs-usb: do not depend on speed for disconnect notifier

For some user cases, like plug out and replug in usb device during
the system suspend, the speed negotiation will be error due to host
doesn't know the device's disconnection, and it still hopes the
high speed device, but the device backs to "powered" state which
its high speed termination is not enabled, the usb core calls
the PHY's disconnect notifier with "full speed", it will NOT
take effect at all.

If the usb core calls disconnect notifer, the port change must happen,
so it is safe to disable high speed disconenct detector, since
connect notifier will be called soon if the device is still connected
on the port, and we will enable high speed disconnect detector at that
time.

Acked-by: Li Jun <b47624@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-14 usb: phy: phy-mxs-usb: add power down and disable wakeup for .shutdown
Peter Chen [Wed, 24 Dec 2014 03:11:52 +0000 (11:11 +0800)]
MLK-10088-14 usb: phy: phy-mxs-usb: add power down and disable wakeup for .shutdown

When we shut down the PHY, we need to power down all PHY's functions
as well as disable wakeup, it is the opposite operation we do at .init.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-13 usb: chipidea: usbmisc_imx: add imx6sx initialization routine
Peter Chen [Tue, 23 Dec 2014 08:30:24 +0000 (16:30 +0800)]
MLK-10088-13 usb: chipidea: usbmisc_imx: add imx6sx initialization routine

Except the same process with earlier imx6, it has below two features:

- Choose which vbus voltage as vbus wakeup source
We choose B_SESSION_VALID as vbus wakeup source since when the system
goes to suspend, the vbus comparator can't compare the vbus voltage
for VBUS_VALID.

- Disable dp/dm (linestate) change as wakeup source at device mode
when the vbus is not there, we don't expect dp/dm change waking up
usb controller at this situation.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-12 doc: usb: usbmisc-imx: add imx6sx compatible string
Peter Chen [Wed, 24 Dec 2014 04:44:41 +0000 (12:44 +0800)]
MLK-10088-12 doc: usb: usbmisc-imx: add imx6sx compatible string

Add compatible string for imx6sx-usbmisc.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-11 usb: chipidea: clear otg interrupt status for otg capable controller
Peter Chen [Tue, 23 Dec 2014 02:30:07 +0000 (10:30 +0800)]
MLK-10088-11 usb: chipidea: clear otg interrupt status for otg capable controller

We need to do it for all otg capable controller, not only peripheral
featured otg capable controller, otherwise, the host-only role, but
otg capable controller may be responded by otg interrupt.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-10 doc: usb: chipidea: add usb wakeup enable example
Peter Chen [Tue, 23 Dec 2014 05:11:34 +0000 (13:11 +0800)]
MLK-10088-10 doc: usb: chipidea: add usb wakeup enable example

Add the example for how to enable USB as system wakeup source.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-9 usb: chipidea: imx: add usb as system wakeup source
Peter Chen [Tue, 23 Dec 2014 05:04:44 +0000 (13:04 +0800)]
MLK-10088-9 usb: chipidea: imx: add usb as system wakeup source

Enable USB as system wakeup source, and each platform needs to implement
imx_usbmisc_set_wakeup in usbmisc_imx.c to support.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-8 usb: chipidea: add usb as system wakeup source
Peter Chen [Tue, 23 Dec 2014 04:58:17 +0000 (12:58 +0800)]
MLK-10088-8 usb: chipidea: add usb as system wakeup source

The USB signal can be system wakeup source, this patch add the
support, for how to enable it, see Documentation/usb/chipidea.txt.
Since USB wakeup enable logic is vendor/platform specific, the
glue layer needs to implement it to support this feature.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-7 usb: chipidea: imx: add runtime power management support
Peter Chen [Tue, 23 Dec 2014 02:19:16 +0000 (10:19 +0800)]
MLK-10088-7 usb: chipidea: imx: add runtime power management support

Add runtime pm support for imx, only imx6 series are supported and tested.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-6 usb: chipidea: usbmisc_imx: add .set_wakeup interface
Peter Chen [Tue, 23 Dec 2014 02:17:30 +0000 (10:17 +0800)]
MLK-10088-6 usb: chipidea: usbmisc_imx: add .set_wakeup interface

This API is used to enable/disable usb wakeup, only imx6 series are
added, since I don't have other imx hardware on hand. Other imx users
can add their API according to reference manual after testing.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-5 usb: chipidea: add runtime power management support
Peter Chen [Mon, 13 Oct 2014 08:30:30 +0000 (16:30 +0800)]
MLK-10088-5 usb: chipidea: add runtime power management support

Add runtime power management support.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-4 usb: chipidea: imx: simplify the usbmisc callers
Peter Chen [Fri, 12 Dec 2014 06:53:32 +0000 (14:53 +0800)]
MLK-10088-4 usb: chipidea: imx: simplify the usbmisc callers

Move struct imx_usbmisc_data NULL pointer judgement from caller to
each API, it can simplify the caller.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-3 usb: chipidea: usbmisc_imx: delete clock information
Peter Chen [Fri, 12 Dec 2014 05:29:58 +0000 (13:29 +0800)]
MLK-10088-3 usb: chipidea: usbmisc_imx: delete clock information

All imx usb controller's non core registers uses the same clock gate with
core registers, the usbmisc_imx is the library for imx glue driver, the
glue keeps clock on when it calls usbmisc_imx API to change non-core register.

Besides, we will support runtime pm in the future, it also needs to
close this clock when the usb is not in use.

Philipp Zabel also verifies it at imx6q platform, see
http://www.spinics.net/lists/linux-usb/msg118491.html

Cc: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-2 usb: chipidea: imx: using common platform flag directly
Peter Chen [Fri, 12 Dec 2014 04:45:50 +0000 (12:45 +0800)]
MLK-10088-2 usb: chipidea: imx: using common platform flag directly

It is meaningless the glue layer driver has its own platform flag
which is the same meaning with common platform flag.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10088-1 usb: chipidea: udc: return immediately if re-enable non-empty endpoint
Peter Chen [Wed, 10 Dec 2014 06:49:41 +0000 (14:49 +0800)]
MLK-10088-1 usb: chipidea: udc: return immediately if re-enable non-empty endpoint

Some gadget driver (like uac1) will try to enable endpoint again even
the ep is not empty, it will cause the ep reset again and may affect
the dTD list which has already queued.

It returns -EBUSY immediately, and indicate the endpoint is in use.
In this way, the ep's behavior will not be affected, and the gadget
driver is also notified.

Cc: Xuebing Wang <xbing6@gmail.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agousb: chipidea: Fixed a few typos in comments
Mickael Maison [Wed, 26 Nov 2014 05:44:38 +0000 (13:44 +0800)]
usb: chipidea: Fixed a few typos in comments

Fixed typos in comments of 2 drivers/usb/chipidea files

Signed-off-by: Mickael Maison <mickael.maison@gmail.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6629467ba5502cac22d31950e207a0334f2a0de5)

9 years agousb: chipidea: fix phy handling
Antoine Tenart [Wed, 26 Nov 2014 05:44:35 +0000 (13:44 +0800)]
usb: chipidea: fix phy handling

The generic plaftorm device for ChipIdea drivers is probed by calling
ci_hdrc_probe. The device structure used is not the one of the specific
ChipIdea driver but the one of the generic ChipIdea platform device.

This results in not being able to probe the PHYs as we're not using the
right device structure. Since all ChipIdea drivers are retrieving their
PHYs in their specific driver code, this didn't impact any of them yet.

Fixes it using the right device structure (dev->parent).

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 21a5b579cb63364b90e545e7e0a4bccb027711e8)

9 years agousb: chipidea: parameter 'mode' isn't needed for hw_device_reset
Peter Chen [Wed, 26 Nov 2014 05:44:33 +0000 (13:44 +0800)]
usb: chipidea: parameter 'mode' isn't needed for hw_device_reset

The hw_device_reset is dedicated to be used at device mode initializaiton,
so delete the parameter 'mode'. For host driver, the ehci driver will
handle all things.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5b1573005a91dc448e6919d6bec076bedc7e1919)

9 years agousb: chipidea: add controller reset API
Peter Chen [Wed, 26 Nov 2014 05:44:32 +0000 (13:44 +0800)]
usb: chipidea: add controller reset API

Add controller reset API, currently it is used for device mode only.
It may be used for host/otg driver in future.

Ususally, we need this API for dual-role switch and back from hibernation
suspend to let the controller at default state.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit cdd278f21eea55412dd0c5bc468bbdfb0639879b)

9 years agousb: chipidea: remove flag CI_HDRC_REQUIRE_TRANSCEIVER
Peter Chen [Wed, 26 Nov 2014 05:44:31 +0000 (13:44 +0800)]
usb: chipidea: remove flag CI_HDRC_REQUIRE_TRANSCEIVER

Now, USB PHY is mandatory for chipidea core, the flag
CI_HDRC_REQUIRE_TRANSCEIVER is useless.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 947c88592f17bd299ff677049c3cda36cc6f93dd)

9 years agousb: chipidea: imx: add system power management support
Peter Chen [Wed, 26 Nov 2014 05:44:30 +0000 (13:44 +0800)]
usb: chipidea: imx: add system power management support

Add basic system power management support

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2558c1f53bbbb5848fd5910918b97b03249d3885)

9 years agousb: chipidea: add system power management support
Peter Chen [Wed, 26 Nov 2014 05:44:29 +0000 (13:44 +0800)]
usb: chipidea: add system power management support

Add system power management support

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8076932ff2fc0f6db0172420e6b148a8b2e8c805)

9 years agousb: chipidea: add hw_wait_phy_stable for getting stable status
Peter Chen [Wed, 26 Nov 2014 05:44:28 +0000 (13:44 +0800)]
usb: chipidea: add hw_wait_phy_stable for getting stable status

The phy needs some delay to output the stable status from low
power mode. And for OTGSC, the status inputs are debounced
using a 1 ms time constant, so, delay 2ms for controller to get
the stable status(like vbus and id) when the phy leaves low power.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b82613cf09455d9a50fbb144ef07b68225f2b452)

9 years agousb: chipidea: remove the unnecessary delay after clear portsc.phcd
Peter Chen [Wed, 26 Nov 2014 05:44:27 +0000 (13:44 +0800)]
usb: chipidea: remove the unnecessary delay after clear portsc.phcd

The individual PHY driver should take this responsibility if it
needs to delay between clear portsc.phcd and let the phy leave
low power mode.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6d037db6409c33738c7153e87ae1cf682ca2851b)

9 years agousb: chipidea: usbmisc_imx: Read MX53_USB_OTG_PHY_CTRL_1_OFFSET directly
Fabio Estevam [Wed, 26 Nov 2014 05:44:26 +0000 (13:44 +0800)]
usb: chipidea: usbmisc_imx: Read MX53_USB_OTG_PHY_CTRL_1_OFFSET directly

There is no need to do an intermediate step for reading the
MX53_USB_OTG_PHY_CTRL_1_OFFSET register.

Read it directly instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4a1d6cf156dcf436e5037375007116197f03bfb1)

9 years agousb: chipidea: usbmisc_imx: Move the reading of USB_PHY_CTRL
Fabio Estevam [Wed, 26 Nov 2014 05:44:25 +0000 (13:44 +0800)]
usb: chipidea: usbmisc_imx: Move the reading of USB_PHY_CTRL

If 'evdo' property is not defined, then reading the MX25_USB_PHY_CTRL_OFFSET
register is an unneeded operation.

Move the reading of MX25_USB_PHY_CTRL_OFFSET inside the 'evdo' if block code,
where it is actually used.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8d1dc4d055faafafca3edd8499aeeef3f77803e4)

9 years agousb: chipidea: ci_hdrc_imx.c: Remove unneeded OOM message
Fabio Estevam [Wed, 26 Nov 2014 05:44:24 +0000 (13:44 +0800)]
usb: chipidea: ci_hdrc_imx.c: Remove unneeded OOM message

MM core code already complains when devm_kzalloc() fails, so no need to print
the error locally.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 73529828cf896df5017255136b4dc2386dff0850)

9 years agousb: chipidea: core: Remove unneeded OOM message
Fabio Estevam [Wed, 26 Nov 2014 05:44:23 +0000 (13:44 +0800)]
usb: chipidea: core: Remove unneeded OOM message

MM core code already complains when devm_kzalloc() fails, so no need to print
the error locally.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d0f992498e82e656646ad833e3f32ad69cd093e7)

9 years agousb: phy: propagate __of_usb_find_phy()'s error on failure
Arjun Sreedharan [Thu, 20 Nov 2014 15:53:36 +0000 (21:23 +0530)]
usb: phy: propagate __of_usb_find_phy()'s error on failure

When __of_usb_find_phy() fails, it returns -ENODEV - its
error code has to be returned by devm_usb_get_phy_by_phandle().
Only when the former function succeeds and try_module_get()
fails should -EPROBE_DEFER be returned.

[ balbi@ti.com : remove trailing whitespace ]

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 1290a958d48e30d60262a33acb5f068e87834ce4)

9 years agousb: phy: fsl: Fix build errors
Felipe Balbi [Wed, 12 Nov 2014 14:31:40 +0000 (08:31 -0600)]
usb: phy: fsl: Fix build errors

commit e47d925 (usb: move the OTG state from
the USB PHY to the OTG structure) moved the
OTG state from struct usb_phy to struct usb_otg.

Unfortunately, even though I fixed quite a few
build regressions with that patch already, this
one was still missing.

Note that this driver still has other randconfig
build problems which I'll leave for driver author
to fix, as that's less trivial.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit e5ba1c024aa0c21ef1755402fd94fabfd6e18c16)

9 years agousb: core: notify disconnection when core detects disconnect
Peter Chen [Tue, 4 Nov 2014 03:14:31 +0000 (11:14 +0800)]
usb: core: notify disconnection when core detects disconnect

It is safe to call notify disconnect when the usb core
thinks the device is disconnected.

This commit also fixes one bug found at below situation:
we have not enabled usb wakeup, we do system suspend when
there is an usb device at the port, after suspend, we plug out
the usb device, then plug in device again. At that time,
the nofity disconnect was not called at current code, as
the controller doesn't know the usb device was disconnected
during the suspend, but USB core knows the port has changed
during that periods.

So to fix this problem, and let the usb core call notify disconnect.

Cc: 3.17+ <stable@vger.kernel.org>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b2108f1e519e983e5dd5712b3a44f7366ab509e4)

9 years agousb: core: need to call usb_phy_notify_connect after device setup
Tony Zheng [Fri, 17 Oct 2014 11:43:02 +0000 (19:43 +0800)]
usb: core: need to call usb_phy_notify_connect after device setup

Since we notify disconnecting based on the usb device is existed
(port_dev->child, the child device at roothub is not NULL), we
need to notify connect after device has been registered.

This fixes a bug that do fast plug in/out test, and the notify_disconnect
is not called due to roothub child is NULL and the enumeration has failed.

Cc: v3.17+ <stable@vger.kernel.org>
Signed-off-by: Tony Zheng <Tony.Zheng@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 01ed67dc70834d00d62b6e754ee0f76301fbc140)

Conflicts:

drivers/usb/core/hub.c

9 years agousb: chipidea: otg_fsm: delete unnecessary 'out of memory' messages
Li Jun [Tue, 6 Jan 2015 09:11:24 +0000 (17:11 +0800)]
usb: chipidea: otg_fsm: delete unnecessary 'out of memory' messages

The memory subsystem has already had similar message for it.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agousb: chipidea: host: add portpower override
Michael Grzeschik [Mon, 13 Oct 2014 01:53:04 +0000 (09:53 +0800)]
usb: chipidea: host: add portpower override

This patch adds an external portpower override callback, only single
port regulator control is supported now.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c8679a2fb8decc949c848ca58f93ff7fb619931a)

9 years agousb: ehci: add ehci_port_power interface
Michael Grzeschik [Mon, 13 Oct 2014 01:53:03 +0000 (09:53 +0800)]
usb: ehci: add ehci_port_power interface

The current EHCI implementation is prepared to toggle the
PORT_POWER bit to enable or disable a USB-Port. In some
cases this port power can not be just toggled by the PORT_POWER
bit, and the gpio-regulator is needed to be toggled too.

This patch defines a port power control interface ehci_port_power for
ehci core use, it toggles PORT_POWER bit as well as calls platform
defined .port_power if it is defined.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 11a7e59405148c855e0a9d13588930ccec02c150)

9 years agousb: chipidea: add support to the generic PHY framework
Antoine Tenart [Thu, 30 Oct 2014 17:41:19 +0000 (18:41 +0100)]
usb: chipidea: add support to the generic PHY framework

This patch adds support of the PHY framework for ChipIdea drivers.
Changes are done in both the ChipIdea common code and in the drivers
accessing the PHY. This is done by adding a new PHY member in
ChipIdea's structures and by taking care of it in the code.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
(cherry picked from commit 1e5e2d3d055436c114e2f16145b83339aed024ff)