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