]> git.kernelconcepts.de Git - karo-tx-linux.git/log
karo-tx-linux.git
9 years agoMLK-10102-6 usb: chipidea: otg: export ci_handle_id_switch API
Li Jun [Thu, 15 Jan 2015 13:05:12 +0000 (21:05 +0800)]
MLK-10102-6 usb: chipidea: otg: export ci_handle_id_switch API

Export ci_handle_id_switch interface for controller handle id
changes during system sleep with power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-5 usb: chipidea: udc: support resume udc from power lost
Li Jun [Thu, 15 Jan 2015 12:49:36 +0000 (20:49 +0800)]
MLK-10102-5 usb: chipidea: udc: support resume udc from power lost

This patch implements the suspend and resume routine for udc resume
from power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-4 usb: chipidea: host: support resume usb from power lost
Li Jun [Thu, 15 Jan 2015 12:10:36 +0000 (20:10 +0800)]
MLK-10102-4 usb: chipidea: host: support resume usb from power lost

This patch implements the suspend and resume routine for save and restore
registers of ehci, this is to support host resume from a system sleep with
power lost.

Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10102-3 usb: chipidea: export hw_controller_reset API
Li Jun [Thu, 15 Jan 2015 12:21:45 +0000 (20:21 +0800)]
MLK-10102-3 usb: chipidea: export hw_controller_reset API

Host needs to reset controller for recovery from power lost.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10102-2 usb: chipidea: add suspend and resume routine for role driver
Li Jun [Thu, 15 Jan 2015 12:17:07 +0000 (20:17 +0800)]
MLK-10102-2 usb: chipidea: add suspend and resume routine for role driver

We may need to do extra things for system suspend/resume per different
roles(e.g. power lost during system sleep), so define system suspend/resume
handler for roles.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10102-1 usb: chipidea: imx: usb resume from power lost during system sleep
Li Jun [Thu, 15 Jan 2015 11:13:13 +0000 (19:13 +0800)]
MLK-10102-1 usb: chipidea: imx: usb resume from power lost during system sleep

i.MX6SX mega off can shutdown domain power supply if none of peripheral
in this domain is registered as wakeup source, this patch adds usb controller
imx specific re-init after resume from such power lost during system sleep.

Signed-off-by: Li Jun <b47624@freescale.com>
9 years agoMLK-10103-2 cpufreq: imx6: increase SOC/PU voltage for vpu 352M
Anson Huang [Fri, 16 Jan 2015 10:47:42 +0000 (18:47 +0800)]
MLK-10103-2 cpufreq: imx6: increase SOC/PU voltage for vpu 352M

When VPU is running at 352MHz, SOC/PU voltage need to be
at 1.25V for 396/792MHz setpoint, as 396M setpoint is
removed, so only increase 792M setpoint's voltage.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoMLK-10103-1 ARM: imx: add VPU 352M for i.mx6q
Anson Huang [Fri, 16 Jan 2015 10:42:08 +0000 (18:42 +0800)]
MLK-10103-1 ARM: imx: add VPU 352M for i.mx6q

When VPU freq is set to 352MHz, it needs to source clk
from PLL2_PFD2_396M, and PLL2_PFD2_396M need to change
freq to 352M, cpufreq's 396M setpoint will be removed.

Busfreq will be disabled as it needs PLL2_PFD2 to be
as 396MHz to achieve low power audio freq setpoint.

To enable VPU 352MHz feature, select it in menuconfig,
it is disabled by default.

Signed-off-by: Anson Huang <b20788@freescale.com>
9 years agoENGR00320136 net: fec: fix rcv is not last issue when do suspend/resume test
Fugang Duan [Fri, 16 Jan 2015 05:18:00 +0000 (13:18 +0800)]
ENGR00320136 net: fec: fix rcv is not last issue when do suspend/resume test

When do suspend/resume stress test, some log shows "rcv is not +last".
The issue is that enet suspend will disable phy clock, phy link down,
after resume back, enet MAC redo initial and ready to tx/rx packet,
but phy still is not ready which is doing auto-negotiation. When phy
link is not up, don't schdule napi soft irq.

(cherry-picked from commit 61b16b307663ac972bc6c80cc5b308c546396027)

Signed-off-by: Fugang Duan <B38611@freescale.com>
9 years agoMLK-10105 ARM: dtsi: Add MLB50 support for the i.MX6SX
Luwei Zhou [Fri, 16 Jan 2015 04:37:41 +0000 (12:37 +0800)]
MLK-10105 ARM: dtsi: Add MLB50 support for the i.MX6SX

