* [RFC PATCH v2 0/5] cmd: fuse: Introduce fuse writebuff sub-system and clean up
@ 2025-03-14 13:57 Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 1/5] cmd: fuse: Remove custom string functions Harsha Vardhan V M
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Harsha Vardhan V M @ 2025-03-14 13:57 UTC (permalink / raw)
To: u-boot; +Cc: trini, vigneshr, k-malarvizhi, kamlesh
This patch series introduces the fuse writebuff sub-system command and
makes improvements to the existing fuse implementation by removing the
custom string functions. The patches are required to be applied in
sequence.
The series consists of the following changes:
Patch 1 removes custom string functions and replaces them with standard
string functions.
Patch 2 introduces fuse.rst documentation for fuse commands.
Patch 3 introduces the fuse writebuff sub-system command, allowing to
write a structured buffer in memory to fuses, and implementing the
necessary function calls.
Patch 4 enables the fuse sub-system in the K3 platform.
Patch 5 updates the fuse.rst documentation to include details about the
new fuse writebuff command.
These changes aim to improve the fuse sub-system by the removal of
custom string functions and the addition of the fuse writebuff
command improves fuse programming workflows by allowing to write a
structured buffer in memory to efuses.
Changes in v2:
1.Convert doc/README.fuse to doc/usage/cmd/fuse.rst as patch #2,
as requested by trini@konsulko.com.
2.Add fuse writebuff documentation in fuse.rst in the final patch.
Harsha Vardhan V M (5):
cmd: fuse: Remove custom string functions
doc: cmd: add documentation for fuse command
cmd: fuse: Add fuse writebuff sub-system command
drivers: k3_fuse: Add fuse sub-system func calls
doc: cmd: add fuse writebuff cmd documentation
cmd/Kconfig | 8 ++
cmd/fuse.c | 49 +++++++-----
doc/usage/cmd/fuse.rst | 176 +++++++++++++++++++++++++++++++++++++++++
drivers/misc/Kconfig | 7 ++
drivers/misc/Makefile | 1 +
drivers/misc/k3_fuse.c | 78 ++++++++++++++++++
include/fuse.h | 9 +++
7 files changed, 307 insertions(+), 21 deletions(-)
create mode 100644 doc/usage/cmd/fuse.rst
create mode 100644 drivers/misc/k3_fuse.c
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [RFC PATCH v2 1/5] cmd: fuse: Remove custom string functions
2025-03-14 13:57 [RFC PATCH v2 0/5] cmd: fuse: Introduce fuse writebuff sub-system and clean up Harsha Vardhan V M
@ 2025-03-14 13:57 ` Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 2/5] doc: cmd: add documentation for fuse command Harsha Vardhan V M
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Harsha Vardhan V M @ 2025-03-14 13:57 UTC (permalink / raw)
To: u-boot; +Cc: trini, vigneshr, k-malarvizhi, kamlesh
Remove custom string functions and replace them with normal string
functions. Remove the custom strtou32 and replace it with str2long.
Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
---
cmd/fuse.c | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/cmd/fuse.c b/cmd/fuse.c
index 598ef496a43..9f489570634 100644
--- a/cmd/fuse.c
+++ b/cmd/fuse.c
@@ -15,17 +15,6 @@
#include <vsprintf.h>
#include <linux/errno.h>
-static int strtou32(const char *str, unsigned int base, u32 *result)
-{
- char *ep;
-
- *result = simple_strtoul(str, &ep, base);
- if (ep == str || *ep != '\0')
- return -EINVAL;
-
- return 0;
-}
-
static int confirm_prog(void)
{
puts("Warning: Programming fuses is an irreversible operation!\n"
@@ -54,14 +43,14 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
argc -= 2 + confirmed;
argv += 2 + confirmed;
- if (argc < 2 || strtou32(argv[0], 0, &bank) ||
- strtou32(argv[1], 0, &word))
+ if (argc < 2 || !(str2long(argv[0], (ulong *)&bank)) ||
+ !(str2long(argv[1], (ulong *)&word)))
return CMD_RET_USAGE;
if (!strcmp(op, "read")) {
if (argc == 2)
cnt = 1;
- else if (argc != 3 || strtou32(argv[2], 0, &cnt))
+ else if (argc != 3 || !(str2long(argv[2], (ulong *)&cnt)))
return CMD_RET_USAGE;
printf("Reading bank %u:\n", bank);
@@ -79,7 +68,7 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
} else if (!strcmp(op, "readm")) {
if (argc == 3)
cnt = 1;
- else if (argc != 4 || strtou32(argv[3], 0, &cnt))
+ else if (argc != 4 || !(str2long(argv[3], (ulong *)&cnt)))
return CMD_RET_USAGE;
addr = simple_strtoul(argv[2], NULL, 16);
@@ -99,7 +88,7 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
unmap_sysmem(start);
} else if (!strcmp(op, "cmp")) {
- if (argc != 3 || strtou32(argv[2], 0, &cmp))
+ if (argc != 3 || !(str2long(argv[2], (ulong *)&cmp)))
return CMD_RET_USAGE;
printf("Comparing bank %u:\n", bank);
@@ -119,7 +108,7 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
} else if (!strcmp(op, "sense")) {
if (argc == 2)
cnt = 1;
- else if (argc != 3 || strtou32(argv[2], 0, &cnt))
+ else if (argc != 3 || !(str2long(argv[2], (ulong *)&cnt)))
return CMD_RET_USAGE;
printf("Sensing bank %u:\n", bank);
@@ -139,7 +128,7 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
for (i = 2; i < argc; i++, word++) {
- if (strtou32(argv[i], 16, &val))
+ if (!(str2long(argv[i], (ulong *)&val)))
return CMD_RET_USAGE;
printf("Programming bank %u word 0x%.8x to 0x%.8x...\n",
@@ -155,7 +144,7 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
for (i = 2; i < argc; i++, word++) {
- if (strtou32(argv[i], 16, &val))
+ if (!(str2long(argv[i], (ulong *)&val)))
return CMD_RET_USAGE;
printf("Overriding bank %u word 0x%.8x with "
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [RFC PATCH v2 2/5] doc: cmd: add documentation for fuse command
2025-03-14 13:57 [RFC PATCH v2 0/5] cmd: fuse: Introduce fuse writebuff sub-system and clean up Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 1/5] cmd: fuse: Remove custom string functions Harsha Vardhan V M
@ 2025-03-14 13:57 ` Harsha Vardhan V M
2025-03-14 16:38 ` Tom Rini
2025-03-14 13:57 ` [RFC PATCH v2 3/5] cmd: fuse: Add fuse writebuff sub-system command Harsha Vardhan V M
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Harsha Vardhan V M @ 2025-03-14 13:57 UTC (permalink / raw)
To: u-boot; +Cc: trini, vigneshr, k-malarvizhi, kamlesh
Add documentation for the 'fuse' sub-system commands.
Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
---
doc/usage/cmd/fuse.rst | 156 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 156 insertions(+)
create mode 100644 doc/usage/cmd/fuse.rst
diff --git a/doc/usage/cmd/fuse.rst b/doc/usage/cmd/fuse.rst
new file mode 100644
index 00000000000..6e330eddfea
--- /dev/null
+++ b/doc/usage/cmd/fuse.rst
@@ -0,0 +1,156 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+.. index::
+ single: fuse (command)
+
+fuse command
+============
+
+Synopsis
+--------
+
+::
+
+ fuse read <bank> <word> [<cnt>]
+ fuse cmp <bank> <word> <hexval>
+ fuse readm <bank> <word> <addr> [<cnt>]
+ fuse sense <bank> <word> [<cnt>]
+ fuse prog [-y] <bank> <word> <hexval> [<hexval>...]
+ fuse override <bank> <word> <hexval> [<hexval>...]
+
+Description
+-----------
+
+The fuse API allows to control a fusebox and how it is used by the upper
+hardware layers.
+
+A fuse corresponds to a single non-volatile memory bit that can be programmed
+(i.e., blown, set to 1) only once. The programming operation is irreversible.
+A fuse that has not been programmed reads as 0.
+
+Fuses can be used by SoCs to store various permanent configurations and data,
+such as boot configurations, security settings, MAC addresses, etc.
+
+A fuse 'word' is the smallest group of fuses that can be read at once from
+the fusebox control IP registers. In the current API, this is limited to 32 bits.
+
+A fuse 'bank' is the smallest group of fuse words having a common ID, as
+defined by each SoC.
+
+Upon startup, the fusebox control IP reads the fuse values and stores them in a
+volatile shadow cache.
+
+Commands
+--------
+
+- **fuse read <bank> <word> [<cnt>]**
+ Reads 1 or 'cnt' fuse words, starting at 'word' from the shadow cache.
+
+- **fuse cmp <bank> <word> <hexval>**
+ Compares 'hexval' to fuse at 'word'.
+
+- **fuse readm <bank> <word> <addr> [<cnt>]**
+ Reads 1 or 'cnt' fuse words, starting at 'word' into memory at 'addr'.
+
+- **fuse sense <bank> <word> [<cnt>]**
+ Sense 1 or 'cnt' fuse words, starting at 'word'.
+ Sense - i.e. read directly from the fusebox, skipping the shadow cache -
+ fuse words. This operation does not update the shadow cache. This is
+ useful to know the true value of fuses if an override has been
+ performed (see below).
+
+- **fuse prog [-y] <bank> <word> <hexval> [<hexval>...]**
+ Permanently programs 1 or several fuse words, starting at 'word'.
+ This operation directly affects the fusebox and is irreversible. The
+ shadow cache is updated accordingly or not, depending on each IP.
+ Only the bits to be programmed should be set in the input value (i.e.
+ for fuse bits that have already been programmed and hence should be
+ left unchanged by a further programming, it is preferable to clear
+ the corresponding bits in the input value in order not to perform a
+ new hardware programming operation on these fuse bits).
+
+- **fuse override <bank> <word> <hexval> [<hexval>...]**
+ Override 1 or several fuse words, starting at 'word' in the shadow cache.
+ The fusebox is unaffected, so following this operation, the shadow cache
+ may differ from the fusebox values. Read or sense operations can then be
+ used to get the values from the shadow cache or from the fusebox.
+ This is useful to change the behaviours linked to some cached fuse values,
+ either because this is needed only temporarily, or because some of the
+ fuses have already been programmed or are locked (if the SoC allows to
+ override a locked fuse).
+
+Examples
+--------
+
+fuse read
+~~~~~~~~~
+
+::
+
+ u-boot=> fuse read 0 1
+ Reading bank 0:
+
+ Word 0x00000001: 00000001
+
+fuse cmp
+~~~~~~~~
+
+::
+
+ u-boot=> fuse cmp 0 1 0x1
+ Comparing bank 0:
+
+ Word 0x00000001:
+ Value 0x00000001:0x00000001
+ passed
+
+fuse readm
+~~~~~~~~~~
+
+::
+
+ u-boot=> fuse readm 0 1 0x83000000
+ Reading bank 0 len 1 to 0x83000000
+
+fuse sense
+~~~~~~~~~~
+
+::
+
+ u-boot=> fuse sense 0 1
+ Sensing bank 0:
+
+ Word 0x00000001: 00000001
+
+fuse prog
+~~~~~~~~~
+
+::
+
+ u-boot=> fuse prog 0 1 0x00000002
+ Programming bank 0 word 0x00000001 to 0x00000002...
+ Warning: Programming fuses is an irreversible operation!
+ This may brick your system.
+ Use this command only if you are sure of what you are doing!
+
+ Really perform this fuse programming? <y/N>
+ y
+
+fuse override
+~~~~~~~~~~~~~
+
+::
+
+ u-boot=> fuse override 0 1 0x00000003
+ Overriding bank 0 word 0x00000001 with 0x00000003...
+
+Configuration
+-------------
+
+The fuse commands are available if CONFIG_CMD_FUSE=y.
+
+Return code
+-----------
+
+The return value $? is set to 0 (true) if the command is successful,
+1 (false) otherwise.
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [RFC PATCH v2 3/5] cmd: fuse: Add fuse writebuff sub-system command
2025-03-14 13:57 [RFC PATCH v2 0/5] cmd: fuse: Introduce fuse writebuff sub-system and clean up Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 1/5] cmd: fuse: Remove custom string functions Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 2/5] doc: cmd: add documentation for fuse command Harsha Vardhan V M
@ 2025-03-14 13:57 ` Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 4/5] drivers: k3_fuse: Add fuse sub-system func calls Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 5/5] doc: cmd: add fuse writebuff cmd documentation Harsha Vardhan V M
4 siblings, 0 replies; 8+ messages in thread
From: Harsha Vardhan V M @ 2025-03-14 13:57 UTC (permalink / raw)
To: u-boot; +Cc: trini, vigneshr, k-malarvizhi, kamlesh
Add CMD_FUSE_WRITEBUFF config option to add and enable fuse writebuff
sub-system command. Add fuse_writebuff function to be invoked on
writebuff command.
Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
cmd/Kconfig | 8 ++++++++
cmd/fuse.c | 26 ++++++++++++++++++++++----
include/fuse.h | 9 +++++++++
3 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/cmd/Kconfig b/cmd/Kconfig
index cd391d422ae..81c59becc2d 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1236,6 +1236,14 @@ config CMD_FUSE
which control the behaviour of the device. The command uses the
fuse_...() API.
+config CMD_FUSE_WRITEBUFF
+ bool "Support for the fuse writebuff"
+ depends on CMD_FUSE
+ help
+ This allows programming fuses, which control the behaviour of
+ the device, using a structured buffer in memory. The command
+ uses the fuse_writebuff() API.
+
config CMD_GPIO
bool "gpio"
help
diff --git a/cmd/fuse.c b/cmd/fuse.c
index 9f489570634..2d53e6bf2c4 100644
--- a/cmd/fuse.c
+++ b/cmd/fuse.c
@@ -43,9 +43,14 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
argc -= 2 + confirmed;
argv += 2 + confirmed;
- if (argc < 2 || !(str2long(argv[0], (ulong *)&bank)) ||
- !(str2long(argv[1], (ulong *)&word)))
- return CMD_RET_USAGE;
+ if (IS_ENABLED(CONFIG_CMD_FUSE_WRITEBUFF) && !strcmp(op, "writebuff")) {
+ if (argc != 1 || !(str2long(argv[0], &addr)))
+ return CMD_RET_USAGE;
+ } else {
+ if (argc < 2 || !(str2long(argv[0], (ulong *)&bank)) ||
+ !(str2long(argv[1], (ulong *)&word)))
+ return CMD_RET_USAGE;
+ }
if (!strcmp(op, "read")) {
if (argc == 2)
@@ -153,6 +158,15 @@ static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc,
if (ret)
goto err;
}
+ } else if (IS_ENABLED(CONFIG_CMD_FUSE_WRITEBUFF) && !strcmp(op, "writebuff")) {
+ printf("Programming fuses using a structured buffer in memory "
+ "starting at addr 0x%lx\n", addr);
+ if (!confirmed && !confirm_prog())
+ return CMD_RET_FAILURE;
+
+ ret = fuse_writebuff(addr);
+ if (ret)
+ goto err;
} else {
return CMD_RET_USAGE;
}
@@ -178,5 +192,9 @@ U_BOOT_CMD(
"fuse prog [-y] <bank> <word> <hexval> [<hexval>...] - program 1 or\n"
" several fuse words, starting at 'word' (PERMANENT)\n"
"fuse override <bank> <word> <hexval> [<hexval>...] - override 1 or\n"
- " several fuse words, starting at 'word'"
+ " several fuse words, starting at 'word'\n"
+#ifdef CONFIG_CMD_FUSE_WRITEBUFF
+ "fuse writebuff [-y] <addr> - program fuse data\n"
+ " using a structured buffer in memory starting at 'addr'\n"
+#endif /* CONFIG_CMD_FUSE_WRITEBUFF */
);
diff --git a/include/fuse.h b/include/fuse.h
index 4519821af7e..902b5f56a74 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -12,6 +12,7 @@
#define _FUSE_H_
#include <linux/types.h>
+#include <linux/errno.h>
/*
* Read/Sense/Program/Override interface:
@@ -25,5 +26,13 @@ int fuse_read(u32 bank, u32 word, u32 *val);
int fuse_sense(u32 bank, u32 word, u32 *val);
int fuse_prog(u32 bank, u32 word, u32 val);
int fuse_override(u32 bank, u32 word, u32 val);
+#ifdef CONFIG_CMD_FUSE_WRITEBUFF
+int fuse_writebuff(ulong addr);
+#else
+static inline int fuse_writebuff(ulong addr)
+{
+ return -EPERM;
+}
+#endif /* CONFIG_CMD_FUSE_WRITEBUFF */
#endif /* _FUSE_H_ */
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [RFC PATCH v2 4/5] drivers: k3_fuse: Add fuse sub-system func calls
2025-03-14 13:57 [RFC PATCH v2 0/5] cmd: fuse: Introduce fuse writebuff sub-system and clean up Harsha Vardhan V M
` (2 preceding siblings ...)
2025-03-14 13:57 ` [RFC PATCH v2 3/5] cmd: fuse: Add fuse writebuff sub-system command Harsha Vardhan V M
@ 2025-03-14 13:57 ` Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 5/5] doc: cmd: add fuse writebuff cmd documentation Harsha Vardhan V M
4 siblings, 0 replies; 8+ messages in thread
From: Harsha Vardhan V M @ 2025-03-14 13:57 UTC (permalink / raw)
To: u-boot; +Cc: trini, vigneshr, k-malarvizhi, kamlesh
Add K3_FUSE config option to add and enable fuse sub-system
implementation function calls.
Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
drivers/misc/Kconfig | 7 ++++
drivers/misc/Makefile | 1 +
drivers/misc/k3_fuse.c | 78 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+)
create mode 100644 drivers/misc/k3_fuse.c
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index da84b35e804..834e0285097 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -468,6 +468,13 @@ config STM32MP_FUSE
for STM32MP architecture.
This API is needed for CMD_FUSE.
+config K3_FUSE
+ bool "Enable TI K3 fuse wrapper providing the fuse API"
+ depends on MISC && CMD_FUSE && CMD_FUSE_WRITEBUFF
+ help
+ If you say Y here, you will get support for the fuse API (OTP)
+ for TI K3 architecture.
+
config STM32_RCC
bool "Enable RCC driver for the STM32 SoC's family"
depends on (ARCH_STM32 || ARCH_STM32MP) && MISC
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index dac805e4cdd..0b81ba2604f 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_$(XPL_)I2C_EEPROM) += i2c_eeprom.o
obj-$(CONFIG_IHS_FPGA) += ihs_fpga.o
obj-$(CONFIG_IMX8) += imx8/
obj-$(CONFIG_IMX_ELE) += imx_ele/
+obj-$(CONFIG_K3_FUSE) += k3_fuse.o
obj-$(CONFIG_LED_STATUS) += status_led.o
obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o
diff --git a/drivers/misc/k3_fuse.c b/drivers/misc/k3_fuse.c
new file mode 100644
index 00000000000..4a8ff1f2523
--- /dev/null
+++ b/drivers/misc/k3_fuse.c
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2025 Texas Instruments Incorporated, <www.ti.com>
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <fuse.h>
+#include <linux/arm-smccc.h>
+#include <string.h>
+
+#define K3_SIP_OTP_WRITEBUFF 0xC2000000
+#define K3_SIP_OTP_WRITE 0xC2000001
+#define K3_SIP_OTP_READ 0xC2000002
+
+int fuse_read(u32 bank, u32 word, u32 *val)
+{
+ struct arm_smccc_res res;
+
+ if (bank != 0U) {
+ printf("Invalid bank argument, ONLY bank 0 is supported\n");
+ return -EINVAL;
+ }
+
+ /* Make SiP SMC call and send the word in the parameter register */
+ arm_smccc_smc(K3_SIP_OTP_READ, word,
+ 0, 0, 0, 0, 0, 0, &res);
+
+ *val = res.a1;
+ if (res.a0 != 0)
+ printf("SMC call failed: Error code %lu\n", res.a0);
+
+ return res.a0;
+}
+
+int fuse_sense(u32 bank, u32 word, u32 *val)
+{
+ return -EPERM;
+}
+
+int fuse_prog(u32 bank, u32 word, u32 val)
+{
+ struct arm_smccc_res res;
+ u32 mask = val;
+
+ if (bank != 0U) {
+ printf("Invalid bank argument, ONLY bank 0 is supported\n");
+ return -EINVAL;
+ }
+
+ /* Make SiP SMC call and send the word, val and mask in the parameter register */
+ arm_smccc_smc(K3_SIP_OTP_WRITE, word,
+ val, mask, 0, 0, 0, 0, &res);
+
+ if (res.a0 != 0)
+ printf("SMC call failed: Error code %lu\n", res.a0);
+
+ return res.a0;
+}
+
+int fuse_override(u32 bank, u32 word, u32 val)
+{
+ return -EPERM;
+}
+
+int fuse_writebuff(ulong addr)
+{
+ struct arm_smccc_res res;
+
+ /* Make SiP SMC call and send the addr in the parameter register */
+ arm_smccc_smc(K3_SIP_OTP_WRITEBUFF, (unsigned long)addr,
+ 0, 0, 0, 0, 0, 0, &res);
+
+ if (res.a0 != 0)
+ printf("SMC call failed: Error code %lu\n", res.a0);
+
+ return res.a0;
+}
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [RFC PATCH v2 5/5] doc: cmd: add fuse writebuff cmd documentation
2025-03-14 13:57 [RFC PATCH v2 0/5] cmd: fuse: Introduce fuse writebuff sub-system and clean up Harsha Vardhan V M
` (3 preceding siblings ...)
2025-03-14 13:57 ` [RFC PATCH v2 4/5] drivers: k3_fuse: Add fuse sub-system func calls Harsha Vardhan V M
@ 2025-03-14 13:57 ` Harsha Vardhan V M
4 siblings, 0 replies; 8+ messages in thread
From: Harsha Vardhan V M @ 2025-03-14 13:57 UTC (permalink / raw)
To: u-boot; +Cc: trini, vigneshr, k-malarvizhi, kamlesh
Add fuse writebuff sub-system command documentation.
Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
---
doc/usage/cmd/fuse.rst | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/doc/usage/cmd/fuse.rst b/doc/usage/cmd/fuse.rst
index 6e330eddfea..42c6e209f99 100644
--- a/doc/usage/cmd/fuse.rst
+++ b/doc/usage/cmd/fuse.rst
@@ -17,6 +17,7 @@ Synopsis
fuse sense <bank> <word> [<cnt>]
fuse prog [-y] <bank> <word> <hexval> [<hexval>...]
fuse override <bank> <word> <hexval> [<hexval>...]
+ fuse writebuff [-y] <addr>
Description
-----------
@@ -79,6 +80,16 @@ Commands
fuses have already been programmed or are locked (if the SoC allows to
override a locked fuse).
+- **fuse writebuff [-y] <addr>**
+ Programs fuse data using a structured buffer in memory starting at 'addr'.
+ This operation directly affects the fusebox and is irreversible.
+
+ The structure of the buffer should contain all necessary details for
+ programming fuses, such as the values to be written to the fuse, optional
+ metadata for validation or programming constraints and any configuration
+ data required for the operation. Define CONFIG_CMD_FUSE_WRITEBUFF to
+ enable the fuse writebuff command.
+
Examples
--------
@@ -144,10 +155,19 @@ fuse override
u-boot=> fuse override 0 1 0x00000003
Overriding bank 0 word 0x00000001 with 0x00000003...
+fuse writebuff
+~~~~~~~~~~~~~~
+
+::
+
+ u-boot=> fuse writebuff -y 0x84000000
+ Programming fuses with buffer at addr 0x84000000
+
Configuration
-------------
The fuse commands are available if CONFIG_CMD_FUSE=y.
+The fuse writebuff command is available if CONFIG_CMD_FUSE_WRITEBUFF=y.
Return code
-----------
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [RFC PATCH v2 2/5] doc: cmd: add documentation for fuse command
2025-03-14 13:57 ` [RFC PATCH v2 2/5] doc: cmd: add documentation for fuse command Harsha Vardhan V M
@ 2025-03-14 16:38 ` Tom Rini
2025-03-17 9:04 ` Harsha Vardhan V M
0 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2025-03-14 16:38 UTC (permalink / raw)
To: Harsha Vardhan V M; +Cc: u-boot, vigneshr, k-malarvizhi, kamlesh
[-- Attachment #1: Type: text/plain, Size: 539 bytes --]
On Fri, Mar 14, 2025 at 07:27:03PM +0530, Harsha Vardhan V M wrote:
> Add documentation for the 'fuse' sub-system commands.
>
> Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
> ---
> doc/usage/cmd/fuse.rst | 156 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 156 insertions(+)
> create mode 100644 doc/usage/cmd/fuse.rst
This should delete the old doc/ file as well. Also please run:
make htmldocs KDOC_WERROR=1
As this will fail due to not including this in the index at a minimum.
Thanks.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC PATCH v2 2/5] doc: cmd: add documentation for fuse command
2025-03-14 16:38 ` Tom Rini
@ 2025-03-17 9:04 ` Harsha Vardhan V M
0 siblings, 0 replies; 8+ messages in thread
From: Harsha Vardhan V M @ 2025-03-17 9:04 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot, vigneshr, k-malarvizhi, kamlesh
On 14/03/25 22:08, Tom Rini wrote:
> On Fri, Mar 14, 2025 at 07:27:03PM +0530, Harsha Vardhan V M wrote:
>
>> Add documentation for the 'fuse' sub-system commands.
>>
>> Signed-off-by: Harsha Vardhan V M <h-vm@ti.com>
>> ---
>> doc/usage/cmd/fuse.rst | 156 +++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 156 insertions(+)
>> create mode 100644 doc/usage/cmd/fuse.rst
>
> This should delete the old doc/ file as well. Also please run:
> make htmldocs KDOC_WERROR=1
>
> As this will fail due to not including this in the index at a minimum.
> Thanks.
>
Thanks, Will remove the doc/README.fuse file and add the fuse index in
doc/usage/index.rst
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-03-17 9:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14 13:57 [RFC PATCH v2 0/5] cmd: fuse: Introduce fuse writebuff sub-system and clean up Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 1/5] cmd: fuse: Remove custom string functions Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 2/5] doc: cmd: add documentation for fuse command Harsha Vardhan V M
2025-03-14 16:38 ` Tom Rini
2025-03-17 9:04 ` Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 3/5] cmd: fuse: Add fuse writebuff sub-system command Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 4/5] drivers: k3_fuse: Add fuse sub-system func calls Harsha Vardhan V M
2025-03-14 13:57 ` [RFC PATCH v2 5/5] doc: cmd: add fuse writebuff cmd documentation Harsha Vardhan V M
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox