1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2015 CompuLab, Ltd.
5 * Configuration settings for the CompuLab CL-SOM-iMX7 System-on-Module.
8 #ifndef __CL_SOM_IMX7_CONFIG_H
9 #define __CL_SOM_IMX7_CONFIG_H
11 #include "mx7_common.h"
13 #define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
15 /* Size of malloc() pool */
16 #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
19 #define CONFIG_FEC_MXC
20 #define CONFIG_FEC_XCV_TYPE RGMII
21 #define CONFIG_ETHPRIME "FEC"
22 #define CONFIG_FEC_MXC_PHYADDR 0
25 #define IMX_FEC_BASE ENET_IPS_BASE_ADDR
29 #define CONFIG_POWER_I2C
30 #define CONFIG_POWER_PFUZE3000
31 #define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08
34 #define CONFIG_SYS_I2C_MXC
35 #define CONFIG_SYS_I2C_MXC_I2C2 /* Enable I2C bus 2 */
36 #define CONFIG_SYS_I2C_SPEED 100000
38 #define CONFIG_PCA953X
39 #define CONFIG_SYS_I2C_PCA953X_ADDR 0x20
40 #define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} }
42 #undef CONFIG_SYS_AUTOLOAD
43 #undef CONFIG_EXTRA_ENV_SETTINGS
44 #undef CONFIG_BOOTCOMMAND
46 #define CONFIG_SYS_AUTOLOAD "no"
48 #define CONFIG_EXTRA_ENV_SETTINGS \
51 "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
52 "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
53 "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
54 "bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
55 "storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
58 "fdt_high=0xffffffff\0" \
59 "initrd_high=0xffffffff\0" \
60 "fdtfile=imx7d-sbc-imx7.dtb\0" \
61 "fdtaddr=0x83000000\0" \
62 "mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
63 "usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
64 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
65 "usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
66 "doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
67 "mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
68 "mmcargs=setenv bootargs console=${console},${baudrate} " \
69 "root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
71 "if run mmc_config; then " \
72 "setenv storagetype mmc;" \
73 "setenv storagedev ${mmcdev}:${mmcpart};" \
74 "if run loadscript; then " \
79 "if run mmc_config; then " \
80 "setenv storagetype mmc;" \
81 "setenv storagedev ${mmcdev}:${mmcpart};" \
82 "if run loadkernel; then " \
83 "if run loadfdt; then " \
84 "run storagebootcmd;" \
88 "sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
89 "run mmcbootscript\0" \
90 "usbbootscript=setenv usbdev ${usbdev_def}; " \
91 "setenv storagetype usb;" \
92 "setenv storagedev ${usbdev}:${usbpart};" \
93 "if run loadscript; then " \
96 "sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
97 "emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
98 "emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
100 #define CONFIG_BOOTCOMMAND \
101 "echo SD boot attempt ...; run sdbootscript; run sdboot; " \
102 "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
103 "echo USB boot attempt ...; run usbbootscript; "
105 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
106 #define CONFIG_SYS_HZ 1000
108 /* Physical Memory Map */
109 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
111 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
112 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
113 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
115 #define CONFIG_SYS_INIT_SP_OFFSET \
116 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
117 #define CONFIG_SYS_INIT_SP_ADDR \
118 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
120 /* SPI Flash support */
122 /* FLASH and environment organization */
125 #ifdef CONFIG_FSL_USDHC
126 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
128 #define CONFIG_SYS_FSL_USDHC_NUM 2
129 #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
133 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
134 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
135 #define CONFIG_MXC_USB_FLAGS 0
136 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
139 #include "imx7_spl.h"
141 #endif /* __CONFIG_H */