1 /* 2 * Copyright (C) 2011 3 * Stefan Herbrechtsmeier <stefan@code.herbrechtsmeier.net> 4 * 5 * Based on Kirkwood support: 6 * (C) Copyright 2009 7 * Marvell Semiconductor <www.marvell.com> 8 * Written-by: Prafulla Wadaskar <prafulla@marvell.com> 9 * 10 * See file CREDITS for list of people who contributed to this 11 * project. 12 * 13 * This program is free software; you can redistribute it and/or 14 * modify it under the terms of the GNU General Public License as 15 * published by the Free Software Foundation; either version 2 of 16 * the License, or (at your option) any later version. 17 * 18 * This program is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU General Public License for more details. 22 * 23 * You should have received a copy of the GNU General Public License 24 * along with this program; if not, write to the Free Software 25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 26 * MA 02110-1301 USA 27 */ 28 29 #ifndef _CONFIG_DNS325_H 30 #define _CONFIG_DNS325_H 31 32 /* 33 * Machine number definition 34 */ 35 #define MACH_TYPE_DNS325 3800 36 #define CONFIG_MACH_TYPE MACH_TYPE_DNS325 37 #define CONFIG_IDENT_STRING "\nD-Link DNS-325" 38 39 /* 40 * High Level Configuration Options (easy to change) 41 */ 42 #define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ 43 #define CONFIG_KIRKWOOD /* SOC Family Name */ 44 #define CONFIG_KW88F6281 /* SOC Name */ 45 #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ 46 47 /* 48 * Commands configuration 49 */ 50 #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ 51 #include <config_cmd_default.h> 52 #define CONFIG_CMD_DHCP 53 #define CONFIG_CMD_ENV 54 #define CONFIG_CMD_NAND 55 #define CONFIG_CMD_PING 56 #define CONFIG_CMD_USB 57 #define CONFIG_CMD_IDE 58 #define CONFIG_CMD_DATE 59 #define CONFIG_SYS_MVFS 60 61 #define CONFIG_NR_DRAM_BANKS 1 62 63 /* 64 * mv-common.h should be defined after CMD configs since it used them 65 * to enable certain macros 66 */ 67 #include "mv-common.h" 68 69 /* Remove or override few declarations from mv-common.h */ 70 #undef CONFIG_SYS_PROMPT 71 #define CONFIG_SYS_PROMPT "=> " 72 73 /* 74 * Ethernet Driver configuration 75 */ 76 #ifdef CONFIG_CMD_NET 77 #define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ 78 #define CONFIG_NETCONSOLE 79 #endif 80 81 /* 82 * SATA Driver configuration 83 */ 84 #ifdef CONFIG_MVSATA_IDE 85 #define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET 86 #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET 87 #endif 88 89 /* 90 * RTC driver configuration 91 */ 92 #ifdef CONFIG_CMD_DATE 93 #define CONFIG_RTC_MV 94 #endif 95 96 /* 97 * Enable GPI0 support 98 */ 99 #define CONFIG_KIRKWOOD_GPIO 100 101 /* 102 * Use the HUSH parser 103 */ 104 #define CONFIG_SYS_HUSH_PARSER 105 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " 106 107 /* 108 * Console configuration 109 */ 110 #define CONFIG_CONSOLE_MUX 111 #define CONFIG_SYS_CONSOLE_IS_IN_ENV 112 113 /* 114 * Enable device tree support 115 */ 116 #define CONFIG_OF_LIBFDT 117 118 /* 119 * Display cpu info at boot 120 */ 121 #define CONFIG_DISPLAY_CPUINFO 122 123 /* 124 * Environment variables configurations 125 */ 126 #ifdef CONFIG_CMD_NAND 127 #define CONFIG_ENV_IS_IN_NAND 128 #define CONFIG_ENV_SECT_SIZE 0x20000 /* 128KB */ 129 #else 130 #define CONFIG_ENV_IS_NOWHERE 131 #endif 132 133 #define CONFIG_ENV_SIZE 0x20000 /* 128KB */ 134 #define CONFIG_ENV_ADDR 0xe0000 135 #define CONFIG_ENV_OFFSET 0xe0000 /* env starts here */ 136 137 /* 138 * Default environment variables 139 */ 140 #define MTDIDS_DEFAULT "nand0=orion_nand" 141 142 #define MTDPARTS_DEFAULT "mtdparts=orion_nand:" \ 143 "896k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)\0" 144 145 #define CONFIG_EXTRA_ENV_SETTINGS \ 146 "stdin=serial\0" \ 147 "stdout=serial\0" \ 148 "stderr=serial\0" \ 149 "loadaddr=0x800000\0" \ 150 "autoload=no\0" \ 151 "console=ttyS0,115200\0" \ 152 "mtdparts="MTDPARTS_DEFAULT \ 153 "optargs=\0" \ 154 "bootenv=uEnv.txt\0" \ 155 "importbootenv=echo Importing environment ...; " \ 156 "env import -t ${loadaddr} ${filesize}\0" \ 157 "loadbootenv=fatload usb 0 ${loadaddr} ${bootenv}\0" \ 158 "setbootargs=setenv bootargs console=${console} " \ 159 "${optargs} " \ 160 "${mtdparts} " \ 161 "root=${bootenvroot} " \ 162 "rootfstype=${bootenvrootfstype}\0" \ 163 "subbootcmd=run setbootargs; " \ 164 "if run bootenvloadimage; then " \ 165 "bootm ${loadaddr};" \ 166 "fi;\0" \ 167 "nandroot=ubi0:rootfs ubi.mtd=rootfs\0" \ 168 "nandrootfstype=ubifs\0" \ 169 "nandloadimage=nand read ${loadaddr} kernel\0" \ 170 "setnandbootenv=echo Booting from nand ...; " \ 171 "setenv bootenvroot ${nandroot}; " \ 172 "setenv bootenvrootfstype ${nandrootfstype}; " \ 173 "setenv bootenvloadimage ${nandloadimage}\0" 174 175 #define CONFIG_BOOTCOMMAND \ 176 "if test -n ${bootenv} && usb start; then " \ 177 "if run loadbootenv; then " \ 178 "echo Loaded environment ${bootenv} from usb;" \ 179 "run importbootenv;" \ 180 "fi;" \ 181 "if test -n ${bootenvcmd}; then " \ 182 "echo Running bootenvcmd ...;" \ 183 "run bootenvcmd;" \ 184 "fi;" \ 185 "fi;" \ 186 "run setnandbootenv subbootcmd;" 187 188 #endif /* _CONFIG_DNS325_H */ 189