Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 Simon Guinot <sguinot@lacie.com> |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 5 | */ |
| 6 | |
Simon Guinot | 77ea071 | 2011-11-21 19:25:47 +0530 | [diff] [blame] | 7 | #ifndef _CONFIG_LACIE_KW_H |
| 8 | #define _CONFIG_LACIE_KW_H |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 9 | |
| 10 | /* |
| 11 | * Machine number definition |
| 12 | */ |
| 13 | #if defined(CONFIG_INETSPACE_V2) |
| 14 | #define CONFIG_MACH_TYPE MACH_TYPE_INETSPACE_V2 |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 15 | #elif defined(CONFIG_NETSPACE_V2) |
| 16 | #define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_V2 |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 17 | #elif defined(CONFIG_NETSPACE_LITE_V2) |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 18 | #define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_LITE_V2 |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 19 | #elif defined(CONFIG_NETSPACE_MINI_V2) |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 20 | #define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MINI_V2 |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 21 | #elif defined(CONFIG_NETSPACE_MAX_V2) |
| 22 | #define CONFIG_MACH_TYPE MACH_TYPE_NETSPACE_MAX_V2 |
Simon Guinot | ee8f6d2 | 2012-09-06 10:51:43 +0000 | [diff] [blame] | 23 | #elif defined(CONFIG_D2NET_V2) |
| 24 | #define CONFIG_MACH_TYPE MACH_TYPE_D2NET_V2 |
Simon Guinot | 77ea071 | 2011-11-21 19:25:47 +0530 | [diff] [blame] | 25 | #elif defined(CONFIG_NET2BIG_V2) |
| 26 | #define CONFIG_MACH_TYPE MACH_TYPE_NET2BIG_V2 |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 27 | #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 Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 35 | /* 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 Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 41 | #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ |
| 42 | |
| 43 | /* |
| 44 | * Commands configuration |
| 45 | */ |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 46 | #define CONFIG_CMD_ENV |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 47 | #define CONFIG_CMD_IDE |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 48 | #ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */ |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 49 | #endif |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 50 | |
| 51 | /* |
Simon Guinot | 77ea071 | 2011-11-21 19:25:47 +0530 | [diff] [blame] | 52 | * Core clock definition |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 53 | */ |
| 54 | #define CONFIG_SYS_TCLK 166000000 /* 166MHz */ |
| 55 | |
Simon Guinot | 77ea071 | 2011-11-21 19:25:47 +0530 | [diff] [blame] | 56 | /* |
| 57 | * SDRAM configuration |
| 58 | */ |
Simon Guinot | f697997 | 2011-11-01 16:44:12 +0530 | [diff] [blame] | 59 | #define CONFIG_NR_DRAM_BANKS 1 |
Simon Guinot | 77ea071 | 2011-11-21 19:25:47 +0530 | [diff] [blame] | 60 | |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 61 | /* |
| 62 | * Different SDRAM configuration and size for some of the boards derived |
| 63 | * from the Network Space v2 |
| 64 | */ |
| 65 | #if defined(CONFIG_INETSPACE_V2) |
Masahiro Yamada | 4ab3fc5 | 2014-03-11 11:05:17 +0900 | [diff] [blame] | 66 | #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-is2.cfg |
Simon Guinot | 3723549 | 2012-09-06 10:51:42 +0000 | [diff] [blame] | 67 | #elif defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2) |
Masahiro Yamada | 4ab3fc5 | 2014-03-11 11:05:17 +0900 | [diff] [blame] | 68 | #define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage-ns2l.cfg |
Simon Guinot | f697997 | 2011-11-01 16:44:12 +0530 | [diff] [blame] | 69 | #endif |
| 70 | |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 71 | /* |
| 72 | * mv-common.h should be defined after CMD configs since it used them |
| 73 | * to enable certain macros |
| 74 | */ |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 75 | #include "mv-common.h" |
| 76 | |
| 77 | /* Remove or override few declarations from mv-common.h */ |
| 78 | #undef CONFIG_RBTREE |
| 79 | #undef CONFIG_ENV_SPI_MAX_HZ |
| 80 | #undef CONFIG_SYS_IDE_MAXBUS |
| 81 | #undef CONFIG_SYS_IDE_MAXDEVICE |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 82 | #define CONFIG_ENV_SPI_MAX_HZ 20000000 /* 20Mhz */ |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 83 | |
| 84 | /* |
Simon Guinot | 2af4d0f | 2013-06-18 15:14:48 +0200 | [diff] [blame] | 85 | * Enable platform initialisation via misc_init_r() function |
| 86 | */ |
| 87 | #define CONFIG_MISC_INIT_R |
| 88 | |
| 89 | /* |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 90 | * Ethernet Driver configuration |
| 91 | */ |
| 92 | #ifdef CONFIG_CMD_NET |
| 93 | #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ |
| 94 | #define CONFIG_NETCONSOLE |
| 95 | #endif |
| 96 | |
| 97 | /* |
| 98 | * SATA Driver configuration |
| 99 | */ |
| 100 | #ifdef CONFIG_MVSATA_IDE |
| 101 | #define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET |
Simon Guinot | ee8f6d2 | 2012-09-06 10:51:43 +0000 | [diff] [blame] | 102 | #if defined(CONFIG_NETSPACE_MAX_V2) || defined(CONFIG_D2NET_V2) || \ |
| 103 | defined(CONFIG_NET2BIG_V2) |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 104 | #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET |
Simon Guinot | 4c669e2 | 2015-09-03 11:12:20 +0200 | [diff] [blame] | 105 | #define CONFIG_SYS_IDE_MAXBUS 2 |
| 106 | #define CONFIG_SYS_IDE_MAXDEVICE 2 |
| 107 | #else |
| 108 | #define CONFIG_SYS_IDE_MAXBUS 1 |
| 109 | #define CONFIG_SYS_IDE_MAXDEVICE 1 |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 110 | #endif |
Simon Guinot | 77ea071 | 2011-11-21 19:25:47 +0530 | [diff] [blame] | 111 | #endif /* CONFIG_MVSATA_IDE */ |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 112 | |
| 113 | /* |
| 114 | * Enable GPI0 support |
| 115 | */ |
| 116 | #define CONFIG_KIRKWOOD_GPIO |
| 117 | |
| 118 | /* |
Simon Guinot | c841c12 | 2011-11-01 16:44:12 +0530 | [diff] [blame] | 119 | * Enable I2C support |
| 120 | */ |
| 121 | #ifdef CONFIG_CMD_I2C |
| 122 | /* I2C EEPROM HT24LC04 (512B - 32 pages of 16 Bytes) */ |
| 123 | #define CONFIG_CMD_EEPROM |
| 124 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 |
| 125 | #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4 /* 16-byte page size */ |
| 126 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* 8-bit device address */ |
Simon Guinot | 2af4d0f | 2013-06-18 15:14:48 +0200 | [diff] [blame] | 127 | #if defined(CONFIG_NET2BIG_V2) |
| 128 | #define CONFIG_SYS_I2C_G762_ADDR 0x3e |
| 129 | #endif |
Simon Guinot | c841c12 | 2011-11-01 16:44:12 +0530 | [diff] [blame] | 130 | #endif /* CONFIG_CMD_I2C */ |
| 131 | |
| 132 | /* |
Simon Guinot | 8e62243 | 2012-09-06 10:51:41 +0000 | [diff] [blame] | 133 | * Partition support |
| 134 | */ |
Simon Guinot | 8e62243 | 2012-09-06 10:51:41 +0000 | [diff] [blame] | 135 | |
| 136 | /* |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 137 | * File systems support |
| 138 | */ |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 139 | |
| 140 | /* |
Simon Guinot | 7964209 | 2011-06-17 19:41:33 +0530 | [diff] [blame] | 141 | * Environment variables configurations |
| 142 | */ |
| 143 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
| 144 | #define CONFIG_ENV_SECT_SIZE 0x10000 /* 64KB */ |
| 145 | #define CONFIG_ENV_SIZE 0x1000 /* 4KB */ |
| 146 | #define CONFIG_ENV_ADDR 0x70000 |
| 147 | #define CONFIG_ENV_OFFSET 0x70000 /* env starts here */ |
| 148 | |
| 149 | /* |
| 150 | * Default environment variables |
| 151 | */ |
| 152 | #define CONFIG_BOOTARGS "console=ttyS0,115200" |
| 153 | |
| 154 | #define CONFIG_BOOTCOMMAND \ |
| 155 | "dhcp && run netconsole; " \ |
| 156 | "if run usbload || run diskload; then bootm; fi" |
| 157 | |
| 158 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 159 | "stdin=serial\0" \ |
| 160 | "stdout=serial\0" \ |
| 161 | "stderr=serial\0" \ |
| 162 | "bootfile=uImage\0" \ |
| 163 | "loadaddr=0x800000\0" \ |
| 164 | "autoload=no\0" \ |
| 165 | "netconsole=" \ |
| 166 | "set stdin $stdin,nc; " \ |
| 167 | "set stdout $stdout,nc; " \ |
| 168 | "set stderr $stderr,nc;\0" \ |
| 169 | "diskload=ide reset && " \ |
| 170 | "ext2load ide 0:1 $loadaddr /boot/$bootfile\0" \ |
| 171 | "usbload=usb start && " \ |
| 172 | "fatload usb 0:1 $loadaddr /boot/$bootfile\0" |
| 173 | |
Simon Guinot | 77ea071 | 2011-11-21 19:25:47 +0530 | [diff] [blame] | 174 | #endif /* _CONFIG_LACIE_KW_H */ |