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