blob: 85fd5e2371f976b1e7aabba0f74ddf4772d0e02c [file] [log] [blame]
Adam Ford8e958832020-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
Tom Rini65cc0e22022-11-16 13:10:41 -050012#define CFG_SYS_UBOOT_BASE \
Adam Ford8e958832020-12-11 06:01:46 -060013 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
14
Adam Ford8e958832020-12-11 06:01:46 -060015/* Initial environment variables */
16#define CONFIG_EXTRA_ENV_SETTINGS \
17 "script=boot.scr\0" \
18 "image=Image\0" \
19 "ramdiskimage=rootfs.cpio.uboot\0" \
20 "console=ttymxc1,115200\0" \
21 "fdt_addr=0x43000000\0" \
22 "ramdisk_addr=0x44000000\0" \
23 "boot_fdt=try\0" \
24 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
25 "initrd_addr=0x43800000\0" \
26 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
Tom Rinide35b8f2021-12-11 14:55:52 -050027 "mmcpart=1\0" \
Adam Ford8e958832020-12-11 06:01:46 -060028 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
29 "mmcautodetect=yes\0" \
30 "mmcargs=setenv bootargs console=${console} " \
31 " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
32 "ramargs=setenv bootargs console=${console} root=/dev/ram rw " \
33 " ${optargs}\0" \
34 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
35 "bootscript=echo Running bootscript from mmc ...; " \
36 "source\0" \
37 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
38 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
39 "loadramdisk=load mmc ${mmcdev} ${ramdisk_addr} ${ramdiskimage}\0"\
40 "mmcboot=echo Booting from mmc ...; " \
41 "run finduuid; run mmcargs; " \
42 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
43 "if run loadfdt; then " \
44 "booti ${loadaddr} - ${fdt_addr}; " \
45 "else " \
46 "echo WARN: Cannot load the DT; " \
47 "fi; " \
48 "else " \
49 "echo wait for boot; " \
50 "fi;\0" \
51 "netargs=setenv bootargs console=${console} " \
52 "root=/dev/nfs " \
53 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
54 "netboot=echo Booting from net ...; " \
55 "run netargs; " \
56 "if test ${ip_dyn} = yes; then " \
57 "setenv get_cmd dhcp; " \
58 "else " \
59 "setenv get_cmd tftp; " \
60 "fi; " \
61 "${get_cmd} ${loadaddr} ${image}; " \
62 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
63 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
64 "booti ${loadaddr} - ${fdt_addr}; " \
65 "else " \
66 "echo WARN: Cannot load the DT; " \
67 "fi; " \
68 "else " \
69 "booti; " \
70 "fi;\0" \
71 "ramboot=echo Booting from RAMdisk...; "\
72 "run loadimage; run loadfdt; fdt addr $fdt_addr; "\
73 "run loadramdisk; run ramargs; " \
74 "booti ${loadaddr} ${ramdisk_addr} ${fdt_addr} ${optargs}\0"
75
Adam Ford8e958832020-12-11 06:01:46 -060076/* Link Definitions */
Adam Ford8e958832020-12-11 06:01:46 -060077
Tom Rini65cc0e22022-11-16 13:10:41 -050078#define CFG_SYS_INIT_RAM_ADDR 0x40000000
79#define CFG_SYS_INIT_RAM_SIZE 0x200000
Adam Ford8e958832020-12-11 06:01:46 -060080
Tom Riniaa6e94d2022-11-16 13:10:37 -050081#define CFG_SYS_SDRAM_BASE 0x40000000
Adam Ford8e958832020-12-11 06:01:46 -060082#define PHYS_SDRAM 0x40000000
Adam Ford5d9b1662021-02-16 08:19:52 -060083#if CONFIG_IS_ENABLED(IMX8MN_BEACON_2GB_LPDDR)
84#define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */
85#else
Adam Ford8e958832020-12-11 06:01:46 -060086#define PHYS_SDRAM_SIZE 0x40000000 /* 1GB DDR */
Adam Ford5d9b1662021-02-16 08:19:52 -060087#endif
Adam Ford8e958832020-12-11 06:01:46 -060088
Adam Ford8e958832020-12-11 06:01:46 -060089#endif