cafaf88d91faa439ead506a533ee500ee937d24a
[platform/kernel/u-boot.git] / include / configs / eb_cpux9k2.h
1 /*
2  * (C) Copyright 2008-2009
3  * BuS Elektronik GmbH & Co. KG <www.bus-elektronik.de>
4  * Jens Scharsig <esw@bus-elektronik.de>
5  *
6  * Configuation settings for the EB+CPUx9K2 board.
7  *
8  * SPDX-License-Identifier:     GPL-2.0+
9  */
10
11 #ifndef _CONFIG_EB_CPUx9K2_H_
12 #define _CONFIG_EB_CPUx9K2_H_
13
14 /*--------------------------------------------------------------------------*/
15
16 #define CONFIG_AT91RM9200               /* It's an Atmel AT91RM9200 SoC */
17 #define CONFIG_EB_CPUX9K2               /* on an EP+CPUX9K2 Board       */
18 #define USE_920T_MMU
19
20 #define CONFIG_VERSION_VARIABLE
21 #define CONFIG_IDENT_STRING     " on EB+CPUx9K2"
22
23 #include <asm/hardware.h>       /* needed for port definitions */
24
25 #define CONFIG_MISC_INIT_R
26 #define CONFIG_BOARD_EARLY_INIT_F
27
28 #define MACH_TYPE_EB_CPUX9K2            1977
29 #define CONFIG_MACH_TYPE                MACH_TYPE_EB_CPUX9K2
30
31 #define CONFIG_SYS_CACHELINE_SIZE       32
32 #define CONFIG_SYS_DCACHE_OFF
33
34 /*--------------------------------------------------------------------------*/
35 #ifndef CONFIG_RAMBOOT
36 #define CONFIG_SYS_TEXT_BASE            0x00000000
37 #else
38 #define CONFIG_SKIP_LOWLEVEL_INIT
39 #define CONFIG_SYS_TEXT_BASE            0x21f00000
40 #endif
41 #define CONFIG_SYS_LOAD_ADDR            0x21000000  /* default load address */
42 #define CONFIG_STANDALONE_LOAD_ADDR     0x21000000
43
44 #define CONFIG_SYS_BOOT_SIZE            0x00 /* 0 KBytes */
45 #define CONFIG_SYS_U_BOOT_BASE          PHYS_FLASH_1
46 #define CONFIG_SYS_U_BOOT_SIZE          0x60000 /* 384 KBytes */
47
48 #define CONFIG_BOOT_RETRY_TIME          30
49 #define CONFIG_CMDLINE_EDITING
50
51 #define CONFIG_SYS_PROMPT       "U-Boot> "      /* Monitor Command Prompt */
52 #define CONFIG_SYS_CBSIZE       512             /* Console I/O Buffer Size */
53 #define CONFIG_SYS_MAXARGS      32              /* max number of command args */
54 #define CONFIG_SYS_PBSIZE       \
55         (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
56
57 /*
58  * ARM asynchronous clock
59  */
60
61 #define AT91C_MAIN_CLOCK        179404800       /* from 12.288 MHz * 73 / 5 */
62 #define AT91C_MASTER_CLOCK      (AT91C_MAIN_CLOCK / 3)
63 #define CONFIG_SYS_HZ_CLOCK     (AT91C_MASTER_CLOCK / 2)
64
65 #define CONFIG_SYS_AT91_SLOW_CLOCK      32768           /* slow clock */
66
67 #define CONFIG_CMDLINE_TAG              1
68 #define CONFIG_SETUP_MEMORY_TAGS        1
69 #define CONFIG_INITRD_TAG               1
70
71 #define CONFIG_SYS_USE_MAIN_OSCILLATOR  1
72 /* flash */
73 #define CONFIG_SYS_EBI_CFGR_VAL         0x00000000
74 #define CONFIG_SYS_SMC_CSR0_VAL         0x00003284 /* 16bit, 2 TDF, 4 WS */
75
76 /* clocks */
77 #define CONFIG_SYS_PLLAR_VAL            0x20483E05 /* 179.4048 MHz for PCK */
78 #define CONFIG_SYS_PLLBR_VAL            0x104C3E0A /* 47.3088 MHz (for USB) */
79 #define CONFIG_SYS_MCKR_VAL             0x00000202 /* PCK/3 = MCK Clock */
80
81 /*
82  * Size of malloc() pool
83  */
84
85 #define CONFIG_SYS_MALLOC_LEN           (4 * 1024 * 1024)
86
87 /*
88  * sdram
89  */
90
91 #define CONFIG_NR_DRAM_BANKS            1
92
93 #define CONFIG_SYS_SDRAM_BASE           0x20000000
94 #define CONFIG_SYS_SDRAM_SIZE           0x04000000  /* 64 megs */
95 #define CONFIG_SYS_INIT_SP_ADDR         0x00204000  /* use internal SRAM */
96
97 #define CONFIG_SYS_MEMTEST_START        CONFIG_SYS_SDRAM_BASE
98 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + \
99                                         CONFIG_SYS_SDRAM_SIZE - 0x00400000 - \
100                                         CONFIG_SYS_MALLOC_LEN)
101
102 #define CONFIG_SYS_PIOC_ASR_VAL         0xFFFF0000 /* PIOC as D16/D31 */
103 #define CONFIG_SYS_PIOC_BSR_VAL         0x00000000
104 #define CONFIG_SYS_PIOC_PDR_VAL         0xFFFF0000
105 #define CONFIG_SYS_EBI_CSA_VAL          0x00000002 /* CS1=SDRAM */
106 #define CONFIG_SYS_SDRC_CR_VAL          0x2188c159 /* set up the SDRAM */
107 #define CONFIG_SYS_SDRAM                0x20000000 /* address of the SDRAM */
108 #define CONFIG_SYS_SDRAM1               0x20000080 /* address of the SDRAM */
109 #define CONFIG_SYS_SDRAM_VAL            0x00000000 /* value written to SDRAM */
110 #define CONFIG_SYS_SDRC_MR_VAL          0x00000002 /* Precharge All */
111 #define CONFIG_SYS_SDRC_MR_VAL1         0x00000004 /* refresh */
112 #define CONFIG_SYS_SDRC_MR_VAL2         0x00000003 /* Load Mode Register */
113 #define CONFIG_SYS_SDRC_MR_VAL3         0x00000000 /* Normal Mode */
114 #define CONFIG_SYS_SDRC_TR_VAL          0x000002E0 /* Write refresh rate */
115
116 /*
117  * Command line configuration
118  */
119
120 #include <config_cmd_default.h>
121
122 #define CONFIG_CMD_BMP
123 #define CONFIG_CMD_DATE
124 #define CONFIG_CMD_DHCP
125 #define CONFIG_CMD_I2C
126 #define CONFIG_CMD_MII
127 #define CONFIG_CMD_NAND
128 #define CONFIG_CMD_PING
129 #define CONFIG_I2C_CMD_TREE
130 #define CONFIG_CMD_USB
131 #define CONFIG_CMD_FAT
132 #define CONFIG_CMD_UBI
133 #define CONFIG_CMD_MTDPARTS
134 #define CONFIG_CMD_UBIFS
135 #define CONFIG_SYS_LONGHELP
136
137 /*
138  * MTD defines
139  */
140
141 #define CONFIG_FLASH_CFI_MTD
142 #define CONFIG_MTD_DEVICE
143 #define CONFIG_MTD_PARTITIONS
144 #define CONFIG_RBTREE
145 #define CONFIG_LZO
146
147 #define MTDIDS_DEFAULT          "nor0=physmap-flash.0,nand0=atmel_nand"
148 #define MTDPARTS_DEFAULT        "mtdparts="                             \
149                                         "physmap-flash.0:"              \
150                                                 "512k(U-Boot),"         \
151                                                 "128k(Env),"            \
152                                                 "128k(Splash),"         \
153                                                 "4M(Kernel),"           \
154                                                 "384k(MiniFS),"         \
155                                                 "-(FS)"                 \
156                                         ";"                             \
157                                         "atmel_nand:"                   \
158                                                 "1M(emergency),"        \
159                                                 "-(data)"
160 /*
161  * Hardware drivers
162  */
163 #define CONFIG_USB_ATMEL
164 #define CONFIG_USB_OHCI_NEW
165 #define CONFIG_AT91C_PQFP_UHPBUG
166 #define CONFIG_USB_STORAGE
167 #define CONFIG_DOS_PARTITION
168 #define CONFIG_ISO_PARTITION
169 #define CONFIG_EFI_PARTITION
170
171 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS      1
172 #define CONFIG_SYS_USB_OHCI_CPU_INIT
173 #define CONFIG_SYS_USB_OHCI_REGS_BASE           0x00300000
174 #define CONFIG_SYS_USB_OHCI_SLOT_NAME           "at91rm9200"
175
176 /*
177  * UART/CONSOLE
178  */
179
180 #define CONFIG_BAUDRATE 115200
181 #define CONFIG_ATMEL_USART
182 #define CONFIG_USART_BASE       ATMEL_BASE_DBGU
183 #define CONFIG_USART_ID         0/* ignored in arm */
184
185 /*
186  * network
187  */
188
189 #define CONFIG_NET_RETRY_COUNT          10
190 #define CONFIG_RESET_PHY_R              1
191
192 #define CONFIG_DRIVER_AT91EMAC          1
193 #define CONFIG_DRIVER_AT91EMAC_QUIET    1
194 #define CONFIG_SYS_RX_ETH_BUFFER        8
195 #define CONFIG_MII                      1
196
197 /*
198  * BOOTP options
199  */
200 #define CONFIG_BOOTP_BOOTFILESIZE
201 #define CONFIG_BOOTP_BOOTPATH
202 #define CONFIG_BOOTP_GATEWAY
203 #define CONFIG_BOOTP_HOSTNAME
204
205 /*
206  * I2C-Bus
207  */
208
209 #define CONFIG_SYS_I2C
210 #define CONFIG_SYS_I2C_SOFT             /* I2C bit-banged */
211 #define CONFIG_SYS_I2C_SOFT_SPEED       50000
212 #define CONFIG_SYS_I2C_SOFT_SLAVE       0
213
214 /* Software  I2C driver configuration */
215
216 #define AT91_PIN_SDA                    (1<<25)         /* AT91C_PIO_PA25 */
217 #define AT91_PIN_SCL                    (1<<26)         /* AT91C_PIO_PA26 */
218
219 #define CONFIG_SYS_I2C_INIT_BOARD
220
221 #define I2C_INIT        i2c_init_board();
222 #define I2C_ACTIVE      writel(ATMEL_PMX_AA_TWD, &pio->pioa.mddr);
223 #define I2C_TRISTATE    writel(ATMEL_PMX_AA_TWD, &pio->pioa.mder);
224 #define I2C_READ        ((readl(&pio->pioa.pdsr) & ATMEL_PMX_AA_TWD) != 0)
225 #define I2C_SDA(bit)                                            \
226         if (bit)                                                \
227                 writel(ATMEL_PMX_AA_TWD, &pio->pioa.sodr);      \
228         else                                                    \
229                 writel(ATMEL_PMX_AA_TWD, &pio->pioa.codr);
230 #define I2C_SCL(bit)                                            \
231         if (bit)                                                \
232                 writel(ATMEL_PMX_AA_TWCK, &pio->pioa.sodr);     \
233         else                                                    \
234                 writel(ATMEL_PMX_AA_TWCK, &pio->pioa.codr);
235
236 #define I2C_DELAY       udelay(2500000/CONFIG_SYS_I2C_SOFT_SPEED)
237
238 /* I2C-RTC */
239
240 #ifdef CONFIG_CMD_DATE
241 #define CONFIG_RTC_DS1338
242 #define CONFIG_SYS_I2C_RTC_ADDR 0x68
243 #endif
244
245 /* EEPROM */
246
247 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
248 #define CONFIG_SYS_I2C_EEPROM_ADDR      0x50
249
250 /* FLASH organization */
251
252 /*  NOR-FLASH */
253 #define CONFIG_FLASH_SHOW_PROGRESS      45
254
255 #define CONFIG_FLASH_CFI_DRIVER 1
256
257 #define PHYS_FLASH_1                    0x10000000
258 #define PHYS_FLASH_SIZE                 0x01000000  /* 16 megs main flash */
259 #define CONFIG_SYS_FLASH_CFI            1
260 #define CONFIG_SYS_FLASH_CFI_WIDTH      FLASH_CFI_16BIT
261
262 #define CONFIG_SYS_FLASH_PROTECTION     1
263 #define CONFIG_SYS_FLASH_BASE           PHYS_FLASH_1
264 #define CONFIG_SYS_MAX_FLASH_BANKS      1
265 #define CONFIG_SYS_MAX_FLASH_SECT       512
266 #define CONFIG_SYS_FLASH_ERASE_TOUT     6000
267 #define CONFIG_SYS_FLASH_WRITE_TOUT     2000
268
269 /* NAND */
270
271 #define CONFIG_SYS_MAX_NAND_DEVICE      1
272 #define CONFIG_SYS_NAND_BASE            0x40000000
273 #define CONFIG_SYS_NAND_DBW_8           1
274
275 /* Status LED's */
276
277 #define CONFIG_STATUS_LED               1
278 #define CONFIG_BOARD_SPECIFIC_LED       1
279
280 #define STATUS_LED_BOOT                 1
281 #define STATUS_LED_ACTIVE               0
282
283 #define STATUS_LED_BIT                  1       /* AT91C_PIO_PD0 green LED */
284 #define STATUS_LED_PERIOD               (CONFIG_SYS_HZ / 2)
285 #define STATUS_LED_STATE                STATUS_LED_OFF          /* BLINKING */
286 #define STATUS_LED_BIT1                 2       /* AT91C_PIO_PD1  red LED */
287 #define STATUS_LED_STATE1               STATUS_LED_ON           /* BLINKING */
288 #define STATUS_LED_PERIOD1              (CONFIG_SYS_HZ / 4)
289
290 #define CONFIG_VIDEO                    1
291
292 /* Options */
293
294 #ifdef CONFIG_VIDEO
295
296 #define CONFIG_VIDEO_VCXK                       1
297
298 #define CONFIG_SPLASH_SCREEN                    1
299
300 #define CONFIG_SYS_VCXK_DEFAULT_LINEALIGN       4
301 #define CONFIG_SYS_VCXK_BASE    0x30000000
302
303 #define CONFIG_SYS_VCXK_ACKNOWLEDGE_PIN         (1<<3)
304 #define CONFIG_SYS_VCXK_ACKNOWLEDGE_PORT        piob
305 #define CONFIG_SYS_VCXK_ACKNOWLEDGE_DDR         odr
306
307 #define CONFIG_SYS_VCXK_ENABLE_PIN              (1<<5)
308 #define CONFIG_SYS_VCXK_ENABLE_PORT             piob
309 #define CONFIG_SYS_VCXK_ENABLE_DDR              oer
310
311 #define CONFIG_SYS_VCXK_REQUEST_PIN             (1<<2)
312 #define CONFIG_SYS_VCXK_REQUEST_PORT            piob
313 #define CONFIG_SYS_VCXK_REQUEST_DDR             oer
314
315 #define CONFIG_SYS_VCXK_INVERT_PIN              (1<<4)
316 #define CONFIG_SYS_VCXK_INVERT_PORT             piob
317 #define CONFIG_SYS_VCXK_INVERT_DDR              oer
318
319 #define CONFIG_SYS_VCXK_RESET_PIN               (1<<6)
320 #define CONFIG_SYS_VCXK_RESET_PORT              piob
321 #define CONFIG_SYS_VCXK_RESET_DDR               oer
322
323 #endif  /* CONFIG_VIDEO */
324
325 /* Environment */
326
327 #define CONFIG_BOOTDELAY                5
328
329 #define CONFIG_ENV_IS_IN_FLASH          1
330 #define CONFIG_ENV_ADDR                 (PHYS_FLASH_1 + 0x80000)
331 #define CONFIG_ENV_SIZE                 0x20000 /* sectors are 128K here */
332
333 #define CONFIG_BAUDRATE                 115200
334
335 #define CONFIG_BOOTCOMMAND              "run nfsboot"
336
337 #define CONFIG_NFSBOOTCOMMAND                                           \
338                 "dhcp $(copy_addr) uImage_cpux9k2;"                     \
339                 "run bootargsdefaults;"                                 \
340                 "set bootargs $(bootargs) boot=nfs "                    \
341                 ";echo $(bootargs)"                                     \
342         ";bootm"
343
344 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
345         "displaywidth=256\0"                                            \
346         "displayheight=512\0"                                           \
347         "displaybsteps=1023\0"                                          \
348         "ubootaddr=10000000\0"                                          \
349         "splashimage=100A0000\0"                                        \
350         "kerneladdr=100C0000\0"                                         \
351         "kernelsize=00400000\0"                                         \
352         "rootfsaddr=10520000\0"                                         \
353         "copy_addr=21200000\0"                                          \
354         "rootfssize=00AE0000\0"                                         \
355         "mtdids=" MTDIDS_DEFAULT "\0"                                   \
356         "mtdparts=" MTDPARTS_DEFAULT "\0"                               \
357         "bootargsdefaults=set bootargs "                                \
358                 "console=ttyS0,115200 "                                 \
359                 "video=vcxk_fb:xres:${displaywidth},"                   \
360                         "yres:${displayheight},"                        \
361                         "bres:${displaybsteps} "                        \
362                 "mem=62M "                                              \
363                 "panic=10 "                                             \
364                 "uboot=\\\"${ver}\\\" "                                 \
365                 "\0"                                                    \
366         "update_kernel=protect off $(kerneladdr) +$(kernelsize);"       \
367                 "dhcp $(copy_addr) uImage_cpux9k2;"                     \
368                 "erase $(kerneladdr) +$(kernelsize);"                   \
369                 "cp.b $(fileaddr) $(kerneladdr) $(filesize);"           \
370                 "protect on $(kerneladdr) +$(kernelsize)"               \
371                 "\0"                                                    \
372         "update_root=protect off $(rootfsaddr) +$(rootfssize);"         \
373                 "dhcp $(copy_addr) rfs;"                                \
374                 "erase $(rootfsaddr) +$(rootfssize);"                   \
375                 "cp.b $(fileaddr) $(rootfsaddr) $(filesize);"           \
376                 "\0"                                                    \
377         "update_uboot=protect off 10000000 1007FFFF;"                   \
378                 "dhcp $(copy_addr) u-boot_eb_cpux9k2;"                  \
379                 "erase 10000000 1007FFFF;"                              \
380                 "cp.b $(fileaddr) $(ubootaddr) $(filesize);"            \
381                 "protect on 10000000 1007FFFF;reset\0"                  \
382         "update_splash=protect off $(splashimage) +20000;"              \
383                 "dhcp $(copy_addr) splash_eb_cpux9k2.bmp;"              \
384                 "erase $(splashimage) +20000;"                          \
385                 "cp.b $(fileaddr) $(splashimage) $(filesize);"          \
386                 "protect on $(splashimage) +20000;reset\0"              \
387         "emergency=run bootargsdefaults;"                               \
388                 "set bootargs $(bootargs) root=initramfs boot=emergency " \
389                 ";bootm $(kerneladdr)\0"                                \
390         "netemergency=run bootargsdefaults;"                            \
391                 "dhcp $(copy_addr) uImage_cpux9k2;"                     \
392                 "set bootargs $(bootargs) root=initramfs boot=emergency " \
393                 ";bootm $(copy_addr)\0"                                 \
394         "norboot=run bootargsdefaults;"                                 \
395                 "set bootargs $(bootargs) root=initramfs boot=local "   \
396                 ";bootm $(kerneladdr)\0"                                \
397         "nandboot=run bootargsdefaults;"                                \
398                 "set bootargs $(bootargs) root=initramfs boot=nand "    \
399                 ";bootm $(kerneladdr)\0"                                \
400         " "
401
402 /*--------------------------------------------------------------------------*/
403
404 #endif
405
406 /* EOF */