1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2022 Marek Vasut <marex@denx.de>
6 #ifndef __IMX8MM_DATA_MODUL_EDM_SBC_H
7 #define __IMX8MM_DATA_MODUL_EDM_SBC_H
9 #include <linux/sizes.h>
10 #include <linux/stringify.h>
11 #include <asm/arch/imx-regs.h>
13 #define CONFIG_SYS_MONITOR_LEN SZ_1M
15 #ifdef CONFIG_SPL_BUILD
16 #define CONFIG_MALLOC_F_ADDR 0x930000
18 /* For RAW image gives a error info not panic */
22 /* Link Definitions */
23 #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
24 #define CONFIG_SYS_INIT_RAM_SIZE 0x200000
26 #define CONFIG_SYS_SDRAM_BASE 0x40000000
27 #define PHYS_SDRAM 0x40000000
28 #define PHYS_SDRAM_SIZE 0x40000000 /* Minimum 1 GiB DDR */
30 #define CONFIG_MXC_UART_BASE UART3_BASE_ADDR
32 /* PHY needs a longer autonegotiation timeout after reset */
33 #define PHY_ANEG_TIMEOUT 20000
36 #define CONFIG_SYS_FSL_USDHC_NUM 2
37 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
39 #define CONFIG_EXTRA_ENV_SETTINGS \
40 "altbootcmd=setenv devpart 2 && run bootcmd ; reset\0" \
44 /* Give slow devices beyond USB HUB chance to come up. */ \
45 "usb_pgood_delay=2000\0" \
47 /* RAM block at DRAM offset 256..768 MiB */ \
48 "ram ram0=ram ram 0x50000000 0x20000000&" \
49 /* 16 MiB SPI NOR */ \
50 "mtd nor0=sf raw 0x0 0x1000000\0" \
52 "sf probe ; " /* Scan for SPI NOR, needed by DFU */ \
53 /* Attempt to start USB and Network console */ \
54 "run dmo_usb_cdc_acm_start ; " \
55 "run dmo_netconsole_start\0" \
57 "setenv dmo_update_env true ; saveenv ; saveenv\0" \
58 "dmo_usb_cdc_acm_start=" \
59 "if test \"${dmo_usb_cdc_acm_enabled}\" = \"true\" ; then "\
60 /* Ungate IMX8MM_CLK_USB1_CTRL_ROOT */ \
61 "mw 0x303844d0 3 ; " \
62 /* Read USBNC_n_PHY_STATUS BIT(4) VBUS_VLD */ \
63 "setexpr.l usbnc_n_phy_status *0x32e4023c \\\\& 0x8 ; " \
64 /* If USB OTG has valid VBUS, enable CDC ACM */ \
65 "if test \"${usbnc_n_phy_status}\" -eq 8 ; then "\
67 "setenv stderr ${stderr},usbacm && " \
68 "setenv stdout ${stdout},usbacm && " \
69 "setenv stdin ${stdin},usbacm ; " \
72 "dmo_netconsole_start=" \
73 "if test \"${dmo_netconsole_enabled}\" = \"true\" ; then "\
74 "setenv autoload false && " \
76 "setenv autoload && " \
77 "setenv ncip ${serverip} && " \
78 "setenv stderr ${stderr},nc && " \
79 "setenv stdout ${stdout},nc && " \
80 "setenv stdin ${stdin},nc ; " \