blob: 13015604509134b0a9049fc6ac077f0ec27f897e [file] [log] [blame]
Tim Harvey256dba02021-03-02 14:00:21 -08001/* 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 Harvey256dba02021-03-02 14:00:21 -080012#define CONFIG_SYS_MONITOR_LEN SZ_512K
Tim Harvey256dba02021-03-02 14:00:21 -080013#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 Harvey256dba02021-03-02 14:00:21 -080017/* 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 Harvey256dba02021-03-02 14:00:21 -080020
21#endif
22
23#define MEM_LAYOUT_ENV_SETTINGS \
Tim Harvey6262ee82022-04-13 08:25:10 -070024 "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 Harvey256dba02021-03-02 14:00:21 -080029
Tim Harvey256dba02021-03-02 14:00:21 -080030/* Enable Distro Boot */
Tim Harvey256dba02021-03-02 14:00:21 -080031#define BOOT_TARGET_DEVICES(func) \
32 func(MMC, mmc, 1) \
33 func(MMC, mmc, 2) \
Tim Harveye9302ec2022-04-13 08:42:52 -070034 func(USB, usb, 0) \
35 func(USB, usb, 1) \
Tim Harvey256dba02021-03-02 14:00:21 -080036 func(DHCP, dhcp, na)
37#include <config_distro_bootcmd.h>
Tim Harvey256dba02021-03-02 14:00:21 -080038
39/* Initial environment variables */
40#define CONFIG_EXTRA_ENV_SETTINGS \
41 BOOTENV \
42 MEM_LAYOUT_ENV_SETTINGS \
43 "script=boot.scr\0" \
44 "bootm_size=0x10000000\0" \
Tim Harvey256dba02021-03-02 14:00:21 -080045 "dev=2\0" \
46 "preboot=gsc wd-disable\0" \
47 "console=ttymxc1,115200\0" \
48 "update_firmware=" \
49 "tftpboot $loadaddr $image && " \
50 "setexpr blkcnt $filesize + 0x1ff && " \
51 "setexpr blkcnt $blkcnt / 0x200 && " \
52 "mmc dev $dev && " \
53 "mmc write $loadaddr 0x42 $blkcnt\0" \
Tim Harvey145e3a82022-02-18 15:20:17 -080054 "loadfdt=" \
55 "if $fsload $fdt_addr_r $dir/$fdt_file1; " \
56 "then echo loaded $fdt_file1; " \
57 "elif $fsload $fdt_addr_r $dir/$fdt_file2; " \
58 "then echo loaded $fdt_file2; " \
59 "elif $fsload $fdt_addr_r $dir/$fdt_file3; " \
60 "then echo loaded $fdt_file3; " \
61 "elif $fsload $fdt_addr_r $dir/$fdt_file4; " \
62 "then echo loaded $fdt_file4; " \
63 "elif $fsload $fdt_addr_r $dir/$fdt_file5; " \
64 "then echo loaded $fdt_file5; " \
65 "fi\0" \
Tim Harvey256dba02021-03-02 14:00:21 -080066 "boot_net=" \
Tim Harvey145e3a82022-02-18 15:20:17 -080067 "setenv fsload tftpboot; " \
68 "run loadfdt && tftpboot $kernel_addr_r $dir/Image && " \
69 "booti $kernel_addr_r - $fdt_addr_r\0" \
Tim Harvey256dba02021-03-02 14:00:21 -080070 "update_rootfs=" \
71 "tftpboot $loadaddr $image && " \
72 "gzwrite mmc $dev $loadaddr $filesize 100000 1000000\0" \
73 "update_all=" \
74 "tftpboot $loadaddr $image && " \
75 "gzwrite mmc $dev $loadaddr $filesize\0" \
76 "erase_env=mmc dev $dev; mmc erase 0x7f08 0x40\0"
77
78#define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
79#define CONFIG_SYS_INIT_RAM_SIZE SZ_2M
Tim Harvey256dba02021-03-02 14:00:21 -080080
Tim Harvey256dba02021-03-02 14:00:21 -080081#define CONFIG_SYS_SDRAM_BASE 0x40000000
82
83/* SDRAM configuration */
84#define PHYS_SDRAM 0x40000000
Tim Harvey56c5e312022-03-30 13:39:02 -070085#define PHYS_SDRAM_SIZE SZ_4G
Tim Harvey256dba02021-03-02 14:00:21 -080086
Tom Rinic253f122022-05-12 10:02:06 -040087/* FEC */
88#define CONFIG_FEC_MXC_PHYADDR 0
89#define FEC_QUIRK_ENET_MAC
Tim Harvey256dba02021-03-02 14:00:21 -080090
Tim Harvey256dba02021-03-02 14:00:21 -080091#endif