blob: 9ff75034b722ccb59b9c8e747882c6a3412b1e3b [file] [log] [blame]
Svyatoslav Ryhelfcb1d912023-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 Ryhelc8931972023-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 Ryhelfcb1d912023-06-30 10:29:05 +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 Ryhelfcb1d912023-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
Svyatoslav Ryhelfb6a4342024-12-03 12:50:45 +020027 $ export CROSS_COMPILE=arm-none-eabi-
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030028 $ 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 Ryhelc8931972023-12-24 10:16:34 +020032image, ready for further processing.
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030033
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020034Process U-Boot
35--------------
36
37``DISCLAMER!`` All questions related to the re-crypt work should be asked
38in re-crypt repo issues. NOT HERE!
39
40re-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.
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030043
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020044Permanent installation can be performed either by using the nv3p protocol or by
45pre-loading just built U-Boot into RAM.
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030046
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020047Processing for the NV3P protocol
48********************************
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030049
50.. code-block:: bash
51
Svyatoslav Ryhelc8931972023-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 Ryhelfcb1d912023-06-30 10:29:05 +030055
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020056The script will produce a ``repart-block.bin`` ready to flash.
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030057
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020058Processing for pre-loaded U-Boot
59********************************
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030060
Svyatoslav Ryhelc8931972023-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 Ryhelfcb1d912023-06-30 10:29:05 +030064
Svyatoslav Ryhelc8931972023-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
Svyatoslav Ryhelfb6a4342024-12-03 12:50:45 +020078enter it by pre-loading vendor bootloader with the Fusée Gelée.
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020079
80With nv3p, ``repart-block.bin`` is used. It contains BCT and a bootloader in
81encrypted state in form, which can just be written RAW at the start of eMMC.
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030082
83.. code-block:: bash
84
Svyatoslav Ryhelfb6a4342024-12-03 12:50:45 +020085 $ ./run_bootloader.sh -s T30 -t ./bct/p895.bct -b android_bootloader.bin
86 $ ./utiils/nvflash_v1.13.87205 --resume --rawdevicewrite 0 1024 repart-block.bin
Svyatoslav Ryhelfcb1d912023-06-30 10:29:05 +030087
Svyatoslav Ryhelfb6a4342024-12-03 12:50:45 +020088When flashing is done, reboot the device. Note that if you have Optimus 4x HD,
89use ``p880.bct``.
Svyatoslav Ryhelc8931972023-12-24 10:16:34 +020090
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 Ryhelfcb1d912023-06-30 10:29:05 +0300110Boot
111----
112
Svyatoslav Ryhelc8931972023-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 Ryhelfcb1d912023-06-30 10:29:05 +0300118
Svyatoslav Ryhelc8931972023-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 Ryhelfcb1d912023-06-30 10:29:05 +0300121
122Self Upgrading
123--------------
124
Svyatoslav Ryhelfb6a4342024-12-03 12:50:45 +0200125Place your ``u-boot-dtb-tegra.bin`` on the first partition of the eMMC or MicroSD
126card if it is supported (using ability of u-boot to mount it). Enter bootmenu,
127choose update bootloader option with Power button and U-Boot should update itself.
128Once the process is completed, U-Boot will ask to press any button to reboot.