Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2009 Faraday Technology |
| 3 | * Po-Yu Chuang <ratbert@faraday-tech.com> |
| 4 | * |
| 5 | * Configuation settings for the Faraday A320 board. |
| 6 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __CONFIG_H |
| 11 | #define __CONFIG_H |
| 12 | |
| 13 | #include <asm/arch/a320.h> |
| 14 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 15 | /* |
Yan-Pai Chen | 9926fa0 | 2011-11-07 19:40:25 +0000 | [diff] [blame] | 16 | * mach-type definition |
| 17 | */ |
| 18 | #define MACH_TYPE_FARADAY 758 |
| 19 | #define CONFIG_MACH_TYPE MACH_TYPE_FARADAY |
| 20 | |
| 21 | /* |
Po-Yu Chuang | fd90b0d | 2011-07-18 16:56:53 +0000 | [diff] [blame] | 22 | * Linux kernel tagged list |
| 23 | */ |
| 24 | #define CONFIG_CMDLINE_TAG |
| 25 | #define CONFIG_SETUP_MEMORY_TAGS |
| 26 | |
| 27 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 28 | * CPU and Board Configuration Options |
| 29 | */ |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 30 | #undef CONFIG_SKIP_LOWLEVEL_INIT |
| 31 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 32 | /* |
Po-Yu Chuang | 8dc667c | 2011-02-17 19:35:23 +0000 | [diff] [blame] | 33 | * Power Management Unit |
| 34 | */ |
| 35 | #define CONFIG_FTPMU010_POWER |
| 36 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 37 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 38 | * Timer |
| 39 | */ |
| 40 | #define CONFIG_SYS_HZ 1000 /* timer ticks per second */ |
| 41 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 42 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 43 | * Real Time Clock |
| 44 | */ |
| 45 | #define CONFIG_RTC_FTRTC010 |
| 46 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 47 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 48 | * Serial console configuration |
| 49 | */ |
| 50 | |
| 51 | /* FTUART is a high speed NS 16C550A compatible UART */ |
| 52 | #define CONFIG_BAUDRATE 38400 |
| 53 | #define CONFIG_CONS_INDEX 1 |
| 54 | #define CONFIG_SYS_NS16550 |
| 55 | #define CONFIG_SYS_NS16550_SERIAL |
| 56 | #define CONFIG_SYS_NS16550_COM1 0x98200000 |
| 57 | #define CONFIG_SYS_NS16550_REG_SIZE -4 |
| 58 | #define CONFIG_SYS_NS16550_CLK 18432000 |
| 59 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 60 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 61 | * Ethernet |
| 62 | */ |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 63 | #define CONFIG_FTMAC100 |
| 64 | |
| 65 | #define CONFIG_BOOTDELAY 3 |
| 66 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 67 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 68 | * Command line configuration. |
| 69 | */ |
| 70 | #include <config_cmd_default.h> |
| 71 | |
| 72 | #define CONFIG_CMD_CACHE |
| 73 | #define CONFIG_CMD_DATE |
| 74 | #define CONFIG_CMD_PING |
| 75 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 76 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 77 | * Miscellaneous configurable options |
| 78 | */ |
| 79 | #define CONFIG_SYS_LONGHELP /* undef to save memory */ |
| 80 | #define CONFIG_SYS_PROMPT "A320 # " /* Monitor Command Prompt */ |
| 81 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ |
| 82 | |
| 83 | /* Print Buffer Size */ |
| 84 | #define CONFIG_SYS_PBSIZE \ |
| 85 | (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
| 86 | |
| 87 | /* max number of command args */ |
| 88 | #define CONFIG_SYS_MAXARGS 16 |
| 89 | |
| 90 | /* Boot Argument Buffer Size */ |
| 91 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 92 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 93 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 94 | * Size of malloc() pool |
| 95 | */ |
| 96 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024) |
| 97 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 98 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 99 | * SDRAM controller configuration |
| 100 | */ |
| 101 | #define CONFIG_SYS_FTSDMC020_TP0 (FTSDMC020_TP0_TRAS(2) | \ |
| 102 | FTSDMC020_TP0_TRP(1) | \ |
| 103 | FTSDMC020_TP0_TRCD(1) | \ |
| 104 | FTSDMC020_TP0_TRF(3) | \ |
| 105 | FTSDMC020_TP0_TWR(1) | \ |
| 106 | FTSDMC020_TP0_TCL(2)) |
| 107 | |
| 108 | #define CONFIG_SYS_FTSDMC020_TP1 (FTSDMC020_TP1_INI_PREC(4) | \ |
| 109 | FTSDMC020_TP1_INI_REFT(8) | \ |
| 110 | FTSDMC020_TP1_REF_INTV(0x180)) |
| 111 | |
| 112 | #define CONFIG_SYS_FTSDMC020_BANK0_BSR (FTSDMC020_BANK_ENABLE | \ |
| 113 | FTSDMC020_BANK_DDW_X16 | \ |
| 114 | FTSDMC020_BANK_DSZ_256M | \ |
| 115 | FTSDMC020_BANK_MBW_32 | \ |
| 116 | FTSDMC020_BANK_SIZE_64M) |
| 117 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 118 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 119 | * Physical Memory Map |
| 120 | */ |
| 121 | #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ |
| 122 | #define PHYS_SDRAM_1 0x10000000 /* SDRAM Bank #1 */ |
| 123 | #define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */ |
| 124 | |
Po-Yu Chuang | 5eb522a | 2010-12-19 23:07:23 +0000 | [diff] [blame] | 125 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
| 126 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000 - \ |
| 127 | GENERATED_GBL_DATA_SIZE) |
| 128 | |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 129 | /* |
| 130 | * Load address and memory test area should agree with |
| 131 | * board/faraday/a320/config.mk. Be careful not to overwrite U-boot itself. |
| 132 | */ |
Po-Yu Chuang | 5eb522a | 2010-12-19 23:07:23 +0000 | [diff] [blame] | 133 | #define CONFIG_SYS_LOAD_ADDR (PHYS_SDRAM_1 + 0x2000000) |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 134 | |
| 135 | /* memtest works on 63 MB in DRAM */ |
Po-Yu Chuang | 5eb522a | 2010-12-19 23:07:23 +0000 | [diff] [blame] | 136 | #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1 |
| 137 | #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x3F00000) |
| 138 | |
| 139 | #define CONFIG_SYS_TEXT_BASE 0 |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 140 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 141 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 142 | * Static memory controller configuration |
| 143 | */ |
| 144 | |
Macpaul Lin | 00d10eb | 2011-04-15 21:37:11 +0000 | [diff] [blame] | 145 | #define CONFIG_FTSMC020 |
| 146 | #include <faraday/ftsmc020.h> |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 147 | |
| 148 | #define FTSMC020_BANK0_CONFIG (FTSMC020_BANK_ENABLE | \ |
| 149 | FTSMC020_BANK_BASE(PHYS_FLASH_1) | \ |
| 150 | FTSMC020_BANK_SIZE_1M | \ |
| 151 | FTSMC020_BANK_MBW_8) |
| 152 | |
| 153 | #define FTSMC020_BANK0_TIMING (FTSMC020_TPR_RBE | \ |
| 154 | FTSMC020_TPR_AST(3) | \ |
| 155 | FTSMC020_TPR_CTW(3) | \ |
| 156 | FTSMC020_TPR_ATI(0xf) | \ |
| 157 | FTSMC020_TPR_AT2(3) | \ |
| 158 | FTSMC020_TPR_WTC(3) | \ |
| 159 | FTSMC020_TPR_AHT(3) | \ |
| 160 | FTSMC020_TPR_TRNA(0xf)) |
| 161 | |
| 162 | #define FTSMC020_BANK1_CONFIG (FTSMC020_BANK_ENABLE | \ |
| 163 | FTSMC020_BANK_BASE(PHYS_FLASH_2) | \ |
| 164 | FTSMC020_BANK_SIZE_32M | \ |
| 165 | FTSMC020_BANK_MBW_32) |
| 166 | |
| 167 | #define FTSMC020_BANK1_TIMING (FTSMC020_TPR_AST(3) | \ |
| 168 | FTSMC020_TPR_CTW(3) | \ |
| 169 | FTSMC020_TPR_ATI(0xf) | \ |
| 170 | FTSMC020_TPR_AT2(3) | \ |
| 171 | FTSMC020_TPR_WTC(3) | \ |
| 172 | FTSMC020_TPR_AHT(3) | \ |
| 173 | FTSMC020_TPR_TRNA(0xf)) |
| 174 | |
| 175 | #define CONFIG_SYS_FTSMC020_CONFIGS { \ |
| 176 | { FTSMC020_BANK0_CONFIG, FTSMC020_BANK0_TIMING, }, \ |
| 177 | { FTSMC020_BANK1_CONFIG, FTSMC020_BANK1_TIMING, }, \ |
| 178 | } |
| 179 | |
Po-Yu Chuang | 7899147 | 2011-07-18 16:55:39 +0000 | [diff] [blame] | 180 | /* |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 181 | * FLASH and environment organization |
| 182 | */ |
| 183 | |
| 184 | /* use CFI framework */ |
| 185 | #define CONFIG_SYS_FLASH_CFI |
| 186 | #define CONFIG_FLASH_CFI_DRIVER |
| 187 | |
| 188 | /* support JEDEC */ |
| 189 | #define CONFIG_FLASH_CFI_LEGACY |
| 190 | #define CONFIG_SYS_FLASH_LEGACY_512Kx8 |
| 191 | |
| 192 | #define PHYS_FLASH_1 0x00000000 |
| 193 | #define PHYS_FLASH_2 0x00400000 |
| 194 | #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1 |
| 195 | #define CONFIG_SYS_FLASH_BANKS_LIST { PHYS_FLASH_1, PHYS_FLASH_2, } |
| 196 | |
| 197 | #define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1 |
| 198 | |
| 199 | /* max number of memory banks */ |
| 200 | #define CONFIG_SYS_MAX_FLASH_BANKS 2 |
| 201 | |
| 202 | /* max number of sectors on one chip */ |
| 203 | #define CONFIG_SYS_MAX_FLASH_SECT 512 |
| 204 | |
| 205 | #undef CONFIG_SYS_FLASH_EMPTY_INFO |
| 206 | |
| 207 | /* environments */ |
| 208 | #define CONFIG_ENV_IS_IN_FLASH |
Po-Yu Chuang | 5eb522a | 2010-12-19 23:07:23 +0000 | [diff] [blame] | 209 | #define CONFIG_ENV_ADDR (PHYS_FLASH_1 + 0x60000) |
Po-Yu Chuang | 43a5f0d | 2009-11-11 17:27:30 +0800 | [diff] [blame] | 210 | #define CONFIG_ENV_SIZE 0x20000 |
| 211 | |
| 212 | #endif /* __CONFIG_H */ |