1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2020 Compass Electronics Group, LLC
6 #ifndef __IMX8MN_BEACON_H
7 #define __IMX8MN_BEACON_H
9 #include <linux/sizes.h>
10 #include <asm/arch/imx-regs.h>
12 #define CONFIG_SYS_MONITOR_LEN SZ_512K
13 #define CONFIG_SYS_UBOOT_BASE \
14 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
16 #ifdef CONFIG_SPL_BUILD
17 #define CONFIG_SPL_BSS_START_ADDR 0x0095e000
18 #define CONFIG_SYS_SPL_MALLOC_START 0x42200000
19 #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
21 /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
22 #define CONFIG_MALLOC_F_ADDR 0x184000
24 /* For RAW image gives a error info not panic */
25 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
27 #endif /* CONFIG_SPL_BUILD */
29 /* Initial environment variables */
30 #define CONFIG_EXTRA_ENV_SETTINGS \
33 "ramdiskimage=rootfs.cpio.uboot\0" \
34 "console=ttymxc1,115200\0" \
35 "fdt_addr=0x43000000\0" \
36 "ramdisk_addr=0x44000000\0" \
38 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
39 "initrd_addr=0x43800000\0" \
40 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
42 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
43 "mmcautodetect=yes\0" \
44 "mmcargs=setenv bootargs console=${console} " \
45 " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
46 "ramargs=setenv bootargs console=${console} root=/dev/ram rw " \
48 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
49 "bootscript=echo Running bootscript from mmc ...; " \
51 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
52 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
53 "loadramdisk=load mmc ${mmcdev} ${ramdisk_addr} ${ramdiskimage}\0"\
54 "mmcboot=echo Booting from mmc ...; " \
55 "run finduuid; run mmcargs; " \
56 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
57 "if run loadfdt; then " \
58 "booti ${loadaddr} - ${fdt_addr}; " \
60 "echo WARN: Cannot load the DT; " \
63 "echo wait for boot; " \
65 "netargs=setenv bootargs console=${console} " \
67 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
68 "netboot=echo Booting from net ...; " \
70 "if test ${ip_dyn} = yes; then " \
71 "setenv get_cmd dhcp; " \
73 "setenv get_cmd tftp; " \
75 "${get_cmd} ${loadaddr} ${image}; " \
76 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
77 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
78 "booti ${loadaddr} - ${fdt_addr}; " \
80 "echo WARN: Cannot load the DT; " \
85 "ramboot=echo Booting from RAMdisk...; "\
86 "run loadimage; run loadfdt; fdt addr $fdt_addr; "\
87 "run loadramdisk; run ramargs; " \
88 "booti ${loadaddr} ${ramdisk_addr} ${fdt_addr} ${optargs}\0"
90 /* Link Definitions */
92 #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
93 #define CONFIG_SYS_INIT_RAM_SIZE 0x200000
95 #define CONFIG_SYS_SDRAM_BASE 0x40000000
96 #define PHYS_SDRAM 0x40000000
97 #if CONFIG_IS_ENABLED(IMX8MN_BEACON_2GB_LPDDR)
98 #define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */
100 #define PHYS_SDRAM_SIZE 0x40000000 /* 1GB DDR */
103 #define CONFIG_MXC_UART_BASE UART_BASE_ADDR(2)