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