All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: sbabic@denx.de
Cc: festevam@gmail.com, u-boot@lists.denx.de, uboot-imx@nxp.com,
	Clement Faure <clement.faure@nxp.com>
Subject: [PATCH V2 14/26] misc: S400_API: add ahab_release_caam
Date: Wed,  6 Apr 2022 14:30:19 +0800	[thread overview]
Message-ID: <20220406063031.21960-15-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <20220406063031.21960-1-peng.fan@oss.nxp.com>

From: Clement Faure <clement.faure@nxp.com>

Add ahab_release_caam() function to the S400 API.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/include/asm/arch-imx8ulp/s400_api.h |  2 ++
 drivers/misc/imx8ulp/s400_api.c              | 29 ++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/arch/arm/include/asm/arch-imx8ulp/s400_api.h b/arch/arm/include/asm/arch-imx8ulp/s400_api.h
index c848f0dfb8f..b788661b098 100644
--- a/arch/arm/include/asm/arch-imx8ulp/s400_api.h
+++ b/arch/arm/include/asm/arch-imx8ulp/s400_api.h
@@ -19,6 +19,7 @@
 #define AHAB_READ_FUSE_REQ_CID	0x97
 #define AHAB_RELEASE_RDC_REQ_CID   0xC4
 #define AHAB_WRITE_FUSE_REQ_CID	0xD6
+#define AHAB_CAAM_RELEASE_CID 0xD7
 
 #define S400_MAX_MSG          8U
 
@@ -37,5 +38,6 @@ int ahab_verify_image(u32 img_id, u32 *response);
 int ahab_forward_lifecycle(u16 life_cycle, u32 *response);
 int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response);
 int ahab_read_common_fuse(u16 fuse_id, u32 *fuse_words, u32 fuse_num, u32 *response);
+int ahab_release_caam(u32 core_did, u32 *response);
 
 #endif
diff --git a/drivers/misc/imx8ulp/s400_api.c b/drivers/misc/imx8ulp/s400_api.c
index d76a95febe7..dd5f9f25da5 100644
--- a/drivers/misc/imx8ulp/s400_api.c
+++ b/drivers/misc/imx8ulp/s400_api.c
@@ -242,3 +242,32 @@ int ahab_write_fuse(u16 fuse_id, u32 fuse_val, bool lock, u32 *response)
 
 	return ret;
 }
