blob: 61e658c66a7dd3d397b1c9c055e514a8a41dfe82 [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
Simon Guinot16311a22011-06-17 19:41:33 +053015#elif defined(CONFIG_NETSPACE_V2)
16#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_V2
Simon Guinot13c5ae62012-09-06 10:51:42 +000017#elif defined(CONFIG_NETSPACE_LITE_V2)
Simon Guinot13c5ae62012-09-06 10:51:42 +000018#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_LITE_V2
Simon Guinot13c5ae62012-09-06 10:51:42 +000019#elif defined(CONFIG_NETSPACE_MINI_V2)
Simon Guinot13c5ae62012-09-06 10:51:42 +000020#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MINI_V2
Simon Guinot16311a22011-06-17 19:41:33 +053021#elif defined(CONFIG_NETSPACE_MAX_V2)
22#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MAX_V2
Simon Guinotcaf09e22012-09-06 10:51:43 +000023#elif defined(CONFIG_D2NET_V2)
24#define CONFIG_MACH_TYPE MACH_TYPE_D2NET_V2
Simon Guinota35cb4c2011-11-21 19:25:47 +053025#elif defined(CONFIG_NET2BIG_V2)
26#define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2
Simon Guinot16311a22011-06-17 19:41:33 +053027#else
28#error "Unknown board"
29#endif
30
31/*
32 * High Level Configuration Options (easy to change)
33 */
34#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
Simon Guinot13c5ae62012-09-06 10:51:42 +000035/* SoC name */
36#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
37#define CONFIG_KW88F6192
38#else
39#define CONFIG_KW88F6281
40#endif
Simon Guinot16311a22011-06-17 19:41:33 +053041#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
42
43/*
44 * Commands configuration
45 */
46#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
Simon Guinot16311a22011-06-17 19:41:33 +053047#define CONFIG_CMD_ENV
Simon Guinot16311a22011-06-17 19:41:33 +053048#define CONFIG_CMD_IDE
Simon Guinot13c5ae62012-09-06 10:51:42 +000049#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot13c5ae62012-09-06 10:51:42 +000050#endif
Simon Guinot16311a22011-06-17 19:41:33 +053051
52/*
Simon Guinota35cb4c2011-11-21 19:25:47 +053053 * Core clock definition
Simon Guinot16311a22011-06-17 19:41:33 +053054 */
55#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
56
Simon Guinota35cb4c2011-11-21 19:25:47 +053057/*
58 * SDRAM configuration
59 */
Simon Guinot65e05172011-11-01 16:44:12 +053060#define CONFIG_NR_DRAM_BANKS 1
Simon Guinota35cb4c2011-11-21 19:25:47 +053061
Simon Guinot13c5ae62012-09-06 10:51:42 +000062/*
63 * Different SDRAM configuration and size for some of the boards derived
64 * from the Network Space v2
65 */
66#if defined(CONFIG_INETSPACE_V2)
Masahiro Yamadad6acdf22014-03-11 11:05:17 +090067#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot13c5ae62012-09-06 10:51:42 +000068#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
Masahiro Yamadad6acdf22014-03-11 11:05:17 +090069#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinot65e05172011-11-01 16:44:12 +053070#endif
71
Simon Guinot16311a22011-06-17 19:41:33 +053072/*
73 * mv-common.h should be defined after CMD configs since it used them
74 * to enable certain macros
75 */
Simon Guinot16311a22011-06-17 19:41:33 +053076#include "mv-common.h"
77
78/* Remove or override few declarations from mv-common.h */
79#undef CONFIG_RBTREE
80#undef CONFIG_ENV_SPI_MAX_HZ
81#undef CONFIG_SYS_IDE_MAXBUS
82#undef CONFIG_SYS_IDE_MAXDEVICE
Simon Guinot16311a22011-06-17 19:41:33 +053083#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
Simon Guinot16311a22011-06-17 19:41:33 +053084
85/*
Simon Guinot1dd67e62013-06-18 15:14:48 +020086 * Enable platform initialisation via misc_init_r() function
87 */
88#define CONFIG_MISC_INIT_R
89
90/*
Simon Guinot16311a22011-06-17 19:41:33 +053091 * Ethernet Driver configuration
92 */
93#ifdef CONFIG_CMD_NET
94#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
95#define CONFIG_NETCONSOLE
96#endif
97
98/*
99 * SATA Driver configuration
100 */
101#ifdef CONFIG_MVSATA_IDE
102#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinotcaf09e22012-09-06 10:51:43 +0000103#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
104 defined(CONFIG_NET2BIG_V2)
Simon Guinot16311a22011-06-17 19:41:33 +0530105#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
Simon Guinot777baa92015-09-03 11:12:20 +0200106#define CONFIG_SYS_IDE_MAXBUS 2
107#define CONFIG_SYS_IDE_MAXDEVICE 2
108#else
109#define CONFIG_SYS_IDE_MAXBUS 1
110#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinot16311a22011-06-17 19:41:33 +0530111#endif
Simon Guinota35cb4c2011-11-21 19:25:47 +0530112#endif /* CONFIG_MVSATA_IDE */
Simon Guinot16311a22011-06-17 19:41:33 +0530113
114/*
115 * Enable GPI0 support
116 */
117#define CONFIG_KIRKWOOD_GPIO
118
119/*
Simon Guinot5aaebab2011-11-01 16:44:12 +0530120 * Enable I2C support
121 */
122#ifdef CONFIG_CMD_I2C
123/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
124#define CONFIG_CMD_EEPROM
125#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
126#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
127#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
Simon Guinot1dd67e62013-06-18 15:14:48 +0200128#if defined(CONFIG_NET2BIG_V2)
129#define CONFIG_SYS_I2C_G762_ADDR 0x3e
130#endif
Simon Guinot5aaebab2011-11-01 16:44:12 +0530131#endif /* CONFIG_CMD_I2C */
132
133/*
Simon Guinot707f5d62012-09-06 10:51:41 +0000134 * Partition support
135 */
Simon Guinot707f5d62012-09-06 10:51:41 +0000136
137/*
Simon Guinot16311a22011-06-17 19:41:33 +0530138 * File systems support
139 */
Simon Guinot16311a22011-06-17 19:41:33 +0530140
141/*
Simon Guinot16311a22011-06-17 19:41:33 +0530142 * Environment variables configurations
143 */
144#define CONFIG_ENV_IS_IN_SPI_FLASH
145#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
146#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
147#define CONFIG_ENV_ADDR 0x70000
148#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
149
150/*
151 * Default environment variables
152 */
153#define CONFIG_BOOTARGS "console=ttyS0,115200"
154
155#define CONFIG_BOOTCOMMAND \
156 "dhcp && run netconsole; " \
157 "if run usbload || run diskload; then bootm; fi"
158
159#define CONFIG_EXTRA_ENV_SETTINGS \
160 "stdin=serial\0" \
161 "stdout=serial\0" \
162 "stderr=serial\0" \
163 "bootfile=uImage\0" \
164 "loadaddr=0x800000\0" \
165 "autoload=no\0" \
166 "netconsole=" \
167 "set stdin $stdin,nc; " \
168 "set stdout $stdout,nc; " \
169 "set stderr $stderr,nc;\0" \
170 "diskload=ide reset && " \
171 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
172 "usbload=usb start && " \
173 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
174
Simon Guinota35cb4c2011-11-21 19:25:47 +0530175#endif /* _CONFIG_LACIE_KW_H */