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