blob: 7f878b713afa169facb51a7746e153e4a80a0e02 [file] [log] [blame]
Simon Guinot16311a22011-06-17 19:41:33 +05301/*
2 * Copyright (C) 2011 Simon Guinot <sguinot@lacie.com>
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Simon Guinot16311a22011-06-17 19:41:33 +05305 */
6
Simon Guinota35cb4c2011-11-21 19:25:47 +05307#ifndef _CONFIG_LACIE_KW_H
8#define _CONFIG_LACIE_KW_H
Simon Guinot16311a22011-06-17 19:41:33 +05309
10/*
Simon Guinote8f99ff2015-09-01 19:01:02 +020011 * Generic board support
12 */
13#define CONFIG_SYS_GENERIC_BOARD
14
15/*
Simon Guinot16311a22011-06-17 19:41:33 +053016 * Machine number definition
17 */
18#if defined(CONFIG_INETSPACE_V2)
19#define CONFIG_MACH_TYPE MACH_TYPE_INETSPACE_V2
20#define CONFIG_IDENT_STRING " IS v2"
21#elif defined(CONFIG_NETSPACE_V2)
22#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_V2
23#define CONFIG_IDENT_STRING " NS v2"
Simon Guinot13c5ae62012-09-06 10:51:42 +000024#elif defined(CONFIG_NETSPACE_LITE_V2)
25#define MACH_TYPE_NETSPACE_LITE_V2 2983 /* missing in mach-types.h */
26#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_LITE_V2
27#define CONFIG_IDENT_STRING " NS v2 Lite"
28#elif defined(CONFIG_NETSPACE_MINI_V2)
29#define MACH_TYPE_NETSPACE_MINI_V2 2831 /* missing in mach-types.h */
30#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MINI_V2
31#define CONFIG_IDENT_STRING " NS v2 Mini"
Simon Guinot16311a22011-06-17 19:41:33 +053032#elif defined(CONFIG_NETSPACE_MAX_V2)
33#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MAX_V2
34#define CONFIG_IDENT_STRING " NS Max v2"
Simon Guinotcaf09e22012-09-06 10:51:43 +000035#elif defined(CONFIG_D2NET_V2)
36#define CONFIG_MACH_TYPE MACH_TYPE_D2NET_V2
37#define CONFIG_IDENT_STRING " D2 v2"
Simon Guinota35cb4c2011-11-21 19:25:47 +053038#elif defined(CONFIG_NET2BIG_V2)
39#define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2
40#define CONFIG_IDENT_STRING " 2Big v2"
Simon Guinot16311a22011-06-17 19:41:33 +053041#else
42#error "Unknown board"
43#endif
44
45/*
46 * High Level Configuration Options (easy to change)
47 */
48#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
Simon Guinot13c5ae62012-09-06 10:51:42 +000049/* SoC name */
50#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
51#define CONFIG_KW88F6192
52#else
53#define CONFIG_KW88F6281
54#endif
Simon Guinot16311a22011-06-17 19:41:33 +053055#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
56
57/*
58 * Commands configuration
59 */
60#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
Simon Guinot16311a22011-06-17 19:41:33 +053061#define CONFIG_CMD_ENV
62#define CONFIG_CMD_DHCP
63#define CONFIG_CMD_PING
64#define CONFIG_CMD_SF
65#define CONFIG_CMD_I2C
66#define CONFIG_CMD_IDE
Simon Guinot13c5ae62012-09-06 10:51:42 +000067#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot16311a22011-06-17 19:41:33 +053068#define CONFIG_CMD_USB
Simon Guinot13c5ae62012-09-06 10:51:42 +000069#endif
Simon Guinot16311a22011-06-17 19:41:33 +053070
71/*
Simon Guinota35cb4c2011-11-21 19:25:47 +053072 * Core clock definition
Simon Guinot16311a22011-06-17 19:41:33 +053073 */
74#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
75
Simon Guinota35cb4c2011-11-21 19:25:47 +053076/*
77 * SDRAM configuration
78 */
Simon Guinot65e05172011-11-01 16:44:12 +053079#define CONFIG_NR_DRAM_BANKS 1
Simon Guinota35cb4c2011-11-21 19:25:47 +053080
Simon Guinot13c5ae62012-09-06 10:51:42 +000081/*
82 * Different SDRAM configuration and size for some of the boards derived
83 * from the Network Space v2
84 */
85#if defined(CONFIG_INETSPACE_V2)
Masahiro Yamadad6acdf22014-03-11 11:05:17 +090086#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot13c5ae62012-09-06 10:51:42 +000087#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
Masahiro Yamadad6acdf22014-03-11 11:05:17 +090088#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinot65e05172011-11-01 16:44:12 +053089#endif
90
Simon Guinot16311a22011-06-17 19:41:33 +053091/*
92 * mv-common.h should be defined after CMD configs since it used them
93 * to enable certain macros
94 */
Simon Guinot16311a22011-06-17 19:41:33 +053095#include "mv-common.h"
96
97/* Remove or override few declarations from mv-common.h */
98#undef CONFIG_RBTREE
99#undef CONFIG_ENV_SPI_MAX_HZ
100#undef CONFIG_SYS_IDE_MAXBUS
101#undef CONFIG_SYS_IDE_MAXDEVICE
102#undef CONFIG_SYS_PROMPT
103#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
Simon Guinotcaf09e22012-09-06 10:51:43 +0000104#if defined(CONFIG_D2NET_V2)
105#define CONFIG_SYS_PROMPT "d2v2> "
106#elif defined(CONFIG_NET2BIG_V2)
Simon Guinota35cb4c2011-11-21 19:25:47 +0530107#define CONFIG_SYS_PROMPT "2big2> "
108#else
Simon Guinot16311a22011-06-17 19:41:33 +0530109#define CONFIG_SYS_PROMPT "ns2> "
Simon Guinota35cb4c2011-11-21 19:25:47 +0530110#endif
Simon Guinot16311a22011-06-17 19:41:33 +0530111
112/*
Simon Guinot1dd67e62013-06-18 15:14:48 +0200113 * Enable platform initialisation via misc_init_r() function
114 */
115#define CONFIG_MISC_INIT_R
116
117/*
Simon Guinot16311a22011-06-17 19:41:33 +0530118 * Ethernet Driver configuration
119 */
120#ifdef CONFIG_CMD_NET
121#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
122#define CONFIG_NETCONSOLE
123#endif
124
125/*
126 * SATA Driver configuration
127 */
128#ifdef CONFIG_MVSATA_IDE
129#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinotcaf09e22012-09-06 10:51:43 +0000130#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
131 defined(CONFIG_NET2BIG_V2)
Simon Guinot16311a22011-06-17 19:41:33 +0530132#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
Simon Guinot777baa92015-09-03 11:12:20 +0200133#define CONFIG_SYS_IDE_MAXBUS 2
134#define CONFIG_SYS_IDE_MAXDEVICE 2
135#else
136#define CONFIG_SYS_IDE_MAXBUS 1
137#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinot16311a22011-06-17 19:41:33 +0530138#endif
Simon Guinota35cb4c2011-11-21 19:25:47 +0530139#endif /* CONFIG_MVSATA_IDE */
Simon Guinot16311a22011-06-17 19:41:33 +0530140
141/*
142 * Enable GPI0 support
143 */
144#define CONFIG_KIRKWOOD_GPIO
145
146/*
Simon Guinot5aaebab2011-11-01 16:44:12 +0530147 * Enable I2C support
148 */
149#ifdef CONFIG_CMD_I2C
150/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
151#define CONFIG_CMD_EEPROM
152#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
153#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
154#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
Simon Guinot1dd67e62013-06-18 15:14:48 +0200155#if defined(CONFIG_NET2BIG_V2)
156#define CONFIG_SYS_I2C_G762_ADDR 0x3e
157#endif
Simon Guinot5aaebab2011-11-01 16:44:12 +0530158#endif /* CONFIG_CMD_I2C */
159
160/*
Simon Guinot707f5d62012-09-06 10:51:41 +0000161 * Partition support
162 */
163#define CONFIG_DOS_PARTITION
164#define CONFIG_EFI_PARTITION
165
166/*
Simon Guinot16311a22011-06-17 19:41:33 +0530167 * File systems support
168 */
169#define CONFIG_CMD_EXT2
170#define CONFIG_CMD_FAT
171
172/*
173 * Use the HUSH parser
174 */
175#define CONFIG_SYS_HUSH_PARSER
Simon Guinot16311a22011-06-17 19:41:33 +0530176
177/*
178 * Console configuration
179 */
180#define CONFIG_CONSOLE_MUX
181#define CONFIG_SYS_CONSOLE_IS_IN_ENV
182
183/*
184 * Enable device tree support
185 */
186#define CONFIG_OF_LIBFDT
187
188/*
189 * Environment variables configurations
190 */
191#define CONFIG_ENV_IS_IN_SPI_FLASH
192#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
193#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
194#define CONFIG_ENV_ADDR 0x70000
195#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
196
197/*
198 * Default environment variables
199 */
200#define CONFIG_BOOTARGS "console=ttyS0,115200"
201
202#define CONFIG_BOOTCOMMAND \
203 "dhcp && run netconsole; " \
204 "if run usbload || run diskload; then bootm; fi"
205
206#define CONFIG_EXTRA_ENV_SETTINGS \
207 "stdin=serial\0" \
208 "stdout=serial\0" \
209 "stderr=serial\0" \
210 "bootfile=uImage\0" \
211 "loadaddr=0x800000\0" \
212 "autoload=no\0" \
213 "netconsole=" \
214 "set stdin $stdin,nc; " \
215 "set stdout $stdout,nc; " \
216 "set stderr $stderr,nc;\0" \
217 "diskload=ide reset && " \
218 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
219 "usbload=usb start && " \
220 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
221
Simon Guinota35cb4c2011-11-21 19:25:47 +0530222#endif /* _CONFIG_LACIE_KW_H */