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