Skip to content

Commit c923d6c

Browse files
committed
feat(U-Boot): Add user-guide to program user OTPs and Boot-mode OTPs
Add documentation on using fuse prog and fuse read command to program and read general purpose OTP bits that are available for end users to program. Also, add documentation on how to program OTP bits that translate reduce Boot-mode pins. These features are only available on AM62L for now. Signed-off-by: Vignesh Raghavendra <[email protected]>
1 parent 0ebc7b7 commit c923d6c

File tree

3 files changed

+153
-0
lines changed

3 files changed

+153
-0
lines changed

configs/AM62LX/AM62LX_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ linux/Foundational_Components/U-Boot/UG-SPI
3232
linux/Foundational_Components/U-Boot/UG-QSPI
3333
linux/Foundational_Components/U-Boot/UG-UART
3434
linux/Foundational_Components/U-Boot/UG-Key-Writer-Lite
35+
linux/Foundational_Components/U-Boot/UG-Programming-OTPs
3536

3637
linux/Foundational_Components/U-Boot/Applications
3738
linux/Foundational_Components/U-Boot/Apps-SPL-Debug-OpenOCD
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
.. _programming-user-otp-fuses-label:
2+
3+
##########################
4+
Programming user OTP fuses
5+
##########################
6+
7+
This guide describes how to read and write User One Time Programmable (OTP)
8+
fuses and Boot-mode fuses by using U-Boot's fuse commands.
9+
10+
.. caution::
11+
12+
Programming fuses is an irreversible operation. Once an OTP fuse is
13+
programmed, it cannot be undone. Please verify all values carefully before
14+
programming.
15+
16+
Commands overview
17+
=================
18+
19+
See U-Boot fuse command `documentation
20+
<https://docs.u-boot.org/en/latest/usage/cmd/fuse.html>`__
21+
22+
Reading fuses
23+
=============
24+
Read is only permitted from bank 0.
25+
26+
Below example shows reading 4 x 32-bit words starting from bank 0, offset 5:
27+
28+
.. code-block:: text
29+
30+
=> fuse read 0 5 4
31+
32+
Programming fuses
33+
=================
34+
35+
.. warning::
36+
37+
Before programming fuses, apply proper voltage to the Vpp pin.
38+
The :ref:`key-writer-lite-label` document explains how to control
39+
Vpp voltage.
40+
41+
The `fuse prog` command programs two types of OTP bits:
42+
43+
- Bank 0 - General Purpose User defined OTP bits.
44+
- Bank 0xFF - Reduced pin Boot-mode related OTP bits.
45+
46+
Programming sequence
47+
--------------------
48+
49+
Programming fuses requires applying a voltage to a specific pin (Vpp).
50+
Refer to device data sheet for more details.
51+
52+
On TI AM62L Evaluation Module, an I2C-based IO expander controls the Vpp pin.
53+
Follow these steps to enable or disable Vpp:
54+
55+
1. Select and probe the I2C bus:
56+
57+
.. code-block:: text
58+
59+
# Select i2c bus 2 (chip 22 is connected to it)
60+
=> i2c dev 2
61+
62+
# Probe the chip
63+
=> i2c probe 22
64+
65+
2. Configure and enable Vpp:
66+
67+
.. code-block:: text
68+
69+
# Turn off Vpp initially
70+
=> i2c mw 0x22 0x04 0x00
71+
72+
# Configure Vpp (port 04) as output
73+
=> i2c mw 0x22 0xC 0xEF
74+
75+
# Turn on Vpp
76+
=> i2c mw 0x22 0x04 0x10
77+
78+
3. Run fuse prog command
79+
80+
.. code-block:: text
81+
82+
# Programs word 15 to 0x1234 (each word is 25-bit)
83+
=> fuse prog 0 15 0x1234
84+
85+
4. Disable Vpp after programming:
86+
87+
.. code-block:: text
88+
89+
# Turn off Vpp
90+
=> i2c mw 0x22 0x04 0x00
91+
92+
5. Power cycle the device for changes to take effect
93+
94+
.. note::
95+
96+
- Bank and word numbers are device-specific
97+
- Changes to fuses only become visible after a full power cycle
98+
99+
For programming many fuses and keys in one-shot using a binary blob
100+
(``fuse writebuff``), see the :ref:`key-writer-lite-label` document.
101+
102+
Programming Boot-mode fuses
103+
===========================
104+
105+
.. caution::
106+
107+
Programming Boot-mode fuses is an irreversible operation. Once an OTP fuse is
108+
programmed, it cannot be undone. Boot-mode fuses lock on first write, so
109+
multi-pass programming is not possible
110+
111+
112+
The Boot-mode pin fuses allow configuration of the boot sequence without
113+
requiring physical pin strapping. The following provides an example of
114+
programming Boot-mode pin related fuses. |__PART_FAMILY_NAME__| supports
115+
reduced Boot-mode configuration by a combination of fuse and Boot-mode pins.
116+
When set to fuse Boot-mode, the Boot-mode pins decode the corresponding fuse
117+
into a 16-bit Boot-mode value. Refer to |__PART_FAMILY_NAME__| Technical
118+
Reference Manual (TRM) for more details. Enable Vpp before programming these
119+
fuses, similar to other fuses.
120+
121+
Boot-mode fuse encoding
122+
-----------------------
123+
124+
`This documentation
125+
<http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/boot_mode_writer_encoding.html>`__
126+
provides the mapping between Boot-mode strapping values and their corresponding
127+
fuse encoding values.
128+
129+
Programming example
130+
-------------------
131+
132+
To program fuse slot 0 with GPMC NAND as primary and USB-DFU as backup, full
133+
pin count strapping would be 0x45B. This translates to 0x18045B according to
134+
Boot-mode pin encoding table. So, following would program fuse slot 1 to
135+
GPMC NAND primary and DFU as backup.
136+
137+
.. code-block:: text
138+
139+
=> fuse prog 0xFF 1 0x18045B
140+
141+
.. note::
142+
143+
- Bank 0xFF stores Boot-mode pin fuses.
144+
- Each word in the bank can store one pin configuration.
145+
- The number of available words depends on the device.
146+
- Refer to your device's TRM for the valid pin numbers.
147+
- New Boot-mode settings take affect post a power-cycle
148+
149+
.. caution::
150+
151+
Currently there is no support to read-back the Boot-mode related fuses.

source/linux/Foundational_Components/U-Boot/Users-Guide.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ User's Guide
3131
UG-Thermal
3232
UG-Splash-Screen
3333
UG-Key-Writer-Lite
34+
UG-Programming-OTPs

0 commit comments

Comments
 (0)