Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | U-Boot for the LG X3 T30 device family |
| 4 | ====================================== |
| 5 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 6 | ``DISCLAMER!`` Moving your LG P880 or P895 to use U-Boot assumes replacement |
| 7 | of the vendor LG bootloader. Vendor android firmwares will no longer be able |
| 8 | to run on the device. This replacement IS reversible. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +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 |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 16 | - Boot |
| 17 | - Self Upgrading |
| 18 | |
| 19 | Build U-Boot |
| 20 | ------------ |
| 21 | |
| 22 | Device support is implemented by applying config fragment to a generic |
| 23 | board 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 | |
| 31 | 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] | 32 | image, ready for further processing. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 33 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 34 | Process U-Boot |
| 35 | -------------- |
| 36 | |
| 37 | ``DISCLAMER!`` All questions related to the re-crypt work should be asked |
| 38 | in re-crypt repo issues. NOT HERE! |
| 39 | |
| 40 | re-crypt is a tool that processes the ``u-boot-dtb-tegra.bin`` binary into form |
| 41 | usable by device. This process is required only on the first installation or |
| 42 | to recover the device in case of a failed update. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 43 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 44 | Permanent installation can be performed either by using the nv3p protocol or by |
| 45 | pre-loading just built U-Boot into RAM. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 46 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 47 | Processing for the NV3P protocol |
| 48 | ******************************** |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 49 | |
| 50 | .. code-block:: bash |
| 51 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 52 | $ 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 Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 55 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 56 | The script will produce a ``repart-block.bin`` ready to flash. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 57 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 58 | Processing for pre-loaded U-Boot |
| 59 | ******************************** |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 60 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 61 | The 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 |
| 63 | to flash. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 64 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 65 | Flashing U-Boot into the eMMC |
| 66 | ----------------------------- |
| 67 | |
| 68 | ``DISCLAMER!`` All questions related to NvFlash should be asked in the proper |
| 69 | place. NOT HERE! Flashing U-Boot will erase all eMMC, so make a backup before! |
| 70 | |
| 71 | Permanent installation can be performed either by using the nv3p protocol or by |
| 72 | pre-loading just built U-Boot into RAM. |
| 73 | |
| 74 | Flashing with the NV3P protocol |
| 75 | ******************************* |
| 76 | |
| 77 | Nv3p is a custom Nvidia protocol used to recover bricked devices. Devices can |
| 78 | enter it either by using ``wheelie`` with the correct ``blob.bin`` file or by |
| 79 | pre-loading vendor bootloader with the Fusée Gelée. |
| 80 | |
| 81 | With nv3p, ``repart-block.bin`` is used. It contains BCT and a bootloader in |
| 82 | encrypted state in form, which can just be written RAW at the start of eMMC. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 83 | |
| 84 | .. code-block:: bash |
| 85 | |
| 86 | $ wheelie --blob blob.bin |
| 87 | $ nvflash --resume --rawdevicewrite 0 1024 repart-block.bin |
| 88 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 89 | When flashing is done, reboot the device. |
| 90 | |
| 91 | Flashing with a pre-loaded U-Boot |
| 92 | ********************************* |
| 93 | |
| 94 | U-Boot pre-loaded into RAM acts the same as when it was booted "cold". Currently |
| 95 | U-Boot supports bootmenu entry fastboot, which allows to write a processed copy |
| 96 | of U-Boot permanently into eMMC. |
| 97 | |
| 98 | While pre-loading U-Boot, hold the ``volume down`` button which will trigger |
| 99 | the bootmenu. There, select ``fastboot`` using the volume and power buttons. |
| 100 | After, 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 | |
| 108 | Device will reboot. |
| 109 | |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 110 | Boot |
| 111 | ---- |
| 112 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 113 | To boot Linux, U-Boot will look for an ``extlinux.conf`` on eMMC. Additionally, |
| 114 | if the Volume Down button is pressed while booting, the device will enter |
| 115 | bootmenu. Bootmenu contains entries to mount eMMC as mass storage, fastboot, |
| 116 | reboot, reboot RCM, poweroff, enter U-Boot console and update bootloader (check |
| 117 | the next chapter). |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 118 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 119 | Flashing ``repart-block.bin`` eliminates vendor restrictions on eMMC and allows |
| 120 | the user to use/partition it in any way the user desires. |
Svyatoslav Ryhel | fcb1d91 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 121 | |
| 122 | Self Upgrading |
| 123 | -------------- |
| 124 | |
Svyatoslav Ryhel | c893197 | 2023-12-24 10:16:34 +0200 | [diff] [blame] | 125 | Place your ``u-boot-dtb-tegra.bin`` on the first partition of the eMMC (using |
| 126 | ability of u-boot to mount it). Enter bootmenu, choose update bootloader option |
| 127 | with Power button and U-Boot should update itself. Once the process is |
| 128 | completed, U-Boot will ask to press any button to reboot. |