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