blob: 0118ca32a961b36b4981ce5a5791c6ea13de26fa [file] [log] [blame]
Adam Fordd42247d2020-12-11 06:01:46 -06001/* 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
Adam Fordd42247d2020-12-11 06:01:46 -060012#define CONFIG_SYS_MONITOR_LEN SZ_512K
Adam Fordd42247d2020-12-11 06:01:46 -060013#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
Adam Fordd42247d2020-12-11 06:01:46 -060019#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
20#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
21
22/* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
23#define CONFIG_MALLOC_F_ADDR 0x184000
24
25/* For RAW image gives a error info not panic */
26#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
27
28#endif /* CONFIG_SPL_BUILD */
29
Adam Fordd42247d2020-12-11 06:01:46 -060030/* Initial environment variables */
31#define CONFIG_EXTRA_ENV_SETTINGS \
32 "script=boot.scr\0" \
33 "image=Image\0" \
34 "ramdiskimage=rootfs.cpio.uboot\0" \
35 "console=ttymxc1,115200\0" \
36 "fdt_addr=0x43000000\0" \
37 "ramdisk_addr=0x44000000\0" \
38 "boot_fdt=try\0" \
39 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
40 "initrd_addr=0x43800000\0" \
41 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
Tom Rinib113bca2021-12-11 14:55:52 -050042 "mmcpart=1\0" \
Adam Fordd42247d2020-12-11 06:01:46 -060043 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
44 "mmcautodetect=yes\0" \
45 "mmcargs=setenv bootargs console=${console} " \
46 " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
47 "ramargs=setenv bootargs console=${console} root=/dev/ram rw " \
48 " ${optargs}\0" \
49 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
50 "bootscript=echo Running bootscript from mmc ...; " \
51 "source\0" \
52 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
53 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
54 "loadramdisk=load mmc ${mmcdev} ${ramdisk_addr} ${ramdiskimage}\0"\
55 "mmcboot=echo Booting from mmc ...; " \
56 "run finduuid; run mmcargs; " \
57 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
58 "if run loadfdt; then " \
59 "booti ${loadaddr} - ${fdt_addr}; " \
60 "else " \
61 "echo WARN: Cannot load the DT; " \
62 "fi; " \
63 "else " \
64 "echo wait for boot; " \
65 "fi;\0" \
66 "netargs=setenv bootargs console=${console} " \
67 "root=/dev/nfs " \
68 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
69 "netboot=echo Booting from net ...; " \
70 "run netargs; " \
71 "if test ${ip_dyn} = yes; then " \
72 "setenv get_cmd dhcp; " \
73 "else " \
74 "setenv get_cmd tftp; " \
75 "fi; " \
76 "${get_cmd} ${loadaddr} ${image}; " \
77 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
78 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
79 "booti ${loadaddr} - ${fdt_addr}; " \
80 "else " \
81 "echo WARN: Cannot load the DT; " \
82 "fi; " \
83 "else " \
84 "booti; " \
85 "fi;\0" \
86 "ramboot=echo Booting from RAMdisk...; "\
87 "run loadimage; run loadfdt; fdt addr $fdt_addr; "\
88 "run loadramdisk; run ramargs; " \
89 "booti ${loadaddr} ${ramdisk_addr} ${fdt_addr} ${optargs}\0"
90
Adam Fordd42247d2020-12-11 06:01:46 -060091/* Link Definitions */
Adam Fordd42247d2020-12-11 06:01:46 -060092
93#define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
94#define CONFIG_SYS_INIT_RAM_SIZE 0x200000
Adam Fordd42247d2020-12-11 06:01:46 -060095
Adam Fordd42247d2020-12-11 06:01:46 -060096#define CONFIG_SYS_SDRAM_BASE 0x40000000
97#define PHYS_SDRAM 0x40000000
Adam Forddd39a6e2021-02-16 08:19:52 -060098#if CONFIG_IS_ENABLED(IMX8MN_BEACON_2GB_LPDDR)
99#define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */
100#else
Adam Fordd42247d2020-12-11 06:01:46 -0600101#define PHYS_SDRAM_SIZE 0x40000000 /* 1GB DDR */
Adam Forddd39a6e2021-02-16 08:19:52 -0600102#endif
Adam Fordd42247d2020-12-11 06:01:46 -0600103
Marek Vasut86a27482022-04-24 23:44:03 +0200104#define CONFIG_MXC_UART_BASE UART_BASE_ADDR(2)
Adam Fordd42247d2020-12-11 06:01:46 -0600105
Adam Fordd42247d2020-12-11 06:01:46 -0600106#endif