Add MLB50 support on the i.MX6SX-ARD platform.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
9 years agoMLK-9769-26 caam: fix RNG buffer cache alignment
Steve Cornelius [Tue, 6 Jan 2015 23:20:15 +0000 (16:20 -0700)]
MLK-9769-26 caam: fix RNG buffer cache alignment

The hwrng output buffers (2) are cast inside of a a struct (caam_rng_ctx)
allocated in one DMA-tagged region. While the kernel's heap allocator
should place the overall struct on a cacheline aligned boundary, the 2
buffers contained within may not necessarily align. Consenquently, the ends
of unaligned buffers may not fully flush, and if so, stale data will be left
behind, resulting in small repeating patterns.

This fix aligns the buffers inside the struct.

Note that not all of the data inside caam_rng_ctx necessarily needs to be
DMA-tagged, only the buffers themselves require this. However, a fix would
incur the expense of error-handling bloat in the case of allocation failure.

Signed-off-by: Steve Cornelius <steve.cornelius@freescale.com>
9 years agoMLK-9769-25 Modify CAAM RNG entropy delay value
Victoria Milhoan [Wed, 14 Jan 2015 19:21:10 +0000 (12:21 -0700)]
MLK-9769-25 Modify CAAM RNG entropy delay value

Modify the minimum entropy delay value for CAAM's RNG based on
recommended settings.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-24 Add cache coherency support to CAAM scatterlist implementation
Victoria Milhoan [Wed, 14 Jan 2015 19:00:59 +0000 (12:00 -0700)]
MLK-9769-24 Add cache coherency support to CAAM scatterlist implementation

Add cache coherency support to the CAAM scatterlist implementation.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9769-23 Replace SECVIO of_irq_to_resource() with irq_of_parse_and_map()
Victoria Milhoan [Wed, 14 Jan 2015 18:43:12 +0000 (11:43 -0700)]
MLK-9769-23 Replace SECVIO of_irq_to_resource() with irq_of_parse_and_map()

Replace of_irq_to_resource() in the SECVIO module with the simpler
equivalent irq_of_parse_and_map().  Also, add error checking to
to the SECVIO and Job Ring modules. Based on upstream commit
f7578496a671a96e501f16a5104893275e32c33a.

Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
9 years agoMLK-9980 Modify CAAM driver to hide algorithm registered notifications
Victoria Milhoan [Wed, 10 Dec 2014 22:32:26 +0000 (15:32 -0700)]
MLK-9980 Modify CAAM driver to hide algorithm registered notifications

The CAAM driver prints a message for each algorithm it registers
with the Crypto API. This patch hides the messages unless debug is
enabled.

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

9 years agoMLK-10036 Freescale CAAM: Add support for DSM with Mega/Fast mix on
Victoria Milhoan [Thu, 18 Dec 2014 21:06:50 +0000 (14:06 -0700)]
MLK-10036 Freescale CAAM: Add support for DSM with Mega/Fast mix on

This patch allows CAAM to be enabled as a wakeup source for the
Mega/Fast mix domain. If CAAM is enabled as a wakeup source, it
will continue to be powered on across Deep Sleep Mode (DSM). This
allows CAAM to be functional after the system resumes from DSM.

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

9 years agoMLK-9971 Add XCBC-AES support for CAAM in i.MX6 family
Winston Hudson (b45308) [Thu, 27 Jun 2013 20:22:39 +0000 (13:22 -0700)]
MLK-9971 Add XCBC-AES support for CAAM in i.MX6 family

Add XCBC-AES 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 agoNeed gate the QSPI2 and GPMI_IO clock during clock init
Jason Liu [Tue, 6 Jan 2015 03:23:59 +0000 (11:23 +0800)]
Need gate the QSPI2 and GPMI_IO clock during clock init

QSPI2/GPMI_IO share the same clock source but with the
different gate, need explicitely gate the QSPI2 & GPMI_IO
during the clock init phase according to the SOC design.

The topo of the clock for the GPMI_IO and NAND as below:

mux --> pre divider --> post divider --gate-- >GPMI_IO
                                     |-gate-- >QSPI2

(Note: i.MX6SX:GPMI_NAND and GSPI2 is PINMUX conflicts.)

