Tim Harvey | 1a50e74 | 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 | 1a50e74 | 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 | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 17 | /* For RAW image gives a error info not panic */ |
| 18 | #define CONFIG_SPL_ABORT_ON_RAW_IMAGE |
| 19 | #endif |
| 20 | |
| 21 | #define MEM_LAYOUT_ENV_SETTINGS \ |
Tim Harvey | 6262ee8 | 2022-04-13 08:25:10 -0700 | [diff] [blame] | 22 | "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
| 23 | "fdt_addr_r=0x50200000\0" \ |
| 24 | "scriptaddr=0x50280000\0" \ |
| 25 | "ramdisk_addr_r=0x50300000\0" \ |
| 26 | "kernel_comp_addr_r=0x40200000\0" |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 27 | |
| 28 | /* Enable Distro Boot */ |
| 29 | #ifndef CONFIG_SPL_BUILD |
| 30 | #define BOOT_TARGET_DEVICES(func) \ |
| 31 | func(MMC, mmc, 1) \ |
| 32 | func(MMC, mmc, 2) \ |
Tim Harvey | e9302ec | 2022-04-13 08:42:52 -0700 | [diff] [blame] | 33 | func(USB, usb, 0) \ |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 34 | func(DHCP, dhcp, na) |
| 35 | #include <config_distro_bootcmd.h> |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 36 | #else |
| 37 | #define BOOTENV |
| 38 | #endif |
| 39 | |
| 40 | /* Initial environment variables */ |
| 41 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 42 | BOOTENV \ |
| 43 | MEM_LAYOUT_ENV_SETTINGS \ |
| 44 | "script=boot.scr\0" \ |
| 45 | "bootm_size=0x10000000\0" \ |
| 46 | "dev=2\0" \ |
| 47 | "preboot=gsc wd-disable\0" \ |
| 48 | "console=ttymxc1,115200\0" \ |
| 49 | "update_firmware=" \ |
| 50 | "tftpboot $loadaddr $image && " \ |
| 51 | "setexpr blkcnt $filesize + 0x1ff && " \ |
| 52 | "setexpr blkcnt $blkcnt / 0x200 && " \ |
| 53 | "mmc dev $dev && " \ |
| 54 | "mmc write $loadaddr 0x40 $blkcnt\0" \ |
Tim Harvey | 145e3a8 | 2022-02-18 15:20:17 -0800 | [diff] [blame] | 55 | "loadfdt=" \ |
| 56 | "if $fsload $fdt_addr_r $dir/$fdt_file1; " \ |
| 57 | "then echo loaded $fdt_file1; " \ |
| 58 | "elif $fsload $fdt_addr_r $dir/$fdt_file2; " \ |
| 59 | "then echo loaded $fdt_file2; " \ |
| 60 | "elif $fsload $fdt_addr_r $dir/$fdt_file3; " \ |
| 61 | "then echo loaded $fdt_file3; " \ |
| 62 | "elif $fsload $fdt_addr_r $dir/$fdt_file4; " \ |
| 63 | "then echo loaded $fdt_file4; " \ |
| 64 | "elif $fsload $fdt_addr_r $dir/$fdt_file5; " \ |
| 65 | "then echo loaded $fdt_file5; " \ |
| 66 | "fi\0" \ |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 67 | "boot_net=" \ |
Tim Harvey | 145e3a8 | 2022-02-18 15:20:17 -0800 | [diff] [blame] | 68 | "setenv fsload tftpboot; " \ |
| 69 | "run loadfdt && tftpboot $kernel_addr_r $dir/Image && " \ |
| 70 | "booti $kernel_addr_r - $fdt_addr_r\0" \ |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 71 | "update_rootfs=" \ |
| 72 | "tftpboot $loadaddr $image && " \ |
| 73 | "gzwrite mmc $dev $loadaddr $filesize 100000 1000000\0" \ |
| 74 | "update_all=" \ |
| 75 | "tftpboot $loadaddr $image && " \ |
| 76 | "gzwrite mmc $dev $loadaddr $filesize\0" \ |
| 77 | "erase_env=mmc dev $dev; mmc erase 0x7f08 0x40\0" |
| 78 | |
| 79 | #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000 |
| 80 | #define CONFIG_SYS_INIT_RAM_SIZE SZ_2M |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 81 | |
| 82 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 |
| 83 | |
| 84 | /* SDRAM configuration */ |
| 85 | #define PHYS_SDRAM 0x40000000 |
Tim Harvey | 56c5e31 | 2022-03-30 13:39:02 -0700 | [diff] [blame] | 86 | #define PHYS_SDRAM_SIZE SZ_4G |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 87 | #define CONFIG_SYS_BOOTM_LEN SZ_256M |
| 88 | |
| 89 | /* UART */ |
Marek Vasut | 86a2748 | 2022-04-24 23:44:03 +0200 | [diff] [blame] | 90 | #define CONFIG_MXC_UART_BASE UART_BASE_ADDR(2) |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 91 | |
Tom Rini | c253f12 | 2022-05-12 10:02:06 -0400 | [diff] [blame] | 92 | /* FEC */ |
| 93 | #define CONFIG_FEC_MXC_PHYADDR 0 |
| 94 | #define FEC_QUIRK_ENET_MAC |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 95 | |
Tim Harvey | 1a50e74 | 2022-02-11 10:48:56 -0800 | [diff] [blame] | 96 | #endif |