This patch adds the Kernel support for the caam-keygen user-space
application. It has two IOCTL calls for key and blob generation and
import a black key from a blob.
This support is included in CRYPTO_DEV_FSL_CAAM_TK_API (tagged key
support).
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
CAAM's Black Key mechanism is intended for protection
of user keys against bus snooping. This automatically
encapsulates and decapsulates cryptographic keys ''on-the-fly''
in an encrypted data structure called a Black Key.
Before a value is copied from a Key Register to memory,
CAAM will automatically encrypt the key as a Black Key
(encrypted key) using the current value in the JDKEKR or
TDKEKR as the encryption key.
CAAM's built-in Blob Protocol provides a method for protecting
user-defined data across system power cycles. CAAM protects data
in a data structure called a Blob, which provides both confidentiality
and integrity protection. The data to be protected is encrypted so that
it can be safely placed into non-volatile storage before the SoC is
powered down.
This patch includes the support to generate a black key from random or
from a plaintext. Also one can encapsulate it into a blob or decapsulate
a black key from a blob.
The key and blob generation descriptors are exported into a separate file,
such that they could be shared with other interfaces (qi, qi2).
This feature has support only for black keys, encapsulated in
black blobs in General Memory.
In caamkeyblob_test.c file is a test that validates the above
operations: create a black key from plaintext or from random,
encapsulate and decapsulate a blob and compare the obtained black key.
This test is configured as a kernel module.
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Tagged keys are keys that contain metadata indicating what
they are and how to handle them using the new added tag_object API.
A tag object represents the metadata (or simply a header/configuration)
and the actual data (e.g. black key) obtained from hardware.
The support, for tagged keys, to skcipher algorithms, is done by
adding new transformations, with tk prefix to distinguish
between plaintext and tagged keys.
The tk_ transformations can be used directly by their name:
struct sockaddr_alg sa = {
.salg_family = AF_ALG,
.salg_type = "skcipher", /* this selects the symmetric cipher */
.salg_name = "tk(cbc(aes))" /* this is the cipher name */
};
or for dm-crypt, e.g. using dmsetup:
dmsetup -v create encrypted --table "0 $(blockdev --getsz /dev/mmcblk2p10)
crypt capi:tk(cbc(aes))-plain :32:logon:seckey 0 /dev/mmcblk2p10 0 1
sector_size:512".
tk_ transformations will know how to handle tagged keys, by loading the
proper settings for KEY command.
The API expects that the object (the actual data) from a tag object
to be a buffer (defined by address and size).
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Bit field of 'valid_ts_received' is 1, change its typedef to
unsigned int. (coverity ID 9000734)
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
A1 chip already fix pcie issue, so enable pcie in imx8dxl-evk.dts,
and remove the extra file "*-pcie.dts".
Current BSP doesn't support A0 chip after the change.
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
1. enable color description in vui when encoding.
2. improve the get/set color description api
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
ISO have defined some color primaries/transfer/matrix,
but not defined in v4l2 framework,
so add some definition
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
This patch checks the return value of imx_sc_misc_set_control() called
in dprc_prg_sel_configure() and generates warning dmesg in case the
return value is nonzero. The check makes Coverity happy.
This fixes Coverity issue: CID 10836597.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
This patch checks the return value of imx_sc_misc_set_control() called
in dprc_dpu_gpr_configure() and generates warning dmesg in case the
return value is nonzero. The check makes Coverity happy.
This fixes Coverity issue: CID 10836598.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
Changed ecspi compatible name to imx6ul-ecspi instead of imx51-ecspi since
ERR009165 fix on i.mx6sll.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Clark Wang <xiaoning.wang@nxp.com>
Changed ecspi compatible name to imx51-ecspi instead of imx6ul-ecspi since
ERR009165 not fix on i.mx8mm.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Clark Wang <xiaoning.wang@nxp.com>
Changed ecspi compatible name to imx51-ecspi instead of imx6ul-ecspi since
ERR009165 not fix on i.mx8mq.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Clark Wang <xiaoning.wang@nxp.com>
ERR009165 are not fix on i.mx8m family, so remove 'ecspi_fixed' on
sdma_imx8mq, otherwise, i.mx8mn ecspi not work in dma mode as below:
[ 8163.444680] SPI transfer using DMA
[ 8163.448144] SPI DMA tx transfer timer: 500
[ 8165.468250] spi_imx 30820000.spi: I/O Error in DMA TX
[ 8165.473353] spidev spi0.0: SPI transfer failed: -110
[ 8165.478446] spi_master spi0: failed to transfer one message from queue
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Clark Wang <xiaoning.wang@nxp.com>
The MxM wifi driver upgrade to:
ssh://git@bitbucket.sw.nxp.com/wcswrel/
rel-nxp-wifi-fp92-bt-fp92-linux-android-mxm4x17186.p2-mgpl.git
Changes mxm4x17186 -> mxm4x17186.p2:
- Increase extended scan timeout to 100 seconds.
- Increase shared memory buffers entries to 40.
- Append IE as a pass through TLV type to the request no matter FT AKM is used.
Reviewed-by: yang.tian <yang.tian@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
If the controller is in low power mode, it needs to skip pullup
operation since it is meaningless, meanwhile, it is not allowed
from current design, show warning message for it.
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
When kernel idle, system will enter wait/stop mode, wdog should continue
running in this scenario, and the refresh thread can wake up system from
wait/stop mode.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
- Delete the duplicated EP_CMD_ERDY and EP_CMD_REQ_CMPL setting
- Prepare the next setup before setting EP_CMD_ERDY and EP_CMD_REQ_CMPL,
it could avoid a bug that DMA hang at EP0 OUT for DEV_VER_NXP_V1
- Delete the duplicated cdns3_set_hw_configuration calling at
cdns3_req_ep0_set_configuration, the composite.c will handle
this request, and call .ep0_queue back, and at .ep_queue it will
call cdns3_set_hw_configuration.
(This patch is porting from upstream with some tiny changes)
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
The other thread may access other endpoints when the cdns3_check_new_setup
is handling, add spinlock to protect it.
Fixes: 7733f6c32e ("usb: cdns3: Add Cadence USB3 DRD Driver")
Cc: <stable@vger.kernel.org>
Reviewed-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/20200623030918.8409-4-peter.chen@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It should use the correct direction value from register, not depends
on previous software setting. It fixed the EP number wrong issue at
trace when the TRBERR interrupt occurs for EP0IN.
When the EP0IN IOC has finished, software prepares the setup packet
request, the expected direction is OUT, but at that time, the TRBERR
for EP0IN may occur since it is DMULT mode, the DMA does not stop
until TRBERR has met.
Fixes: 7733f6c32e ("usb: cdns3: Add Cadence USB3 DRD Driver")
Cc: <stable@vger.kernel.org>
Reviewed-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/20200623030918.8409-3-peter.chen@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add nine variables as bellow to enable camera related driver for
iMX8QXP, QM, MN and MP platform
CONFIG_IMX8_MEDIA_DEVICE
CONFIG_IMX8_ISI_HW
CONFIG_IMX8_ISI_CORE
CONFIG_IMX8_ISI_CAPTURE
CONFIG_IMX8_ISI_M2M
CONFIG_IMX8_MIPI_CSI2
CONFIG_IMX8_MIPI_CSI2_SAM
CONFIG_IMX8_PARALLEL_CSI
CONFIG_GMSL_MAX9286
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
In order to decouple ISI core, capture and mem2mem driver, need to config
imx8-isi-hw.c as a separate driver and build as tristate
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
mxc_isi_get_hostdata() and mxc_isi_dev_get_parent() are defined in isi
core driver and they will be used capture and mem2mem driver, so moving
them from core driver to isi hardware driver will be better.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
mxc_isi_m2m_frame_write_done is called in imx8-isi-core.c driver.
if build the driver as modules, mem2mem driver need to export the
function.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
mxc_isi_cap_frame_write_done is called in imx8-isi-core.c driver,
if build the driver as modules, capture driver need to export the
function.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Because ISI hardware is shared by capture and mem2mem driver. Their
functions depended on methods in imx8-isi-hw.c to do register read/
write operation. When build capture and mem2mem driver as modules,we
need to export methods in imx8-isi-hw.c file.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
We create a virtual capture device under isi device and isi driver will
populate platform device for the virtual device, but missed depopulate
operation when parent(isi) driver removed.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Because iMX8QXP/QM parallel interface for camera rely on multi power
domain resources, so driver will attach the related power domain when
driver probe and missed detach operation when driver removed.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Because MIPI CSI for iMX8QXP/QM rely on multi power domain resources
(CSI0, ISI0), so driver will attach the related power domain when
driver probe but missed detach operation when driver removed.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
uart4 is used for debug purpose when dsp is used, disabled the uart4 node
for the access conflication in uart driver and dsp firmware.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
On imx8qxp-mek, the RS232 interface is used for debugging dsp firmware.
So dedicately configure lpuart in this dtb.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
For PCM format the supported format is mono/stereo, S16_LE/S32_LE,
and 8KHz-192kHz frequency.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
In SPDIF full duplex mode in order to get both RX and TX working we
need to start RX first, and TX second, fix this by porting SPDIF RX
configuration code from XCVR FW into Kernel driver and avoid using
M0+ core for SPDIF configuration.
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Select bt-sco-pcm-wb codec dai in default to support HFP
nbs and wbs for nxp 88w8997 and 88w8987 chips.
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>