The SOC design spec required that if change the parent clock
of the GPMI_IO or QSPI2, need gate the GPMI_IO and QSPI2 first
otherwise, there will have some glitch which cause the divider
malfunciton. Thus, we need explicitely gate QSPI2 & GPMI_IO at
the clock initialization phase and then later on common clock
framework will gurantee that each time, the parent clock rate
changes after the child clock is disabled(gated).

Signed-off-by: Jason Liu <r64343@freescale.com>
(cherry picked from commit 110d63a5886e065e77a69f816216af044c096a44)

Conflicts:
arch/arm/mach-imx/clk-imx6sx.c

9 years agoENGR00320792-3 usb: gadget: mark init as late_initcall
Peter Chen [Mon, 23 Sep 2013 03:20:08 +0000 (11:20 +0800)]
ENGR00320792-3 usb: gadget: mark init as late_initcall

Since we introduce -EPROBE_DEFER for udc driver, it will be
probed at late_initcall if it is defered. When the gadget
is built in, it will return "couldn't find an available UDC"
at such case. That's the problem we met at below link:

http://marc.info/?l=linux-usb&m=137706435611447&w=2

We have no driver's probe at gadget driver, so we can't return
-EPROBE_DEFER. And it is also not suitable to defer udc_bind_to_driver
if the udc is not found temporarily, since it is hard to decide the
return value for usb_gadget_probe_driver.

Due to above reasons, mark gadget's init as late_initcall may be a
moderate solution.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoENGR00286926 usb: chipidea: imx: add release_bus_freq at failure path
Peter Chen [Fri, 8 Nov 2013 02:14:18 +0000 (10:14 +0800)]
ENGR00286926 usb: chipidea: imx: add release_bus_freq at failure path

If not, the request{release}_bus_freq will be mismatch if
fail occurs.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoENGR00286459 usb: chipidea: imx: add request{release}_bus_freq
Peter Chen [Wed, 6 Nov 2013 08:38:18 +0000 (16:38 +0800)]
ENGR00286459 usb: chipidea: imx: add request{release}_bus_freq

When the usb in idle, it calls release_bus_req.
When the usb is going to use, it calls request_bus_req.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10101-1 usb: chipidea: otg: runtime PM support for otg fsm mode
Li Jun [Wed, 14 Jan 2015 10:10:09 +0000 (18:10 +0800)]
MLK-10101-1 usb: chipidea: otg: runtime PM support for otg fsm mode

Add runtime PM for otg fsm.

Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-7 usb: chipidea: imx: add usb charger detection for imx6
Li Jun [Fri, 9 Jan 2015 13:58:41 +0000 (21:58 +0800)]
MLK-10085-7 usb: chipidea: imx: add usb charger detection for imx6

The usb controller driver creates usb charger, and notify
the charger connect and disconnect using vbus connect and
disconnect event.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-6 usb: chipidea: Add usb charger detect support in otg fsm mode
Li Jun [Wed, 14 Jan 2015 05:12:04 +0000 (13:12 +0800)]
MLK-10085-6 usb: chipidea: Add usb charger detect support in otg fsm mode

Use b_sess_valid_event for charger detection in otg fsm mode.

Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-5 usb: chipidea: Add usb charger detect notify
Li Jun [Fri, 9 Jan 2015 07:35:07 +0000 (15:35 +0800)]
MLK-10085-5 usb: chipidea: Add usb charger detect notify

- Change .notify's return value from void to int, update msm notify_event
  return value accordingly.
- Add CI_HDRC_CONTROLLER_VBUS_EVENT and
  CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger
  detection flow.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-4 usb: doc: chipidea: imx: add imx6-usb-charger-detection property
Li Jun [Fri, 9 Jan 2015 06:37:24 +0000 (14:37 +0800)]
MLK-10085-4 usb: doc: chipidea: imx: add imx6-usb-charger-detection property

It is used to indicate whether we use SoC's usb charger
detection or not. Besides, we add anatop phandle since
we need to use anatop register to do most of charger detect operations.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10085-3 ARM: imx6: remove imx6-usb-charger-detection for imx6sx-sabreauto
Li Jun [Mon, 12 Jan 2015 07:58:21 +0000 (15:58 +0800)]
MLK-10085-3 ARM: imx6: remove imx6-usb-charger-detection for imx6sx-sabreauto

Disable imx6-usb-charger-detection by default.

