Skip to content

firmware: imx: NXP Secure-Enclave FW Driver

Pankaj Gupta linux-arm-kernel linux-devicetree lkml 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest11 patches 9 repliesIn review
  2. v611 patches 8 repliesSuperseded
  3. v511 patches 16 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v47 patches25 repliesSuperseded
v37 patches11 repliesSuperseded
v27 patches7 repliesSuperseded
v17 patches2 repliesSuperseded

Changes in v7 from the cover letter

- 2/11 DT Binding: Disposed off comments from .yaml
-- added | to preserve formating.
-- removed extra spaces, restricting under 80 col.
-- replaced the "fsl,sram" property, with standard property "sram". -- Added details about usage of sram.
-- removed the property "mu_id".
-- Added allOf:if:then: for reserved memory.
-- removed label.

- 3,4,5,6/11: DTSI changes:
-- removed the property "mu_id".
-- rename node-name & label

- 7/11 firmware: imx: add driver for NXP EdgeLock Enclave:
-- Removed dev_err for the cases of failure in memory allocation. -- For others, coverted dev_err to dev_dbg.
-- Updated the commit msg about the details for userspace lib

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11Documentation/firmware: added imx/se-fw to other_interfacesDocumentation/driver-api/firmware/other_interfaces.rst+67 -02 replies
2/11dt-bindings: arm: fsl: add imx-se-fw binding docDocumentation/devicetree/bindings/firmware/fsl,imx-se-fw.yaml+83 -02 replies
3/11arm64: dts: imx8ulp-evk: added nxp secure enclave firmwarearch/arm64/boot/dts/freescale/imx8ulp.dtsi+9 -11 reply
4/11arm64: dts: imx8ulp-evk: reserved mem-ranges to constrain ele_fw dma-rangearch/arm64/boot/dts/freescale/imx8ulp-evk.dts+15 -00 replies
5/11arm64: dts: imx93-11x11-evk: added nxp secure enclave fwarch/arm64/boot/dts/freescale/imx93.dtsi+7 -11 reply
6/11arm64: dts: imx93-11x11-evk: reserved mem-rangesarch/arm64/boot/dts/freescale/imx93-11x11-evk.dts+15 -01 reply
7/11firmware: imx: add driver for NXP EdgeLock EnclaveDocumentation/ABI/testing/se-cdev drivers/firmware/imx/Kconfig drivers/firmware/imx/Makefile +7 more+1901 -01 reply
8/11firmware: imx: init-fw api exchange on imx93drivers/firmware/imx/Makefile drivers/firmware/imx/ele_fw_api.c drivers/firmware/imx/ele_fw_api.h +1 more+84 -20 replies
9/11firmware: imx: enable trngdrivers/firmware/imx/Kconfig drivers/firmware/imx/Makefile drivers/firmware/imx/ele_base_msg.c +7 more+323 -00 replies
10/11firmware: imx: enclave-fw: add handling for save/restore IMEM regiondrivers/firmware/imx/ele_base_msg.c drivers/firmware/imx/ele_common.c drivers/firmware/imx/ele_common.h +2 more+226 -00 replies
11/11MAINTAINERS: Added maintainer detailsMAINTAINERS+10 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [PATCH v7 00/11] firmware: imx: NXP Secure-Enclave FW Driver

V7 Changes:
- 2/11 DT Binding: Disposed off comments from .yaml
-- added | to preserve formating.
-- removed extra spaces, restricting under 80 col.
-- replaced the "fsl,sram" property, with standard property "sram". -- Added details about usage of sram.
-- removed the property "mu_id".
-- Added allOf:if:then: for reserved memory.
-- removed label.

- 3,4,5,6/11: DTSI changes:
-- removed the property "mu_id".
-- rename node-name & label

- 7/11 firmware: imx: add driver for NXP EdgeLock Enclave:
-- Removed dev_err for the cases of failure in memory allocation. -- For others, coverted dev_err to dev_dbg.
-- Updated the commit msg about the details for userspace lib

V6 Changes:

- 1/11 (New): Kernel doc: "Documentation/driver-api/firmware/other_interfaces.rst" is added.

- 2/11 DT Binding: Disposed off comments from .yaml
-- replaced the "sram-pool" property, with standard property "fsl,sram". -- removed the additional details from the description.

- 3,4,5,6/11: DTSI changes:

	-- Validated using the following commands:
		--- make dt_binding_check DT_SCHEMA_FILES=freescale
        --- make CHECK_DTBS=y freescale/imx8ulp-evk.dtb;
		    make CHECK_DTBS=y freescale/imx93-11x11-evk.dtb

- 7/11 firmware: imx: add driver for NXP EdgeLock Enclave:
-- Removed:

