xref: /openbmc/u-boot/include/configs/dns325.h (revision 702e6014)
1 /*
2  * Copyright (C) 2011
3  * Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net>
4  *
5  * Based on Kirkwood support:
6  * (C) Copyright 2009
7  * Marvell Semiconductor <www.marvell.com>
8  * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
9  *
10  * See file CREDITS for list of people who contributed to this
11  * project.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License as
15  * published by the Free Software Foundation; either version 2 of
16  * the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26  * MA 02110-1301 USA
27  */
28 
29 #ifndef _CONFIG_DNS325_H
30 #define _CONFIG_DNS325_H
31 
32 /*
33  * Machine number definition
34  */
35 #define MACH_TYPE_DNS325		3800
36 #define CONFIG_MACH_TYPE		MACH_TYPE_DNS325
37 #define CONFIG_IDENT_STRING		"\nD-Link DNS-325"
38 
39 /*
40  * High Level Configuration Options (easy to change)
41  */
42 #define CONFIG_FEROCEON_88FR131		/* CPU Core subversion */
43 #define CONFIG_KIRKWOOD			/* SOC Family Name */
44 #define CONFIG_KW88F6281		/* SOC Name */
45 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
46 
47 /*
48  * Commands configuration
49  */
50 #define CONFIG_SYS_NO_FLASH		/* Declare no flash (NOR/SPI) */
51 #include <config_cmd_default.h>
52 #define CONFIG_CMD_DHCP
53 #define CONFIG_CMD_ENV
54 #define CONFIG_CMD_NAND
55 #define CONFIG_CMD_PING
56 #define CONFIG_CMD_USB
57 #define CONFIG_CMD_IDE
58 #define CONFIG_CMD_DATE
59 #define CONFIG_SYS_MVFS
60 
61 #define CONFIG_NR_DRAM_BANKS		1
62 
63 /*
64  * mv-common.h should be defined after CMD configs since it used them
65  * to enable certain macros
66  */
67 #include "mv-common.h"
68 
69 /* Remove or override few declarations from mv-common.h */
70 #undef CONFIG_SYS_PROMPT
71 #define CONFIG_SYS_PROMPT		"=> "
72 
73 /*
74  * Ethernet Driver configuration
75  */
76 #ifdef CONFIG_CMD_NET
77 #define CONFIG_MVGBE_PORTS		{1, 0} /* enable port 0 only */
78 #define CONFIG_NETCONSOLE
79 #endif
80 
81 /*
82  * SATA Driver configuration
83  */
84 #ifdef CONFIG_MVSATA_IDE
85 #define CONFIG_SYS_ATA_IDE0_OFFSET      MV_SATA_PORT0_OFFSET
86 #define CONFIG_SYS_ATA_IDE1_OFFSET      MV_SATA_PORT1_OFFSET
87 #endif
88 
89 /*
90  * RTC driver configuration
91  */
92 #ifdef CONFIG_CMD_DATE
93 #define CONFIG_RTC_MV
94 #endif
95 
96 /*
97  * Enable GPI0 support
98  */
99 #define CONFIG_KIRKWOOD_GPIO
100 
101 /*
102  * Use the HUSH parser
103  */
104 #define CONFIG_SYS_HUSH_PARSER
105 
106 /*
107  * Console configuration
108  */
109 #define CONFIG_CONSOLE_MUX
110 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
111 
112 /*
113  * Enable device tree support
114  */
115 #define CONFIG_OF_LIBFDT
116 
117 /*
118  * Display cpu info at boot
119  */
120 #define CONFIG_DISPLAY_CPUINFO
121 
122 /*
123  * Environment variables configurations
124  */
125 #ifdef CONFIG_CMD_NAND
126 #define CONFIG_ENV_IS_IN_NAND
127 #define CONFIG_ENV_SECT_SIZE		0x20000	/* 128KB */
128 #else
129 #define CONFIG_ENV_IS_NOWHERE
130 #endif
131 
132 #define CONFIG_ENV_SIZE			0x20000	/* 128KB */
133 #define CONFIG_ENV_ADDR			0xe0000
134 #define CONFIG_ENV_OFFSET		0xe0000	/* env starts here */
135 
136 /*
137  * Default environment variables
138  */
139 #define MTDIDS_DEFAULT			"nand0=orion_nand"
140 
141 #define MTDPARTS_DEFAULT		"mtdparts=orion_nand:" \
142 	"896k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)\0"
143 
144 #define CONFIG_EXTRA_ENV_SETTINGS \
145 	"stdin=serial\0" \
146 	"stdout=serial\0" \
147 	"stderr=serial\0" \
148 	"loadaddr=0x800000\0" \
149 	"autoload=no\0" \
150 	"console=ttyS0,115200\0" \
151 	"mtdparts="MTDPARTS_DEFAULT \
152 	"optargs=\0" \
153 	"bootenv=uEnv.txt\0" \
154 	"importbootenv=echo Importing environment ...; " \
155 		"env import -t ${loadaddr} ${filesize}\0" \
156 	"loadbootenv=fatload usb 0 ${loadaddr} ${bootenv}\0" \
157 	"setbootargs=setenv bootargs console=${console} " \
158 		"${optargs} " \
159 		"${mtdparts} " \
160 		"root=${bootenvroot} " \
161 		"rootfstype=${bootenvrootfstype}\0" \
162 	"subbootcmd=run setbootargs; " \
163 		"if run bootenvloadimage; then " \
164 			"bootm ${loadaddr};" \
165 		"fi;\0" \
166 	"nandroot=ubi0:rootfs ubi.mtd=rootfs\0" \
167 	"nandrootfstype=ubifs\0" \
168 	"nandloadimage=nand read ${loadaddr} kernel\0" \
169 	"setnandbootenv=echo Booting from nand ...; " \
170 		"setenv bootenvroot ${nandroot}; " \
171 		"setenv bootenvrootfstype ${nandrootfstype}; " \
172 		"setenv bootenvloadimage ${nandloadimage}\0"
173 
174 #define CONFIG_BOOTCOMMAND \
175 	"if test -n ${bootenv} && usb start; then " \
176 		"if run loadbootenv; then " \
177 			"echo Loaded environment ${bootenv} from usb;" \
178 			"run importbootenv;" \
179 		"fi;" \
180 		"if test -n ${bootenvcmd}; then " \
181 			"echo Running bootenvcmd ...;" \
182 			"run bootenvcmd;" \
183 		"fi;" \
184 	"fi;" \
185 	"run setnandbootenv subbootcmd;"
186 
187 #endif /* _CONFIG_DNS325_H */
188