Common codes changes in the mcc 2.0 updates
- common definitions are moved from mcc_config.h to mcc_common.h
because that these definitions are common for the standalone mcc
stack, and shared by different platforms, such as Linux, MQX.
- re-define the common api _psp_core_num(), and _psp_node_num().
Let them to be no platform dependency.
- move the definition of the MCC_OS_USED in mcc_config.h
- new add on mcc_config_linux.h file, contained the platform
related macro definitions contained in mcc_config.h before.
- add the related linux modifications into mcc_api.c/mcc_common.c
when implement the mcc2.0 into linux BSP.
- fix one potential bug that all the share memory operations should
be protected by sema4.
Acked-by: Shawn Guo
Signed-off-by: Richard Zhu <richard.zhu@freescale.com>
KMap the buffers before copying trailing bytes during hmac into a session
temporary buffer. This is required if pinned buffer from user-space is send
during hmac and is safe even if hmac request is generated from within kernel.
Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 82ad6bcade)
RNG4 block contains multiple (i.e. 2) state handles that can be
initialized. This patch adds the necessary code for detecting
which of the two state handles has been instantiated by another
piece of software e.g. u-boot and instantiate the other one (or
both if none was instantiated). Only the state handle(s)
instantiated by this driver will be deinstantiated when removing
the module.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 1005bccd7a)
[<vicki.milhoan@freescale.com>: Edited to apply to 3.10]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
RNG4 defines in desc.h were incomplete (bits AI & PS were missing),
while SK was set as an ALG related bit. This patchs adds the
missing bits and corrects the SK bit.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit f1157a5bf3)
If the caam driver module instantiates the RNG state handle 0, then
upon the removal of the module, the RNG state handle is left
initialized. This patch takes care of reverting the state of the
handle back to its previous uninstantatied state.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit b1f996e0b3)
[<vicki.milhoan@freescale.com>: Edited to apply to 3.10]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
In the frame_to_bytes(), when hw_ptr*frame_bits exceed the maxmum of unsigned
long, the return value is saturated, so the appl_bytes is wrong.
This patch is to correct the usage of frame_to_bytes().
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Revert "ENGR00320849-3 ASoC: dmaengine: Audio suspend/resume will be failed."
This reverts commit 2e516e0787f9f83003a2fddac2ce1ce51bbdcfcc.
According commit 1880fc41df, sdma has fixed the issue in suspend/resume. So
enable the audio dma suspend/resume.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Return value -ERESTARTSYS is not visible for user space according
to include/linux/errno.h. So use -EBUSY replace it.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The reason of crach is that some variables are not protected in
function mxc_asrc_suspend(), when suspend, there is possibility to
access one NULL pointer.
Refine the spin lock usage, add protecting for pair_hold.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The hardware ASRC version 1, used on i.MX35, has a limitation that even
pair can only process even channel data. However, after using version 2,
it actually can support odd number of channels now. So we drop the check
for non-v1 versions.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
The earlier patch for "ENGR00313512 dma: imx-sdma: A bungle of work around for
BUG ON issue" is better not applied for loop mode, since there is no any cookie
touch in loop mode which means never trigger the BUG_ON workaround. Otherwise,
if upper driver such as UART disable dma channel but the device still has sent
the data into the RXFIFO, bd buffer will be consumed quickly and then stop.That
will trigger "RX FIFO overrun", like below log:
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
imx-uart 21ec000.serial: Rx FIFO overrun
Signed-off-by: Robin Gong <b38343@freescale.com>
Add these two interface, so than user can set and get pre-timeout value to save
some important data before watchdog reboot.
Signed-off-by: Robin Gong <B38343@freescale.com>
(cherry picked from commit 36d2c03e30f18a34439fdb928ad5bad8d66a1b64)
This change is required for post SEC-5.0 devices which have RNG4.
Setting RDB in security configuration register allows CAAM to use the
"Random Data Buffer" to be filled by a single request. The Random Data
Buffer is large enough for ten packets to get their IVs from a single
request. If the Random Data Buffer is not enabled, then each IV causes a
separate request, and RNG4 hardware cannot keep up resulting in lower
IPSEC throughput if random IVs are used.
Signed-off-by: Vakul Garg <vakul@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 575c1bd549)
[<vicki.milhoan@freescale.com>: Edited to apply to 3.10]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
This patch splits the RNG4 state handle instantiation
function into two parts: one that handles the creation
of the descriptor which instructs the CAAM to perform
the instantiation of the state handle and another
function that performs the running of the said descriptor
using the DECO debug mechanism.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 04cddbfe6b)
[<vicki.milhoan@freescale.com>: Edited to disable ARM clocks at removal]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
The RNG4 block in CAAM needs to be 'seeded' first before being used
for generating pseudo-random data. The 'seeding' is done by getting
entropy from the TRNG ring oscillator. The RTFRQMAX register controls
the maximum allowable number of samples that can be aquired during
an entropy sample. Depending on the clock at which the RNG4 block
(and for that matter the SEC block) runs, it's possible that a
hard-coded value for the maximum frequency is inadequate, i.e. more
samples than needed are taken. This is an error, and thus the RNG4
block doesn't get initialized. The patch attempts to alleviate
this issue by trying with progressivly larger frequencies, until
the number of samples is adequate.
This patch also fixes how a descriptor is deemed as being finished:
instead of checking the VALID field in the DECO debug register,
it makes sure that the DECO is idle, by checking the DECO state field
of the said register.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 84cf48278b)
[<vicki.milhoan@freescale.com>: Adjusted RNG values to support more devices]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
If the CAAM driver initialization failed (due to various reasons, e.g. RNG4
initialization failed), then the registration of hash/algorithms/rng shouldn't
take place. This patch adds the necessary code to prevent this registration.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit b2744dfd39)
[<vicki.milhoan@freescale.com>: Edited to fix misplaced of_node_put() calls]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
The way the DECO runs a descriptor through the direct (debug)
interface is different from the JRI interface: the DECO will
continue to try and execute the next commands, after the descriptor
buffer has ended. This leads to unpredictable results and possibly
to locking up of the DECO. This patch adds a halt command at the
end of the descriptor to ensure the DECO halts when it reaches
the end of the descriptor buffer.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit d5e4e999cd)
The i.MX6SX-sabreauto board has an base board which contains a SD
slot, this SD slot is connect to usdhc4, so add usdhc4 in devicetree.
Due to the SD slot is on base board, if we set the usdhc4 pad drive
strength as 87 Ohm, the signal on these pads is not good, usdhc4 can't
get the SD card's status. So change the usdhc4 pad drive strength to
43 Ohm, then usdhc4 can work well for base board.
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
CAAM driver contains one macro (xstr) used for printing
the line location in a file where a memdump is done. This patch
replaces the xstr macro with the already existing __stringify
macro that performs the same function.
Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 514df2816f)
[<vicki.milhoan@freescale.com>: Edited to apply to 3.10]
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
DESC_JOB_IO_LEN is a generic macro which indicates the space required in
the descriptor for placing SEQIN/OUT commands, job descriptor header,
shared descriptor pointer. Moving it to descriptor construction file
which can be supposedly included by different algo offload files.
Change-Id: Ic8900990d465e9079827b0c7fcacc61766d7efb6
Signed-off-by: Vakul Garg <vakul@freescale.com>
Reviewed-by: Geanta Neag Horia Ioan-B05471 <horia.geanta@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit aa2faec1a0)
Modify CAAM RNG code within the CAAM driver to simplify
RNG instantiation and more closely match the upstream
version of the CAAM driver.
Signed-off-by: Victoria Milhoan <vicki.milhoan@freescale.com>
"Patch ENGR00329450 ARM: imx: set CLK_SET_RATE_GATE for gate and divider clocks"
requires that the particular clock (derived from PLL) need to be disabled before
its rate is changed. While on imx6sx, CSI0 and CSI1 shares the same CSI clock,
which means the CSI clock cannot be disabled then changed the clock when another
CSI module is already working.
Currently the CSI clock is only derived from OSC 24Mhz instead of PLL.
Now use the clk_register_gate() without CLK_SET_RATE_GATE flag by compromise
to make two CSIs work properly.
Signed-off-by: Robby Cai <r63905@freescale.com>
If so, we can set freely 'fsl,arm-soc-shared' property in dts file,
for example, we can default setting it '1' in imx6sx-sdb.dts and overwrite
it '0' in upper level imx6sx-sdb-ldo.dts.
Signed-off-by: Robin Gong <b38343@freescale.com>
On imx6sx-sdb-revb board we use pfuze200 and pfuze100 on reva board.
Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit c0ebad128792a876f8c37a8572f46ab4ee82c14e)
The CAN transceiver is changed on RevB board and the default imx6sx-sdb.dts
is for support new RevB board.
This patch adds the dts for legacy RevA board support, especially for CAN
device.
This is for people who still wants to use RevA board with this code base.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 9d90c66e3cf61ed243ae148d401f2b46875f0745)
With this, we can pass the gpio active flag from device tree
for initialize the transceiver.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 1847de083ac1dd0f0e150cc65ea1460baf362656)
In i.MX6SX-ARD board, the SD slot's card detect pin has an pull-up resistor,
and this pull-up resister is connect to VGEN1_1V2 which is output from PMIC.
But PMIC default turn off VGEN1_1V2, so the card detect pin is always low level,
can't detect whether the SD card has been inserted.
This patch turn on the VGEN1 in PMIC to supprot SD card hot plug.
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>