blob: d2bef9b6e528d8b8bd8b9eb2dc3221924cef8b57 [file] [log] [blame]
Mathew McBridea1d2fd32022-01-31 18:34:43 +05301/* 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
Mathew McBridea1d2fd32022-01-31 18:34:43 +053012
Tom Rini65cc0e22022-11-16 13:10:41 -050013#define CFG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
Mathew McBridea1d2fd32022-01-31 18:34:43 +053014
15#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd"
16#define SD_BOOTCOMMAND "run distro_bootcmd"
17
Mathew McBride154d9082023-07-21 04:39:19 +000018#define SD_FIRMWARE_PATH "firmware/traverse/ten64/"
19
Mathew McBridea1d2fd32022-01-31 18:34:43 +053020#define QSPI_MC_INIT_CMD \
21 "sf probe 0:0 && sf read 0x80000000 0x300000 0x200000 &&" \
22 "sf read 0x80200000 0x5C0000 0x40000 &&" \
23 "fsl_mc start mc 0x80000000 0x80200000 && " \
Mathew McBride1edd1442023-07-21 04:39:18 +000024 "sf read 0x8E000000 0x580000 0x40000 && fsl_mc lazyapply DPL 0x8E000000 && "\
25 "echo 'default DPL loaded'\0"
Mathew McBridea1d2fd32022-01-31 18:34:43 +053026#define SD_MC_INIT_CMD \
Mathew McBride154d9082023-07-21 04:39:19 +000027 "mmcinfo; fatload mmc 0 0x80000000 " SD_FIRMWARE_PATH "mc_ls1088a.itb; "\
28 "fatload mmc 0 0x80200000 " SD_FIRMWARE_PATH "dpc.0x1D-0x0D.dtb; "\
Mathew McBride1edd1442023-07-21 04:39:18 +000029 "fsl_mc start mc 0x80000000 0x80200000 && " \
Mathew McBride154d9082023-07-21 04:39:19 +000030 "fatload mmc 0 0x8E000000 " SD_FIRMWARE_PATH "eth-dpl-all.dtb && " \
Mathew McBride1edd1442023-07-21 04:39:18 +000031 "fsl_mc lazyapply DPL 0x8E000000 && echo 'default DPL loaded'\0"
Mathew McBridea1d2fd32022-01-31 18:34:43 +053032
33#define BOOT_TARGET_DEVICES(func) \
34 func(NVME, nvme, 0) \
35 func(USB, usb, 0) \
36 func(MMC, mmc, 0) \
37 func(SCSI, scsi, 0) \
38 func(DHCP, dhcp, 0) \
39 func(PXE, pxe, 0)
40#include <config_distro_bootcmd.h>
41
Mathew McBridebcedba52023-07-21 04:39:21 +000042#define OPENWRT_NAND_BOOTCMD \
43 "bootcmd_openwrt_nand=ubi part ubi${openwrt_active_sys} && "\
44 "ubi read $load_addr kernel && " \
45 "setenv bootargs \"root=/dev/ubiblock0_1 earlycon ubi.mtd=ubi${openwrt_active_sys}\" &&"\
46 "bootm $load_addr#ten64\0"
Tom Rini0613c362022-12-04 10:03:50 -050047#undef CFG_EXTRA_ENV_SETTINGS
Mathew McBridea1d2fd32022-01-31 18:34:43 +053048
Mathew McBride0a63fb92023-07-21 04:39:22 +000049#if CONFIG_IS_ENABLED(CMD_BOOTMENU)
50#define DEFAULT_MENU_ENTRIES \
51 "bootmenu_0=Continue standard boot=run bootcmd\0" \
52 "bootmenu_1=Boot into recovery=run bootcmd_recovery\0" \
53 "bootmenu_2=Boot OpenWrt from NAND=run bootcmd_openwrt_nand\0"
54#else
55#define DEFAULT_MENU_ENTRIES ""
56#endif /* CONFIG_IS_ENABLED(CMD_BOOTMENU) */
57
Tom Rini0613c362022-12-04 10:03:50 -050058#define CFG_EXTRA_ENV_SETTINGS \
Mathew McBridea1d2fd32022-01-31 18:34:43 +053059 "BOARD=ten64\0" \
60 "fdt_addr_r=0x90000000\0" \
61 "fdt_high=0xa0000000\0" \
62 "kernel_addr_r=0x81000000\0" \
63 "load_addr=0xa0000000\0" \
64 BOOTENV \
Mathew McBridebcedba52023-07-21 04:39:21 +000065 OPENWRT_NAND_BOOTCMD \
66 "openwrt_active_sys=a\0" \
Mathew McBridea1d2fd32022-01-31 18:34:43 +053067 "load_efi_dtb=mtd read devicetree $fdt_addr_r && fdt addr $fdt_addr_r && " \
68 "fdt resize && fdt boardsetup\0" \
Mathew McBride0a63fb92023-07-21 04:39:22 +000069 "bootcmd_recovery=mtd read recovery 0xa0000000; " \
70 "setenv bootargs \"earlycon root=/dev/ram0 ramdisk_size=0x3000000\" && bootm 0xa0000000#ten64\0" \
71 DEFAULT_MENU_ENTRIES
Mathew McBridea1d2fd32022-01-31 18:34:43 +053072
73#endif /* __TEN64_H */