blob: e3c1191817809a4c909b02a642c8816e10870e80 [file] [log] [blame]
Stefano Babic99d51c52017-07-26 18:23:05 +02001/*
2 * Copyright (C) Stefano Babic <sbabic@denx.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7
8#ifndef __PCM058_CONFIG_H
9#define __PCM058_CONFIG_H
10
Stefano Babic99d51c52017-07-26 18:23:05 +020011#ifdef CONFIG_SPL
12#define CONFIG_SPL_SPI_LOAD
13#define CONFIG_SYS_SPI_U_BOOT_OFFS (64 * 1024)
14#include "imx6_spl.h"
15#endif
16
17#include "mx6_common.h"
18
19/* Thermal */
20#define CONFIG_IMX_THERMAL
21
22/* Serial */
23#define CONFIG_MXC_UART
24#define CONFIG_MXC_UART_BASE UART4_BASE
25#define CONSOLE_DEV "ttymxc3"
26
27/* Early setup */
Stefano Babic99d51c52017-07-26 18:23:05 +020028
29
30/* Size of malloc() pool */
31#define CONFIG_SYS_MALLOC_LEN (8 * SZ_1M)
32
33/* Ethernet */
Stefano Babic99d51c52017-07-26 18:23:05 +020034#define CONFIG_MII
35#define IMX_FEC_BASE ENET_BASE_ADDR
36#define CONFIG_FEC_XCV_TYPE RGMII
37#define CONFIG_ETHPRIME "FEC"
38#define CONFIG_FEC_MXC_PHYADDR 3
39
Stefano Babic99d51c52017-07-26 18:23:05 +020040/* SPI Flash */
Stefano Babic99d51c52017-07-26 18:23:05 +020041#define CONFIG_SF_DEFAULT_BUS 2
42#define CONFIG_SF_DEFAULT_CS 0
43#define CONFIG_SF_DEFAULT_SPEED 20000000
44#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
45
46/* I2C Configs */
47#define CONFIG_SYS_I2C
48#define CONFIG_SYS_I2C_MXC
49#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 0 */
50#define CONFIG_SYS_I2C_SPEED 100000
51
52#ifndef CONFIG_SPL_BUILD
53#define CONFIG_CMD_NAND
54/* Enable NAND support */
55#define CONFIG_CMD_NAND_TRIMFFS
Stefano Babic99d51c52017-07-26 18:23:05 +020056#define CONFIG_SYS_MAX_NAND_DEVICE 1
57#define CONFIG_SYS_NAND_BASE 0x40000000
58#define CONFIG_SYS_NAND_5_ADDR_CYCLE
59#define CONFIG_SYS_NAND_ONFI_DETECTION
60#endif
61
62/* DMA stuff, needed for GPMI/MXS NAND support */
Stefano Babic99d51c52017-07-26 18:23:05 +020063
64/* Filesystem support */
65#define CONFIG_MTD_PARTITIONS
66#define CONFIG_MTD_DEVICE
Stefano Babic99d51c52017-07-26 18:23:05 +020067
68/* Various command support */
69
70/* Physical Memory Map */
71#define CONFIG_NR_DRAM_BANKS 1
72#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
73
74#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
75#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
76#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
77
78#define CONFIG_SYS_INIT_SP_OFFSET \
79 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
80#define CONFIG_SYS_INIT_SP_ADDR \
81 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
82
83/* MMC Configs */
84#define CONFIG_SYS_FSL_ESDHC_ADDR 0
85#define CONFIG_SYS_FSL_USDHC_NUM 2
86
87/* Environment organization */
88#define CONFIG_ENV_IS_IN_SPI_FLASH
89#define CONFIG_ENV_SIZE (16 * 1024)
90#define CONFIG_ENV_OFFSET (1024 * SZ_1K)
91#define CONFIG_ENV_SECT_SIZE (64 * SZ_1K)
92#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
93#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
94#define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
95#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
96#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
97#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
98 CONFIG_ENV_SECT_SIZE)
99#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
100
101#ifdef CONFIG_ENV_IS_IN_NAND
102#define CONFIG_ENV_OFFSET (0x1E0000)
103#define CONFIG_ENV_SECT_SIZE (128 * SZ_1K)
104#endif
105
106/* Default environment */
107#define CONFIG_EXTRA_ENV_SETTINGS \
108 "addcons=setenv bootargs ${bootargs} " \
109 "console=${console},${baudrate}\0" \
110 "addip=setenv bootargs ${bootargs} " \
111 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
112 "${netmask}:${hostname}:${netdev}:off\0" \
113 "addmisc=setenv bootargs ${bootargs} ${miscargs}\0" \
114 "addmtd=run mtdnand;run mtdspi;" \
115 "setenv bootargs ${bootargs} ${mtdparts}\0" \
116 "mtdnand=setenv mtdparts mtdparts=gpmi-nand:" \
117 "40m(Kernels),400m(root),-(nand)\0" \
118 "mtdspi=setenv mtdparts ${mtdparts}" \
119 "';spi2.0:1024k(bootloader)," \
120 "64k(env1),64k(env2),-(rescue)'\0" \
121 "bootcmd=if test -n ${rescue};" \
122 "then run swupdate;fi;run nandboot;run swupdate\0" \
123 "bootfile=uImage\0" \
124 "bootimage=uImage\0" \
125 "console=ttymxc3\0" \
126 "fdt_addr_r=0x18000000\0" \
127 "fdt_file=pfla02.dtb\0" \
128 "fdt_high=0xffffffff\0" \
129 "initrd_high=0xffffffff\0" \
130 "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
131 "miscargs=panic=1 quiet\0" \
132 "mmcargs=setenv bootargs root=${mmcroot} rw rootwait\0" \
133 "mmcboot=if run mmcload;then " \
134 "run mmcargs addcons addmisc;" \
135 "bootm;fi\0" \
136 "mmcload=mmc rescan;" \
137 "load mmc 0:${mmcpart} ${kernel_addr_r} boot/fitImage\0"\
138 "mmcpart=1\0" \
139 "mmcroot=/dev/mmcblk0p1\0" \
140 "ubiroot=1\0" \
141 "nandargs=setenv bootargs ubi.mtd=1 " \
142 "root=ubi0:rootfs${ubiroot} rootfstype=ubifs\0" \
143 "nandboot=run mtdnand;ubi part nand0,0;" \
144 "ubi readvol ${kernel_addr_r} kernel${ubiroot};" \
145 "run nandargs addip addcons addmtd addmisc;" \
146 "bootm ${kernel_addr_r}\0" \
147 "net_nfs=tftp ${kernel_addr_r} ${board_name}/${bootfile};" \
148 "tftp ${fdt_addr_r} ${board_name}/${fdt_file};" \
149 "run nfsargs addip addcons addmtd addmisc;" \
150 "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \
151 "net_nfs_fit=tftp ${kernel_addr_r} ${board_name}/${fitfile};" \
152 "run nfsargs addip addcons addmtd addmisc;" \
153 "bootm ${kernel_addr_r}\0" \
154 "nfsargs=setenv bootargs root=/dev/nfs" \
155 " nfsroot=${serverip}:${nfsroot},v3 panic=1\0" \
156 "swupdate=setenv bootargs root=/dev/ram;" \
157 "run addip addcons addmtd addmisc;" \
158 "sf probe;" \
159 "sf read ${kernel_addr_r} 120000 600000;" \
160 "sf read 14000000 730000 800000;" \
161 "bootm ${kernel_addr_r} 14000000\0"
162
163#endif