]>
Commit | Line | Data |
---|---|---|
2cb156e1 TH |
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_SPL_MAX_SIZE (148 * 1024) | |
13 | #define CONFIG_SYS_MONITOR_LEN SZ_512K | |
14 | #define CONFIG_SYS_UBOOT_BASE \ | |
15 | (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) | |
16 | ||
17 | #ifdef CONFIG_SPL_BUILD | |
18 | #define CONFIG_SPL_STACK 0x980000 | |
19 | #define CONFIG_SPL_BSS_START_ADDR 0x950000 | |
20 | #define CONFIG_SPL_BSS_MAX_SIZE SZ_8K /* 8 KB */ | |
21 | #define CONFIG_SYS_SPL_MALLOC_START 0x42200000 | |
22 | #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K /* 512 KB */ | |
23 | ||
24 | /* For RAW image gives a error info not panic */ | |
25 | #define CONFIG_SPL_ABORT_ON_RAW_IMAGE | |
26 | #endif | |
27 | ||
28 | #define MEM_LAYOUT_ENV_SETTINGS \ | |
fd5c7173 TH |
29 | "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
30 | "fdt_addr_r=0x50200000\0" \ | |
31 | "scriptaddr=0x50280000\0" \ | |
32 | "ramdisk_addr_r=0x50300000\0" \ | |
33 | "kernel_comp_addr_r=0x40200000\0" | |
2cb156e1 TH |
34 | |
35 | /* Enable Distro Boot */ | |
36 | #ifndef CONFIG_SPL_BUILD | |
37 | #define BOOT_TARGET_DEVICES(func) \ | |
38 | func(MMC, mmc, 1) \ | |
39 | func(MMC, mmc, 2) \ | |
40 | func(DHCP, dhcp, na) | |
41 | #include <config_distro_bootcmd.h> | |
2cb156e1 TH |
42 | #else |
43 | #define BOOTENV | |
44 | #endif | |
45 | ||
46 | /* Initial environment variables */ | |
47 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
48 | BOOTENV \ | |
49 | MEM_LAYOUT_ENV_SETTINGS \ | |
50 | "script=boot.scr\0" \ | |
51 | "bootm_size=0x10000000\0" \ | |
52 | "dev=2\0" \ | |
53 | "preboot=gsc wd-disable\0" \ | |
54 | "console=ttymxc1,115200\0" \ | |
55 | "update_firmware=" \ | |
56 | "tftpboot $loadaddr $image && " \ | |
57 | "setexpr blkcnt $filesize + 0x1ff && " \ | |
58 | "setexpr blkcnt $blkcnt / 0x200 && " \ | |
59 | "mmc dev $dev && " \ | |
60 | "mmc write $loadaddr 0x40 $blkcnt\0" \ | |
f3722dd6 TH |
61 | "loadfdt=" \ |
62 | "if $fsload $fdt_addr_r $dir/$fdt_file1; " \ | |
63 | "then echo loaded $fdt_file1; " \ | |
64 | "elif $fsload $fdt_addr_r $dir/$fdt_file2; " \ | |
65 | "then echo loaded $fdt_file2; " \ | |
66 | "elif $fsload $fdt_addr_r $dir/$fdt_file3; " \ | |
67 | "then echo loaded $fdt_file3; " \ | |
68 | "elif $fsload $fdt_addr_r $dir/$fdt_file4; " \ | |
69 | "then echo loaded $fdt_file4; " \ | |
70 | "elif $fsload $fdt_addr_r $dir/$fdt_file5; " \ | |
71 | "then echo loaded $fdt_file5; " \ | |
72 | "fi\0" \ | |
2cb156e1 | 73 | "boot_net=" \ |
f3722dd6 TH |
74 | "setenv fsload tftpboot; " \ |
75 | "run loadfdt && tftpboot $kernel_addr_r $dir/Image && " \ | |
76 | "booti $kernel_addr_r - $fdt_addr_r\0" \ | |
2cb156e1 TH |
77 | "update_rootfs=" \ |
78 | "tftpboot $loadaddr $image && " \ | |
79 | "gzwrite mmc $dev $loadaddr $filesize 100000 1000000\0" \ | |
80 | "update_all=" \ | |
81 | "tftpboot $loadaddr $image && " \ | |
82 | "gzwrite mmc $dev $loadaddr $filesize\0" \ | |
83 | "erase_env=mmc dev $dev; mmc erase 0x7f08 0x40\0" | |
84 | ||
85 | #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000 | |
86 | #define CONFIG_SYS_INIT_RAM_SIZE SZ_2M | |
87 | #define CONFIG_SYS_INIT_SP_OFFSET \ | |
88 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
89 | #define CONFIG_SYS_INIT_SP_ADDR \ | |
90 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) | |
91 | ||
92 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 | |
93 | ||
94 | /* SDRAM configuration */ | |
95 | #define PHYS_SDRAM 0x40000000 | |
52ae8d6c | 96 | #define PHYS_SDRAM_SIZE SZ_4G |
2cb156e1 TH |
97 | #define CONFIG_SYS_BOOTM_LEN SZ_256M |
98 | ||
99 | /* UART */ | |
100 | #define CONFIG_MXC_UART_BASE UART2_BASE_ADDR | |
101 | ||
102 | /* Monitor Command Prompt */ | |
103 | #define CONFIG_SYS_CBSIZE SZ_2K | |
104 | #define CONFIG_SYS_MAXARGS 64 | |
105 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE | |
106 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ | |
107 | sizeof(CONFIG_SYS_PROMPT) + 16) | |
108 | /* USDHC */ | |
109 | #define CONFIG_SYS_FSL_USDHC_NUM 2 | |
110 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 | |
111 | ||
112 | /* FEC */ | |
2cb156e1 TH |
113 | #define CONFIG_FEC_MXC_PHYADDR 0 |
114 | #define FEC_QUIRK_ENET_MAC | |
115 | ||
116 | #endif |