blob: d47bdd228d6a30b1b6a84323ddcce3ac035c8b0c [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Ilya Ledvich69632042017-09-24 09:00:25 +03002/*
3 * Copyright (C) 2015 CompuLab, Ltd.
4 *
5 * Configuration settings for the CompuLab CL-SOM-iMX7 System-on-Module.
Ilya Ledvich69632042017-09-24 09:00:25 +03006 */
7
8#ifndef __CL_SOM_IMX7_CONFIG_H
9#define __CL_SOM_IMX7_CONFIG_H
10
11#include "mx7_common.h"
12
Ilya Ledvich69632042017-09-24 09:00:25 +030013#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
14
15/* Size of malloc() pool */
16#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
17
18#define CONFIG_BOARD_LATE_INIT
19
Ilya Ledvich69632042017-09-24 09:00:25 +030020/* Network */
21#define CONFIG_FEC_MXC
Ilya Ledvich69632042017-09-24 09:00:25 +030022#define CONFIG_FEC_XCV_TYPE RGMII
23#define CONFIG_ETHPRIME "FEC"
24#define CONFIG_FEC_MXC_PHYADDR 0
25
Ilya Ledvich69632042017-09-24 09:00:25 +030026/* ENET1 */
27#define IMX_FEC_BASE ENET_IPS_BASE_ADDR
28
29/* PMIC */
30#define CONFIG_POWER
31#define CONFIG_POWER_I2C
32#define CONFIG_POWER_PFUZE3000
33#define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08
34
Ilya Ledvich69632042017-09-24 09:00:25 +030035/* I2C configs */
36#define CONFIG_SYS_I2C
37#define CONFIG_SYS_I2C_MXC
38#define CONFIG_SYS_I2C_MXC_I2C2 /* Enable I2C bus 2 */
39#define CONFIG_SYS_I2C_SPEED 100000
40#define SYS_I2C_BUS_SOM 0
41
42#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
43#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
44#define CONFIG_SYS_I2C_EEPROM_BUS SYS_I2C_BUS_SOM
45
46#define CONFIG_PCA953X
47#define CONFIG_CMD_PCA953X
48#define CONFIG_SYS_I2C_PCA953X_ADDR 0x20
49#define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} }
50
51#undef CONFIG_SYS_AUTOLOAD
52#undef CONFIG_EXTRA_ENV_SETTINGS
53#undef CONFIG_BOOTCOMMAND
Ilya Ledvich69632042017-09-24 09:00:25 +030054
Ilya Ledvich69632042017-09-24 09:00:25 +030055#define CONFIG_SYS_AUTOLOAD "no"
56
57#define CONFIG_EXTRA_ENV_SETTINGS \
58 "autoload=off\0" \
59 "script=boot.scr\0" \
60 "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
61 "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
62 "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
63 "bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
64 "storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
65 "kernel=zImage\0" \
66 "console=ttymxc0\0" \
67 "fdt_high=0xffffffff\0" \
68 "initrd_high=0xffffffff\0" \
69 "fdtfile=imx7d-sbc-imx7.dtb\0" \
70 "fdtaddr=0x83000000\0" \
71 "mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
72 "usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
73 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
74 "usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
75 "doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
76 "mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
77 "mmcargs=setenv bootargs console=${console},${baudrate} " \
78 "root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
79 "mmcbootscript=" \
80 "if run mmc_config; then " \
81 "setenv storagetype mmc;" \
82 "setenv storagedev ${mmcdev}:${mmcpart};" \
83 "if run loadscript; then " \
84 "run bootscript; " \
85 "fi; " \
86 "fi;\0" \
87 "mmcboot=" \
88 "if run mmc_config; then " \
89 "setenv storagetype mmc;" \
90 "setenv storagedev ${mmcdev}:${mmcpart};" \
91 "if run loadkernel; then " \
92 "if run loadfdt; then " \
93 "run storagebootcmd;" \
94 "fi; " \
95 "fi; " \
96 "fi;\0" \
97 "sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
98 "run mmcbootscript\0" \
99 "usbbootscript=setenv usbdev ${usbdev_def}; " \
100 "setenv storagetype usb;" \
101 "setenv storagedev ${usbdev}:${usbpart};" \
102 "if run loadscript; then " \
103 "run bootscript; " \
104 "fi; " \
105 "sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
106 "emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
107 "emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
108
109#define CONFIG_BOOTCOMMAND \
110 "echo SD boot attempt ...; run sdbootscript; run sdboot; " \
111 "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
112 "echo USB boot attempt ...; run usbbootscript; "
113
114#define CONFIG_SYS_MEMTEST_START 0x80000000
115#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x20000000)
116
117#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
118#define CONFIG_SYS_HZ 1000
119
120/* Physical Memory Map */
Ilya Ledvich69632042017-09-24 09:00:25 +0300121#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
122
123#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
124#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
125#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
126
127#define CONFIG_SYS_INIT_SP_OFFSET \
128 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
129#define CONFIG_SYS_INIT_SP_ADDR \
130 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
131
132/* SPI Flash support */
Ilya Ledvich69632042017-09-24 09:00:25 +0300133
134/* FLASH and environment organization */
Ilya Ledvich69632042017-09-24 09:00:25 +0300135
136/* MMC Config*/
Ilya Ledvich69632042017-09-24 09:00:25 +0300137#ifdef CONFIG_FSL_USDHC
138#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
139
140#define CONFIG_SYS_FSL_USDHC_NUM 2
141#define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
Ilya Ledvich69632042017-09-24 09:00:25 +0300142#endif
143
144/* USB Configs */
145#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
146#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
147#define CONFIG_MXC_USB_FLAGS 0
148#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
149
150/* Uncomment to enable iMX thermal driver support */
151/*#define CONFIG_IMX_THERMAL*/
152
153/* SPL */
154#include "imx7_spl.h"
Ilya Ledvich69632042017-09-24 09:00:25 +0300155
156#endif /* __CONFIG_H */