blob: 878d2a32a102e46645b08b972d4e2769b6e85c82 [file] [log] [blame]
Simon Guinot16311a22011-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 Guinota35cb4c2011-11-21 19:25:47 +053018#ifndef _CONFIG_LACIE_KW_H
19#define _CONFIG_LACIE_KW_H
Simon Guinot16311a22011-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 Guinot13c5ae62012-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 Guinot16311a22011-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 Guinota35cb4c2011-11-21 19:25:47 +053041#elif defined(CONFIG_NET2BIG_V2)
42#define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2
43#define CONFIG_IDENT_STRING " 2Big v2"
Simon Guinot16311a22011-06-17 19:41:33 +053044#else
45#error "Unknown board"
46#endif
47
48/*
49 * High Level Configuration Options (easy to change)
50 */
51#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
Simon Guinot13c5ae62012-09-06 10:51:42 +000052#define CONFIG_KIRKWOOD /* SoC Family Name */
53/* SoC name */
54#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
55#define CONFIG_KW88F6192
56#else
57#define CONFIG_KW88F6281
58#endif
Simon Guinot16311a22011-06-17 19:41:33 +053059#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
60
61/*
62 * Commands configuration
63 */
64#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
65#include <config_cmd_default.h>
66#define CONFIG_CMD_ENV
67#define CONFIG_CMD_DHCP
68#define CONFIG_CMD_PING
69#define CONFIG_CMD_SF
70#define CONFIG_CMD_I2C
71#define CONFIG_CMD_IDE
Simon Guinot13c5ae62012-09-06 10:51:42 +000072#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot16311a22011-06-17 19:41:33 +053073#define CONFIG_CMD_USB
Simon Guinot13c5ae62012-09-06 10:51:42 +000074#endif
Simon Guinot16311a22011-06-17 19:41:33 +053075
76/*
Simon Guinota35cb4c2011-11-21 19:25:47 +053077 * Core clock definition
Simon Guinot16311a22011-06-17 19:41:33 +053078 */
79#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
80
Simon Guinota35cb4c2011-11-21 19:25:47 +053081/*
82 * SDRAM configuration
83 */
Simon Guinot65e05172011-11-01 16:44:12 +053084#define CONFIG_NR_DRAM_BANKS 1
Simon Guinota35cb4c2011-11-21 19:25:47 +053085
Simon Guinot13c5ae62012-09-06 10:51:42 +000086/*
87 * Different SDRAM configuration and size for some of the boards derived
88 * from the Network Space v2
89 */
90#if defined(CONFIG_INETSPACE_V2)
Simon Guinot95ae3662012-06-05 13:15:59 +000091#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot13c5ae62012-09-06 10:51:42 +000092#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
93#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinot65e05172011-11-01 16:44:12 +053094#endif
95
Simon Guinot16311a22011-06-17 19:41:33 +053096/*
97 * mv-common.h should be defined after CMD configs since it used them
98 * to enable certain macros
99 */
Simon Guinot16311a22011-06-17 19:41:33 +0530100#include "mv-common.h"
101
102/* Remove or override few declarations from mv-common.h */
103#undef CONFIG_RBTREE
104#undef CONFIG_ENV_SPI_MAX_HZ
105#undef CONFIG_SYS_IDE_MAXBUS
106#undef CONFIG_SYS_IDE_MAXDEVICE
107#undef CONFIG_SYS_PROMPT
108#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
109#define CONFIG_SYS_IDE_MAXBUS 1
110#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinota35cb4c2011-11-21 19:25:47 +0530111#if defined(CONFIG_NET2BIG_V2)
112#define CONFIG_SYS_PROMPT "2big2> "
113#else
Simon Guinot16311a22011-06-17 19:41:33 +0530114#define CONFIG_SYS_PROMPT "ns2> "
Simon Guinota35cb4c2011-11-21 19:25:47 +0530115#endif
Simon Guinot16311a22011-06-17 19:41:33 +0530116
117/*
118 * Ethernet Driver configuration
119 */
120#ifdef CONFIG_CMD_NET
Simon Guinot6e238912011-11-08 11:31:14 +0000121#define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */
Simon Guinot16311a22011-06-17 19:41:33 +0530122#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
123#define CONFIG_NETCONSOLE
124#endif
125
126/*
127 * SATA Driver configuration
128 */
129#ifdef CONFIG_MVSATA_IDE
130#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinota35cb4c2011-11-21 19:25:47 +0530131#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_NET2BIG_V2)
Simon Guinot16311a22011-06-17 19:41:33 +0530132#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
133#endif
Simon Guinota35cb4c2011-11-21 19:25:47 +0530134#endif /* CONFIG_MVSATA_IDE */
Simon Guinot16311a22011-06-17 19:41:33 +0530135
136/*
137 * Enable GPI0 support
138 */
139#define CONFIG_KIRKWOOD_GPIO
140
141/*
Simon Guinot5aaebab2011-11-01 16:44:12 +0530142 * Enable I2C support
143 */
144#ifdef CONFIG_CMD_I2C
145/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
146#define CONFIG_CMD_EEPROM
147#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
148#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
149#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
150#endif /* CONFIG_CMD_I2C */
151
152/*
Simon Guinot707f5d62012-09-06 10:51:41 +0000153 * Partition support
154 */
155#define CONFIG_DOS_PARTITION
156#define CONFIG_EFI_PARTITION
157
158/*
Simon Guinot16311a22011-06-17 19:41:33 +0530159 * File systems support
160 */
161#define CONFIG_CMD_EXT2
162#define CONFIG_CMD_FAT
163
164/*
165 * Use the HUSH parser
166 */
167#define CONFIG_SYS_HUSH_PARSER
Simon Guinot16311a22011-06-17 19:41:33 +0530168
169/*
170 * Console configuration
171 */
172#define CONFIG_CONSOLE_MUX
173#define CONFIG_SYS_CONSOLE_IS_IN_ENV
174
175/*
176 * Enable device tree support
177 */
178#define CONFIG_OF_LIBFDT
179
180/*
181 * Environment variables configurations
182 */
183#define CONFIG_ENV_IS_IN_SPI_FLASH
184#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
185#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
186#define CONFIG_ENV_ADDR 0x70000
187#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
188
189/*
190 * Default environment variables
191 */
192#define CONFIG_BOOTARGS "console=ttyS0,115200"
193
194#define CONFIG_BOOTCOMMAND \
195 "dhcp && run netconsole; " \
196 "if run usbload || run diskload; then bootm; fi"
197
198#define CONFIG_EXTRA_ENV_SETTINGS \
199 "stdin=serial\0" \
200 "stdout=serial\0" \
201 "stderr=serial\0" \
202 "bootfile=uImage\0" \
203 "loadaddr=0x800000\0" \
204 "autoload=no\0" \
205 "netconsole=" \
206 "set stdin $stdin,nc; " \
207 "set stdout $stdout,nc; " \
208 "set stderr $stderr,nc;\0" \
209 "diskload=ide reset && " \
210 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
211 "usbload=usb start && " \
212 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
213
Simon Guinota35cb4c2011-11-21 19:25:47 +0530214#endif /* _CONFIG_LACIE_KW_H */