1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2016 Freescale Semiconductor
4 * Copyright 2019-2021 NXP
7 #ifndef __LS1046A_COMMON_H
8 #define __LS1046A_COMMON_H
11 #ifdef CONFIG_SPL_BUILD
20 #if defined(CONFIG_SPL_BUILD) && \
21 (defined(CONFIG_NAND_BOOT) || defined(CONFIG_QSPI_BOOT))
24 #if defined(CONFIG_SPL_BUILD) && \
25 !defined(CONFIG_SPL_FSL_LS_PPA)
29 #include <asm/arch/config.h>
30 #include <asm/arch/stream_id_lsch2.h>
32 /* Link Definitions */
34 #define CONFIG_VERY_BIG_RAM
35 #define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000
36 #define CFG_SYS_FSL_DDR_SDRAM_BASE_PHY 0
37 #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
38 #define CONFIG_SYS_DDR_BLOCK2_BASE 0x880000000ULL
40 #define CPU_RELEASE_ADDR secondary_boot_addr
43 #define CONFIG_SYS_NS16550_SERIAL
44 #define CONFIG_SYS_NS16550_REG_SIZE 1
45 #define CONFIG_SYS_NS16550_CLK (get_serial_clock())
49 #ifdef CONFIG_NXP_ESBC
50 #define CONFIG_U_BOOT_HDR_SIZE (16 << 10)
52 * HDR would be appended at end of image and copied to DDR along
53 * with U-Boot image. Here u-boot max. size is 512K. So if binary
54 * size increases then increase this size in case of secure boot as
55 * it uses raw u-boot image instead of fit image.
57 #endif /* ifdef CONFIG_NXP_ESBC */
61 #ifdef CONFIG_NAND_BOOT
62 #define CFG_SYS_NAND_U_BOOT_DST CONFIG_TEXT_BASE
63 #define CFG_SYS_NAND_U_BOOT_START CONFIG_TEXT_BASE
72 #define CONFIG_SYS_SATA AHCI_BASE_ADDR
77 #define CONFIG_SYS_DPAA_FMAN
78 #ifdef CONFIG_SYS_DPAA_FMAN
79 #define CONFIG_SYS_FM_MURAM_SIZE 0x60000
83 /* Miscellaneous configurable options */
85 #define CONFIG_HWCONFIG
86 #define HWCONFIG_BUFFER_SIZE 128
88 #define BOOT_TARGET_DEVICES(func) \
93 #include <config_distro_bootcmd.h>
95 #if defined(CONFIG_TARGET_LS1046AFRWY)
96 #define LS1046A_BOOT_SRC_AND_HDR\
97 "boot_scripts=ls1046afrwy_boot.scr\0" \
98 "boot_script_hdr=hdr_ls1046afrwy_bs.out\0"
99 #elif defined(CONFIG_TARGET_LS1046AQDS)
100 #define LS1046A_BOOT_SRC_AND_HDR\
101 "boot_scripts=ls1046aqds_boot.scr\0" \
102 "boot_script_hdr=hdr_ls1046aqds_bs.out\0"
104 #define LS1046A_BOOT_SRC_AND_HDR\
105 "boot_scripts=ls1046ardb_boot.scr\0" \
106 "boot_script_hdr=hdr_ls1046ardb_bs.out\0"
109 /* Initial environment variables */
110 #define CONFIG_EXTRA_ENV_SETTINGS \
111 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
112 "ramdisk_addr=0x800000\0" \
113 "ramdisk_size=0x2000000\0" \
114 "bootm_size=0x10000000\0" \
115 "kernel_addr=0x61000000\0" \
116 "scriptaddr=0x80000000\0" \
117 "scripthdraddr=0x80080000\0" \
118 "fdtheader_addr_r=0x80100000\0" \
119 "kernelheader_addr_r=0x80200000\0" \
120 "load_addr=0xa0000000\0" \
121 "kernel_addr_r=0x81000000\0" \
122 "fdt_addr_r=0x90000000\0" \
123 "ramdisk_addr_r=0xa0000000\0" \
124 "kernel_start=0x1000000\0" \
125 "kernelheader_start=0x600000\0" \
126 "kernel_load=0xa0000000\0" \
127 "kernel_size=0x2800000\0" \
128 "kernelheader_size=0x40000\0" \
129 "kernel_addr_sd=0x8000\0" \
130 "kernel_size_sd=0x14000\0" \
131 "kernelhdr_addr_sd=0x3000\0" \
132 "kernelhdr_size_sd=0x10\0" \
133 "console=ttyS0,115200\0" \
134 CONFIG_MTDPARTS_DEFAULT "\0" \
136 LS1046A_BOOT_SRC_AND_HDR \
137 "scan_dev_for_boot_part=" \
138 "part list ${devtype} ${devnum} devplist; " \
139 "env exists devplist || setenv devplist 1; " \
140 "for distro_bootpart in ${devplist}; do " \
141 "if fstype ${devtype} " \
142 "${devnum}:${distro_bootpart} " \
143 "bootfstype; then " \
144 "run scan_dev_for_boot; " \
148 "load ${devtype} ${devnum}:${distro_bootpart} " \
149 "${scriptaddr} ${prefix}${script}; " \
150 "env exists secureboot && load ${devtype} " \
151 "${devnum}:${distro_bootpart} " \
152 "${scripthdraddr} ${prefix}${boot_script_hdr}; " \
153 "env exists secureboot " \
154 "&& esbc_validate ${scripthdraddr};" \
155 "source ${scriptaddr}\0" \
156 "qspi_bootcmd=echo Trying load from qspi..;" \
157 "sf probe && sf read $load_addr " \
158 "$kernel_start $kernel_size; env exists secureboot " \
159 "&& sf read $kernelheader_addr_r $kernelheader_start " \
160 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
161 "bootm $load_addr#$board\0" \
162 "nand_bootcmd=echo Trying load from nand..;" \
163 "nand info; nand read $load_addr " \
164 "$kernel_start $kernel_size; env exists secureboot " \
165 "&& nand read $kernelheader_addr_r $kernelheader_start " \
166 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
167 "bootm $load_addr#$board\0" \
168 "nor_bootcmd=echo Trying load from nor..;" \
169 "cp.b $kernel_addr $load_addr " \
170 "$kernel_size; env exists secureboot " \
171 "&& cp.b $kernelheader_addr $kernelheader_addr_r " \
172 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
173 "bootm $load_addr#$board\0" \
174 "sd_bootcmd=echo Trying load from SD ..;" \
175 "mmcinfo; mmc read $load_addr " \
176 "$kernel_addr_sd $kernel_size_sd && " \
177 "env exists secureboot && mmc read $kernelheader_addr_r " \
178 "$kernelhdr_addr_sd $kernelhdr_size_sd " \
179 " && esbc_validate ${kernelheader_addr_r};" \
180 "bootm $load_addr#$board\0"
184 #include <asm/arch/soc.h>
186 #endif /* __LS1046A_COMMON_H */