xref: /openbmc/u-boot/include/configs/lacie_kw.h (revision 95963679)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2011 Simon Guinot <sguinot@lacie.com>
4  */
5 
6 #ifndef _CONFIG_LACIE_KW_H
7 #define _CONFIG_LACIE_KW_H
8 
9 /*
10  * Machine number definition
11  */
12 #if defined(CONFIG_INETSPACE_V2)
13 #define CONFIG_MACH_TYPE		MACH_TYPE_INETSPACE_V2
14 #elif defined(CONFIG_NETSPACE_V2)
15 #define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_V2
16 #elif defined(CONFIG_NETSPACE_LITE_V2)
17 #define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_LITE_V2
18 #elif defined(CONFIG_NETSPACE_MINI_V2)
19 #define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_MINI_V2
20 #elif defined(CONFIG_NETSPACE_MAX_V2)
21 #define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_MAX_V2
22 #elif defined(CONFIG_D2NET_V2)
23 #define CONFIG_MACH_TYPE		MACH_TYPE_D2NET_V2
24 #elif defined(CONFIG_NET2BIG_V2)
25 #define CONFIG_MACH_TYPE		MACH_TYPE_NET2BIG_V2
26 #else
27 #error "Unknown board"
28 #endif
29 
30 /*
31  * High Level Configuration Options (easy to change)
32  */
33 #define CONFIG_FEROCEON_88FR131		/* CPU Core subversion */
34 /* SoC name */
35 #if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
36 #define CONFIG_KW88F6192
37 #else
38 #define CONFIG_KW88F6281
39 #endif
40 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
41 
42 /*
43  * Core clock definition
44  */
45 #define CONFIG_SYS_TCLK			166000000 /* 166MHz */
46 
47 /*
48  * SDRAM configuration
49  */
50 #define CONFIG_NR_DRAM_BANKS		1
51 
52 /*
53  * Different SDRAM configuration and size for some of the boards derived
54  * from the Network Space v2
55  */
56 #if defined(CONFIG_INETSPACE_V2)
57 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg
58 #elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
59 #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
60 #endif
61 
62 /*
63  * mv-common.h should be defined after CMD configs since it used them
64  * to enable certain macros
65  */
66 #include "mv-common.h"
67 
68 /* Remove or override few declarations from mv-common.h */
69 #undef CONFIG_ENV_SPI_MAX_HZ
70 #undef CONFIG_SYS_IDE_MAXBUS
71 #undef CONFIG_SYS_IDE_MAXDEVICE
72 #define CONFIG_ENV_SPI_MAX_HZ           20000000 /* 20Mhz */
73 
74 /*
75  * Enable platform initialisation via misc_init_r() function
76  */
77 #define CONFIG_MISC_INIT_R
78 
79 /*
80  * Ethernet Driver configuration
81  */
82 #ifdef CONFIG_CMD_NET
83 #define CONFIG_MVGBE_PORTS		{1, 0} /* enable port 0 only */
84 #define CONFIG_NETCONSOLE
85 #endif
86 
87 /*
88  * SATA Driver configuration
89  */
90 #ifdef CONFIG_MVSATA_IDE
91 #define CONFIG_SYS_ATA_IDE0_OFFSET      MV_SATA_PORT0_OFFSET
92 #if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
93 	defined(CONFIG_NET2BIG_V2)
94 #define CONFIG_SYS_ATA_IDE1_OFFSET      MV_SATA_PORT1_OFFSET
95 #define CONFIG_SYS_IDE_MAXBUS           2
96 #define CONFIG_SYS_IDE_MAXDEVICE        2
97 #else
98 #define CONFIG_SYS_IDE_MAXBUS           1
99 #define CONFIG_SYS_IDE_MAXDEVICE        1
100 #endif
101 #endif /* CONFIG_MVSATA_IDE */
102 
103 /*
104  * Enable GPI0 support
105  */
106 #define CONFIG_KIRKWOOD_GPIO
107 
108 /*
109  * Enable I2C support
110  */
111 #ifdef CONFIG_CMD_I2C
112 /* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
113 #define CONFIG_SYS_I2C_EEPROM_ADDR		0x50
114 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	4 /* 16-byte page size */
115 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		1 /* 8-bit device address */
116 #if defined(CONFIG_NET2BIG_V2)
117 #define CONFIG_SYS_I2C_G762_ADDR		0x3e
118 #endif
119 #endif /* CONFIG_CMD_I2C */
120 
121 /*
122  * Partition support
123  */
124 
125 /*
126  * File systems support
127  */
128 
129 /*
130  * Environment variables configurations
131  */
132 #define CONFIG_ENV_SECT_SIZE		0x10000	/* 64KB */
133 #define CONFIG_ENV_SIZE			0x1000	/* 4KB */
134 #define CONFIG_ENV_ADDR			0x70000
135 #define CONFIG_ENV_OFFSET		0x70000	/* env starts here */
136 
137 /*
138  * Default environment variables
139  */
140 #define CONFIG_BOOTCOMMAND					\
141 	"dhcp && run netconsole; "				\
142 	"if run usbload || run diskload; then bootm; fi"
143 
144 #define CONFIG_EXTRA_ENV_SETTINGS				\
145 	"stdin=serial\0"					\
146 	"stdout=serial\0"					\
147 	"stderr=serial\0"					\
148 	"bootfile=uImage\0"					\
149 	"loadaddr=0x800000\0"					\
150 	"autoload=no\0"						\
151 	"netconsole="						\
152 		"set stdin $stdin,nc; "				\
153 		"set stdout $stdout,nc; "			\
154 		"set stderr $stderr,nc;\0"			\
155 	"diskload=ide reset && "				\
156 		"ext2load ide 0:1 $loadaddr /boot/$bootfile\0"	\
157 	"usbload=usb start && "					\
158 		"fatload usb 0:1 $loadaddr /boot/$bootfile\0"
159 
160 #endif /* _CONFIG_LACIE_KW_H */
161