Svyatoslav Ryhel | 623a8c8 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * (C) Copyright 2010,2012 |
| 4 | * NVIDIA Corporation <www.nvidia.com> |
| 5 | * |
| 6 | * (C) Copyright 2022 |
| 7 | * Svyatoslav Ryhel <clamor95@gmail.com> |
| 8 | */ |
| 9 | |
| 10 | #ifndef __CONFIG_H |
| 11 | #define __CONFIG_H |
| 12 | |
| 13 | #include <linux/sizes.h> |
| 14 | |
| 15 | #include "tegra30-common.h" |
| 16 | |
| 17 | #define CFG_TEGRA_BOARD_STRING "LG X3 Board" |
| 18 | |
| 19 | #ifdef CONFIG_DEVICE_P880 |
| 20 | /* High-level configuration options */ |
| 21 | #undef CFG_TEGRA_BOARD_STRING |
| 22 | #define CFG_TEGRA_BOARD_STRING "LG Optimus 4X HD" |
| 23 | #endif |
| 24 | |
| 25 | #ifdef CONFIG_DEVICE_P895 |
| 26 | /* High-level configuration options */ |
| 27 | #undef CFG_TEGRA_BOARD_STRING |
| 28 | #define CFG_TEGRA_BOARD_STRING "LG Optimus Vu" |
| 29 | #endif |
| 30 | |
| 31 | #define X3_FLASH_UBOOT \ |
| 32 | "flash_uboot=echo Preparing RAM;" \ |
| 33 | "mw ${kernel_addr_r} 0 ${boot_block_size_r};" \ |
| 34 | "mw ${ramdisk_addr_r} 0 ${boot_block_size_r};" \ |
| 35 | "echo Reading BCT;" \ |
| 36 | "mmc dev 0 1;" \ |
| 37 | "mmc read ${kernel_addr_r} 0 ${boot_block_size};" \ |
| 38 | "echo Reading bootloader;" \ |
| 39 | "if load mmc 0:1 ${ramdisk_addr_r} ${bootloader_file};" \ |
| 40 | "then echo Calculating bootloader size;" \ |
| 41 | "size mmc 0:1 ${bootloader_file};" \ |
| 42 | "ebtupdate ${kernel_addr_r} ${ramdisk_addr_r} ${filesize};" \ |
| 43 | "echo Writing bootloader to eMMC;" \ |
| 44 | "mmc dev 0 1;" \ |
| 45 | "mmc write ${kernel_addr_r} 0 ${boot_block_size};" \ |
| 46 | "mmc dev 0 2;" \ |
| 47 | "mmc write ${ramdisk_addr_r} 0 ${boot_block_size};" \ |
| 48 | "echo Bootloader written successfully;" \ |
| 49 | "pause 'Press ANY key to reboot device...'; reset;" \ |
| 50 | "else echo Reading bootloader failed;" \ |
| 51 | "pause 'Press ANY key to return to bootmenu...'; bootmenu; fi\0" |
| 52 | |
| 53 | #define X3_BOOTMENU \ |
| 54 | X3_FLASH_UBOOT \ |
| 55 | "bootmenu_0=mount internal storage=usb start && ums 0 mmc 0; bootmenu\0" \ |
| 56 | "bootmenu_1=mount external storage=usb start && ums 0 mmc 1; bootmenu\0" \ |
| 57 | "bootmenu_2=fastboot=echo Starting Fastboot protocol ...; fastboot usb 0; bootmenu\0" \ |
| 58 | "bootmenu_3=update bootloader=run flash_uboot\0" \ |
| 59 | "bootmenu_4=reboot RCM=enterrcm\0" \ |
| 60 | "bootmenu_5=reboot=reset\0" \ |
| 61 | "bootmenu_6=power off=poweroff\0" \ |
| 62 | "bootmenu_delay=-1\0" |
| 63 | |
| 64 | #define BOARD_EXTRA_ENV_SETTINGS \ |
| 65 | "boot_block_size_r=0x200000\0" \ |
| 66 | "boot_block_size=0x1000\0" \ |
| 67 | "bootloader_file=u-boot-dtb-tegra.bin\0" \ |
| 68 | "check_button=gpio input 116; test $? -eq 0\0" \ |
| 69 | "partitions=name=emmc,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
| 70 | X3_BOOTMENU |
| 71 | |
| 72 | /* Board-specific serial config */ |
| 73 | #define CFG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE |
| 74 | |
| 75 | #include "tegra-common-post.h" |
| 76 | |
| 77 | #endif /* __CONFIG_H */ |