Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | U-Boot for the ASUS Transformer device family |
| 4 | ============================================= |
| 5 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 6 | ``DISCLAMER!`` Moving your ASUS Transformer to use U-Boot assumes replacement |
| 7 | of the vendor ASUS bootloader. Vendor Android firmwares will no longer be |
| 8 | able to run on the device. This replacement IS reversible. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 9 | |
| 10 | Quick Start |
| 11 | ----------- |
| 12 | |
| 13 | - Build U-Boot |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 14 | - Process U-Boot |
| 15 | - Flashing U-Boot into the eMMC |
| 16 | - Flashing U-Boot into the SPI flash |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 17 | - Boot |
| 18 | - Self Upgrading |
| 19 | |
| 20 | Build U-Boot |
| 21 | ------------ |
| 22 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 23 | Device support is implemented by applying a config fragment to a generic board |
| 24 | defconfig. Valid fragments are ``tf201.config``, ``tf300t.config``, |
| 25 | ``tf300tg.config``, ``tf300tl.config``, ``tf700t.config``, ``tf600t.config`` and |
| 26 | ``p1801-t.config``. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 27 | |
| 28 | .. code-block:: bash |
| 29 | |
| 30 | $ export CROSS_COMPILE=arm-linux-gnueabi- |
| 31 | $ make transformer_t30_defconfig tf201.config # For TF201 |
| 32 | $ make |
| 33 | |
| 34 | After the build succeeds, you will obtain the final ``u-boot-dtb-tegra.bin`` |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 35 | image, ready for further processing. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 36 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 37 | Process U-Boot |
| 38 | -------------- |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 39 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 40 | ``DISCLAMER!`` All questions related to the re-crypt work should be asked |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 41 | in re-crypt repo issues. NOT HERE! |
| 42 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 43 | re-crypt is a tool that processes the ``u-boot-dtb-tegra.bin`` binary into form |
| 44 | usable by device. This process is required only on the first installation or |
| 45 | to recover the device in case of a failed update. You need to know your |
| 46 | tablet's individual SBK to continue. |
| 47 | |
| 48 | Permanent installation can be performed either by using the nv3p protocol or by |
| 49 | pre-loading just built U-Boot into RAM. |
| 50 | |
| 51 | Processing for the NV3P protocol |
| 52 | ******************************** |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 53 | |
| 54 | .. code-block:: bash |
| 55 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 56 | $ git clone https://gitlab.com/grate-driver/re-crypt.git |
| 57 | $ cd re-crypt # place your u-boot-dtb-tegra.bin here |
| 58 | $ ./re-crypt.py --dev tf201 --sbk <your sbk> |
| 59 | |
| 60 | where SBK has next form ``0xXXXXXXXX`` ``0xXXXXXXXX`` ``0xXXXXXXXX`` ``0xXXXXXXXX`` |
| 61 | |
| 62 | The script will produce a ``repart-block.bin`` ready to flash. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 63 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 64 | Processing for pre-loaded U-Boot |
| 65 | ******************************** |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 66 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 67 | The procedure is the same, but the ``--split`` argument is used with the |
| 68 | ``re-crypt.py``. The script will produce ``bct.img`` and ``ebt.img`` ready |
| 69 | to flash. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 70 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 71 | Flashing U-Boot into the eMMC |
| 72 | ----------------------------- |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 73 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 74 | ``DISCLAMER!`` All questions related to NvFlash should be asked in the proper |
| 75 | place. NOT HERE! Flashing U-Boot will erase all eMMC, so make a backup before! |
| 76 | |
| 77 | Permanent installation can be performed either by using the nv3p protocol or by |
| 78 | pre-loading just built U-Boot into RAM. |
| 79 | |
| 80 | Flashing with the NV3P protocol |
| 81 | ******************************* |
| 82 | |
| 83 | Nv3p is a custom Nvidia protocol used to recover bricked devices. Devices can |
| 84 | enter it either by using ``wheelie`` with the correct ``blob.bin`` file or by |
| 85 | pre-loading vendor bootloader with the Fusée Gelée. |
| 86 | |
| 87 | With nv3p, ``repart-block.bin`` is used. It contains BCT and a bootloader in |
| 88 | encrypted state in form, which can just be written RAW at the start of eMMC. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 89 | |
| 90 | .. code-block:: bash |
| 91 | |
| 92 | $ wheelie --blob blob.bin |
| 93 | $ nvflash --resume --rawdevicewrite 0 1024 repart-block.bin |
| 94 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 95 | When flashing is done, reboot the device. |
| 96 | |
| 97 | Flashing with a pre-loaded U-Boot |
| 98 | ********************************* |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 99 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 100 | U-Boot pre-loaded into RAM acts the same as when it was booted "cold". Currently |
| 101 | U-Boot supports bootmenu entry fastboot, which allows to write a processed copy |
| 102 | of U-Boot permanently into eMMC. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 103 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 104 | While pre-loading U-Boot, hold the ``volume down`` button which will trigger |
| 105 | the bootmenu. There, select ``fastboot`` using the volume and power buttons. |
| 106 | After, on host PC, do: |
| 107 | |
| 108 | .. code-block:: bash |
| 109 | |
| 110 | $ fastboot flash 0.1 bct.img |
| 111 | $ fastboot flash 0.2 ebt.img |
| 112 | $ fastboot reboot |
| 113 | |
| 114 | Device will reboot. |
| 115 | |
| 116 | Flashing U-Boot into the SPI Flash |
| 117 | ---------------------------------- |
| 118 | |
| 119 | Some of Transformers use a separate 4 MB SPI flash, which contains all data |
| 120 | required for boot. It is flashed from within U-Boot itself, preloaded into RAM |
| 121 | using Fusée Gelée. |
| 122 | |
| 123 | After creating your ``repart-block.bin`` you have to place it on a 1st partition |
| 124 | of microSD card formated in fat. Then insert this microSD card into your tablet |
| 125 | and boot it using Fusée Gelée and U-Boot, which was included into |
| 126 | ``repart-block.bin``, while booting you must hold the ``volume down`` button. |
| 127 | |
| 128 | The process should take less than a minute, if everything goes correctly, |
| 129 | on microSD will appear ``spi-flash-backup.bin`` file, which is the dump of your |
| 130 | SPI Flash content and can be used to restore UEFI, do not lose it, tablet will |
| 131 | power itself off. |
| 132 | |
| 133 | Self-updating of U-Boot is performed by placing ``u-boot-dtb-tegra.bin`` on 1st |
| 134 | partition of microSD, inserting it into the tablet and booting with a pressed |
| 135 | ``volume down`` button. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 136 | |
| 137 | Boot |
| 138 | ---- |
| 139 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 140 | To boot Linux, U-Boot will look for an ``extlinux.conf`` on MicroSD and then on |
| 141 | eMMC. Additionally, if the Volume Down button is pressed while booting, the |
| 142 | device will enter bootmenu. Bootmenu contains entries to mount MicroSD and eMMC |
| 143 | as mass storage, fastboot, reboot, reboot RCM, poweroff, enter U-Boot console |
| 144 | and update bootloader (check the next chapter). |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 145 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 146 | Flashing ``repart-block.bin`` eliminates vendor restrictions on eMMC and allows |
| 147 | the user to use/partition it in any way the user desires. |
Svyatoslav Ryhel | 7a25c38 | 2023-06-30 10:29:03 +0300 | [diff] [blame] | 148 | |
| 149 | Self Upgrading |
| 150 | -------------- |
| 151 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 152 | Place your ``u-boot-dtb-tegra.bin`` on the first partition of the MicroSD card |
| 153 | and insert it into the tablet. Enter bootmenu, choose update the bootloader |
| 154 | option with the Power button and U-Boot should update itself. Once the process |
| 155 | is completed, U-Boot will ask to press any button to reboot. |