blob: e0edefe28ae5b0002acd75bb0140f730e81efde4 [file] [log] [blame]
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +03001.. SPDX-License-Identifier: GPL-2.0+
2
3U-Boot for the HTC One X (endeavoru)
4====================================
5
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +02006``DISCLAMER!`` Moving your HTC ONe X to use U-Boot assumes replacement of the
7vendor hboot. Vendor android firmwares will no longer be able to run on the
8device. This replacement IS reversible.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +03009
10Quick Start
11-----------
12
13- Build U-Boot
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020014- Process U-Boot
15- Flashing U-Boot into the eMMC
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030016- Boot
17- Self Upgrading
18
19Build U-Boot
20------------
21
22.. code-block:: bash
23
24 $ export CROSS_COMPILE=arm-linux-gnueabi-
25 $ make endeavoru_defconfig
26 $ make
27
28After the build succeeds, you will obtain the final ``u-boot-dtb-tegra.bin``
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020029image, ready for further processing.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030030
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020031Process U-Boot
32--------------
33
34``DISCLAMER!`` All questions related to the re-crypt work should be asked
35in re-crypt repo issues. NOT HERE!
36
37re-crypt is a tool that processes the ``u-boot-dtb-tegra.bin`` binary into form
38usable by device. This process is required only on the first installation or
39to recover the device in case of a failed update.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030040
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020041Permanent installation can be performed either by using the nv3p protocol or by
42pre-loading just built U-Boot into RAM.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030043
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020044Processing for the NV3P protocol
45********************************
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030046
47.. code-block:: bash
48
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020049 $ git clone https://gitlab.com/grate-driver/re-crypt.git
50 $ cd re-crypt # place your u-boot-dtb-tegra.bin here
51 $ ./re-crypt.py --dev endeavoru
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030052
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020053The script will produce a ``repart-block.bin`` ready to flash.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030054
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020055Processing for pre-loaded U-Boot
56********************************
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030057
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020058The procedure is the same, but the ``--split`` argument is used with the
59``re-crypt.py``. The script will produce ``bct.img`` and ``ebt.img`` ready
60to flash.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030061
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020062Flashing U-Boot into the eMMC
63-----------------------------
64
65``DISCLAMER!`` All questions related to NvFlash should be asked in the proper
66place. NOT HERE! Flashing U-Boot will erase all eMMC, so make a backup before!
67
68Permanent installation can be performed either by using the nv3p protocol or by
69pre-loading just built U-Boot into RAM.
70
71Flashing with the NV3P protocol
72*******************************
73
74Nv3p is a custom Nvidia protocol used to recover bricked devices. Devices can
75enter it either by using ``wheelie`` with the correct ``blob.bin`` file or by
76pre-loading vendor bootloader with the Fusée Gelée.
77
78With nv3p, ``repart-block.bin`` is used. It contains BCT and a bootloader in
79encrypted state in form, which can just be written RAW at the start of eMMC.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +030080
81.. code-block:: bash
82
83 $ wheelie --blob blob.bin
84 $ nvflash --resume --rawdevicewrite 0 1024 repart-block.bin
85
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020086When flashing is done, reboot the device.
87
88Flashing with a pre-loaded U-Boot
89*********************************
90
91U-Boot pre-loaded into RAM acts the same as when it was booted "cold". Currently
92U-Boot supports bootmenu entry fastboot, which allows to write a processed copy
93of U-Boot permanently into eMMC.
94
95While pre-loading U-Boot, hold the ``volume down`` button which will trigger
96the bootmenu. There, select ``fastboot`` using the volume and power buttons.
97After, on host PC, do:
98
99.. code-block:: bash
100
101 $ fastboot flash 0.1 bct.img
102 $ fastboot flash 0.2 ebt.img
103 $ fastboot reboot
104
105Device will reboot.
106
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +0300107Boot
108----
109
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +0200110To boot Linux, U-Boot will look for an ``extlinux.conf`` on eMMC. Additionally,
111if the Volume Down button is pressed while booting, the device will enter
112bootmenu. Bootmenu contains entries to mount eMMC as mass storage, fastboot,
113reboot, reboot RCM, poweroff, enter U-Boot console and update bootloader (check
114the next chapter).
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +0300115
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +0200116Flashing ``repart-block.bin`` eliminates vendor restrictions on eMMC and allows
117the user to use/partition it in any way the user desires.
Svyatoslav Ryhel4c5fe372023-06-30 10:29:06 +0300118
119Self Upgrading
120--------------
121
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +0200122Place your ``u-boot-dtb-tegra.bin`` on the first partition of the eMMC (using
123ability of u-boot to mount it). Enter bootmenu, choose update bootloader option
124with Power button and U-Boot should update itself. Once the process is
125completed, U-Boot will ask to press any button to reboot.