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 | |
Svyatoslav Ryhel | fd211f8 | 2023-11-27 19:08:32 +0200 | [diff] [blame] | 17 | /* High-level configuration options */ |
Svyatoslav Ryhel | 623a8c8 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 18 | #define CFG_TEGRA_BOARD_STRING "LG X3 Board" |
| 19 | |
Svyatoslav Ryhel | 623a8c8 | 2023-06-30 10:29:05 +0300 | [diff] [blame] | 20 | #define X3_FLASH_UBOOT \ |
| 21 | "flash_uboot=echo Preparing RAM;" \ |
| 22 | "mw ${kernel_addr_r} 0 ${boot_block_size_r};" \ |
| 23 | "mw ${ramdisk_addr_r} 0 ${boot_block_size_r};" \ |
| 24 | "echo Reading BCT;" \ |
| 25 | "mmc dev 0 1;" \ |
| 26 | "mmc read ${kernel_addr_r} 0 ${boot_block_size};" \ |
| 27 | "echo Reading bootloader;" \ |
| 28 | "if load mmc 0:1 ${ramdisk_addr_r} ${bootloader_file};" \ |
| 29 | "then echo Calculating bootloader size;" \ |
| 30 | "size mmc 0:1 ${bootloader_file};" \ |
| 31 | "ebtupdate ${kernel_addr_r} ${ramdisk_addr_r} ${filesize};" \ |
| 32 | "echo Writing bootloader to eMMC;" \ |
| 33 | "mmc dev 0 1;" \ |
| 34 | "mmc write ${kernel_addr_r} 0 ${boot_block_size};" \ |
| 35 | "mmc dev 0 2;" \ |
| 36 | "mmc write ${ramdisk_addr_r} 0 ${boot_block_size};" \ |
| 37 | "echo Bootloader written successfully;" \ |
| 38 | "pause 'Press ANY key to reboot device...'; reset;" \ |
| 39 | "else echo Reading bootloader failed;" \ |
| 40 | "pause 'Press ANY key to return to bootmenu...'; bootmenu; fi\0" |
| 41 | |
| 42 | #define X3_BOOTMENU \ |
| 43 | X3_FLASH_UBOOT \ |
| 44 | "bootmenu_0=mount internal storage=usb start && ums 0 mmc 0; bootmenu\0" \ |
| 45 | "bootmenu_1=mount external storage=usb start && ums 0 mmc 1; bootmenu\0" \ |
| 46 | "bootmenu_2=fastboot=echo Starting Fastboot protocol ...; fastboot usb 0; bootmenu\0" \ |
| 47 | "bootmenu_3=update bootloader=run flash_uboot\0" \ |
| 48 | "bootmenu_4=reboot RCM=enterrcm\0" \ |
| 49 | "bootmenu_5=reboot=reset\0" \ |
| 50 | "bootmenu_6=power off=poweroff\0" \ |
| 51 | "bootmenu_delay=-1\0" |
| 52 | |
| 53 | #define BOARD_EXTRA_ENV_SETTINGS \ |
| 54 | "boot_block_size_r=0x200000\0" \ |
| 55 | "boot_block_size=0x1000\0" \ |
| 56 | "bootloader_file=u-boot-dtb-tegra.bin\0" \ |
| 57 | "check_button=gpio input 116; test $? -eq 0\0" \ |
| 58 | "partitions=name=emmc,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
| 59 | X3_BOOTMENU |
| 60 | |
| 61 | /* Board-specific serial config */ |
| 62 | #define CFG_SYS_NS16550_COM1 NV_PA_APB_UARTD_BASE |
| 63 | |
| 64 | #include "tegra-common-post.h" |
| 65 | |
| 66 | #endif /* __CONFIG_H */ |