Skip to content

Commit 2b2fe45

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 2b2fe45

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-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: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
.. _programming-user-otps-label:
2+
3+
#####################
4+
Programming User OTPs
5+
#####################
6+
7+
This guide describes how to read and write User One Time Programmable (OTP)
8+
fuses and Boot-mode fuses 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/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+
- It is the responsibility of the SoC user to design a suitable circuit
98+
that enables the Vpp pin to be powered for non-TI EVM boards
99+
100+
For programming multiple fuses and keys using a binary blob (fuse writebuff), refer to the
101+
:ref:`key-writer-lite-label` document.
102+
103+
Programming Boot-mode Pin Fuses
104+
===============================
105+
106+
.. caution::
107+
108+
Programming Boot-mode fuses is an irreversible operation. Once an OTP fuse is
109+
programmed, it cannot be undone. Boot-mode fuses lock on first write, so multi-pass
110+
programming isn't possible
111+
112+
113+
The Boot-mode pin fuses allow you to configure the boot sequence without requiring physical
114+
pin strapping. This section provides examples of programming Boot-mode pin related fuses.
115+
|__PART_FAMILY_NAME__| supports reduced Boot-mode configuration via combination of fuse and Boot-mode pins.
116+
When the Boot-mode pins are set fuse Boot-mode, corresponding fuse is decoded to determine 16-bit
117+
Boot-mode value. Refer to |__PART_FAMILY_NAME__| TRM for more details. Vpp needs to be enabled for programming
118+
these fuses similar to other fuses.
119+
120+
Boot-mode fuse Encoding
121+
-----------------------
122+
Refer to `this documentation <http://downloads.ti.com/tisci/esd/latest/6_topic_user_guides/boot_mode_writer_encoding.html>`_
123+
for mapping between Boot-mode strapping value to encoded value to be written to fuse.
124+
125+
Programming Examples
126+
--------------------
127+
128+
To program fuse slot 0 with GPMC NAND as primary and USB-DFU as backup, full pin
129+
count strapping would be 0x45B. This translates to 0x18045B according to Boot-mode pin
130+
encoding table. So below would program fuse slot 1 to GPMC NAND primary and DFU as backup.
131+
132+
.. code-block:: text
133+
134+
=> fuse prog 0xFF 1 0x18045B
135+
136+
.. note::
137+
138+
- Bank 0xFF is reserved for Boot-mode pin fuses.
139+
- Each word in the bank can store one pin configuration.
140+
- The number of available words depends on the device.
141+
- Refer to your device's TRM for the valid pin numbers.
142+
- After programming, a power cycle is required for the new
143+
Boot-mode settings to take effect.
144+
145+
.. caution::
146+
147+
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)