+
+int ahab_release_caam(u32 core_did, u32 *response)
+{
+	struct udevice *dev = gd->arch.s400_dev;
+	int size = sizeof(struct imx8ulp_s400_msg);
+	struct imx8ulp_s400_msg msg;
+	int ret;
+
+	if (!dev) {
+		printf("s400 dev is not initialized\n");
+		return -ENODEV;
+	}
+
+	msg.version = AHAB_VERSION;
+	msg.tag = AHAB_CMD_TAG;
+	msg.size = 2;
+	msg.command = AHAB_CAAM_RELEASE_CID;
+	msg.data[0] = core_did;
+
+	ret = misc_call(dev, false, &msg, size, &msg, size);
+	if (ret)
+		printf("Error: %s: ret %d, response 0x%x\n",
+		       __func__, ret, msg.data[0]);
+
+	if (response)
+		*response = msg.data[0];
+
+	return ret;
+}
-- 
2.35.1


  parent reply	other threads:[~2022-04-06  5:53 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06  6:30 [PATCH V2 00/26] imx: imx8ulp: misc update from downstream Peng Fan (OSS)
2022-04-06  6:30 ` [PATCH V2 01/26] imx: imx8ulp: Set COUNTER_FREQUENCY to 1Mhz Peng Fan (OSS)
2022-04-12 18:43   ` sbabic
2022-04-06  6:30 ` [PATCH V2 02/26] imx: imx8ulp: include pcc/cgc header in clock header Peng Fan (OSS)
2022-04-12 18:46   ` sbabic
2022-04-06  6:30 ` [PATCH V2 03/26] imx: imx8ulp: Add M33 handshake functions Peng Fan (OSS)
2022-04-12 18:46   ` sbabic
2022-04-06  6:30 ` [PATCH V2 04/26] imx: imx8ulp: clock: Add clock support for i3c controller Peng Fan (OSS)
2022-04-12 18:44   ` sbabic
2022-04-06  6:30 ` [PATCH V2 05/26] imx: imx8ulp: add CAAM clock entry Peng Fan (OSS)
2022-04-12 18:43   ` sbabic
2022-04-06  6:30 ` [PATCH V2 06/26] imx: imx8ulp_evk: Remove PMIC Bucks PWM mode settings Peng Fan (OSS)
2022-04-12 18:42   ` sbabic
2022-04-06  6:30 ` [PATCH V2 07/26] imx: imx8ulp: add ND/LD clock Peng Fan (OSS)
2022-04-12 18:43   ` sbabic
2022-04-06  6:30 ` [PATCH V2 08/26] imx: imx8ulp_evk: Skip init DDR for reboot in dual boot mode Peng Fan (OSS)
2022-04-12 18:45   ` sbabic
2022-04-06  6:30 ` [PATCH V2 09/26] imx: imx8ulp: cgc: Switch to NICLPAV to FRO192 before PLL4 init Peng Fan (OSS)
2022-04-12 18:45   ` sbabic
2022-04-06  6:30 ` [PATCH V2 10/26] imx: imx8ulp: enable MU0_B clk by default Peng Fan (OSS)
2022-04-12 18:46   ` sbabic
2022-04-06  6:30 ` [PATCH V2 11/26] misc: imx8ulp: Add OEM SRK Hash fuse support Peng Fan (OSS)
2022-04-12 18:46   ` sbabic
2022-04-06  6:30 ` [PATCH V2 12/26] imx: imx8ulp: Change LPAV assignment for dual boot Peng Fan (OSS)
2022-04-12 18:42   ` sbabic
2022-04-06  6:30 ` [PATCH V2 13/26] imx: imx8ulp: Load the lposc fuse " Peng Fan (OSS)
2022-04-12 18:47   ` sbabic
2022-04-06  6:30 ` Peng Fan (OSS) [this message]
2022-04-12 18:41   ` [PATCH V2 14/26] misc: S400_API: add ahab_release_caam sbabic
2022-04-06  6:30 ` [PATCH V2 15/26] misc: S400_API: Update S400 API for buffer dump Peng Fan (OSS)
2022-04-12 18:47   ` sbabic
2022-04-06  6:30 ` [PATCH V2 16/26] imx: imx8ulp: release CAAM for the Cortex-A35 Peng Fan (OSS)
2022-04-12 18:47   ` sbabic
2022-04-06  6:30 ` [PATCH V2 17/26] imx: imx8ulp_evk: Update LPDDR4 PHY settings Peng Fan (OSS)
2022-04-12 18:42   ` sbabic
2022-04-06  6:30 ` [PATCH V2 18/26] imx: imx8ulp_evk: call the handshake with M33 Peng Fan (OSS)
2022-04-12 18:47   ` sbabic
2022-04-06  6:30 ` [PATCH V2 19/26] imx: imx8ulp_evk: Power down the domains may used in u-boot Peng Fan (OSS)
2022-04-12 17:10   ` Stefano Babic
2022-04-13  3:00     ` Peng Fan (OSS)
2022-04-13  7:45       ` Stefano Babic
2022-04-06  6:30 ` [PATCH V2 20/26] imx: dynamic setting mmcdev and mmcroot Peng Fan (OSS)
2022-04-12 18:45   ` sbabic
2022-04-25 19:58   ` Tim Harvey
2022-04-26 11:24     ` Peng Fan (OSS)
2022-04-06  6:30 ` [PATCH V2 21/26] imx: imx8ulp_evk: Enable SD/MMC port auto detect Peng Fan (OSS)
2022-04-12 18:46   ` sbabic
2022-04-06  6:30 ` [PATCH V2 22/26] imx: imx8ulp: enable wdog_ad interrupt in CMC1 Peng Fan (OSS)
2022-04-12 18:47   ` sbabic
2022-04-06  6:30 ` [PATCH V2 23/26] imx: imx8ulp: reserve tee memory Peng Fan (OSS)
2022-04-12 18:43   ` sbabic
2022-04-06  6:30 ` [PATCH V2 24/26] imx: imx8ulp_evk: enlarge CONFIG_NR_DRAM_BANKS Peng Fan (OSS)
2022-04-12 18:43   ` sbabic
2022-04-06  6:30 ` [PATCH V2 25/26] imx: imx8ulp_evk: Enable multiple env storage devices Peng Fan (OSS)
2022-04-12 18:43   ` sbabic
2022-04-06  6:30 ` [PATCH V2 26/26] misc: imx8ulp: Update fuse driver Peng Fan (OSS)
2022-04-12 18:46   ` sbabic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220406063031.21960-15-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=clement.faure@nxp.com \
    --cc=festevam@gmail.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.