blob: d5bb2e96c51a2e655f3b490545e6f1890178489b [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
Tom Rini65cc0e22022-11-16 13:10:41 -050012#define CFG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
Mathew McBridea1d2fd32022-01-31 18:34:43 +053013
14#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd"
15#define SD_BOOTCOMMAND "run distro_bootcmd"
16
Mathew McBride154d9082023-07-21 04:39:19 +000017#define SD_FIRMWARE_PATH "firmware/traverse/ten64/"
18
Mathew McBridea1d2fd32022-01-31 18:34:43 +053019#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 McBride1edd1442023-07-21 04:39:18 +000023 "sf read 0x8E000000 0x580000 0x40000 && fsl_mc lazyapply DPL 0x8E000000 && "\
24 "echo 'default DPL loaded'\0"
Mathew McBridea1d2fd32022-01-31 18:34:43 +053025#define SD_MC_INIT_CMD \
Mathew McBride154d9082023-07-21 04:39:19 +000026 "mmcinfo; fatload mmc 0 0x80000000 " SD_FIRMWARE_PATH "mc_ls1088a.itb; "\
27 "fatload mmc 0 0x80200000 " SD_FIRMWARE_PATH "dpc.0x1D-0x0D.dtb; "\
Mathew McBride1edd1442023-07-21 04:39:18 +000028 "fsl_mc start mc 0x80000000 0x80200000 && " \
Mathew McBride154d9082023-07-21 04:39:19 +000029 "fatload mmc 0 0x8E000000 " SD_FIRMWARE_PATH "eth-dpl-all.dtb && " \
Mathew McBride1edd1442023-07-21 04:39:18 +000030 "fsl_mc lazyapply DPL 0x8E000000 && echo 'default DPL loaded'\0"
Mathew McBridea1d2fd32022-01-31 18:34:43 +053031
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 McBridebcedba52023-07-21 04:39:21 +000041#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 Rini0613c362022-12-04 10:03:50 -050046#undef CFG_EXTRA_ENV_SETTINGS
Mathew McBridea1d2fd32022-01-31 18:34:43 +053047
Mathew McBride0a63fb92023-07-21 04:39:22 +000048#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 Rini0613c362022-12-04 10:03:50 -050057#define CFG_EXTRA_ENV_SETTINGS \
Mathew McBridea1d2fd32022-01-31 18:34:43 +053058 "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 McBridebcedba52023-07-21 04:39:21 +000064 OPENWRT_NAND_BOOTCMD \
65 "openwrt_active_sys=a\0" \
Mathew McBridea1d2fd32022-01-31 18:34:43 +053066 "load_efi_dtb=mtd read devicetree $fdt_addr_r && fdt addr $fdt_addr_r && " \
67 "fdt resize && fdt boardsetup\0" \
Mathew McBride0a63fb92023-07-21 04:39:22 +000068 "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 McBridea1d2fd32022-01-31 18:34:43 +053071
72#endif /* __TEN64_H */