|
| 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. |
0 commit comments