f641f4902dc0b957e98e3449e9047624edc18839
[platform/kernel/u-boot.git] / include / configs / imx8mp_dhcom_pdk2.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2022 Marek Vasut <marex@denx.de>
4  */
5
6 #ifndef __IMX8MP_DHCOM_PDK2_H
7 #define __IMX8MP_DHCOM_PDK2_H
8
9 #include <linux/sizes.h>
10 #include <linux/stringify.h>
11 #include <asm/arch/imx-regs.h>
12
13 #define CONFIG_SYS_BOOTM_LEN            SZ_128M
14
15 #define CONFIG_SYS_MONITOR_LEN          SZ_1M
16
17 #ifdef CONFIG_SPL_BUILD
18 #define CONFIG_SPL_STACK                0x96FC00
19 #define CONFIG_SPL_BSS_START_ADDR       0x0096FC00
20 #define CONFIG_SYS_SPL_MALLOC_START     0x4c000000
21 #define CONFIG_SYS_SPL_MALLOC_SIZE      SZ_512K /* 512 kiB */
22
23 /* For RAW image gives a error info not panic */
24 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
25
26 #endif
27
28 /* Link Definitions */
29 #define CONFIG_SYS_INIT_RAM_ADDR        0x40000000
30 #define CONFIG_SYS_INIT_RAM_SIZE        0x200000
31
32 #define CONFIG_SYS_SDRAM_BASE           0x40000000
33 #define PHYS_SDRAM                      0x40000000
34 #define PHYS_SDRAM_SIZE                 0x20000000 /* Minimum 512 MiB DDR */
35
36 #define CONFIG_MXC_UART_BASE            UART1_BASE_ADDR
37
38 /* PHY needs a longer autonegotiation timeout after reset */
39 #define PHY_ANEG_TIMEOUT                20000
40 #define FEC_QUIRK_ENET_MAC
41
42 /* USDHC */
43 #define CONFIG_SYS_FSL_USDHC_NUM        2
44 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
45
46 #if !defined(CONFIG_SPL_BUILD)
47
48 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
49         "altbootcmd=run bootcmd ; reset\0"                              \
50         "bootlimit=3\0"                                                 \
51         "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0"         \
52         "pxefile_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0"        \
53         "ramdisk_addr_r=0x58000000\0"                                   \
54         "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0"            \
55         /* Give slow devices beyond USB HUB chance to come up. */       \
56         "usb_pgood_delay=2000\0"                                        \
57         "dfu_alt_info="                                                 \
58                 /* RAM block at DRAM offset 256..768 MiB */             \
59                 "ram ram0=ram ram 0x50000000 0x20000000&"               \
60                 /* 16 MiB SPI NOR */                                    \
61                 "mtd nor0=sf raw 0x0 0x1000000\0"                       \
62         "dh_update_env="                                                \
63                 "setenv dh_update_env true ; saveenv ; saveenv\0"       \
64         "dh_update_sf_gen_fcfb="                                        \
65                 "setexpr sfaddr ${loadaddr} - 0x1000 ; "                \
66                 "base ${sfaddr} ; "                                     \
67                 "mw 0 0 0x400 ; "                                       \
68                 "mw 0x400 0x42464346 ; "                                \
69                 "mw 0x404 0x56010000 ; "                                \
70                 "mw 0x40c 00030300 ; "                                  \
71                 "mw 0x444 0x00020101 ; "                                \
72                 "mw 0x450 0x10000000 ; "                                \
73                 "mw 0x480 0x0818040b ; "                                \
74                 "mw 0x484 0x24043008 ; "                                \
75                 "mw 0x5c0 0x100 ; "                                     \
76                 "mw 0x5c4 0x10000 ; "                                   \
77                 "base 0\0"                                              \
78         "dh_update_sf_write_data="                                      \
79                 "setexpr sfaddr ${loadaddr} - 0x1000 ; "                \
80                 "setexpr filesize ${filesize} + 0x1000 ; "              \
81                 "sf probe && sf update ${sfaddr} 0 ${filesize}\0"       \
82         "dh_update_sd_to_sf="                                           \
83                 "load mmc 0:1 ${loadaddr} boot/flash.bin && "           \
84                 "run dh_update_sf_gen_fcfb dh_update_sf_write_data\0"   \
85         "dh_update_emmc_to_sf="                                         \
86                 "load mmc 1:1 ${loadaddr} boot/flash.bin && "           \
87                 "run dh_update_sf_gen_fcfb dh_update_sf_write_data\0"   \
88         BOOTENV
89
90 #define BOOT_TARGET_DEVICES(func)       \
91         func(MMC, mmc, 0)               \
92         func(MMC, mmc, 1)               \
93         func(USB, usb, 0)               \
94         func(DHCP, dhcp, na)
95
96 #include <config_distro_bootcmd.h>
97
98 #endif
99
100 #endif