summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2024-03-11 11:21:49 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-03-13 12:01:21 +0100
commitcb6ee04c5b9eb9b7bfbd2d807f85b1c3ad9ec212 (patch)
tree427044e44196feef6e2d80b017b0b9ba6b800a61
parent6119914937119a5f34a8ffeeeff40a31fce1f374 (diff)
downloadbarebox-cb6ee04c5b9eb9b7bfbd2d807f85b1c3ad9ec212.tar.gz
barebox-cb6ee04c5b9eb9b7bfbd2d807f85b1c3ad9ec212.tar.xz
ARM: i.MX: ele: add function comments
i.MX fuse numbers are sometimes referred to as the index of the 32bit word, sometimes as bit offsets and the device in /dev/imx_ocotp counts in bytes. To avoid more confusion add some comments to the function headers of functions reading/writing the fuses that clearly state that they take the 32bit word number as input. Link: https://lore.barebox.org/20240311102152.360762-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-imx/ele.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/ele.c b/arch/arm/mach-imx/ele.c
index 2107a62832..0086366a33 100644
--- a/arch/arm/mach-imx/ele.c
+++ b/arch/arm/mach-imx/ele.c
@@ -227,6 +227,16 @@ int imx93_ele_load_fw(void *bl33)
return 0;
}
+/*
+ * ele_read_common_fuse - read a fuse
+ * @fuse_id: The fuse to read (in 32bit word number)
+ * fuse_word: The value read from the fuse
+ * @response: on return contains the response from ELE
+ *
+ * This reads the shadow value of the fuse @fuse_id.
+ *
+ * Return: 0 when the ELE call succeeds, negative error code otherwise
+ */
int ele_read_common_fuse(u16 fuse_id, u32 *fuse_word, u32 *response)
{
struct ele_msg msg;
@@ -248,6 +258,16 @@ int ele_read_common_fuse(u16 fuse_id, u32 *fuse_word, u32 *response)
return ret;
}
+/*
+ * ele_read_shadow_fuse - read a fuse
+ * @fuse_id: The fuse to read (in 32bit word number)
+ * fuse_word: The value read from the fuse
+ * @response: on return contains the response from ELE
+ *
+ * This reads the shadow value of the fuse @fuse_id.
+ *
+ * Return: 0 when the ELE call succeeds, negative error code otherwise
+ */
int ele_read_shadow_fuse(u16 fuse_id, u32 *fuse_word, u32 *response)
{
struct ele_msg msg;
@@ -271,7 +291,7 @@ int ele_read_shadow_fuse(u16 fuse_id, u32 *fuse_word, u32 *response)
/*
* ele_write_fuse - write a fuse
- * @fuse_id: The fuse to write to
+ * @fuse_id: The fuse to write to (in 32bit word number)
* @fuse_val: The value to write to the fuse
* @lock: lock fuse after writing
* @response: on return contains the response from ELE