Signed-off-by: Li Jun <jun.li@freescale.com>
9 years agoMLK-10085-2 ARM: imx6: add usb anatop phandle at usbotg node
Li Jun [Fri, 9 Jan 2015 06:27:07 +0000 (14:27 +0800)]
MLK-10085-2 ARM: imx6: add usb anatop phandle at usbotg node

Add anatop phandle at usbotg node to access anatop register.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10085-1 power: imx6: add imx6 USB charger detection
Li Jun [Fri, 9 Jan 2015 03:39:33 +0000 (11:39 +0800)]
MLK-10085-1 power: imx6: add imx6 USB charger detection

Add imx6 USB charger detection, the vbus supplier will create and
remove struct usb_charger, and notify vbus connect and disconnect
event. The detail USB charger detection flow is at: "i.MX6 RM,
Chapter Universal Serial Bus 2.0 Integrated PHY (USB-PHY),
Charger detection, Charger detection software flow".

Since imx6 only has charger detection function, and no charging
current function is existed. It the user wants the detection abilities
from SoC, it can use this detection method
(add imx6-usb-charger-detection at dts). If the charger IC
already has USB charger detection function, and the user wants
to use the detection method from charger IC, please do not add
imx6-usb-charger-detection property at dts.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
9 years agoMLK-10099 ARM: dts: imx6qdl: Add VDOA support
Liu Ying [Thu, 15 Jan 2015 03:04:18 +0000 (11:04 +0800)]
MLK-10099 ARM: dts: imx6qdl: Add VDOA support

This patch adds VDOA device tree node support.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
9 years agoMLK-9941 mtd: qspi: Update device tree binding doc for ddrsmp property
Ye.Li [Mon, 1 Dec 2014 14:06:53 +0000 (22:06 +0800)]
MLK-9941 mtd: qspi: Update device tree binding doc for ddrsmp property

The new property "ddrsmp" was added into device tree. Update the doc
accordingly.

Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 4239df12c5d6c3ac19a25e120ffe17df93c358a3)

9 years agoMLK-10028 QSPI dynamically alloc memory for AHB read
Allen Xu [Thu, 15 Jan 2015 02:18:29 +0000 (10:18 +0800)]
MLK-10028 QSPI dynamically alloc memory for AHB read

QSPI may failed to alloc enough memory (256MB) for AHB read in
previous implementation, especially in 3G/1G memory layout kernel.
Dynamically alloc memory to avoid such issue.

This implementation generally alloc 4MB memory for AHB read, it should
be enough for common scenarios, and the side effect (0.6% performance
drop) is minor.

Previous implementation

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=1K count=32K
32768+0 records in
32768+0 records out
33554432 bytes (34 MB) copied, 2.16006 s, 15.5 MB/s

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=32M count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 1.43149 s, 23.4 MB/s

After applied the patch

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=1K count=32K
32768+0 records in
32768+0 records out
33554432 bytes (34 MB) copied, 2.1743 s, 15.4 MB/s

root@imx6qdlsolo:~# dd if=/dev/mtd0 of=/dev/null bs=32M count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 1.43158 s, 23.4 MB/s

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

9 years agoMLK-9976: ARM: dts: NAND BBT inconsistency causes UBIFS randomly mount failed
Allen Xu [Tue, 9 Dec 2014 22:12:00 +0000 (06:12 +0800)]
MLK-9976: ARM: dts: NAND BBT inconsistency causes UBIFS randomly mount failed

NAND scans the bad blocks during kernel boots up, which invokes the
gpmi_ecc_read_oob function to check the badblock mark for each block. In
this function the oob data was raw read from NAND chip without ECC, so
it hardly to guarantee the consistency of the data considering the
possible bitflips. It found that in some MLC NAND the oob data changed
and consequently the BBT changed in different power cycles. This issue
may cause the UBIFS mount failed.

To fix this issue, add "nand_on_flash_bbt" option in dts to store the BBT
in NAND flash. On the first time kernel boot up, all bad blocks and
probably some fake bad block would be recognized and be recorded in
on-nand bad block table. From the second time boot, kernel will read BBT
from NAND Flash rather than calling gpmi_ecc_read_oob function to check
bad block.

No bad block would be missed when create BBT since the probability that
16bit bad block mark filps from 0x00 to 0xFF is extremely low.

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

9 years agoMLK-9957 mtd: NAND: fix the kernel panic issue for NAND suspend/resume
Allen Xu [Thu, 4 Dec 2014 13:51:48 +0000 (21:51 +0800)]
MLK-9957 mtd: NAND: fix the kernel panic issue for NAND suspend/resume

