074f5b08fc1a9ff9cef6d1f6cc5004819b32d172
[platform/kernel/u-boot.git] / include / configs / imx8mp_venice.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2022 Gateworks Corporation
4  */
5
6 #ifndef __IMX8MP_VENICE_H
7 #define __IMX8MP_VENICE_H
8
9 #include <asm/arch/imx-regs.h>
10 #include <linux/sizes.h>
11
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
17 #define CONFIG_SPL_BSS_START_ADDR       0x0098FC00
18 #define CONFIG_SYS_SPL_MALLOC_START     0x42200000
19 #define CONFIG_SYS_SPL_MALLOC_SIZE      SZ_512K /* 512 KB */
20
21 /* For RAW image gives a error info not panic */
22 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
23 #endif
24
25 #define MEM_LAYOUT_ENV_SETTINGS \
26         "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
27         "fdt_addr_r=0x50200000\0" \
28         "scriptaddr=0x50280000\0" \
29         "ramdisk_addr_r=0x50300000\0" \
30         "kernel_comp_addr_r=0x40200000\0"
31
32 /* Enable Distro Boot */
33 #ifndef CONFIG_SPL_BUILD
34 #define BOOT_TARGET_DEVICES(func) \
35         func(MMC, mmc, 1) \
36         func(MMC, mmc, 2) \
37         func(USB, usb, 0) \
38         func(DHCP, dhcp, na)
39 #include <config_distro_bootcmd.h>
40 #else
41 #define BOOTENV
42 #endif
43
44 /* Initial environment variables */
45 #define CONFIG_EXTRA_ENV_SETTINGS \
46         BOOTENV \
47         MEM_LAYOUT_ENV_SETTINGS \
48         "script=boot.scr\0" \
49         "bootm_size=0x10000000\0" \
50         "dev=2\0" \
51         "preboot=gsc wd-disable\0" \
52         "console=ttymxc1,115200\0" \
53         "update_firmware=" \
54                 "tftpboot $loadaddr $image && " \
55                 "setexpr blkcnt $filesize + 0x1ff && " \
56                 "setexpr blkcnt $blkcnt / 0x200 && " \
57                 "mmc dev $dev && " \
58                 "mmc write $loadaddr 0x40 $blkcnt\0" \
59         "loadfdt=" \
60                 "if $fsload $fdt_addr_r $dir/$fdt_file1; " \
61                         "then echo loaded $fdt_file1; " \
62                 "elif $fsload $fdt_addr_r $dir/$fdt_file2; " \
63                         "then echo loaded $fdt_file2; " \
64                 "elif $fsload $fdt_addr_r $dir/$fdt_file3; " \
65                         "then echo loaded $fdt_file3; " \
66                 "elif $fsload $fdt_addr_r $dir/$fdt_file4; " \
67                         "then echo loaded $fdt_file4; " \
68                 "elif $fsload $fdt_addr_r $dir/$fdt_file5; " \
69                         "then echo loaded $fdt_file5; " \
70                 "fi\0" \
71         "boot_net=" \
72                 "setenv fsload tftpboot; " \
73                 "run loadfdt && tftpboot $kernel_addr_r $dir/Image && " \
74                 "booti $kernel_addr_r - $fdt_addr_r\0" \
75         "update_rootfs=" \
76                 "tftpboot $loadaddr $image && " \
77                 "gzwrite mmc $dev $loadaddr $filesize 100000 1000000\0" \
78         "update_all=" \
79                 "tftpboot $loadaddr $image && " \
80                 "gzwrite mmc $dev $loadaddr $filesize\0" \
81         "erase_env=mmc dev $dev; mmc erase 0x7f08 0x40\0"
82
83 #define CONFIG_SYS_INIT_RAM_ADDR        0x40000000
84 #define CONFIG_SYS_INIT_RAM_SIZE        SZ_2M
85
86 #define CONFIG_SYS_SDRAM_BASE           0x40000000
87
88 /* SDRAM configuration */
89 #define PHYS_SDRAM                      0x40000000
90 #define PHYS_SDRAM_SIZE                 SZ_4G
91 #define CONFIG_SYS_BOOTM_LEN            SZ_256M
92
93 /* UART */
94 #define CONFIG_MXC_UART_BASE            UART2_BASE_ADDR
95
96 /* FEC */
97 #define FEC_QUIRK_ENET_MAC
98
99 #endif