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 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 12 | #define CFG_SYS_UBOOT_BASE \ |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 13 | (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) |
| 14 | |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 15 | /* 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 Rini | b113bca | 2021-12-11 14:55:52 -0500 | [diff] [blame] | 27 | "mmcpart=1\0" \ |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 28 | "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 Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 76 | /* Link Definitions */ |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 77 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 78 | #define CFG_SYS_INIT_RAM_ADDR 0x40000000 |
| 79 | #define CFG_SYS_INIT_RAM_SIZE 0x200000 |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 80 | |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 81 | #define CFG_SYS_SDRAM_BASE 0x40000000 |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 82 | #define PHYS_SDRAM 0x40000000 |
Adam Ford | dd39a6e | 2021-02-16 08:19:52 -0600 | [diff] [blame] | 83 | #if CONFIG_IS_ENABLED(IMX8MN_BEACON_2GB_LPDDR) |
| 84 | #define PHYS_SDRAM_SIZE 0x80000000 /* 2GB DDR */ |
| 85 | #else |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 86 | #define PHYS_SDRAM_SIZE 0x40000000 /* 1GB DDR */ |
Adam Ford | dd39a6e | 2021-02-16 08:19:52 -0600 | [diff] [blame] | 87 | #endif |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 88 | |
Adam Ford | d42247d | 2020-12-11 06:01:46 -0600 | [diff] [blame] | 89 | #endif |