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 <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
This commit is contained in:
Svyatoslav Ryhel
2023-11-03 21:00:22 +02:00
parent bf2d1902f4
commit 24e578cbac
11 changed files with 860 additions and 0 deletions

16
board/lg/star/Kconfig Normal file
View File

@@ -0,0 +1,16 @@
if TARGET_STAR
config SYS_BOARD
default "star"
config SYS_VENDOR
default "lg"
config SYS_CONFIG_NAME
default "tegra"
config TEGRA_BOARD_STRING
string "Default Tegra board name"
default "LG Star"
endif

View File

@@ -0,0 +1,7 @@
STAR BOARD
M: Svyatoslav Ryhel <clamor95@gmail.com>
S: Maintained
F: arch/arm/dts/tegra20-lg-star.dts
F: board/lg/star/
F: configs/star_defconfig
F: doc/board/lg/star.rst

9
board/lg/star/Makefile Normal file
View File

@@ -0,0 +1,9 @@
# SPDX-License-Identifier: GPL-2.0+
#
# (C) Copyright 2010-2012
# NVIDIA Corporation <www.nvidia.com>
#
# (C) Copyright 2024
# Svyatoslav Ryhel <clamor95@gmail.com>
obj-y += star.o

50
board/lg/star/star.c Normal file
View File

@@ -0,0 +1,50 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2023
* Svyatoslav Ryhel <clamor95@gmail.com>
*/
#include <dm.h>
#include <dm/root.h>
#include <fdt_support.h>
#include <log.h>
#include <spl_gpio.h>
static int star_fix_panel(void *fdt)
{
int panel_offset, ret;
/* Patch panel compatible */
spl_gpio_input(NULL, TEGRA_GPIO(J, 5));
if (spl_gpio_get_value(NULL, TEGRA_GPIO(J, 5))) {
panel_offset = fdt_node_offset_by_compatible(fdt, -1,
"hit,tx10d07vm0baa");
if (panel_offset < 0) {
log_debug("%s: panel node not found\n", __func__);
return panel_offset;
}
ret = fdt_setprop_string(fdt, panel_offset, "compatible",
"lg,lh400wv3-sd04");
if (ret) {
log_debug("%s: panel comapible patch failed\n", __func__);
return ret;
}
}
return 0;
}
void pinmux_init(void)
{
void *fdt = (void *)gd->fdt_blob;
star_fix_panel(fdt);
}
#if IS_ENABLED(CONFIG_OF_LIBFDT) && IS_ENABLED(CONFIG_OF_BOARD_SETUP)
int ft_board_setup(void *fdt, struct bd_info *bd)
{
return star_fix_panel(fdt);
}
#endif

15
board/lg/star/star.env Normal file
View File

@@ -0,0 +1,15 @@
#include <env/nvidia/prod_upd.env>
button_cmd_0_name=Volume Down
button_cmd_0=bootmenu
partitions=name=emmc,start=0,size=-,uuid=${uuid_gpt_rootfs}
boot_dev=1
bootmenu_0=mount internal storage=usb start && ums 0 mmc 0; bootmenu
bootmenu_1=mount external storage=usb start && ums 0 mmc 1; bootmenu
bootmenu_2=fastboot=echo Starting Fastboot protocol ...; fastboot usb 0; bootmenu
bootmenu_3=update bootloader=run flash_uboot
bootmenu_4=reboot RCM=enterrcm
bootmenu_5=reboot=reset
bootmenu_6=power off=poweroff
bootmenu_delay=-1