blob: 9b2c575badeab2372aa6f71f47339ee0bd089025 [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/*
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 Guinot13c5ae62012-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 Guinot16311a22011-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 Guinotcaf09e22012-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 Guinota35cb4c2011-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 Guinot16311a22011-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 Guinot13c5ae62012-09-06 10:51:42 +000044/* SoC name */
45#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
46#define CONFIG_KW88F6192
47#else
48#define CONFIG_KW88F6281
49#endif
Simon Guinot16311a22011-06-17 19:41:33 +053050#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
51
52/*
53 * Commands configuration
54 */
55#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
Simon Guinot16311a22011-06-17 19:41:33 +053056#define CONFIG_CMD_ENV
Simon Guinot16311a22011-06-17 19:41:33 +053057#define CONFIG_CMD_IDE
Simon Guinot13c5ae62012-09-06 10:51:42 +000058#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot13c5ae62012-09-06 10:51:42 +000059#endif
Simon Guinot16311a22011-06-17 19:41:33 +053060
61/*
Simon Guinota35cb4c2011-11-21 19:25:47 +053062 * Core clock definition
Simon Guinot16311a22011-06-17 19:41:33 +053063 */
64#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
65
Simon Guinota35cb4c2011-11-21 19:25:47 +053066/*
67 * SDRAM configuration
68 */
Simon Guinot65e05172011-11-01 16:44:12 +053069#define CONFIG_NR_DRAM_BANKS 1
Simon Guinota35cb4c2011-11-21 19:25:47 +053070
Simon Guinot13c5ae62012-09-06 10:51:42 +000071/*
72 * Different SDRAM configuration and size for some of the boards derived
73 * from the Network Space v2
74 */
75#if defined(CONFIG_INETSPACE_V2)
Masahiro Yamadad6acdf22014-03-11 11:05:17 +090076#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot13c5ae62012-09-06 10:51:42 +000077#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
Masahiro Yamadad6acdf22014-03-11 11:05:17 +090078#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinot65e05172011-11-01 16:44:12 +053079#endif
80
Simon Guinot16311a22011-06-17 19:41:33 +053081/*
82 * mv-common.h should be defined after CMD configs since it used them
83 * to enable certain macros
84 */
Simon Guinot16311a22011-06-17 19:41:33 +053085#include "mv-common.h"
86
87/* Remove or override few declarations from mv-common.h */
88#undef CONFIG_RBTREE
89#undef CONFIG_ENV_SPI_MAX_HZ
90#undef CONFIG_SYS_IDE_MAXBUS
91#undef CONFIG_SYS_IDE_MAXDEVICE
Simon Guinot16311a22011-06-17 19:41:33 +053092#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
Simon Guinot16311a22011-06-17 19:41:33 +053093
94/*
Simon Guinot1dd67e62013-06-18 15:14:48 +020095 * Enable platform initialisation via misc_init_r() function
96 */
97#define CONFIG_MISC_INIT_R
98
99/*
Simon Guinot16311a22011-06-17 19:41:33 +0530100 * Ethernet Driver configuration
101 */
102#ifdef CONFIG_CMD_NET
103#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
104#define CONFIG_NETCONSOLE
105#endif
106
107/*
108 * SATA Driver configuration
109 */
110#ifdef CONFIG_MVSATA_IDE
111#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinotcaf09e22012-09-06 10:51:43 +0000112#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
113 defined(CONFIG_NET2BIG_V2)
Simon Guinot16311a22011-06-17 19:41:33 +0530114#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
Simon Guinot777baa92015-09-03 11:12:20 +0200115#define CONFIG_SYS_IDE_MAXBUS 2
116#define CONFIG_SYS_IDE_MAXDEVICE 2
117#else
118#define CONFIG_SYS_IDE_MAXBUS 1
119#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinot16311a22011-06-17 19:41:33 +0530120#endif
Simon Guinota35cb4c2011-11-21 19:25:47 +0530121#endif /* CONFIG_MVSATA_IDE */
Simon Guinot16311a22011-06-17 19:41:33 +0530122
123/*
124 * Enable GPI0 support
125 */
126#define CONFIG_KIRKWOOD_GPIO
127
128/*
Simon Guinot5aaebab2011-11-01 16:44:12 +0530129 * Enable I2C support
130 */
131#ifdef CONFIG_CMD_I2C
132/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
133#define CONFIG_CMD_EEPROM
134#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
135#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
136#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
Simon Guinot1dd67e62013-06-18 15:14:48 +0200137#if defined(CONFIG_NET2BIG_V2)
138#define CONFIG_SYS_I2C_G762_ADDR 0x3e
139#endif
Simon Guinot5aaebab2011-11-01 16:44:12 +0530140#endif /* CONFIG_CMD_I2C */
141
142/*
Simon Guinot707f5d62012-09-06 10:51:41 +0000143 * Partition support
144 */
145#define CONFIG_DOS_PARTITION
146#define CONFIG_EFI_PARTITION
147
148/*
Simon Guinot16311a22011-06-17 19:41:33 +0530149 * File systems support
150 */
Simon Guinot16311a22011-06-17 19:41:33 +0530151
152/*
Simon Guinot16311a22011-06-17 19:41:33 +0530153 * Console configuration
154 */
155#define CONFIG_CONSOLE_MUX
156#define CONFIG_SYS_CONSOLE_IS_IN_ENV
157
158/*
Simon Guinot16311a22011-06-17 19:41:33 +0530159 * Environment variables configurations
160 */
161#define CONFIG_ENV_IS_IN_SPI_FLASH
162#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
163#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
164#define CONFIG_ENV_ADDR 0x70000
165#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
166
167/*
168 * Default environment variables
169 */
170#define CONFIG_BOOTARGS "console=ttyS0,115200"
171
172#define CONFIG_BOOTCOMMAND \
173 "dhcp && run netconsole; " \
174 "if run usbload || run diskload; then bootm; fi"
175
176#define CONFIG_EXTRA_ENV_SETTINGS \
177 "stdin=serial\0" \
178 "stdout=serial\0" \
179 "stderr=serial\0" \
180 "bootfile=uImage\0" \
181 "loadaddr=0x800000\0" \
182 "autoload=no\0" \
183 "netconsole=" \
184 "set stdin $stdin,nc; " \
185 "set stdout $stdout,nc; " \
186 "set stderr $stderr,nc;\0" \
187 "diskload=ide reset && " \
188 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
189 "usbload=usb start && " \
190 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
191
Simon Guinota35cb4c2011-11-21 19:25:47 +0530192#endif /* _CONFIG_LACIE_KW_H */