blob: 1d9224c21ce929c944f7b40c8ea4f803c3ed4060 [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
Simon Guinot79642092011-06-17 19:41:33 +053015#elif defined(CONFIG_NETSPACE_V2)
16#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_V2
Simon Guinot37235492012-09-06 10:51:42 +000017#elif defined(CONFIG_NETSPACE_LITE_V2)
18#define MACH_TYPE_NETSPACE_LITE_V2 2983 /* missing in mach-types.h */
19#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_LITE_V2
Simon Guinot37235492012-09-06 10:51:42 +000020#elif defined(CONFIG_NETSPACE_MINI_V2)
21#define MACH_TYPE_NETSPACE_MINI_V2 2831 /* missing in mach-types.h */
22#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MINI_V2
Simon Guinot79642092011-06-17 19:41:33 +053023#elif defined(CONFIG_NETSPACE_MAX_V2)
24#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MAX_V2
Simon Guinotee8f6d22012-09-06 10:51:43 +000025#elif defined(CONFIG_D2NET_V2)
26#define CONFIG_MACH_TYPE MACH_TYPE_D2NET_V2
Simon Guinot77ea0712011-11-21 19:25:47 +053027#elif defined(CONFIG_NET2BIG_V2)
28#define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2
Simon Guinot79642092011-06-17 19:41:33 +053029#else
30#error "Unknown board"
31#endif
32
33/*
34 * High Level Configuration Options (easy to change)
35 */
36#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
Simon Guinot37235492012-09-06 10:51:42 +000037/* SoC name */
38#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
39#define CONFIG_KW88F6192
40#else
41#define CONFIG_KW88F6281
42#endif
Simon Guinot79642092011-06-17 19:41:33 +053043#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
44
45/*
46 * Commands configuration
47 */
48#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
Simon Guinot79642092011-06-17 19:41:33 +053049#define CONFIG_CMD_ENV
Simon Guinot79642092011-06-17 19:41:33 +053050#define CONFIG_CMD_IDE
Simon Guinot37235492012-09-06 10:51:42 +000051#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot37235492012-09-06 10:51:42 +000052#endif
Simon Guinot79642092011-06-17 19:41:33 +053053
54/*
Simon Guinot77ea0712011-11-21 19:25:47 +053055 * Core clock definition
Simon Guinot79642092011-06-17 19:41:33 +053056 */
57#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
58
Simon Guinot77ea0712011-11-21 19:25:47 +053059/*
60 * SDRAM configuration
61 */
Simon Guinotf6979972011-11-01 16:44:12 +053062#define CONFIG_NR_DRAM_BANKS 1
Simon Guinot77ea0712011-11-21 19:25:47 +053063
Simon Guinot37235492012-09-06 10:51:42 +000064/*
65 * Different SDRAM configuration and size for some of the boards derived
66 * from the Network Space v2
67 */
68#if defined(CONFIG_INETSPACE_V2)
Masahiro Yamada4ab3fc52014-03-11 11:05:17 +090069#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot37235492012-09-06 10:51:42 +000070#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
Masahiro Yamada4ab3fc52014-03-11 11:05:17 +090071#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinotf6979972011-11-01 16:44:12 +053072#endif
73
Simon Guinot79642092011-06-17 19:41:33 +053074/*
75 * mv-common.h should be defined after CMD configs since it used them
76 * to enable certain macros
77 */
Simon Guinot79642092011-06-17 19:41:33 +053078#include "mv-common.h"
79
80/* Remove or override few declarations from mv-common.h */
81#undef CONFIG_RBTREE
82#undef CONFIG_ENV_SPI_MAX_HZ
83#undef CONFIG_SYS_IDE_MAXBUS
84#undef CONFIG_SYS_IDE_MAXDEVICE
Simon Guinot79642092011-06-17 19:41:33 +053085#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
Simon Guinot79642092011-06-17 19:41:33 +053086
87/*
Simon Guinot2af4d0f2013-06-18 15:14:48 +020088 * Enable platform initialisation via misc_init_r() function
89 */
90#define CONFIG_MISC_INIT_R
91
92/*
Simon Guinot79642092011-06-17 19:41:33 +053093 * Ethernet Driver configuration
94 */
95#ifdef CONFIG_CMD_NET
96#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
97#define CONFIG_NETCONSOLE
98#endif
99
100/*
101 * SATA Driver configuration
102 */
103#ifdef CONFIG_MVSATA_IDE
104#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinotee8f6d22012-09-06 10:51:43 +0000105#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
106 defined(CONFIG_NET2BIG_V2)
Simon Guinot79642092011-06-17 19:41:33 +0530107#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
Simon Guinot4c669e22015-09-03 11:12:20 +0200108#define CONFIG_SYS_IDE_MAXBUS 2
109#define CONFIG_SYS_IDE_MAXDEVICE 2
110#else
111#define CONFIG_SYS_IDE_MAXBUS 1
112#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinot79642092011-06-17 19:41:33 +0530113#endif
Simon Guinot77ea0712011-11-21 19:25:47 +0530114#endif /* CONFIG_MVSATA_IDE */
Simon Guinot79642092011-06-17 19:41:33 +0530115
116/*
117 * Enable GPI0 support
118 */
119#define CONFIG_KIRKWOOD_GPIO
120
121/*
Simon Guinotc841c122011-11-01 16:44:12 +0530122 * Enable I2C support
123 */
124#ifdef CONFIG_CMD_I2C
125/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
126#define CONFIG_CMD_EEPROM
127#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
128#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
129#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
Simon Guinot2af4d0f2013-06-18 15:14:48 +0200130#if defined(CONFIG_NET2BIG_V2)
131#define CONFIG_SYS_I2C_G762_ADDR 0x3e
132#endif
Simon Guinotc841c122011-11-01 16:44:12 +0530133#endif /* CONFIG_CMD_I2C */
134
135/*
Simon Guinot8e622432012-09-06 10:51:41 +0000136 * Partition support
137 */
Simon Guinot8e622432012-09-06 10:51:41 +0000138
139/*
Simon Guinot79642092011-06-17 19:41:33 +0530140 * File systems support
141 */
Simon Guinot79642092011-06-17 19:41:33 +0530142
143/*
Simon Guinot79642092011-06-17 19:41:33 +0530144 * Environment variables configurations
145 */
146#define CONFIG_ENV_IS_IN_SPI_FLASH
147#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
148#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
149#define CONFIG_ENV_ADDR 0x70000
150#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
151
152/*
153 * Default environment variables
154 */
155#define CONFIG_BOOTARGS "console=ttyS0,115200"
156
157#define CONFIG_BOOTCOMMAND \
158 "dhcp && run netconsole; " \
159 "if run usbload || run diskload; then bootm; fi"
160
161#define CONFIG_EXTRA_ENV_SETTINGS \
162 "stdin=serial\0" \
163 "stdout=serial\0" \
164 "stderr=serial\0" \
165 "bootfile=uImage\0" \
166 "loadaddr=0x800000\0" \
167 "autoload=no\0" \
168 "netconsole=" \
169 "set stdin $stdin,nc; " \
170 "set stdout $stdout,nc; " \
171 "set stderr $stderr,nc;\0" \
172 "diskload=ide reset && " \
173 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
174 "usbload=usb start && " \
175 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
176
Simon Guinot77ea0712011-11-21 19:25:47 +0530177#endif /* _CONFIG_LACIE_KW_H */