Issue: ELE TRNG register with hwrng and open a kthread
which remains running after suspend also and results in
random interrupts from ELE.
Fix: unregister hwrng in suspend and re-register in resume
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Enables dual FW support for i.MX95
- loading of runtime fw from rootfs.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Adds a new API ELE_GET_FW_VERSION, to fetch the FW version and other
misc. details.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Enables the support for V2X-SG#0 & V2X-SG#1 on i.MX95 B0.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
New API support is added for dumping v2x debug logs.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Reviewed-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
As part linux suspend resume, v2x-fw is requested to:
- power-down as part of suspend.
- power-up as part of resume.
Squash: 8fd2c1e95e24a ("TBS: drivers: firmware: imx: replace the hardcoded debugging address.")
4a6e34427205b TBS: LF-14638: driver: firmware: imx: v2x suspend-resume snd-rcv error checking
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Reviewed-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
imx: Enforcing the msg-seq flow feature is applied
to change voltage API(s).
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Tested-by: Ye Li <ye.li@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
New kernel feature to enforce the msg-seq flow:
- Once started before the first API,
- will continue for all the intermediate participating API(s),
- will halt after the last API successfully exchanged.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Tested-by: Ye Li <ye.li@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
export se-api(s) in se_api.h:
- for reading/writing fuses
- for voltage control interface.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Add support for imx93 soc and its platforms.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Debugging feature to enable time synchronised logging of:
- the Message exchange over MU with FW.
- IOCTL(s)
- any user articulated debug messages.
The logs are saved to a file in the linux filesystem.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
additional changes to the upstream driver.
- construct se_name from se_type_id and instance id
- move soc_register to info_list
- move fetch soc info function pointer to info_list
- ele soc fetch generalization
- ele debug dump
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
NXP hardware IP(s) for secure-enclaves like Edgelock Enclave(ELE),
are embedded in the SoC to support the features like HSM, SHE & V2X,
using message based communication interface.
The secure enclave FW communicates on a dedicated messaging unit(MU)
based interface(s) with application core, where kernel is running.
It exists on specific i.MX processors. e.g. i.MX8ULP, i.MX93.
This patch adds the driver for communication interface to secure-enclave,
for exchanging messages with NXP secure enclave HW IP(s) like EdgeLock
Enclave (ELE) from Kernel-space, used by kernel management layers like
- DM-Crypt.
squash e7d2fac2d1ceb TBS: LF-14067: drivers: firmware: imx: se suspend-resume
squash c4c9b2f7cf710 TBS: drivers: firmware: imx: correct macro ELE_DEBUG_DUMP_RSP_SZ value
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Acked-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Acked-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Initialized the err variable to fix the coverity issue,
"Uninitialized scalar variable"
Signed-off-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
signed message ioctl() is not available due to which
test will fail on i.MX8X SECO that have signed message
not null.
Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Reviewed-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Update soc_info structure to have board_type information.
board_type is deduced by reading fuse values using nvmem framework
get_soc_info ioctl is updated to return board_type for i.MX8dxl
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
When running below low power case on 8ULP dual boot, we meet Linux fail to
restore ELE imem from file
APD: Linux boot, then “poweroff” to DPD.
RTD: After linux “poweroff”, enter DPD and wake up by timer (G+T+2)
then enter PD and wake up by timer (F+T+2), wake up APD (W).
The root cause is when RTD is waken up from DPD, it is booted from ROM,
and ROM reloads the ELE FW and RTD image. Then when RTD is waken up from PD
and wake up APD, APD will try to restore the ELE imem which was saved
before ELE FW reloading. So this imem restore is failed.
To avoid moving ELE imem save/restore to M33, because of RAM size problem
and big codes change. The proposed solution is replacing the imem restore
from file with re-install ELE FW. This patch needs to work with ELE FW
which supports the re-install feature.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
To support iMX93 GDET enabled part, it needs to isolate GDET when VDD_SOC
changing between OD and LD. ELE introduces two new APIs: voltage start and
finish for this purpose.
Voltage change start:
- This command isolates GDET and launches a 5 ms timer.
During the 5 ms, the voltage needs to be changed and voltage change
finish command must be called to remove GDET isolation (no other command
will be accepted). A GDET software reset is done before removing the
isolation in voltage change finish.
Voltage change finish:
- This command can’t be called without voltage change start.
To support above commands, especailly no other command will be accepted
after voltage change start issued, so adjust the mu_cmd_lock to each
command begin, this also resolves potential issue in imx_se_alloc_tx_rx_buf
since the buf pointer is not locked.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Clean-up, when signal interrupt from ctrl + c, is received
by se-fw kernel driver; in order to achieve the graceful
exit to any application based on se-lib.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
When RTD is power down, 64kB over the 96kB of ELE FW RAM are lost and
must be restored at resume. However when kernel (APD) is poweroff,
current implementation does not restore the ELE RAM, so cause failure
when trying to load externd FW.
To fix the issue, this patch checks the iMEM state from ELE get info API
to determine loading extend FW or restore iMEM. It also saves ELE iMEM RAM
to file on rootfs at ELE driver probe and resume.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Tested-by: Jacky Bai <ping.bai@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
SHE info structure is added for SECO SHE support
Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
i.MX8DXL support SECO and V2X, Info structure is modified
to support V2X nodes.
Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Two different drivers for ELE SE and SECO SE. Both SE use
MU framework. Unify ELE SE FW driver with SECO MU driver.
Add base patch support of SECO MU in ELE SE FW driver.
Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com>
Reviewed-by: Rahul Kumar Yadav <rahulkumar.yadav@nxp.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Using rising/falling edge as event id is wrong. To SCMI MISC, event id
is always 0. But rising/falling edge flags still needs to be passed to
System Manager to configure, so export a new hook misc_ctrl_req_notify
to enable notification.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Tested-by: Shenwei Wang <shenwei.wang@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Now, SoC attributes registration will be done based on data
fetched from TF-A, on NXP i.MX9 series SoC.
Changes prevents soc-registration for all NXP i.MX9 Series SoC,
as part the driver.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Using u32 type to store the number of wakeup sources results
in kernel crash when no wakeup sources are defined in dts.
Need to use integer data type.
Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Implement mailbox specific driver for the Messaging Units used by ISP-FW
running on a remote core.
This will be used as a communication protocol for the ISP firmware code.
Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
- Allocated buffer clean-up in the func "ele_service_swap".
- Sending/receiving the same message twice in the func "ele_get_trng_state".
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Enabling Dual FW support on i.MX8ULP, such that secondary
FW is copied from RFS and sent for authentication to ELE-FW
before loading it, to enable HSM feature-set.
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
Issue:
Data abort during memset() operation when using FAST MAC v2
with maximum supported message length i.e. 240 bytes.
Fix:
MU buffer is a device type memory, when calling memset()
with 240 bytes then it optimizes the call and perform cache
clean operation which results in exception as device type
memory is on-cacheable.
Using recommended memset_io() for device_type memory.
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Issue:
data offset 0 was used to compare the Primary and Secondary
RNG entopy generation status
Fix:
change data offset to 1
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
The key 'suspended' status will be set to 'false' in resume
callback. But the 'pwrkey_event' is called after resume callback,
the pwr key press event will be lost when resumed pwr key event.
Set 'suspended' to false in 'pwrkey_event' to fix the key press
event missing issue.
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>