blob: 618b00d34e365cfa5b3d7dea0db16417c3bb93df [file] [log] [blame]
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +03001.. SPDX-License-Identifier: GPL-2.0+
2
3U-Boot for the LG X3 T30 device family
4======================================
5
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +02006``DISCLAMER!`` Moving your LG P880 or P895 to use U-Boot assumes replacement
7of the vendor LG bootloader. Vendor android firmwares will no longer be able
8to run on the device. This replacement IS reversible.
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +03009
10Quick Start
11-----------
12
13- Build U-Boot
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020014- Process U-Boot
15- Flashing U-Boot into the eMMC
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030016- Boot
17- Self Upgrading
18
19Build U-Boot
20------------
21
22Device support is implemented by applying config fragment to a generic
23board defconfig. Valid fragments are ``p880.config`` and ``p895.config``.
24
25.. code-block:: bash
26
27 $ export CROSS_COMPILE=arm-linux-gnueabi-
28 $ make x3_t30_defconfig p895.config # For LG Optimus Vu
29 $ make
30
31After the build succeeds, you will obtain the final ``u-boot-dtb-tegra.bin``
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020032image, ready for further processing.
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030033
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020034Process U-Boot
35--------------
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030036
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020037``DISCLAMER!`` All questions related to the re-crypt work should be asked
38in re-crypt repo issues. NOT HERE!
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030039
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020040re-crypt is a tool that processes the ``u-boot-dtb-tegra.bin`` binary into form
41usable by device. This process is required only on the first installation or
42to recover the device in case of a failed update.
43
44Permanent installation can be performed either by using the nv3p protocol or by
45pre-loading just built U-Boot into RAM.
46
47Processing for the NV3P protocol
48********************************
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030049
50.. code-block:: bash
51
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020052 $ git clone https://gitlab.com/grate-driver/re-crypt.git
53 $ cd re-crypt # place your u-boot-dtb-tegra.bin here
54 $ ./re-crypt.py --dev p895
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030055
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020056The script will produce a ``repart-block.bin`` ready to flash.
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030057
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020058Processing for pre-loaded U-Boot
59********************************
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030060
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020061The procedure is the same, but the ``--split`` argument is used with the
62``re-crypt.py``. The script will produce ``bct.img`` and ``ebt.img`` ready
63to flash.
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030064
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020065Flashing U-Boot into the eMMC
66-----------------------------
67
68``DISCLAMER!`` All questions related to NvFlash should be asked in the proper
69place. NOT HERE! Flashing U-Boot will erase all eMMC, so make a backup before!
70
71Permanent installation can be performed either by using the nv3p protocol or by
72pre-loading just built U-Boot into RAM.
73
74Flashing with the NV3P protocol
75*******************************
76
77Nv3p is a custom Nvidia protocol used to recover bricked devices. Devices can
78enter it either by using ``wheelie`` with the correct ``blob.bin`` file or by
79pre-loading vendor bootloader with the Fusée Gelée.
80
81With nv3p, ``repart-block.bin`` is used. It contains BCT and a bootloader in
82encrypted state in form, which can just be written RAW at the start of eMMC.
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +030083
84.. code-block:: bash
85
86 $ wheelie --blob blob.bin
87 $ nvflash --resume --rawdevicewrite 0 1024 repart-block.bin
88
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +020089When flashing is done, reboot the device.
90
91Flashing with a pre-loaded U-Boot
92*********************************
93
94U-Boot pre-loaded into RAM acts the same as when it was booted "cold". Currently
95U-Boot supports bootmenu entry fastboot, which allows to write a processed copy
96of U-Boot permanently into eMMC.
97
98While pre-loading U-Boot, hold the ``volume down`` button which will trigger
99the bootmenu. There, select ``fastboot`` using the volume and power buttons.
100After, on host PC, do:
101
102.. code-block:: bash
103
104 $ fastboot flash 0.1 bct.img
105 $ fastboot flash 0.2 ebt.img
106 $ fastboot reboot
107
108Device will reboot.
109
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +0300110Boot
111----
112
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +0200113To boot Linux, U-Boot will look for an ``extlinux.conf`` on eMMC. Additionally,
114if the Volume Down button is pressed while booting, the device will enter
115bootmenu. Bootmenu contains entries to mount eMMC as mass storage, fastboot,
116reboot, reboot RCM, poweroff, enter U-Boot console and update bootloader (check
117the next chapter).
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +0300118
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +0200119Flashing ``repart-block.bin`` eliminates vendor restrictions on eMMC and allows
120the user to use/partition it in any way the user desires.
Svyatoslav Ryhel623a8c82023-06-30 10:29:05 +0300121
122Self Upgrading
123--------------
124
Svyatoslav Ryhelec8528c2023-12-24 10:16:34 +0200125Place your ``u-boot-dtb-tegra.bin`` on the first partition of the eMMC (using
126ability of u-boot to mount it). Enter bootmenu, choose update bootloader option
127with Power button and U-Boot should update itself. Once the process is
128completed, U-Boot will ask to press any button to reboot.