Merge tag 'v2022.04-rc5' into next
[platform/kernel/u-boot.git] / include / configs / imx7-cm.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2021 Ronetix GmbH
4  *
5  * Configuration settings for the Ronetix's iMX7-CM System-on-Module.
6  */
7
8 #ifndef __IMX7_CM_CONFIG_H
9 #define __IMX7_CM_CONFIG_H
10
11 #include "mx7_common.h"
12
13 #define CONFIG_MXC_UART_BASE            UART1_IPS_BASE_ADDR
14
15 #undef CONFIG_SYS_AUTOLOAD
16 #undef CONFIG_EXTRA_ENV_SETTINGS
17
18 /*
19  * Use:
20  *              boot-mode=mix
21  *              boot-mode=sd
22  *              boot-mode=net
23  */
24 #define MY_CONFIG_BOOT_MODE     "boot-mode=sd\0"
25
26 #define CONFIG_EXTRA_ENV_SETTINGS \
27         MY_CONFIG_BOOT_MODE \
28         "image=zImage\0" \
29         "console=ttymxc0\0" \
30         "fdt_file=imx7-cm.dtb\0" \
31         "fdt_addr=0x83000000\0" \
32         "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
33         "mmcpart=1\0" \
34         "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
35         "mmcargs=setenv bootargs console=${console},${baudrate} " \
36                 "root=${mmcroot}\0" \
37                 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
38                 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
39         \
40         "bootsd=" \
41                 "echo Booting from SD card ...; " \
42                 "run mmcargs; " \
43                 "mmc dev ${mmcdev};" \
44                 "run loadimage; " \
45                 "run loadfdt; " \
46                 "bootz ${loadaddr} - ${fdt_addr}; " \
47                 "\0" \
48         \
49         "bootmix=" \
50                 "echo Boot Kernel and FDT from TFTP, RootFs from SD card ...; " \
51                 "run mmcargs; " \
52                 "mmc dev ${mmcdev};" \
53                 "tftp ${fdt_addr} ${fdt_file}; " \
54                 "tftp ${image}; " \
55                 "bootz ${loadaddr} - ${fdt_addr}; " \
56                 "\0" \
57         \
58         "netargs=setenv bootargs console=${console},${baudrate} " \
59                 "root=/dev/nfs " \
60                 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp" \
61                 "\0" \
62         "bootnet=" \
63                 "echo Booting from net ...; " \
64                 "run netargs; " \
65                 "tftp ${image}; " \
66                 "tftp ${fdt_addr} ${fdt_file}; " \
67                 "bootz ${loadaddr} - ${fdt_addr}; " \
68                 "\0"
69
70 /* Physical Memory Map */
71 #define PHYS_SDRAM                                      MMDC0_ARB_BASE_ADDR
72
73 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
74 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
75 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
76
77 #define CONFIG_SYS_INIT_SP_OFFSET \
78         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
79 #define CONFIG_SYS_INIT_SP_ADDR \
80         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
81
82 /* MMC Config*/
83 #define CONFIG_SYS_FSL_ESDHC_ADDR       USDHC1_BASE_ADDR
84 #define CONFIG_SYS_FSL_USDHC_NUM                2
85
86 #define CONFIG_MMCROOT                                  "/dev/mmcblk0p2"  /* USDHC1 */
87
88 /* USB Configs */
89 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
90
91 #define CONFIG_USBD_HS
92
93 /* SPL */
94 #include "imx7_spl.h"
95
96 #endif  /* __CONFIG_H */