-- pr_info is removed.
-- macro "devctx_info", "devctx_dbg" & "devctx_err" is removed.
-- Updated ABI:
--- Users: user-space SE-LIB, crypto-api, imx-ocotp-ele driver , smw
--- IOCTLS: Updated the ioctl
--- read/write:
-- Correct message header validation.
--- segregated handling of the error, while msg header parsing.
-- removed TX and RX messages static allocation in state container. -- ran coccicheck: make C=1 CHECK=scripts/coccicheck drivers/firmware/imx/*.* W=1
--- ran on all the patches.
- 8/11 firmware: imx: init-fw api exchange on imx93
-- removed TX and RX messages static allocation in state container. -- moved the header file ele_fw_api.h, to driver/firmware/imx/
-- segregated handling of the error, while msg header parsing.

- 9/11 firmware: imx: enable trng
-- macro "devctx_info", "devctx_dbg" & "devctx_err" is removed.
-- will remove this patch, will send this patch later, including RNG and crypto-maintainers.

- 10/11 firmware: imx: enclave-fw: add handling for save/restore IMEM region -- Linux comment style fixed.

- 10/11(old)(Removed) firmware: imx: enclave api to read-common-fuses
-- This API will be used by imx-ocotp-ele.c.
-- This patch can be sent later, when the changes to imx-ocotp-ele.c will be sent. -- "Documentation/driver-api/firmware/other_interfaces.rst" will be update for the exported symbols:
- read_common_fuses()
- get_se_dev()

v5 Changes:
- 1/7 DT Binding: Disposed off comments from .yaml
-- to use "-", instead of "_".
-- to use generic name, concatinated with soc-id.
-- removed mu-did.
-- renamed the ele-mu to se-fw
-- moved the file from .../arm/freescale/ to .../firmware/
- 2/7 Changed the .dtsi, as per the comments.
-- removed mu-did
-- renamed the ele_mu to se-fw.
-- updated the compatible string.
-- tested the DTB.
- 4/7 Changed the .dtsi, as per the comments.
-- removed mu-did
-- renamed the ele_mu to se-fw.
-- updated the compatible string.
-- tested the DTB.
- 6/7 Changes in driver code:
-- replace pr_err with dev_err
-- removed export symbols, except one, which will be used in other driver. -- Each API, send-recived based on device reference.
-- Divided the commits into smaller commits.
- Base Driver
-- Added ABI file.
- 7/11 (new) firmware: imx: init-fw api exchange on imx93
- 8/11 (new) firmware: imx: enable trng
- 9/11 (new) firmware: imx: enclave-fw: add handling for save/restore IMEM region
- 10/11 (new) firmware: imx: enclave api to read-common-fuses

v4 Changes:
- Post internal review, changed the name from "ele-mu" to "se-fw".
- Disposed-off comments in the dt-binding file.
- Removed the non-hw related dt-bindings from the driver code.
- Corrected the File MAINTAINERS for correct name of yaml file.

v3 Changes:
- update the commit message for documentation.
- Fixed dt-binding checking error for file- fsl,ele_mu.yaml
- Coverity fixes in the ele_mu.c

v2 Changes:
- Fixed Kernel Test Bot issues.
- Removed ".../devicetree/bindings/mailbox/fsl,muap.txt"

The NXP's i.MX EdgeLock Enclave, a HW IP creating an embedded secure enclave within the SoC boundary to enable features like
- HSM
- SHE
- V2X

Communicates via message unit with linux kernel. This driver is enables communication ensuring well defined message sequence protocol between Application Core and enclave's firmware.

Driver configures multiple misc-device on the MU, for multiple user-space applications can communicate on single MU.

It exists on some i.MX processors. e.g. i.MX8ULP, i.MX93 etc.

Pankaj Gupta (11):
Documentation/firmware: added imx/se-fw to other_interfaces
dt-bindings: arm: fsl: add imx-se-fw binding doc
arm64: dts: imx8ulp-evk: added nxp secure enclave firmware
arm64: dts: imx8ulp-evk: reserved mem-ranges to constrain ele_fw
dma-range
arm64: dts: imx93-11x11-evk: added nxp secure enclave fw
arm64: dts: imx93-11x11-evk: reserved mem-ranges
firmware: imx: add driver for NXP EdgeLock Enclave
firmware: imx: init-fw api exchange on imx93
firmware: imx: enable trng
firmware: imx: enclave-fw: add handling for save/restore IMEM region
MAINTAINERS: Added maintainer details

 Documentation/ABI/testing/se-cdev             |   41 +
 .../bindings/firmware/fsl,imx-se-fw.yaml      |   83 +
 .../driver-api/firmware/other_interfaces.rst  |   67 +
 MAINTAINERS                                   |   10 +
 arch/arm64/boot/dts/freescale/imx8ulp-evk.dts |   15 +
 arch/arm64/boot/dts/freescale/imx8ulp.dtsi    |   10 +-
 .../boot/dts/freescale/imx93-11x11-evk.dts    |   15 +
 arch/arm64/boot/dts/freescale/imx93.dtsi      |    8 +-
 drivers/firmware/imx/Kconfig                  |   21 +
 drivers/firmware/imx/Makefile                 |    3 +
 drivers/firmware/imx/ele_base_msg.c           |  271 ++++
 drivers/firmware/imx/ele_common.c             |  294 ++++
 drivers/firmware/imx/ele_common.h             |   40 +
 drivers/firmware/imx/ele_fw_api.c             |  118 ++
 drivers/firmware/imx/ele_fw_api.h             |   26 +
 drivers/firmware/imx/ele_trng.c               |   47 +
 drivers/firmware/imx/se_fw.c                  | 1376 +++++++++++++++++
 drivers/firmware/imx/se_fw.h                  |  154 ++
 include/linux/firmware/imx/ele_base_msg.h     |   67 +
 include/linux/firmware/imx/ele_mu_ioctl.h     |   74 +
 20 files changed, 2738 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/ABI/testing/se-cdev
 create mode 100644 Documentation/devicetree/bindings/firmware/fsl,imx-se-fw.yaml
 create mode 100644 drivers/firmware/imx/ele_base_msg.c
 create mode 100644 drivers/firmware/imx/ele_common.c
 create mode 100644 drivers/firmware/imx/ele_common.h
 create mode 100644 drivers/firmware/imx/ele_fw_api.c
 create mode 100644 drivers/firmware/imx/ele_fw_api.h
 create mode 100644 drivers/firmware/imx/ele_trng.c
 create mode 100644 drivers/firmware/imx/se_fw.c
 create mode 100644 drivers/firmware/imx/se_fw.h
 create mode 100644 include/linux/firmware/imx/ele_base_msg.h
 create mode 100644 include/linux/firmware/imx/ele_mu_ioctl.h
Signature · 1 line
2.34.1