Skip to content

Commit 0680fae

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 0680fae

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-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: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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
14+
before programming.
15+
16+
Commands Overview
17+
=================
18+
19+
Refer to U-Boot fuse command `documentation <https://docs.u-boot.org/en/latest/usage/cmd/fuse.html>`_
20+
21+
Reading Fuses
22+
=============
23+
Read is only permitted from bank 0.
24+
25+
Below example shows reading 4 x 32-bit words starting from bank 0, offset 5:
26+
27+
.. code-block:: text
28+
29+
=> fuse read 0 5 4
30+
31+
Programming Fuses
32+
=================
33+
34+
.. warning::
35+
36+
Before programming fuses, ensure proper voltage is applied to the
37+
Vpp pin. Refer to the :ref:`key-writer-lite-label` document for
38+
details on controlling Vpp voltage.
39+
40+
There are two types of OTP bits that can be programmed using `fuse prog` command:
41+
42+
- Bank 0 - General Purpose User defined OTP bits.
43+
- Bank 0xFF - Reduced pin Boot-mode related OTP bits.
44+
45+
Programming Sequence
46+
--------------------
47+
48+
Fuse modification requires a voltage to be applied on a specific pin (Vpp) during programming.
49+
Refer to device data sheet for more details.
50+
51+
On TI AM62L PROC181E1 EVMs, the Vpp pin is controlled through an I2C-based IO expander.
52+
Follow these steps to enable or disable Vpp:
53+
54+
1. Select and probe the I2C bus:
55+
56+
.. code-block:: text
57+
58+
# Select i2c bus 2 (chip 22 is connected to it)
59+
=> i2c dev 2
60+
61+
# Probe the chip
62+
=> i2c probe 22
63+
64+
2. Configure and enable Vpp:
65+
66+
.. code-block:: text
67+
68+
# Turn off Vpp initially
69+
=> i2c mw 0x22 0x04 0x00
70+
71+
# Configure Vpp (port 04) as output
72+
=> i2c mw 0x22 0xC 0xEF
73+
74+
# Turn on Vpp
75+
=> i2c mw 0x22 0x04 0x10
76+
77+
3. Execute fuse prog command
78+
79+
.. code-block:: text
80+
81+
# Programs word 15 to 0x1234 (each word is 25-bit)
82+
=> fuse prog 0 15 0x1234
83+
84+
4. Disable Vpp after programming:
85+
86+
.. code-block:: text
87+
88+
# Turn off Vpp
89+
=> i2c mw 0x22 0x04 0x00
90+
91+
5. Power cycle the device for changes to take effect
92+
93+
.. note::
94+
95+
- Bank and word numbers are device-specific
96+
- Changes to fuses only become visible after a full power cycle
97+
98+
For programming multiple fuses and keys by using a binary blob (fuse writebuff), refer to the
99+
:ref:`key-writer-lite-label` document.
100+
101+
Programming Boot-mode Pin Fuses
102+
===============================
103+
104+
.. caution::
105+
106+
Programming Boot-mode fuses is an irreversible operation. Once an OTP fuse is
107+
programmed, it cannot be undone. Boot-mode fuses lock on first write, so multi-pass
108+
programming is not possible
109+
110+
111+
The Boot-mode pin fuses allow users to configure the boot sequence without requiring physical
112+
pin strapping. This section provides examples of programming Boot-mode pin related fuses.
113+
|__PART_FAMILY_NAME__| supports reduced Boot-mode configuration via combination of fuse and Boot-mode pins.
114+
When the Boot-mode pins are set fuse Boot-mode, corresponding fuse is decoded to imply 16-bit
115+
Boot-mode value. Refer to |__PART_FAMILY_NAME__| TRM for more details. Vpp needs to be enabled for programming
116+
these fuses similar to other fuses.
117+
118+
Boot-mode Fuse Encoding
119+
-----------------------
120+
121+
Refer to `this documentation <http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/boot_mode_writer_encoding.html>`_
122+
for mapping between Boot-mode strapping value to encoded value to be written to fuse.
123+
124+
Programming Examples
125+
--------------------
126+
127+
To program fuse slot 0 with GPMC NAND as primary and USB-DFU as backup, full pin
128+
count strapping would be 0x45B. This translates to 0x18045B according to Boot-mode pin
129+
encoding table. So, following would program fuse slot 1 to GPMC NAND primary and DFU as backup.
130+
131+
.. code-block:: text
132+
133+
=> fuse prog 0xFF 1 0x18045B
134+
135+
.. note::
136+
137+
- Bank 0xFF is reserved for Boot-mode pin fuses.
138+
- Each word in the bank can store one pin configuration.
139+
- The number of available words depends on the device.
140+
- Refer to your device's TRM for the valid pin numbers.
141+
- After programming, a power cycle is required for the new
142+
Boot-mode settings to take effect.
143+
144+
.. caution::
145+
146+
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)