blob: ac9ac4aeaa563c61252d1540f27bf08c1b1a68e4 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Guinot79642092011-06-17 19:41:33 +05302/*
3 * Copyright (C) 2011 Simon Guinot <sguinot@lacie.com>
Simon Guinot79642092011-06-17 19:41:33 +05304 */
5
Simon Guinot77ea0712011-11-21 19:25:47 +05306#ifndef _CONFIG_LACIE_KW_H
7#define _CONFIG_LACIE_KW_H
Simon Guinot79642092011-06-17 19:41:33 +05308
9/*
10 * Machine number definition
11 */
12#if defined(CONFIG_INETSPACE_V2)
13#define CONFIG_MACH_TYPE MACH_TYPE_INETSPACE_V2
Simon Guinot79642092011-06-17 19:41:33 +053014#elif defined(CONFIG_NETSPACE_V2)
15#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_V2
Simon Guinot37235492012-09-06 10:51:42 +000016#elif defined(CONFIG_NETSPACE_LITE_V2)
Simon Guinot37235492012-09-06 10:51:42 +000017#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_LITE_V2
Simon Guinot37235492012-09-06 10:51:42 +000018#elif defined(CONFIG_NETSPACE_MINI_V2)
Simon Guinot37235492012-09-06 10:51:42 +000019#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MINI_V2
Simon Guinot79642092011-06-17 19:41:33 +053020#elif defined(CONFIG_NETSPACE_MAX_V2)
21#define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MAX_V2
Simon Guinotee8f6d22012-09-06 10:51:43 +000022#elif defined(CONFIG_D2NET_V2)
23#define CONFIG_MACH_TYPE MACH_TYPE_D2NET_V2
Simon Guinot77ea0712011-11-21 19:25:47 +053024#elif defined(CONFIG_NET2BIG_V2)
25#define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2
Simon Guinot79642092011-06-17 19:41:33 +053026#else
27#error "Unknown board"
28#endif
29
30/*
31 * High Level Configuration Options (easy to change)
32 */
33#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
Simon Guinot37235492012-09-06 10:51:42 +000034/* SoC name */
35#if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
36#define CONFIG_KW88F6192
37#else
38#define CONFIG_KW88F6281
39#endif
Simon Guinot79642092011-06-17 19:41:33 +053040#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
41
42/*
43 * Commands configuration
44 */
Simon Guinot37235492012-09-06 10:51:42 +000045#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
Simon Guinot37235492012-09-06 10:51:42 +000046#endif
Simon Guinot79642092011-06-17 19:41:33 +053047
48/*
Simon Guinot77ea0712011-11-21 19:25:47 +053049 * Core clock definition
Simon Guinot79642092011-06-17 19:41:33 +053050 */
51#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
52
Simon Guinot77ea0712011-11-21 19:25:47 +053053/*
54 * SDRAM configuration
55 */
Simon Guinotf6979972011-11-01 16:44:12 +053056#define CONFIG_NR_DRAM_BANKS 1
Simon Guinot77ea0712011-11-21 19:25:47 +053057
Simon Guinot37235492012-09-06 10:51:42 +000058/*
59 * Different SDRAM configuration and size for some of the boards derived
60 * from the Network Space v2
61 */
62#if defined(CONFIG_INETSPACE_V2)
Masahiro Yamada4ab3fc52014-03-11 11:05:17 +090063#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg
Simon Guinot37235492012-09-06 10:51:42 +000064#elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
Masahiro Yamada4ab3fc52014-03-11 11:05:17 +090065#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg
Simon Guinotf6979972011-11-01 16:44:12 +053066#endif
67
Simon Guinot79642092011-06-17 19:41:33 +053068/*
69 * mv-common.h should be defined after CMD configs since it used them
70 * to enable certain macros
71 */
Simon Guinot79642092011-06-17 19:41:33 +053072#include "mv-common.h"
73
74/* Remove or override few declarations from mv-common.h */
Simon Guinot79642092011-06-17 19:41:33 +053075#undef CONFIG_ENV_SPI_MAX_HZ
76#undef CONFIG_SYS_IDE_MAXBUS
77#undef CONFIG_SYS_IDE_MAXDEVICE
Simon Guinot79642092011-06-17 19:41:33 +053078#define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */
Simon Guinot79642092011-06-17 19:41:33 +053079
80/*
Simon Guinot2af4d0f2013-06-18 15:14:48 +020081 * Enable platform initialisation via misc_init_r() function
82 */
83#define CONFIG_MISC_INIT_R
84
85/*
Simon Guinot79642092011-06-17 19:41:33 +053086 * Ethernet Driver configuration
87 */
88#ifdef CONFIG_CMD_NET
89#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
90#define CONFIG_NETCONSOLE
91#endif
92
93/*
94 * SATA Driver configuration
95 */
96#ifdef CONFIG_MVSATA_IDE
97#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
Simon Guinotee8f6d22012-09-06 10:51:43 +000098#if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \
99 defined(CONFIG_NET2BIG_V2)
Simon Guinot79642092011-06-17 19:41:33 +0530100#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
Simon Guinot4c669e22015-09-03 11:12:20 +0200101#define CONFIG_SYS_IDE_MAXBUS 2
102#define CONFIG_SYS_IDE_MAXDEVICE 2
103#else
104#define CONFIG_SYS_IDE_MAXBUS 1
105#define CONFIG_SYS_IDE_MAXDEVICE 1
Simon Guinot79642092011-06-17 19:41:33 +0530106#endif
Simon Guinot77ea0712011-11-21 19:25:47 +0530107#endif /* CONFIG_MVSATA_IDE */
Simon Guinot79642092011-06-17 19:41:33 +0530108
109/*
110 * Enable GPI0 support
111 */
112#define CONFIG_KIRKWOOD_GPIO
113
114/*
Simon Guinotc841c122011-11-01 16:44:12 +0530115 * Enable I2C support
116 */
117#ifdef CONFIG_CMD_I2C
118/* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */
Simon Guinotc841c122011-11-01 16:44:12 +0530119#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
120#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */
121#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */
Simon Guinot2af4d0f2013-06-18 15:14:48 +0200122#if defined(CONFIG_NET2BIG_V2)
123#define CONFIG_SYS_I2C_G762_ADDR 0x3e
124#endif
Simon Guinotc841c122011-11-01 16:44:12 +0530125#endif /* CONFIG_CMD_I2C */
126
127/*
Simon Guinot8e622432012-09-06 10:51:41 +0000128 * Partition support
129 */
Simon Guinot8e622432012-09-06 10:51:41 +0000130
131/*
Simon Guinot79642092011-06-17 19:41:33 +0530132 * File systems support
133 */
Simon Guinot79642092011-06-17 19:41:33 +0530134
135/*
Simon Guinot79642092011-06-17 19:41:33 +0530136 * Environment variables configurations
137 */
Simon Guinot79642092011-06-17 19:41:33 +0530138#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */
139#define CONFIG_ENV_SIZE 0x1000 /* 4KB */
140#define CONFIG_ENV_ADDR 0x70000
141#define CONFIG_ENV_OFFSET 0x70000 /* env starts here */
142
143/*
144 * Default environment variables
145 */
Simon Guinot79642092011-06-17 19:41:33 +0530146#define CONFIG_BOOTCOMMAND \
147 "dhcp && run netconsole; " \
148 "if run usbload || run diskload; then bootm; fi"
149
150#define CONFIG_EXTRA_ENV_SETTINGS \
151 "stdin=serial\0" \
152 "stdout=serial\0" \
153 "stderr=serial\0" \
154 "bootfile=uImage\0" \
155 "loadaddr=0x800000\0" \
156 "autoload=no\0" \
157 "netconsole=" \
158 "set stdin $stdin,nc; " \
159 "set stdout $stdout,nc; " \
160 "set stderr $stderr,nc;\0" \
161 "diskload=ide reset && " \
162 "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \
163 "usbload=usb start && " \
164 "fatload usb 0:1 $loadaddr /boot/$bootfile\0"
165
Simon Guinot77ea0712011-11-21 19:25:47 +0530166#endif /* _CONFIG_LACIE_KW_H */