Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 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 | |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 12 | #define CONFIG_SYS_MONITOR_LEN SZ_512K |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 13 | #define CONFIG_SYS_UBOOT_BASE \ |
| 14 | (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) |
| 15 | |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 16 | /* Initial environment variables */ |
| 17 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 18 | "script=boot.scr\0" \ |
| 19 | "image=Image\0" \ |
| 20 | "ramdiskimage=rootfs.cpio.uboot\0" \ |
| 21 | "console=ttymxc1,115200\0" \ |
| 22 | "fdt_addr=0x43000000\0" \ |
| 23 | "ramdisk_addr=0x44000000\0" \ |
| 24 | "boot_fdt=try\0" \ |
| 25 | "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
| 26 | "initrd_addr=0x43800000\0" \ |
| 27 | "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ |
Tom Rini | de35b8f | 2021-12-11 14:55:52 -0500 | [diff] [blame] | 28 | "mmcpart=1\0" \ |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 29 | "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \ |
| 30 | "mmcautodetect=yes\0" \ |
| 31 | "mmcargs=setenv bootargs console=${console} " \ |
| 32 | " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \ |
| 33 | "ramargs=setenv bootargs console=${console} root=/dev/ram rw " \ |
| 34 | " ${optargs}\0" \ |
| 35 | "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 36 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 37 | "source\0" \ |
| 38 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
| 39 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
| 40 | "loadramdisk=load mmc ${mmcdev} ${ramdisk_addr} ${ramdiskimage}\0"\ |
| 41 | "mmcboot=echo Booting from mmc ...; " \ |
| 42 | "run finduuid; run mmcargs; " \ |
| 43 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 44 | "if run loadfdt; then " \ |
| 45 | "booti ${loadaddr} - ${fdt_addr}; " \ |
| 46 | "else " \ |
| 47 | "echo WARN: Cannot load the DT; " \ |
| 48 | "fi; " \ |
| 49 | "else " \ |
| 50 | "echo wait for boot; " \ |
| 51 | "fi;\0" \ |
| 52 | "netargs=setenv bootargs console=${console} " \ |
| 53 | "root=/dev/nfs " \ |
| 54 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 55 | "netboot=echo Booting from net ...; " \ |
| 56 | "run netargs; " \ |
| 57 | "if test ${ip_dyn} = yes; then " \ |
| 58 | "setenv get_cmd dhcp; " \ |
| 59 | "else " \ |
| 60 | "setenv get_cmd tftp; " \ |
| 61 | "fi; " \ |
| 62 | "${get_cmd} ${loadaddr} ${image}; " \ |
| 63 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 64 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 65 | "booti ${loadaddr} - ${fdt_addr}; " \ |
| 66 | "else " \ |
| 67 | "echo WARN: Cannot load the DT; " \ |
| 68 | "fi; " \ |
| 69 | "else " \ |
| 70 | "booti; " \ |
| 71 | "fi;\0" \ |
| 72 | "ramboot=echo Booting from RAMdisk...; "\ |
| 73 | "run loadimage; run loadfdt; fdt addr $fdt_addr; "\ |
| 74 | "run loadramdisk; run ramargs; " \ |
| 75 | "booti ${loadaddr} ${ramdisk_addr} ${fdt_addr} ${optargs}\0" |
| 76 | |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 77 | /* Link Definitions */ |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 78 | |
| 79 | #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000 |
| 80 | #define CONFIG_SYS_INIT_RAM_SIZE 0x200000 |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 81 | |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 82 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 |
| 83 | #define PHYS_SDRAM 0x40000000 |
Adam Ford | 5d9b166 | 2021-02-16 08:19:52 -0600 | [diff] [blame] | 84 | #if CONFIG_IS_ENABLED(IMX8MN_BEACON_2GB_LPDDR) |
| 85 | #define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */ |
| 86 | #else |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 87 | #define PHYS_SDRAM_SIZE 0x40000000 /* 1GB DDR */ |
Adam Ford | 5d9b166 | 2021-02-16 08:19:52 -0600 | [diff] [blame] | 88 | #endif |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 89 | |
Adam Ford | 8e95883 | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 90 | #endif |