5fac4ad5e605f292a4cbd31ff440fc6c9de165dc
[platform/kernel/u-boot.git] / include / configs / imx8mn_beacon.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2020 Compass Electronics Group, LLC
4  */
5
6 #ifndef __IMX8MN_BEACON_H
7 #define __IMX8MN_BEACON_H
8
9 #include <linux/sizes.h>
10 #include <asm/arch/imx-regs.h>
11
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)
15
16 #ifdef CONFIG_SPL_BUILD
17 #define CONFIG_SYS_SPL_MALLOC_START     0x42200000
18 #define CONFIG_SYS_SPL_MALLOC_SIZE      SZ_512K
19
20 /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
21 #define CONFIG_MALLOC_F_ADDR            0x184000
22
23 /* For RAW image gives a error info not panic */
24 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
25
26 #endif /* CONFIG_SPL_BUILD */
27
28 /* Initial environment variables */
29 #define CONFIG_EXTRA_ENV_SETTINGS               \
30         "script=boot.scr\0" \
31         "image=Image\0" \
32         "ramdiskimage=rootfs.cpio.uboot\0" \
33         "console=ttymxc1,115200\0" \
34         "fdt_addr=0x43000000\0"                 \
35         "ramdisk_addr=0x44000000\0" \
36         "boot_fdt=try\0" \
37         "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
38         "initrd_addr=0x43800000\0"              \
39         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
40         "mmcpart=1\0" \
41         "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
42         "mmcautodetect=yes\0" \
43         "mmcargs=setenv bootargs console=${console} " \
44         " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
45         "ramargs=setenv bootargs console=${console} root=/dev/ram rw " \
46         " ${optargs}\0" \
47         "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
48         "bootscript=echo Running bootscript from mmc ...; " \
49                 "source\0" \
50         "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
51         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
52         "loadramdisk=load mmc ${mmcdev} ${ramdisk_addr} ${ramdiskimage}\0"\
53         "mmcboot=echo Booting from mmc ...; " \
54                 "run finduuid; run mmcargs; " \
55                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
56                         "if run loadfdt; then " \
57                                 "booti ${loadaddr} - ${fdt_addr}; " \
58                         "else " \
59                                 "echo WARN: Cannot load the DT; " \
60                         "fi; " \
61                 "else " \
62                         "echo wait for boot; " \
63                 "fi;\0" \
64         "netargs=setenv bootargs console=${console} " \
65                 "root=/dev/nfs " \
66                 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
67         "netboot=echo Booting from net ...; " \
68                 "run netargs;  " \
69                 "if test ${ip_dyn} = yes; then " \
70                         "setenv get_cmd dhcp; " \
71                 "else " \
72                         "setenv get_cmd tftp; " \
73                 "fi; " \
74                 "${get_cmd} ${loadaddr} ${image}; " \
75                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
76                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
77                                 "booti ${loadaddr} - ${fdt_addr}; " \
78                         "else " \
79                                 "echo WARN: Cannot load the DT; " \
80                         "fi; " \
81                 "else " \
82                         "booti; " \
83                 "fi;\0" \
84         "ramboot=echo Booting from RAMdisk...; "\
85                 "run loadimage; run loadfdt; fdt addr $fdt_addr; "\
86                 "run loadramdisk; run ramargs; " \
87                 "booti ${loadaddr} ${ramdisk_addr} ${fdt_addr} ${optargs}\0"
88
89 /* Link Definitions */
90
91 #define CONFIG_SYS_INIT_RAM_ADDR        0x40000000
92 #define CONFIG_SYS_INIT_RAM_SIZE        0x200000
93
94 #define CONFIG_SYS_SDRAM_BASE           0x40000000
95 #define PHYS_SDRAM                      0x40000000
96 #if CONFIG_IS_ENABLED(IMX8MN_BEACON_2GB_LPDDR)
97 #define PHYS_SDRAM_SIZE         0x80000000 /* 2GB DDR */
98 #else
99 #define PHYS_SDRAM_SIZE         0x40000000 /* 1GB DDR */
100 #endif
101
102 #define CONFIG_MXC_UART_BASE            UART_BASE_ADDR(2)
103
104 #endif