| 5e588771 | 10-Jun-2021 |
Clément Léger <clement.leger@bootlin.com> |
drivers: add type field to dt_driver struct
In order to keep the current mechanism simple but allow parsing the device tree by iterating on driver (clocks for instance), add a type field to dt drive
drivers: add type field to dt_driver struct
In order to keep the current mechanism simple but allow parsing the device tree by iterating on driver (clocks for instance), add a type field to dt driver struct which will allow differentiating drivers when iterating on entries and thus avoid casting struct dt_driver::driver to the wrong type in case a bad DT is provided. This will also allow adding a more generic driver model by probing generic driver based on their compatible.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
show more ...
|
| be501eb1 | 05-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carrie
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6d777f26 | 05-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
util: define IS_ALIGNED macro
Keep a single version of the macro definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Revi
util: define IS_ALIGNED macro
Keep a single version of the macro definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 702fe5a7 | 10-Aug-2021 |
Clément Léger <clement.leger@bootlin.com> |
core: kernel: interrupt: add type and prio for interrupts
When describing a device in the device tree, it is sometimes necessary to parse the interrupts properties and propagates them until adding t
core: kernel: interrupt: add type and prio for interrupts
When describing a device in the device tree, it is sometimes necessary to parse the interrupts properties and propagates them until adding the interrupt. For instance some interrupt-cells allows to describe priority and type of interrupt:
interrupts = <67 IRQ_TYPE_LEVEL_HIGH 2>;
With existing support, only the interrupt number is returned by `dt_get_irq()`. This patch adds type and prio parameter which are passed to `dt_get_irq_type_prio()` and `itr_add_type_prio()`. This allows interrupt drivers to fill this from devicetree in `dt_get_irq()` but also use these information in the `add()` callback. Additionally, it allows to specify these flags manually when not using devicetree.
These parameters can then be used by the interrupt controller driver to setup the irq line correctly.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 888bb63d | 13-Oct-2021 |
Clément Léger <clement.leger@bootlin.com> |
core: kernel: interrupt: rename len argument of dt_get_irq to count
len can be missleading, use a more descriptive name.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienn
core: kernel: interrupt: rename len argument of dt_get_irq to count
len can be missleading, use a more descriptive name.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| f02c0ee2 | 07-Oct-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: imx_ocotp: fix clock enablement for imx7 platforms
Set the correct CCM clock domain ID to enabled the OCOTP clock on imx7 platforms.
Fixes: e4ca953c38 ("drivers: imx: add OCOTP driver") Si
drivers: imx_ocotp: fix clock enablement for imx7 platforms
Set the correct CCM clock domain ID to enabled the OCOTP clock on imx7 platforms.
Fixes: e4ca953c38 ("drivers: imx: add OCOTP driver") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| e08643a4 | 05-Oct-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: fix RSAES-OAEP encryption length check
According to PKCS#1 v2.2: RSA Cryptography Standard, for RSAES-OAEP Encryption operation function, the following length check must be done pri
drivers: crypto: fix RSAES-OAEP encryption length check
According to PKCS#1 v2.2: RSA Cryptography Standard, for RSAES-OAEP Encryption operation function, the following length check must be done prior the encryptioon operation [1]:
Return error if mLen > k - 2*hlen - 2
Because (k - 2*hlen - 2) must be superior or equal to zero, return an error also if 2*hlen >= k - 2
Links: [1] https://datatracker.ietf.org/doc/html/rfc8017 Fixes: f5a70e3efb ("drivers: crypto: generic resources for crypto device driver - RSA") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5d49c2f4 | 01-Oct-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: check destination buffer size before copying message
At the end of the RSA-OAEP decryption operation, check if the destination message buffer is big enough to hold the output of the d
drivers: caam: check destination buffer size before copying message
At the end of the RSA-OAEP decryption operation, check if the destination message buffer is big enough to hold the output of the decryption operation. If the buffer is too small, return TEE_ERROR_SHORT_BUFFER error code along the expected buffer size.
Fixes: 796ea6d867 ("drivers: caam: implement NXP CAAM Driver - RSA") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e4ca953c | 10-Aug-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: imx: add OCOTP driver
Add OCOTP driver for imx6, imx7, imx7ulp and imx8m platforms. The implementation only supports the read of OCOTP shadow registers. It also implements the tee_otp_get_d
drivers: imx: add OCOTP driver
Add OCOTP driver for imx6, imx7, imx7ulp and imx8m platforms. The implementation only supports the read of OCOTP shadow registers. It also implements the tee_otp_get_die_id() function.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 0d7e03a9 | 01-Sep-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: fix ECC key size bytes to bits conversion
Convert the ECC key size from bytes to bits. By adding the new key_size variable, it also fixes the crypto driver traces bellow printing th
drivers: crypto: fix ECC key size bytes to bits conversion
Convert the ECC key size from bytes to bits. By adding the new key_size variable, it also fixes the crypto driver traces bellow printing the ECC key size from the variable that was missing.
Fixes: d29cd2e ("core: driver: generic resources for crypto device driver - ECC") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 2391d619 | 31-Aug-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: acipher: fix traces compilation
Cast key pointers to uintptr_t to avoid compilation warnings when crypto driver traces are enabled (CFG_CRYPTO_DRIVER_DEBUG=0x1)
Fixes: 62590f0 ("dr
drivers: crypto: acipher: fix traces compilation
Cast key pointers to uintptr_t to avoid compilation warnings when crypto driver traces are enabled (CFG_CRYPTO_DRIVER_DEBUG=0x1)
Fixes: 62590f0 ("drivers: crypto: implement crypto device driver - DSA") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4278ad18 | 25-Aug-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: dma: fix copy data size
After each crypto operation that involves a DMA output, the content of the SGT buffer is copied to the actual output buffer. Fix the DMA copy function where th
drivers: caam: dma: fix copy data size
After each crypto operation that involves a DMA output, the content of the SGT buffer is copied to the actual output buffer. Fix the DMA copy function where the size of the data to be copied is either the full size of the data processed by the CAAM (obj->sgtbuf.length) or the size of the output buffer.
In some cases, the output buffer is smaller than the CAAM output. The size of data to be copied is the smallest size between the CAAM output data size and the output buffer size.
Fixes: 38923d4 ("drivers: caam: implement CAAM DMA Object") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| ea6ed343 | 25-Aug-2020 |
Cedric Neveux <cedric.neveux@nxp.com> |
drivers: caam: add RNG data check error code
Check if the CAAM RNG driver returns DATA_FAILURE error code. If the data check returns DATA_FAILURE, the function returns CAAM_FAILURE.
Fixes: 2d7a896
drivers: caam: add RNG data check error code
Check if the CAAM RNG driver returns DATA_FAILURE error code. If the data check returns DATA_FAILURE, the function returns CAAM_FAILURE.
Fixes: 2d7a896 ("driver: implement CAAM driver") Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 742ce3ad | 25-Aug-2020 |
Cedric Neveux <cedric.neveux@nxp.com> |
drivers: caam: fix CAAM Job Ring halt/flush/cancel
Fix CAAM halt/flush jobs by calling dequeue operation to complete all jobs. Add spinlock management in the cancel function because of the shared JR
drivers: caam: fix CAAM Job Ring halt/flush/cancel
Fix CAAM halt/flush jobs by calling dequeue operation to complete all jobs. Add spinlock management in the cancel function because of the shared JR structure.
Fixes: 2d7a896 ("driver: implement CAAM driver") Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| fb1849d7 | 25-Aug-2020 |
Cedric Neveux <cedric.neveux@nxp.com> |
drivers: caam: Fix hal clock registers read/write
Fix CAAM Clock registers access to use io_read/write() functions and not io_caam_read/write().
Fixes: 2d7a896 ("driver: implement CAAM driver") Sig
drivers: caam: Fix hal clock registers read/write
Fix CAAM Clock registers access to use io_read/write() functions and not io_caam_read/write().
Fixes: 2d7a896 ("driver: implement CAAM driver") Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 046801b6 | 04-Aug-2020 |
Cedric Neveux <cedric.neveux@nxp.com> |
drivers: caam: fix hal control split key detection
Fix the CAAM Version ID MS register address (CAAM Control + JR Offset). Change HAL caam_hal_ctrl_splitkey() to read the parameters register LS bit
drivers: caam: fix hal control split key detection
Fix the CAAM Version ID MS register address (CAAM Control + JR Offset). Change HAL caam_hal_ctrl_splitkey() to read the parameters register LS bit 14 (SPLIT_KEY) that indicates the support for the split key.
Fixes: 81ab436 ("drivers: caam: implement NXP CAAM Driver - HMAC") Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| ae368944 | 28-Jan-2021 |
Dragos Rosioru <dragos.rosioru@nxp.com> |
drivers: caam: hwrng fix perf drop after suspend/resume
RNG performance drops after a suspend/resume cycle on parts where caam loses power, since the initial U-boot settings are not restored by OP-T
drivers: caam: hwrng fix perf drop after suspend/resume
RNG performance drops after a suspend/resume cycle on parts where caam loses power, since the initial U-boot settings are not restored by OP-TEE when resuming. Modifying the TRNG "sample size" (the total number of entropy samples that will be taken during entropy generation) from it's default conservative value of 2500 to be more in line with the "sample size" that the caam driver in U-boot/Linux kernel select(512) will solve the performance hit.
Changed the default minimum entropy delay value for I.MX 6SX from 4800 to 3200 to be in line with U-boot and Kernel setting for this value. The higher default entropy delay value for OP-TEE would have caused a perceived performance hit after/suspend resume.
Fixes: 2d7a896 ("driver: implement CAAM driver") Signed-off-by: Dragos Rosioru <dragos.rosioru@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 1b7b5954 | 17-Feb-2021 |
Cedric Neveux <cedric.neveux@nxp.com> |
drivers: caam: fix missing output additional length
CAAM HW Module requires additional bytes in output buffer to perform the requested operation. This is the case for ECDSA operation, signature must
drivers: caam: fix missing output additional length
CAAM HW Module requires additional bytes in output buffer to perform the requested operation. This is the case for ECDSA operation, signature must be 16 bytes aligned. The CAAM DMA object is adding the required bytes if the signature output buffer is too short. The issue is that this additional bytes were not added in the DMA buffer to be allocated.
Fixes: 38923d4 ("drivers: caam: implement CAAM DMA Object") Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 84989f86 | 28-May-2021 |
Franck LENORMAND <franck.lenormand@nxp.com> |
drivers: caam: ack the interrupt when completing a job
The ITR will only be acked if the job finishes between the do_jr_dequeue() and caam_hal_jr_check_ack_itr(). With this fix, we ensure the ITR is
drivers: caam: ack the interrupt when completing a job
The ITR will only be acked if the job finishes between the do_jr_dequeue() and caam_hal_jr_check_ack_itr(). With this fix, we ensure the ITR is acked when leaving caam_jr_dequeue() function.
Fixes: 2d7a896 ("driver: implement CAAM driver") Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| cfada897 | 06-Sep-2021 |
Alexandru Gagniuc <mr.nuke.me@gmail.com> |
plat-stm32mp1: Don't call get_embedded_dt() without CFG_EMBED_DT
Several pieces of stm32mp1 code call get_embedded_dt(), then use the resulting pointer without checks, or initiate a panic if it is N
plat-stm32mp1: Don't call get_embedded_dt() without CFG_EMBED_DT
Several pieces of stm32mp1 code call get_embedded_dt(), then use the resulting pointer without checks, or initiate a panic if it is NULL. Thus hitting this code results in a non-working binary. For example:
"PLATFORM=stm32mp1 CFG_DT=y"
The get_embedded_dt() uses were #ifdef'd out based on CFG_DT. However, as shown, this is problematic, as the calls assumed a valid fdt must be returned. A non-NULL fdt can be guaranteed with CFG_EMBED_DT, so use this as the basis for the #ifdefs.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| c4853b5c | 06-Jun-2021 |
Clément Léger <clement.leger@bootlin.com> |
drivers: scmi-msg: fix typo
Fix a trivial typo (§ -> /)
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> |
| c2e4eb43 | 23-May-2021 |
Anton Rybakov <a.rybakov@omp.ru> |
core_mmu: fix phys_to_virt() to check length
phys_to_virt() function without length parameter doesn`t always have ability to find the correct mapping for requested physical address. This is because
core_mmu: fix phys_to_virt() to check length
phys_to_virt() function without length parameter doesn`t always have ability to find the correct mapping for requested physical address. This is because physical address can be mapped in the same time in different virtual regions with different length. So the first found region which contains the requested physical address possibly doesn`t have enough mapped data. This is fixed by adding the length parameter to phys_to_virt() function. Length parameter can be set to 1 if caller knows that requested (pa + len) doesn`t cross mapping granule boundary.
core_mmu_get_va() and io_pa_or_va() functions now are take length parameter too as they based on phys_to_virt() in case of MMU enabled.
Signed-off-by: Anton Rybakov <a.rybakov@omp.ru> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (stm32mp1-157C_DK2) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabreauto) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabresd) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6qpsabreauto) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6sllevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ullevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulzevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7dsabresd) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7ulpevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mmevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mnevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mqevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mpevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qmmek) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qxpmek)
show more ...
|
| 5729b44e | 06-Jul-2021 |
Devendra Devadiga <devendradevadiga01@gmail.com> |
drivers: imx_i2c: support i2c4
Extend the driver functionality to support i2c4
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Signed-off-by: De
drivers: imx_i2c: support i2c4
Extend the driver functionality to support i2c4
Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Signed-off-by: Devendra Devadiga <devendradevadiga01@gmail.com>
show more ...
|
| c29c5388 | 06-Jul-2021 |
Devendra Devadiga <devendradevadiga01@gmail.com> |
drivers: imx_i2c: fix support for MX8MQ
Add missing config required to enable the support
Reviewed-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Signed-off-by: Devendra Devadiga <devendradevadiga01
drivers: imx_i2c: fix support for MX8MQ
Add missing config required to enable the support
Reviewed-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Signed-off-by: Devendra Devadiga <devendradevadiga01@gmail.com>
show more ...
|
| 661cea17 | 10-Jun-2021 |
Cedric Neveux <cedric.neveux@nxp.com> |
drivers: caam: fix DMA object when only output reallocated
Use case: - cipher block to encrypt/decrypt is more than 1 Kbytes (e.g. 1232 bytes) - input data are accessible from CAAM (no reallocatio
drivers: caam: fix DMA object when only output reallocated
Use case: - cipher block to encrypt/decrypt is more than 1 Kbytes (e.g. 1232 bytes) - input data are accessible from CAAM (no reallocation) - output data is not accessible from CAAM (reallocation of DMA buffer).
In case of cipher operation, the input and output CAAM SGT/Buffer are built in same time through function caam_dmaobj_sgtbuf_inout_build() to ensure that both SGT/Buffer do the same cipher block size. Function caam_dmaobj_sgtbuf_inout_build() calls the function caam_dmaobj_sgtbuf_build(): - first to build the input data SGT/Buffer. Length returned is whole cipher buffer size (i.e. 1232 bytes). - secondly to build the output data SGT/Buffer. Length return is whole cipher buffer size (i.e. 1232 bytes) whereas it must be 1024 bytes because output data must use the reallocation DMA buffer (max 1KBytes).
Fix consist in returning the SGT/Buffer length effectively mapped and not the maximum length that is the input data SGT/Buffer length.
Consequence of this fix, AES CMAC update loop has to be fixed.
Fixes: 38923d487567 ("drivers: caam: implement CAAM DMA Object")
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|