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