From 24e578cbac78d7d09ec2bb9b3049a0eec456e626 Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Fri, 3 Nov 2023 21:00:22 +0200 Subject: board: lg: star: add Optimus 2X P990 support The LG Optimus 2X is a touchscreen-based, slate-sized smartphone designed and manufactured by LG that runs the Android operating system. The Optimus 2X features a 4" WVGA display, an Nvidia Tegra 2 dual-core chip, 512 MB of RAM and extendable 8 GB of internal storage. UART-B is default debug port. Tested-by: Ion Agorria Signed-off-by: Svyatoslav Ryhel --- doc/board/lg/index.rst | 1 + doc/board/lg/star.rst | 125 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 doc/board/lg/star.rst (limited to 'doc') diff --git a/doc/board/lg/index.rst b/doc/board/lg/index.rst index 3af3681e0bb..2db0f2374ad 100644 --- a/doc/board/lg/index.rst +++ b/doc/board/lg/index.rst @@ -6,4 +6,5 @@ LG .. toctree:: :maxdepth: 2 + star x3_t30 diff --git a/doc/board/lg/star.rst b/doc/board/lg/star.rst new file mode 100644 index 00000000000..9e480929182 --- /dev/null +++ b/doc/board/lg/star.rst @@ -0,0 +1,125 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +U-Boot for the LG Optimus 2X P990 +================================= + +``DISCLAMER!`` Moving your device to use U-Boot assumes replacement of the +vendor bootloader. Vendor Android firmwares will no longer be able to run on +the device. This replacement IS reversible. + +Quick Start +----------- + +- Build U-Boot +- Process U-Boot +- Flashing U-Boot into the eMMC +- Boot +- Self Upgrading + +Build U-Boot +------------ + +.. code-block:: bash + + $ export CROSS_COMPILE=arm-none-eabi- + $ make star_defconfig + $ make + +After the build succeeds, you will obtain the final ``u-boot-dtb-tegra.bin`` +image, ready for further processing. + +Process U-Boot +-------------- + +``DISCLAMER!`` All questions related to the re-crypt work should be asked +in re-crypt repo issues. NOT HERE! + +re-crypt is a tool that processes the ``u-boot-dtb-tegra.bin`` binary into form +usable by device. This process is required only on the first installation or +to recover the device in case of a failed update. + +Permanent installation can be performed either by using the nv3p protocol or by +pre-loading just built U-Boot into RAM. + +Processing for the NV3P protocol +******************************** + +.. code-block:: bash + + $ git clone https://gitlab.com/grate-driver/re-crypt.git + $ cd re-crypt # place your u-boot-dtb-tegra.bin here + $ ./re-crypt.py --dev star + +The script will produce a ``repart-block.bin`` ready to flash. + +Processing for pre-loaded U-Boot +******************************** + +The procedure is the same, but the ``--split`` argument is used with the +``re-crypt.py``. The script will produce ``bct.img`` and ``ebt.img`` ready +to flash. + +Flashing U-Boot into the eMMC +----------------------------- + +``DISCLAMER!`` All questions related to NvFlash should be asked in the proper +place. NOT HERE! Flashing U-Boot will erase all eMMC, so make a backup before! + +Permanent installation can be performed either by using the nv3p protocol or by +pre-loading just built U-Boot into RAM. + +Flashing with the NV3P protocol +******************************* + +Nv3p is a custom Nvidia protocol used to recover bricked devices. Devices can +enter it by pre-loading vendor bootloader with nvflash. + +With nv3p, ``repart-block.bin`` is used. It contains BCT and a bootloader in +encrypted state in form, which can just be written RAW at the start of eMMC. + +.. code-block:: bash + + $ ./nvflash_v1.13.87205 --bct star.bct --setbct --odmdata 0xC8000 + --configfile flash.cfg --bl android_bootloader.bin --sync + $ ./utiils/nvflash_v1.13.87205 --resume --rawdevicewrite 0 2048 repart-block.bin + +When flashing is done, reboot the device. + +Flashing with a pre-loaded U-Boot +********************************* + +U-Boot pre-loaded into RAM acts the same as when it was booted "cold". Currently +U-Boot supports bootmenu entry fastboot, which allows to write a processed copy +of U-Boot permanently into eMMC. + +While pre-loading U-Boot, hold the ``volume down`` button which will trigger +the bootmenu. There, select ``fastboot`` using the volume and power buttons. +After, on host PC, do: + +.. code-block:: bash + + $ fastboot flash 0.1 bct.img + $ fastboot flash 0.2 ebt.img + $ fastboot reboot + +Device will reboot. + +Boot +---- + +To boot Linux, U-Boot will look for an ``extlinux.conf`` on MicroSD and then on +eMMC. Additionally, if the Volume Down button is pressed while booting, the +device will enter bootmenu. Bootmenu contains entries to mount MicroSD and eMMC +as mass storage, fastboot, reboot, reboot RCM, poweroff, enter U-Boot console +and update bootloader (check the next chapter). + +Flashing ``repart-block.bin`` eliminates vendor restrictions on eMMC and allows +the user to use/partition it in any way the user desires. + +Self Upgrading +-------------- + +Place your ``u-boot-dtb-tegra.bin`` on the first partition of the MicroSD card +and insert it into the device. Enter bootmenu, choose update the bootloader +option with the Power button and U-Boot should update itself. Once the process +is completed, U-Boot will ask to press any button to reboot. -- cgit v1.3.1 From 718740855325c3366ea95e420bf8b32f47b0aa9f Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Tue, 15 Apr 2025 11:55:28 +0300 Subject: ARM: tegra: convert boards to use TEGRA_PRAM Switch boards that use CFG_PRAM to TEGRA_PRAM. Signed-off-by: Svyatoslav Ryhel --- board/asus/transformer-t114/Kconfig | 6 +++++- board/nvidia/tegratab/Kconfig | 6 +++++- board/xiaomi/mocha/Kconfig | 6 +++++- doc/board/asus/transformer_t114.rst | 2 +- doc/board/nvidia/tegratab.rst | 2 +- doc/board/xiaomi/mocha.rst | 2 +- include/configs/mocha.h | 19 ------------------- include/configs/tegratab.h | 19 ------------------- include/configs/transformer-t114.h | 19 ------------------- 9 files changed, 18 insertions(+), 63 deletions(-) delete mode 100644 include/configs/mocha.h delete mode 100644 include/configs/tegratab.h delete mode 100644 include/configs/transformer-t114.h (limited to 'doc') diff --git a/board/asus/transformer-t114/Kconfig b/board/asus/transformer-t114/Kconfig index 2560c35846e..2d7630422de 100644 --- a/board/asus/transformer-t114/Kconfig +++ b/board/asus/transformer-t114/Kconfig @@ -7,10 +7,14 @@ config SYS_VENDOR default "asus" config SYS_CONFIG_NAME - default "transformer-t114" + default "tegra" config TEGRA_BOARD_STRING string "Default Tegra board name" default "ASUS Transformer T114" +config TEGRA_PRAM_SIZE + depends on TEGRA_PRAM + default 0x20000 + endif diff --git a/board/nvidia/tegratab/Kconfig b/board/nvidia/tegratab/Kconfig index 8bd7cfd87b8..25468bb57f5 100644 --- a/board/nvidia/tegratab/Kconfig +++ b/board/nvidia/tegratab/Kconfig @@ -7,10 +7,14 @@ config SYS_VENDOR default "nvidia" config SYS_CONFIG_NAME - default "tegratab" + default "tegra" config TEGRA_BOARD_STRING string "Default Tegra board name" default "NVIDIA TegraTab" +config TEGRA_PRAM_SIZE + depends on TEGRA_PRAM + default 0x21c00 + endif diff --git a/board/xiaomi/mocha/Kconfig b/board/xiaomi/mocha/Kconfig index bb53cc56161..3e1e076986c 100644 --- a/board/xiaomi/mocha/Kconfig +++ b/board/xiaomi/mocha/Kconfig @@ -7,10 +7,14 @@ config SYS_VENDOR default "xiaomi" config SYS_CONFIG_NAME - default "mocha" + default "tegra" config TEGRA_BOARD_STRING string "Default Tegra board name" default "Xiaomi Mocha" +config TEGRA_PRAM_SIZE + depends on TEGRA_PRAM + default 0x38400 + endif diff --git a/doc/board/asus/transformer_t114.rst b/doc/board/asus/transformer_t114.rst index 3e42b5dd9a3..29094eeeaf4 100644 --- a/doc/board/asus/transformer_t114.rst +++ b/doc/board/asus/transformer_t114.rst @@ -36,7 +36,7 @@ To build U-Boot without SPL adjust tf701t_defconfig: CONFIG_TEXT_BASE=0x80A00000 CONFIG_SKIP_LOWLEVEL_INIT=y # CONFIG_OF_BOARD_SETUP is not set - CONFIG_TEGRA_SUPPORT_NON_SECURE=y + CONFIG_TEGRA_PRAM=y After the build succeeds, you will obtain the final ``u-boot-dtb.bin`` file, ready for booting with fastboot boot or which can be further processed into diff --git a/doc/board/nvidia/tegratab.rst b/doc/board/nvidia/tegratab.rst index c6d97ce3828..65150fc7fbf 100644 --- a/doc/board/nvidia/tegratab.rst +++ b/doc/board/nvidia/tegratab.rst @@ -36,7 +36,7 @@ To build U-Boot without SPL adjust tegratab_defconfig: CONFIG_TEXT_BASE=0x80A00000 CONFIG_SKIP_LOWLEVEL_INIT=y # CONFIG_OF_BOARD_SETUP is not set - CONFIG_TEGRA_SUPPORT_NON_SECURE=y + CONFIG_TEGRA_PRAM=y After the build succeeds, you will obtain the final ``u-boot-dtb.bin`` file, ready for booting with fastboot boot or which can be further processed into diff --git a/doc/board/xiaomi/mocha.rst b/doc/board/xiaomi/mocha.rst index be3e333127b..230081e3287 100644 --- a/doc/board/xiaomi/mocha.rst +++ b/doc/board/xiaomi/mocha.rst @@ -105,7 +105,7 @@ To build U-Boot without SPL suitable for chainloading adjust mocha_defconfig: CONFIG_TEXT_BASE=0x80A00000 CONFIG_SKIP_LOWLEVEL_INIT=y # CONFIG_OF_BOARD_SETUP is not set - CONFIG_TEGRA_SUPPORT_NON_SECURE=y + CONFIG_TEGRA_PRAM=y After the build succeeds, you will obtain the final ``u-boot-dtb.bin`` file, ready for booting using vendor bootloader's fastboot or which can be diff --git a/include/configs/mocha.h b/include/configs/mocha.h deleted file mode 100644 index 7255f31baec..00000000000 --- a/include/configs/mocha.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. - * - * Copyright (c) 2024, Svyatoslav Ryhel - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include "tegra124-common.h" - -#ifdef CONFIG_TEGRA_SUPPORT_NON_SECURE - #define CFG_PRAM 0x38400 /* 225 MB */ -#endif - -#include "tegra-common-post.h" - -#endif /* __CONFIG_H */ diff --git a/include/configs/tegratab.h b/include/configs/tegratab.h deleted file mode 100644 index afab01ec09c..00000000000 --- a/include/configs/tegratab.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. - * - * Copyright (c) 2023, Svyatoslav Ryhel - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include "tegra114-common.h" - -#ifdef CONFIG_TEGRA_SUPPORT_NON_SECURE - #define CFG_PRAM 0x21c00 /* 135 MB */ -#endif - -#include "tegra-common-post.h" - -#endif /* __CONFIG_H */ diff --git a/include/configs/transformer-t114.h b/include/configs/transformer-t114.h deleted file mode 100644 index 2fbf3417691..00000000000 --- a/include/configs/transformer-t114.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved. - * - * Copyright (c) 2023, Svyatoslav Ryhel - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include "tegra114-common.h" - -#ifdef CONFIG_TEGRA_SUPPORT_NON_SECURE - #define CFG_PRAM 0x20000 /* 128 MB */ -#endif - -#include "tegra-common-post.h" - -#endif /* __CONFIG_H */ -- cgit v1.3.1