xref: /openbmc/u-boot/include/configs/dns325.h (revision 1878804a)
1 /*
2  * Copyright (C) 2011
3  * Stefan Herbrechtsmeier <stefan@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  * SPDX-License-Identifier:	GPL-2.0+
11  */
12 
13 #ifndef _CONFIG_DNS325_H
14 #define _CONFIG_DNS325_H
15 
16 /*
17  * Machine number definition
18  */
19 #define CONFIG_MACH_TYPE		MACH_TYPE_DNS325
20 
21 /*
22  * High Level Configuration Options (easy to change)
23  */
24 #define CONFIG_FEROCEON_88FR131		/* CPU Core subversion */
25 #define CONFIG_KW88F6281		/* SOC Name */
26 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
27 
28 /*
29  * Commands configuration
30  */
31 #define CONFIG_CMD_ENV
32 #define CONFIG_CMD_NAND
33 #define CONFIG_CMD_IDE
34 #define CONFIG_CMD_DATE
35 #define CONFIG_SYS_MVFS
36 
37 #define CONFIG_NR_DRAM_BANKS		1
38 
39 /*
40  * mv-common.h should be defined after CMD configs since it used them
41  * to enable certain macros
42  */
43 #include "mv-common.h"
44 
45 /* Remove or override few declarations from mv-common.h */
46 
47 /*
48  * Ethernet Driver configuration
49  */
50 #ifdef CONFIG_CMD_NET
51 #define CONFIG_MVGBE_PORTS		{1, 0} /* enable port 0 only */
52 #define CONFIG_NETCONSOLE
53 #endif
54 
55 /*
56  * SATA Driver configuration
57  */
58 #ifdef CONFIG_MVSATA_IDE
59 #define CONFIG_SYS_ATA_IDE0_OFFSET      MV_SATA_PORT0_OFFSET
60 #define CONFIG_SYS_ATA_IDE1_OFFSET      MV_SATA_PORT1_OFFSET
61 #endif
62 
63 /*
64  * RTC driver configuration
65  */
66 #ifdef CONFIG_CMD_DATE
67 #define CONFIG_RTC_MV
68 #endif
69 
70 /*
71  * Enable GPI0 support
72  */
73 #define CONFIG_KIRKWOOD_GPIO
74 
75 /*
76  * Environment variables configurations
77  */
78 #ifdef CONFIG_CMD_NAND
79 #define CONFIG_ENV_IS_IN_NAND
80 #define CONFIG_ENV_SECT_SIZE		0x20000	/* 128KB */
81 #else
82 #define CONFIG_ENV_IS_NOWHERE
83 #endif
84 
85 #define CONFIG_ENV_SIZE			0x20000	/* 128KB */
86 #define CONFIG_ENV_ADDR			0xe0000
87 #define CONFIG_ENV_OFFSET		0xe0000	/* env starts here */
88 
89 /*
90  * Default environment variables
91  */
92 #define MTDIDS_DEFAULT			"nand0=orion_nand"
93 
94 #define MTDPARTS_DEFAULT		"mtdparts=orion_nand:" \
95 	"896k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)\0"
96 
97 #define CONFIG_EXTRA_ENV_SETTINGS \
98 	"stdin=serial\0" \
99 	"stdout=serial\0" \
100 	"stderr=serial\0" \
101 	"loadaddr=0x800000\0" \
102 	"autoload=no\0" \
103 	"console=ttyS0,115200\0" \
104 	"mtdparts="MTDPARTS_DEFAULT \
105 	"optargs=\0" \
106 	"bootenv=uEnv.txt\0" \
107 	"importbootenv=echo Importing environment ...; " \
108 		"env import -t ${loadaddr} ${filesize}\0" \
109 	"loadbootenv=fatload usb 0 ${loadaddr} ${bootenv}\0" \
110 	"setbootargs=setenv bootargs console=${console} " \
111 		"${optargs} " \
112 		"${mtdparts} " \
113 		"root=${bootenvroot} " \
114 		"rootfstype=${bootenvrootfstype}\0" \
115 	"subbootcmd=run setbootargs; " \
116 		"if run bootenvloadimage; then " \
117 			"bootm ${loadaddr};" \
118 		"fi;\0" \
119 	"nandroot=ubi0:rootfs ubi.mtd=rootfs\0" \
120 	"nandrootfstype=ubifs\0" \
121 	"nandloadimage=nand read ${loadaddr} kernel\0" \
122 	"setnandbootenv=echo Booting from nand ...; " \
123 		"setenv bootenvroot ${nandroot}; " \
124 		"setenv bootenvrootfstype ${nandrootfstype}; " \
125 		"setenv bootenvloadimage ${nandloadimage}\0"
126 
127 #define CONFIG_BOOTCOMMAND \
128 	"if test -n ${bootenv} && usb start; then " \
129 		"if run loadbootenv; then " \
130 			"echo Loaded environment ${bootenv} from usb;" \
131 			"run importbootenv;" \
132 		"fi;" \
133 		"if test -n ${bootenvcmd}; then " \
134 			"echo Running bootenvcmd ...;" \
135 			"run bootenvcmd;" \
136 		"fi;" \
137 	"fi;" \
138 	"run setnandbootenv subbootcmd;"
139 
140 #endif /* _CONFIG_DNS325_H */
141