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