xref: /rk3399_rockchip-uboot/include/configs/apx4devkit.h (revision cb04db155f4e7ccaec1b961d8a84e1a1b9524594)
1 /*
2  * Copyright (C) 2012 Bluegiga Technologies Oy
3  *
4  * Authors:
5  * Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
6  * Lauri Hintsala <lauri.hintsala@bluegiga.com>
7  *
8  * Based on m28evk.h:
9  * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
10  * on behalf of DENX Software Engineering GmbH
11  *
12  * SPDX-License-Identifier:	GPL-2.0+
13  */
14 #ifndef __CONFIGS_APX4DEVKIT_H__
15 #define __CONFIGS_APX4DEVKIT_H__
16 
17 /* System configurations */
18 #define CONFIG_MX28				/* i.MX28 SoC */
19 #define MACH_TYPE_APX4DEVKIT	3712
20 #define CONFIG_MACH_TYPE	MACH_TYPE_APX4DEVKIT
21 
22 /* U-Boot Commands */
23 #define CONFIG_SYS_NO_FLASH
24 #define CONFIG_DISPLAY_CPUINFO
25 #define CONFIG_DOS_PARTITION
26 
27 #define CONFIG_CMD_CACHE
28 #define CONFIG_CMD_DATE
29 #define CONFIG_CMD_EXT2
30 #define CONFIG_CMD_FAT
31 #define CONFIG_CMD_MII
32 #define CONFIG_CMD_MMC
33 #define CONFIG_CMD_NAND
34 
35 /* Memory configuration */
36 #define CONFIG_NR_DRAM_BANKS		1		/* 1 bank of DRAM */
37 #define PHYS_SDRAM_1			0x40000000	/* Base address */
38 #define PHYS_SDRAM_1_SIZE		0x20000000	/* Max 512 MB RAM */
39 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
40 
41 /* Environment */
42 #define CONFIG_ENV_OVERWRITE
43 #define CONFIG_ENV_IS_IN_NAND
44 
45 /* Environment is in MMC */
46 #if defined(CONFIG_CMD_MMC) && defined(CONFIG_ENV_IS_IN_MMC)
47 #define CONFIG_ENV_OFFSET		(256 * 1024)
48 #define CONFIG_ENV_SIZE			(16 * 1024)
49 #define CONFIG_SYS_MMC_ENV_DEV		0
50 #endif
51 
52 /* Environment is in NAND */
53 #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
54 #define CONFIG_ENV_SECT_SIZE		(128 * 1024)
55 #define CONFIG_ENV_SIZE			(128 * 1024)
56 #define CONFIG_ENV_SIZE_REDUND		CONFIG_ENV_SIZE
57 #define CONFIG_ENV_RANGE		(384 * 1024)
58 #define CONFIG_ENV_OFFSET		0x120000
59 #define CONFIG_ENV_OFFSET_REDUND	\
60 		(CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
61 #endif
62 
63 /* UBI and NAND partitioning */
64 #ifdef CONFIG_CMD_NAND
65 #define CONFIG_CMD_UBI
66 #define CONFIG_CMD_UBIFS
67 #define CONFIG_CMD_MTDPARTS
68 #define CONFIG_RBTREE
69 #define CONFIG_LZO
70 #define CONFIG_MTD_DEVICE
71 #define CONFIG_MTD_PARTITIONS
72 #define MTDIDS_DEFAULT			"nand0=gpmi-nand"
73 #define MTDPARTS_DEFAULT \
74 	"mtdparts=gpmi-nand:128k(bootstrap),1024k(boot),768k(env),-(root)"
75 #else
76 #define MTDPARTS_DEFAULT		""
77 #endif
78 
79 /* FEC Ethernet on SoC */
80 #ifdef CONFIG_CMD_NET
81 #define CONFIG_FEC_MXC
82 #define CONFIG_ETHPRIME			"FEC"
83 #define CONFIG_FEC_MXC_PHYADDR		0
84 #define IMX_FEC_BASE			MXS_ENET0_BASE
85 #endif
86 
87 /* USB */
88 #ifdef CONFIG_CMD_USB
89 #define CONFIG_EHCI_MXS_PORT1
90 #define CONFIG_USB_MAX_CONTROLLER_COUNT	1
91 #define CONFIG_USB_STORAGE
92 #endif
93 
94 /* RTC */
95 #ifdef CONFIG_CMD_DATE
96 #define CONFIG_RTC_PCF8563
97 #define CONFIG_SYS_I2C_RTC_ADDR		0x51
98 #endif
99 
100 /* Boot Linux */
101 #define CONFIG_BOOTDELAY		1
102 #define CONFIG_BOOTFILE			"uImage"
103 #define CONFIG_BOOTCOMMAND		"run bootcmd_nand"
104 #define CONFIG_LOADADDR			0x41000000
105 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
106 #define CONFIG_SERIAL_TAG
107 #define CONFIG_REVISION_TAG
108 
109 /* Extra Environments */
110 #define CONFIG_EXTRA_ENV_SETTINGS \
111 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
112 	"verify=no\0" \
113 	"bootcmd=run bootcmd_nand\0" \
114 	"kernelargs=console=tty0 console=ttyAMA0,115200 consoleblank=0\0" \
115 	"bootargs_nand=" \
116 		"setenv bootargs ${kernelargs} ubi.mtd=3,2048 " \
117 		"root=ubi0:rootfs rootfstype=ubifs ${mtdparts} rw\0" \
118 	"bootcmd_nand=" \
119 		"run bootargs_nand && ubi part root 2048 && " \
120 		"ubifsmount ubi:rootfs && ubifsload 41000000 boot/uImage && " \
121 		"bootm 41000000\0" \
122 	"bootargs_mmc=" \
123 		"setenv bootargs ${kernelargs} " \
124 		"root=/dev/mmcblk0p2 rootwait ${mtdparts} rw\0" \
125 	"bootcmd_mmc=" \
126 		"run bootargs_mmc && mmc rescan && " \
127 		"ext2load mmc 0:2 41000000 boot/uImage && bootm 41000000\0" \
128 ""
129 
130 /* The rest of the configuration is shared */
131 #include <configs/mxs.h>
132 
133 #endif /* __CONFIGS_APX4DEVKIT_H__ */
134