blob: 9a169351a3a05adc7c72dee6b3097968949c41e6 [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 */
Stefano Babic83605d32017-07-26 18:23:05 +020077#define CONFIG_ENV_SIZE (16 * 1024)
78#define CONFIG_ENV_OFFSET (1024 * SZ_1K)
79#define CONFIG_ENV_SECT_SIZE (64 * SZ_1K)
Stefano Babic83605d32017-07-26 18:23:05 +020080#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
81 CONFIG_ENV_SECT_SIZE)
82#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
83
84#ifdef CONFIG_ENV_IS_IN_NAND
85#define CONFIG_ENV_OFFSET (0x1E0000)
86#define CONFIG_ENV_SECT_SIZE (128 * SZ_1K)
87#endif
88
89/* Default environment */
90#define CONFIG_EXTRA_ENV_SETTINGS \
91 "addcons=setenv bootargs ${bootargs} " \
92 "console=${console},${baudrate}\0" \
93 "addip=setenv bootargs ${bootargs} " \
94 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
95 "${netmask}:${hostname}:${netdev}:off\0" \
96 "addmisc=setenv bootargs ${bootargs} ${miscargs}\0" \
97 "addmtd=run mtdnand;run mtdspi;" \
98 "setenv bootargs ${bootargs} ${mtdparts}\0" \
99 "mtdnand=setenv mtdparts mtdparts=gpmi-nand:" \
100 "40m(Kernels),400m(root),-(nand)\0" \
101 "mtdspi=setenv mtdparts ${mtdparts}" \
102 "';spi2.0:1024k(bootloader)," \
103 "64k(env1),64k(env2),-(rescue)'\0" \
104 "bootcmd=if test -n ${rescue};" \
105 "then run swupdate;fi;run nandboot;run swupdate\0" \
106 "bootfile=uImage\0" \
107 "bootimage=uImage\0" \
108 "console=ttymxc3\0" \
109 "fdt_addr_r=0x18000000\0" \
110 "fdt_file=pfla02.dtb\0" \
111 "fdt_high=0xffffffff\0" \
112 "initrd_high=0xffffffff\0" \
113 "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
114 "miscargs=panic=1 quiet\0" \
115 "mmcargs=setenv bootargs root=${mmcroot} rw rootwait\0" \
116 "mmcboot=if run mmcload;then " \
117 "run mmcargs addcons addmisc;" \
118 "bootm;fi\0" \
119 "mmcload=mmc rescan;" \
120 "load mmc 0:${mmcpart} ${kernel_addr_r} boot/fitImage\0"\
121 "mmcpart=1\0" \
122 "mmcroot=/dev/mmcblk0p1\0" \
123 "ubiroot=1\0" \
124 "nandargs=setenv bootargs ubi.mtd=1 " \
125 "root=ubi0:rootfs${ubiroot} rootfstype=ubifs\0" \
126 "nandboot=run mtdnand;ubi part nand0,0;" \
127 "ubi readvol ${kernel_addr_r} kernel${ubiroot};" \
128 "run nandargs addip addcons addmtd addmisc;" \
129 "bootm ${kernel_addr_r}\0" \
130 "net_nfs=tftp ${kernel_addr_r} ${board_name}/${bootfile};" \
131 "tftp ${fdt_addr_r} ${board_name}/${fdt_file};" \
132 "run nfsargs addip addcons addmtd addmisc;" \
133 "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \
134 "net_nfs_fit=tftp ${kernel_addr_r} ${board_name}/${fitfile};" \
135 "run nfsargs addip addcons addmtd addmisc;" \
136 "bootm ${kernel_addr_r}\0" \
137 "nfsargs=setenv bootargs root=/dev/nfs" \
138 " nfsroot=${serverip}:${nfsroot},v3 panic=1\0" \
139 "swupdate=setenv bootargs root=/dev/ram;" \
140 "run addip addcons addmtd addmisc;" \
141 "sf probe;" \
142 "sf read ${kernel_addr_r} 120000 600000;" \
143 "sf read 14000000 730000 800000;" \
144 "bootm ${kernel_addr_r} 14000000\0"
145
146#endif