The branch determined by GPMI_IS_MX6SX() should not include
acquire_dma_channels() function which causes unbalanced dma
request/release on other platform.

Removed GPMI_IS_MX6SX() to make code simple although it is not necessary
to restore GPMI/BCH registers for i.MX6Q/DL

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

9 years agoMLK-9811 mtd: gpmi: add supend/resume support
Huang Shijie [Wed, 7 May 2014 09:15:03 +0000 (17:15 +0800)]
MLK-9811 mtd: gpmi: add supend/resume support

support gpmi nand suspend/resume function

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

9 years agoMLK-9810 dma: mxs-dma: add power management support
Huang Shijie [Wed, 7 May 2014 06:04:09 +0000 (14:04 +0800)]
MLK-9810 dma: mxs-dma: add power management support

this patch adds power management support for mxs-dma driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Allen Xu <b45815@freescale.com>
(cherry picked from commit 7a59828eeda36457e6e60383705a0bc5831ffbf7)

9 years agoMLK-9949: mtd: qspi: Handle QSPI probe error path correctly
Allen Xu [Wed, 3 Dec 2014 17:06:47 +0000 (01:06 +0800)]
MLK-9949: mtd: qspi: Handle QSPI probe error path correctly

If QSPI probe failed in some cases, such as board rework, the error
patch was not handled correctly.

This issue may cause kernle dump in fec driver, since the
pm_qos_remove_request() in QSPI driver was not invoked when probe
failed.

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

9 years agoMLK-9842 mtd: fsl-quadspi: Propagate the error from of_modalias_node()
Fabio Estevam [Fri, 17 Oct 2014 18:31:08 +0000 (15:31 -0300)]
MLK-9842 mtd: fsl-quadspi: Propagate the error from of_modalias_node()

The 'map_failed' label will return 'ret', so we need to assign the error
code to 'ret', otherwise the probe function will return success.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(cherry picked from commit b26171e392c7d3952b6eeb6da62a861c5317e438)
(cherry picked from commit 9e4a091d30e27dd40a04b892bf5f6bf372271380)

9 years agoMLK-9948: ARM: dts: Add ddrsmp parameter for 19x19 arm2 board
Allen Xu [Wed, 3 Dec 2014 17:04:20 +0000 (01:04 +0800)]
MLK-9948: ARM: dts: Add ddrsmp parameter for 19x19 arm2 board

Add the ddrsmp parameter for 19x19 arm2 board.
2 ---- i.MX6SX 19x19 ARM2 board

And reduce the clock frequency from 53Mhz to 29Mhz.

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

9 years agoMLK-9939 ARM: dts: Add ddrsmp parameter to device tree for i.MX6SX ARM2 board
Allen Xu [Mon, 1 Dec 2014 11:55:18 +0000 (19:55 +0800)]
MLK-9939 ARM: dts: Add ddrsmp parameter to device tree for i.MX6SX ARM2 board

The ddr sample point is board related, so add ddrsmp parameter to device
tree for i.MX6SX 17x17 ARM2 board.

DDRSMP value:
2 ---- i.MX6SX 17x17 ARM2 board

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

9 years agoMLK-9920 mtd: qspi: Add ddrsmp parameter to device tree
Ye.Li [Mon, 1 Dec 2014 09:28:47 +0000 (17:28 +0800)]
MLK-9920 mtd: qspi: Add ddrsmp parameter to device tree

Since QSPI internal DDR sample point is relevant with board layout,
we can't use same value for all boards. Add ddrsmp parameter to device
tree for i.MX6SX Sabreauto/Sabresd board.

DDRSMP value:
0 ---- i.MX6SX Sabresd board (RevB and RevA)
2 ---- i.MX6SX Sabreauto board

The Sabresd RevA board also needs to reduce clock to 29Mhz according to
the Spansion spec.

Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit c9115cc22d836b5b980ca20932a005ea61b20082)

9 years agoMLK-9924 mtd: qspi: QSPI1 cannot wake up WAIT mode workaround
Allen Xu [Sat, 29 Nov 2014 09:51:36 +0000 (03:51 -0600)]
MLK-9924 mtd: qspi: QSPI1 cannot wake up WAIT mode workaround

QSPI1 cannot wake up CCM from WAIT mode on SX ARD board, add pmqos to
let CCM NOT enter WAIT mode when accessing QSPI1, refer to TKT245618.

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

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>