Svyatoslav Ryhel | 4c5fe37 | 2023-06-30 10:29:06 +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 | /* High-level configuration options */ |
| 18 | #define CFG_TEGRA_BOARD_STRING "HTC One X" |
| 19 | |
| 20 | #define ENDEAVORU_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 ENDEAVORU_BOOTMENU \ |
| 43 | ENDEAVORU_FLASH_UBOOT \ |
| 44 | "bootmenu_0=mount internal storage=usb start && ums 0 mmc 0; bootmenu\0" \ |
| 45 | "bootmenu_1=fastboot=echo Starting Fastboot protocol ...; fastboot usb 0; bootmenu\0" \ |
| 46 | "bootmenu_2=update bootloader=run flash_uboot\0" \ |
| 47 | "bootmenu_3=reboot RCM=enterrcm\0" \ |
| 48 | "bootmenu_4=reboot=reset\0" \ |
| 49 | "bootmenu_5=power off=poweroff\0" \ |
| 50 | "bootmenu_delay=-1\0" |
| 51 | |
| 52 | #define BOARD_EXTRA_ENV_SETTINGS \ |
| 53 | "boot_block_size_r=0x200000\0" \ |
| 54 | "boot_block_size=0x1000\0" \ |
| 55 | "bootloader_file=u-boot-dtb-tegra.bin\0" \ |
Svyatoslav Ryhel | 8e30f39 | 2024-01-07 11:17:47 +0200 | [diff] [blame] | 56 | "button_cmd_0_name=Volume Down\0" \ |
| 57 | "button_cmd_0=bootmenu\0" \ |
Svyatoslav Ryhel | 4c5fe37 | 2023-06-30 10:29:06 +0300 | [diff] [blame] | 58 | "partitions=name=emmc,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
| 59 | ENDEAVORU_BOOTMENU |
| 60 | |
| 61 | /* Board-specific serial config */ |
| 62 | #define CFG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE |
| 63 | |
| 64 | #include "tegra-common-post.h" |
| 65 | |
| 66 | #endif /* __CONFIG_H */ |