blob: 2d2e23a2a9c65f1125ab6a8f84e96b2be0cf35e2 [file] [log] [blame]
Simon Guinot79642092011-06-17 19:41:33 +05301/*
2 * Copyright (C) 2011 Simon Guinot <sguinot@lacie.com>
3 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Simon Guinot79642092011-06-17 19:41:33 +05305 */
6
Simon Guinot77ea0712011-11-21 19:25:47 +05307#ifndef _CONFIG_LACIE_KW_H
8#define _CONFIG_LACIE_KW_H
Simon Guinot79642092011-06-17 19:41:33 +05309
10/*
11 * Machine number definition
12 */
13#if defined(CONFIG_INETSPACE_V2)
14#define CONFIG_MACH_TYPE MACH_TYPE_INETSPACE_V2
15#define CONFIG_IDENT_STRING " IS v2"
16#elif defined(CONFIG_NETSPACE_V2)
17#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_V2
18#define CONFIG_IDENT_STRING " NS v2"
Simon Guinot37235492012-09-06 10:51:42 +000019#elif defined(CONFIG_NETSPACE_LITE_V2)
20#define MACH_TYPE_NETSPACE_LITE_V2 2983 /* missing in mach-types.h */
21#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_LITE_V2
22#define CONFIG_IDENT_STRING " NS v2 Lite"
23#elif defined(CONFIG_NETSPACE_MINI_V2)
24#define MACH_TYPE_NETSPACE_MINI_V2 2831 /* missing in mach-types.h */
25#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MINI_V2
26#define CONFIG_IDENT_STRING " NS v2 Mini"
Simon Guinot79642092011-06-17 19:41:33 +053027#elif defined(CONFIG_NETSPACE_MAX_V2)
28#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MAX_V2
29#define CONFIG_IDENT_STRING " NS Max v2"
Simon Guinotee8f6d22012-09-06 10:51:43 +000030#elif defined(CONFIG_D2NET_V2)
31#define CONFIG_MACH_TYPE MACH_TYPE_D2NET_V2
32#define CONFIG_IDENT_STRING " D2 v2"
Simon Guinot77ea0712011-11-21 19:25:47 +053033#elif defined(CONFIG_NET2BIG_V2)
34#define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2
35#define CONFIG_IDENT_STRING " 2Big v2"
Simon Guinot79642092011-06-17 19:41:33 +053036#else
37#error "Unknown board"
38#endif
39
40/*
41 * High Level Configuration Options (easy to change)
42 */
43#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
Simon Guinot37235492012-09-06 10:51:42 +000044#define CONFIG_KIRKWOOD /* SoC Family Name */
45/* SoC name */
46#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
47#define CONFIG_KW88F6192
48#else
49#define CONFIG_KW88F6281
50#endif
Simon Guinot79642092011-06-17 19:41:33 +053051#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
52
53/*
54 * Commands configuration
55 */
56#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
57#include <config_cmd_default.h>
58#define CONFIG_CMD_ENV
59#define CONFIG_CMD_DHCP
60#define CONFIG_CMD_PING
61#define CONFIG_CMD_SF
62#define CONFIG_CMD_I2C
63#define CONFIG_CMD_IDE
Simon Guinot37235492012-09-06 10:51:42 +000064#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot79642092011-06-17 19:41:33 +053065#define CONFIG_CMD_USB
Simon Guinot37235492012-09-06 10:51:42 +000066#endif
Simon Guinot79642092011-06-17 19:41:33 +053067
68/*
Simon Guinot77ea0712011-11-21 19:25:47 +053069 * Core clock definition
Simon Guinot79642092011-06-17 19:41:33 +053070 */
71#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
72
Simon Guinot77ea0712011-11-21 19:25:47 +053073/*
74 * SDRAM configuration
75 */
Simon Guinotf6979972011-11-01 16:44:12 +053076#define CONFIG_NR_DRAM_BANKS 1
Simon Guinot77ea0712011-11-21 19:25:47 +053077
Simon Guinot37235492012-09-06 10:51:42 +000078/*
79 * Different SDRAM configuration and size for some of the boards derived
80 * from the Network Space v2
81 */
82#if defined(CONFIG_INETSPACE_V2)
Masahiro Yamada4ab3fc52014-03-11 11:05:17 +090083#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot37235492012-09-06 10:51:42 +000084#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
Masahiro Yamada4ab3fc52014-03-11 11:05:17 +090085#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinotf6979972011-11-01 16:44:12 +053086#endif
87
Simon Guinot79642092011-06-17 19:41:33 +053088/*
89 * mv-common.h should be defined after CMD configs since it used them
90 * to enable certain macros
91 */
Simon Guinot79642092011-06-17 19:41:33 +053092#include "mv-common.h"
93
94/* Remove or override few declarations from mv-common.h */
95#undef CONFIG_RBTREE
96#undef CONFIG_ENV_SPI_MAX_HZ
97#undef CONFIG_SYS_IDE_MAXBUS
98#undef CONFIG_SYS_IDE_MAXDEVICE
99#undef CONFIG_SYS_PROMPT
100#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
101#define CONFIG_SYS_IDE_MAXBUS 1
102#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinotee8f6d22012-09-06 10:51:43 +0000103#if defined(CONFIG_D2NET_V2)
104#define CONFIG_SYS_PROMPT "d2v2> "
105#elif defined(CONFIG_NET2BIG_V2)
Simon Guinot77ea0712011-11-21 19:25:47 +0530106#define CONFIG_SYS_PROMPT "2big2> "
107#else
Simon Guinot79642092011-06-17 19:41:33 +0530108#define CONFIG_SYS_PROMPT "ns2> "
Simon Guinot77ea0712011-11-21 19:25:47 +0530109#endif
Simon Guinot79642092011-06-17 19:41:33 +0530110
111/*
Simon Guinot2af4d0f2013-06-18 15:14:48 +0200112 * Enable platform initialisation via misc_init_r() function
113 */
114#define CONFIG_MISC_INIT_R
115
116/*
Simon Guinot79642092011-06-17 19:41:33 +0530117 * Ethernet Driver configuration
118 */
119#ifdef CONFIG_CMD_NET
120#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
121#define CONFIG_NETCONSOLE
122#endif
123
124/*
125 * SATA Driver configuration
126 */
127#ifdef CONFIG_MVSATA_IDE
128#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinotee8f6d22012-09-06 10:51:43 +0000129#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
130 defined(CONFIG_NET2BIG_V2)
Simon Guinot79642092011-06-17 19:41:33 +0530131#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
132#endif
Simon Guinot77ea0712011-11-21 19:25:47 +0530133#endif /* CONFIG_MVSATA_IDE */
Simon Guinot79642092011-06-17 19:41:33 +0530134
135/*
136 * Enable GPI0 support
137 */
138#define CONFIG_KIRKWOOD_GPIO
139
140/*
Simon Guinotc841c122011-11-01 16:44:12 +0530141 * Enable I2C support
142 */
143#ifdef CONFIG_CMD_I2C
144/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
145#define CONFIG_CMD_EEPROM
146#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
147#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
148#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
Simon Guinot2af4d0f2013-06-18 15:14:48 +0200149#if defined(CONFIG_NET2BIG_V2)
150#define CONFIG_SYS_I2C_G762_ADDR 0x3e
151#endif
Simon Guinotc841c122011-11-01 16:44:12 +0530152#endif /* CONFIG_CMD_I2C */
153
154/*
Simon Guinot8e622432012-09-06 10:51:41 +0000155 * Partition support
156 */
157#define CONFIG_DOS_PARTITION
158#define CONFIG_EFI_PARTITION
159
160/*
Simon Guinot79642092011-06-17 19:41:33 +0530161 * File systems support
162 */
163#define CONFIG_CMD_EXT2
164#define CONFIG_CMD_FAT
165
166/*
167 * Use the HUSH parser
168 */
169#define CONFIG_SYS_HUSH_PARSER
Simon Guinot79642092011-06-17 19:41:33 +0530170
171/*
172 * Console configuration
173 */
174#define CONFIG_CONSOLE_MUX
175#define CONFIG_SYS_CONSOLE_IS_IN_ENV
176
177/*
178 * Enable device tree support
179 */
180#define CONFIG_OF_LIBFDT
181
182/*
183 * Environment variables configurations
184 */
185#define CONFIG_ENV_IS_IN_SPI_FLASH
186#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
187#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
188#define CONFIG_ENV_ADDR 0x70000
189#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
190
191/*
192 * Default environment variables
193 */
194#define CONFIG_BOOTARGS "console=ttyS0,115200"
195
196#define CONFIG_BOOTCOMMAND \
197 "dhcp && run netconsole; " \
198 "if run usbload || run diskload; then bootm; fi"
199
200#define CONFIG_EXTRA_ENV_SETTINGS \
201 "stdin=serial\0" \
202 "stdout=serial\0" \
203 "stderr=serial\0" \
204 "bootfile=uImage\0" \
205 "loadaddr=0x800000\0" \
206 "autoload=no\0" \
207 "netconsole=" \
208 "set stdin $stdin,nc; " \
209 "set stdout $stdout,nc; " \
210 "set stderr $stderr,nc;\0" \
211 "diskload=ide reset && " \
212 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
213 "usbload=usb start && " \
214 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
215
Simon Guinot77ea0712011-11-21 19:25:47 +0530216#endif /* _CONFIG_LACIE_KW_H */