Merge tag 'u-boot-stm32-20211012' of https://source.denx.de/u-boot/custodians/u-boot-stm
[platform/kernel/u-boot.git] / include / configs / cl-som-imx7.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2015 CompuLab, Ltd.
4  *
5  * Configuration settings for the CompuLab CL-SOM-iMX7 System-on-Module.
6  */
7
8 #ifndef __CL_SOM_IMX7_CONFIG_H
9 #define __CL_SOM_IMX7_CONFIG_H
10
11 #include "mx7_common.h"
12
13 #define CONFIG_MXC_UART_BASE            UART1_IPS_BASE_ADDR
14
15 /* Network */
16 #define CONFIG_FEC_MXC
17 #define CONFIG_FEC_XCV_TYPE             RGMII
18 #define CONFIG_ETHPRIME                 "FEC"
19 #define CONFIG_FEC_MXC_PHYADDR          0
20
21 /* ENET1 */
22 #define IMX_FEC_BASE                    ENET_IPS_BASE_ADDR
23
24 /* PMIC */
25 #define CONFIG_POWER_PFUZE3000
26 #define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08
27
28 #define CONFIG_PCA953X
29 #define CONFIG_SYS_I2C_PCA953X_ADDR     0x20
30 #define CONFIG_SYS_I2C_PCA953X_WIDTH    { {0x20, 16} }
31
32 #undef CONFIG_SYS_AUTOLOAD
33 #undef CONFIG_EXTRA_ENV_SETTINGS
34 #undef CONFIG_BOOTCOMMAND
35
36 #define CONFIG_SYS_AUTOLOAD             "no"
37
38 #define CONFIG_EXTRA_ENV_SETTINGS \
39         "autoload=off\0" \
40         "script=boot.scr\0" \
41         "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
42         "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
43         "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
44         "bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
45         "storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
46         "kernel=zImage\0" \
47         "console=ttymxc0\0" \
48         "fdt_high=0xffffffff\0" \
49         "initrd_high=0xffffffff\0" \
50         "fdtfile=imx7d-sbc-imx7.dtb\0" \
51         "fdtaddr=0x83000000\0" \
52         "mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
53         "usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
54         "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
55         "usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
56         "doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
57         "mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
58         "mmcargs=setenv bootargs console=${console},${baudrate} " \
59                 "root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
60         "mmcbootscript=" \
61                 "if run mmc_config; then " \
62                         "setenv storagetype mmc;" \
63                         "setenv storagedev ${mmcdev}:${mmcpart};" \
64                         "if run loadscript; then " \
65                                 "run bootscript; " \
66                         "fi; " \
67                 "fi;\0" \
68         "mmcboot=" \
69                 "if run mmc_config; then " \
70                         "setenv storagetype mmc;" \
71                         "setenv storagedev ${mmcdev}:${mmcpart};" \
72                         "if run loadkernel; then " \
73                                 "if run loadfdt; then " \
74                                         "run storagebootcmd;" \
75                                 "fi; " \
76                         "fi; " \
77                 "fi;\0" \
78         "sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
79                 "run mmcbootscript\0" \
80         "usbbootscript=setenv usbdev ${usbdev_def}; " \
81                 "setenv storagetype usb;" \
82                 "setenv storagedev ${usbdev}:${usbpart};" \
83                 "if run loadscript; then " \
84                         "run bootscript; " \
85                 "fi; " \
86         "sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
87         "emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
88         "emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
89
90 #define CONFIG_BOOTCOMMAND \
91         "echo SD boot attempt ...; run sdbootscript; run sdboot; " \
92         "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
93         "echo USB boot attempt ...; run usbbootscript; "
94
95 #define CONFIG_SYS_HZ                   1000
96
97 /* Physical Memory Map */
98 #define PHYS_SDRAM                      MMDC0_ARB_BASE_ADDR
99
100 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
101 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
102 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
103
104 #define CONFIG_SYS_INIT_SP_OFFSET \
105         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
106 #define CONFIG_SYS_INIT_SP_ADDR \
107         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
108
109 /* SPI Flash support */
110
111 /* FLASH and environment organization */
112
113 /* MMC Config*/
114 #ifdef CONFIG_FSL_USDHC
115 #define CONFIG_SYS_FSL_ESDHC_ADDR       USDHC1_BASE_ADDR
116
117 #define CONFIG_SYS_FSL_USDHC_NUM        2
118 #define CONFIG_MMCROOT                  "/dev/mmcblk0p2" /* USDHC1 */
119 #endif
120
121 /* USB Configs */
122 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
123 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
124 #define CONFIG_MXC_USB_FLAGS   0
125 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
126
127 /* SPL */
128 #include "imx7_spl.h"
129
130 #endif  /* __CONFIG_H */