Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright 2017 NXP |
| 4 | * Copyright 2019-2021 Traverse Technologies |
| 5 | */ |
| 6 | |
| 7 | #ifndef __TEN64_H |
| 8 | #define __TEN64_H |
| 9 | |
| 10 | #include "ls1088a_common.h" |
| 11 | |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 12 | #define CFG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000 |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 13 | |
| 14 | #define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd" |
| 15 | #define SD_BOOTCOMMAND "run distro_bootcmd" |
| 16 | |
Mathew McBride | 154d908 | 2023-07-21 04:39:19 +0000 | [diff] [blame] | 17 | #define SD_FIRMWARE_PATH "firmware/traverse/ten64/" |
| 18 | |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 19 | #define QSPI_MC_INIT_CMD \ |
| 20 | "sf probe 0:0 && sf read 0x80000000 0x300000 0x200000 &&" \ |
| 21 | "sf read 0x80200000 0x5C0000 0x40000 &&" \ |
| 22 | "fsl_mc start mc 0x80000000 0x80200000 && " \ |
Mathew McBride | 1edd144 | 2023-07-21 04:39:18 +0000 | [diff] [blame] | 23 | "sf read 0x8E000000 0x580000 0x40000 && fsl_mc lazyapply DPL 0x8E000000 && "\ |
| 24 | "echo 'default DPL loaded'\0" |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 25 | #define SD_MC_INIT_CMD \ |
Mathew McBride | 154d908 | 2023-07-21 04:39:19 +0000 | [diff] [blame] | 26 | "mmcinfo; fatload mmc 0 0x80000000 " SD_FIRMWARE_PATH "mc_ls1088a.itb; "\ |
| 27 | "fatload mmc 0 0x80200000 " SD_FIRMWARE_PATH "dpc.0x1D-0x0D.dtb; "\ |
Mathew McBride | 1edd144 | 2023-07-21 04:39:18 +0000 | [diff] [blame] | 28 | "fsl_mc start mc 0x80000000 0x80200000 && " \ |
Mathew McBride | 154d908 | 2023-07-21 04:39:19 +0000 | [diff] [blame] | 29 | "fatload mmc 0 0x8E000000 " SD_FIRMWARE_PATH "eth-dpl-all.dtb && " \ |
Mathew McBride | 1edd144 | 2023-07-21 04:39:18 +0000 | [diff] [blame] | 30 | "fsl_mc lazyapply DPL 0x8E000000 && echo 'default DPL loaded'\0" |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 31 | |
| 32 | #define BOOT_TARGET_DEVICES(func) \ |
| 33 | func(NVME, nvme, 0) \ |
| 34 | func(USB, usb, 0) \ |
| 35 | func(MMC, mmc, 0) \ |
| 36 | func(SCSI, scsi, 0) \ |
| 37 | func(DHCP, dhcp, 0) \ |
| 38 | func(PXE, pxe, 0) |
| 39 | #include <config_distro_bootcmd.h> |
| 40 | |
Mathew McBride | bcedba5 | 2023-07-21 04:39:21 +0000 | [diff] [blame] | 41 | #define OPENWRT_NAND_BOOTCMD \ |
| 42 | "bootcmd_openwrt_nand=ubi part ubi${openwrt_active_sys} && "\ |
| 43 | "ubi read $load_addr kernel && " \ |
| 44 | "setenv bootargs \"root=/dev/ubiblock0_1 earlycon ubi.mtd=ubi${openwrt_active_sys}\" &&"\ |
| 45 | "bootm $load_addr#ten64\0" |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 46 | #undef CFG_EXTRA_ENV_SETTINGS |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 47 | |
Mathew McBride | 0a63fb9 | 2023-07-21 04:39:22 +0000 | [diff] [blame] | 48 | #if CONFIG_IS_ENABLED(CMD_BOOTMENU) |
| 49 | #define DEFAULT_MENU_ENTRIES \ |
| 50 | "bootmenu_0=Continue standard boot=run bootcmd\0" \ |
| 51 | "bootmenu_1=Boot into recovery=run bootcmd_recovery\0" \ |
| 52 | "bootmenu_2=Boot OpenWrt from NAND=run bootcmd_openwrt_nand\0" |
| 53 | #else |
| 54 | #define DEFAULT_MENU_ENTRIES "" |
| 55 | #endif /* CONFIG_IS_ENABLED(CMD_BOOTMENU) */ |
| 56 | |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 57 | #define CFG_EXTRA_ENV_SETTINGS \ |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 58 | "BOARD=ten64\0" \ |
| 59 | "fdt_addr_r=0x90000000\0" \ |
| 60 | "fdt_high=0xa0000000\0" \ |
| 61 | "kernel_addr_r=0x81000000\0" \ |
| 62 | "load_addr=0xa0000000\0" \ |
| 63 | BOOTENV \ |
Mathew McBride | bcedba5 | 2023-07-21 04:39:21 +0000 | [diff] [blame] | 64 | OPENWRT_NAND_BOOTCMD \ |
| 65 | "openwrt_active_sys=a\0" \ |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 66 | "load_efi_dtb=mtd read devicetree $fdt_addr_r && fdt addr $fdt_addr_r && " \ |
| 67 | "fdt resize && fdt boardsetup\0" \ |
Mathew McBride | 0a63fb9 | 2023-07-21 04:39:22 +0000 | [diff] [blame] | 68 | "bootcmd_recovery=mtd read recovery 0xa0000000; " \ |
| 69 | "setenv bootargs \"earlycon root=/dev/ram0 ramdisk_size=0x3000000\" && bootm 0xa0000000#ten64\0" \ |
| 70 | DEFAULT_MENU_ENTRIES |
Mathew McBride | a1d2fd3 | 2022-01-31 18:34:43 +0530 | [diff] [blame] | 71 | |
| 72 | #endif /* __TEN64_H */ |