Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright 2022 Gateworks Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef __IMX8MM_VENICE_H |
| 7 | #define __IMX8MM_VENICE_H |
| 8 | |
| 9 | #include <asm/arch/imx-regs.h> |
| 10 | #include <linux/sizes.h> |
| 11 | |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 12 | #define CONFIG_SYS_MONITOR_LEN SZ_512K |
| 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 |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 17 | /* For RAW image gives a error info not panic */ |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 18 | #endif |
| 19 | |
| 20 | #define MEM_LAYOUT_ENV_SETTINGS \ |
Tim Harvey | fd5c717 | 2022-04-13 08:25:10 -0700 | [diff] [blame] | 21 | "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
| 22 | "fdt_addr_r=0x50200000\0" \ |
| 23 | "scriptaddr=0x50280000\0" \ |
| 24 | "ramdisk_addr_r=0x50300000\0" \ |
| 25 | "kernel_comp_addr_r=0x40200000\0" |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 26 | |
| 27 | /* Enable Distro Boot */ |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 28 | #define BOOT_TARGET_DEVICES(func) \ |
| 29 | func(MMC, mmc, 1) \ |
| 30 | func(MMC, mmc, 2) \ |
Tim Harvey | c574736 | 2022-04-13 08:42:52 -0700 | [diff] [blame] | 31 | func(USB, usb, 0) \ |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 32 | func(DHCP, dhcp, na) |
| 33 | #include <config_distro_bootcmd.h> |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 34 | |
| 35 | /* Initial environment variables */ |
| 36 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 37 | BOOTENV \ |
| 38 | MEM_LAYOUT_ENV_SETTINGS \ |
| 39 | "script=boot.scr\0" \ |
| 40 | "bootm_size=0x10000000\0" \ |
| 41 | "dev=2\0" \ |
| 42 | "preboot=gsc wd-disable\0" \ |
| 43 | "console=ttymxc1,115200\0" \ |
| 44 | "update_firmware=" \ |
| 45 | "tftpboot $loadaddr $image && " \ |
| 46 | "setexpr blkcnt $filesize + 0x1ff && " \ |
| 47 | "setexpr blkcnt $blkcnt / 0x200 && " \ |
| 48 | "mmc dev $dev && " \ |
| 49 | "mmc write $loadaddr 0x40 $blkcnt\0" \ |
Tim Harvey | f3722dd | 2022-02-18 15:20:17 -0800 | [diff] [blame] | 50 | "loadfdt=" \ |
| 51 | "if $fsload $fdt_addr_r $dir/$fdt_file1; " \ |
| 52 | "then echo loaded $fdt_file1; " \ |
| 53 | "elif $fsload $fdt_addr_r $dir/$fdt_file2; " \ |
| 54 | "then echo loaded $fdt_file2; " \ |
| 55 | "elif $fsload $fdt_addr_r $dir/$fdt_file3; " \ |
| 56 | "then echo loaded $fdt_file3; " \ |
| 57 | "elif $fsload $fdt_addr_r $dir/$fdt_file4; " \ |
| 58 | "then echo loaded $fdt_file4; " \ |
| 59 | "elif $fsload $fdt_addr_r $dir/$fdt_file5; " \ |
| 60 | "then echo loaded $fdt_file5; " \ |
| 61 | "fi\0" \ |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 62 | "boot_net=" \ |
Tim Harvey | f3722dd | 2022-02-18 15:20:17 -0800 | [diff] [blame] | 63 | "setenv fsload tftpboot; " \ |
| 64 | "run loadfdt && tftpboot $kernel_addr_r $dir/Image && " \ |
| 65 | "booti $kernel_addr_r - $fdt_addr_r\0" \ |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 66 | "update_rootfs=" \ |
| 67 | "tftpboot $loadaddr $image && " \ |
| 68 | "gzwrite mmc $dev $loadaddr $filesize 100000 1000000\0" \ |
| 69 | "update_all=" \ |
| 70 | "tftpboot $loadaddr $image && " \ |
| 71 | "gzwrite mmc $dev $loadaddr $filesize\0" \ |
| 72 | "erase_env=mmc dev $dev; mmc erase 0x7f08 0x40\0" |
| 73 | |
| 74 | #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000 |
| 75 | #define CONFIG_SYS_INIT_RAM_SIZE SZ_2M |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 76 | |
| 77 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 |
| 78 | |
| 79 | /* SDRAM configuration */ |
| 80 | #define PHYS_SDRAM 0x40000000 |
Tim Harvey | 52ae8d6 | 2022-03-30 13:39:02 -0700 | [diff] [blame] | 81 | #define PHYS_SDRAM_SIZE SZ_4G |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 82 | |
Tom Rini | 6889412 | 2022-05-12 10:02:06 -0400 | [diff] [blame] | 83 | /* FEC */ |
| 84 | #define CONFIG_FEC_MXC_PHYADDR 0 |
| 85 | #define FEC_QUIRK_ENET_MAC |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 86 | |
Tim Harvey | 2cb156e | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 87 | #endif |