blob: e2b3b21182f32ab8229bd84fc125b79d5f944b3b [file] [log] [blame]
Simon Guinot79642092011-06-17 19:41:33 +05301/*
2 * Copyright (C) 2011 Simon Guinot <sguinot@lacie.com>
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
Simon Guinot77ea0712011-11-21 19:25:47 +053018#ifndef _CONFIG_LACIE_KW_H
19#define _CONFIG_LACIE_KW_H
Simon Guinot79642092011-06-17 19:41:33 +053020
21/*
22 * Machine number definition
23 */
24#if defined(CONFIG_INETSPACE_V2)
25#define CONFIG_MACH_TYPE MACH_TYPE_INETSPACE_V2
26#define CONFIG_IDENT_STRING " IS v2"
27#elif defined(CONFIG_NETSPACE_V2)
28#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_V2
29#define CONFIG_IDENT_STRING " NS v2"
Simon Guinot37235492012-09-06 10:51:42 +000030#elif defined(CONFIG_NETSPACE_LITE_V2)
31#define MACH_TYPE_NETSPACE_LITE_V2 2983 /* missing in mach-types.h */
32#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_LITE_V2
33#define CONFIG_IDENT_STRING " NS v2 Lite"
34#elif defined(CONFIG_NETSPACE_MINI_V2)
35#define MACH_TYPE_NETSPACE_MINI_V2 2831 /* missing in mach-types.h */
36#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MINI_V2
37#define CONFIG_IDENT_STRING " NS v2 Mini"
Simon Guinot79642092011-06-17 19:41:33 +053038#elif defined(CONFIG_NETSPACE_MAX_V2)
39#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MAX_V2
40#define CONFIG_IDENT_STRING " NS Max v2"
Simon Guinotee8f6d22012-09-06 10:51:43 +000041#elif defined(CONFIG_D2NET_V2)
42#define CONFIG_MACH_TYPE MACH_TYPE_D2NET_V2
43#define CONFIG_IDENT_STRING " D2 v2"
Simon Guinot77ea0712011-11-21 19:25:47 +053044#elif defined(CONFIG_NET2BIG_V2)
45#define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2
46#define CONFIG_IDENT_STRING " 2Big v2"
Simon Guinot79642092011-06-17 19:41:33 +053047#else
48#error "Unknown board"
49#endif
50
51/*
52 * High Level Configuration Options (easy to change)
53 */
54#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
Simon Guinot37235492012-09-06 10:51:42 +000055#define CONFIG_KIRKWOOD /* SoC Family Name */
56/* SoC name */
57#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
58#define CONFIG_KW88F6192
59#else
60#define CONFIG_KW88F6281
61#endif
Simon Guinot79642092011-06-17 19:41:33 +053062#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
63
64/*
65 * Commands configuration
66 */
67#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
68#include <config_cmd_default.h>
69#define CONFIG_CMD_ENV
70#define CONFIG_CMD_DHCP
71#define CONFIG_CMD_PING
72#define CONFIG_CMD_SF
73#define CONFIG_CMD_I2C
74#define CONFIG_CMD_IDE
Simon Guinot37235492012-09-06 10:51:42 +000075#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot79642092011-06-17 19:41:33 +053076#define CONFIG_CMD_USB
Simon Guinot37235492012-09-06 10:51:42 +000077#endif
Simon Guinot79642092011-06-17 19:41:33 +053078
79/*
Simon Guinot77ea0712011-11-21 19:25:47 +053080 * Core clock definition
Simon Guinot79642092011-06-17 19:41:33 +053081 */
82#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
83
Simon Guinot77ea0712011-11-21 19:25:47 +053084/*
85 * SDRAM configuration
86 */
Simon Guinotf6979972011-11-01 16:44:12 +053087#define CONFIG_NR_DRAM_BANKS 1
Simon Guinot77ea0712011-11-21 19:25:47 +053088
Simon Guinot37235492012-09-06 10:51:42 +000089/*
90 * Different SDRAM configuration and size for some of the boards derived
91 * from the Network Space v2
92 */
93#if defined(CONFIG_INETSPACE_V2)
Simon Guinotd92151b2012-06-05 13:15:59 +000094#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot37235492012-09-06 10:51:42 +000095#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
96#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinotf6979972011-11-01 16:44:12 +053097#endif
98
Simon Guinot79642092011-06-17 19:41:33 +053099/*
100 * mv-common.h should be defined after CMD configs since it used them
101 * to enable certain macros
102 */
Simon Guinot79642092011-06-17 19:41:33 +0530103#include "mv-common.h"
104
105/* Remove or override few declarations from mv-common.h */
106#undef CONFIG_RBTREE
107#undef CONFIG_ENV_SPI_MAX_HZ
108#undef CONFIG_SYS_IDE_MAXBUS
109#undef CONFIG_SYS_IDE_MAXDEVICE
110#undef CONFIG_SYS_PROMPT
111#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
112#define CONFIG_SYS_IDE_MAXBUS 1
113#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinotee8f6d22012-09-06 10:51:43 +0000114#if defined(CONFIG_D2NET_V2)
115#define CONFIG_SYS_PROMPT "d2v2> "
116#elif defined(CONFIG_NET2BIG_V2)
Simon Guinot77ea0712011-11-21 19:25:47 +0530117#define CONFIG_SYS_PROMPT "2big2> "
118#else
Simon Guinot79642092011-06-17 19:41:33 +0530119#define CONFIG_SYS_PROMPT "ns2> "
Simon Guinot77ea0712011-11-21 19:25:47 +0530120#endif
Simon Guinot79642092011-06-17 19:41:33 +0530121
122/*
Simon Guinot2af4d0f2013-06-18 15:14:48 +0200123 * Enable platform initialisation via misc_init_r() function
124 */
125#define CONFIG_MISC_INIT_R
126
127/*
Simon Guinot79642092011-06-17 19:41:33 +0530128 * Ethernet Driver configuration
129 */
130#ifdef CONFIG_CMD_NET
131#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
132#define CONFIG_NETCONSOLE
133#endif
134
135/*
136 * SATA Driver configuration
137 */
138#ifdef CONFIG_MVSATA_IDE
139#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinotee8f6d22012-09-06 10:51:43 +0000140#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
141 defined(CONFIG_NET2BIG_V2)
Simon Guinot79642092011-06-17 19:41:33 +0530142#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
143#endif
Simon Guinot77ea0712011-11-21 19:25:47 +0530144#endif /* CONFIG_MVSATA_IDE */
Simon Guinot79642092011-06-17 19:41:33 +0530145
146/*
147 * Enable GPI0 support
148 */
149#define CONFIG_KIRKWOOD_GPIO
150
151/*
Simon Guinotc841c122011-11-01 16:44:12 +0530152 * Enable I2C support
153 */
154#ifdef CONFIG_CMD_I2C
155/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
156#define CONFIG_CMD_EEPROM
157#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
158#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
159#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
Simon Guinot2af4d0f2013-06-18 15:14:48 +0200160#if defined(CONFIG_NET2BIG_V2)
161#define CONFIG_SYS_I2C_G762_ADDR 0x3e
162#endif
Simon Guinotc841c122011-11-01 16:44:12 +0530163#endif /* CONFIG_CMD_I2C */
164
165/*
Simon Guinot8e622432012-09-06 10:51:41 +0000166 * Partition support
167 */
168#define CONFIG_DOS_PARTITION
169#define CONFIG_EFI_PARTITION
170
171/*
Simon Guinot79642092011-06-17 19:41:33 +0530172 * File systems support
173 */
174#define CONFIG_CMD_EXT2
175#define CONFIG_CMD_FAT
176
177/*
178 * Use the HUSH parser
179 */
180#define CONFIG_SYS_HUSH_PARSER
Simon Guinot79642092011-06-17 19:41:33 +0530181
182/*
183 * Console configuration
184 */
185#define CONFIG_CONSOLE_MUX
186#define CONFIG_SYS_CONSOLE_IS_IN_ENV
187
188/*
189 * Enable device tree support
190 */
191#define CONFIG_OF_LIBFDT
192
193/*
194 * Environment variables configurations
195 */
196#define CONFIG_ENV_IS_IN_SPI_FLASH
197#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
198#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
199#define CONFIG_ENV_ADDR 0x70000
200#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
201
202/*
203 * Default environment variables
204 */
205#define CONFIG_BOOTARGS "console=ttyS0,115200"
206
207#define CONFIG_BOOTCOMMAND \
208 "dhcp && run netconsole; " \
209 "if run usbload || run diskload; then bootm; fi"
210
211#define CONFIG_EXTRA_ENV_SETTINGS \
212 "stdin=serial\0" \
213 "stdout=serial\0" \
214 "stderr=serial\0" \
215 "bootfile=uImage\0" \
216 "loadaddr=0x800000\0" \
217 "autoload=no\0" \
218 "netconsole=" \
219 "set stdin $stdin,nc; " \
220 "set stdout $stdout,nc; " \
221 "set stderr $stderr,nc;\0" \
222 "diskload=ide reset && " \
223 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
224 "usbload=usb start && " \
225 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
226
Simon Guinot77ea0712011-11-21 19:25:47 +0530227#endif /* _CONFIG_LACIE_KW_H */