blob: 6c080437ffa91325efdfa3a1cabd1629c873951c [file] [log] [blame]
wdenkfe8c2802002-11-03 00:38:21 +00001/*
2 * (C) Copyright 2000
3 * Murray Jensen <Murray.Jensen@cmst.csiro.au>
4 *
5 * (C) Copyright 2000
6 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
7 * Marius Groeger <mgroeger@sysgo.de>
8 *
9 * (C) Copyright 2001
10 * Advent Networks, Inc. <http://www.adventnetworks.com>
11 * Jay Monkman <jmonkman@adventnetworks.com>
12 *
13 * (C) Copyright 2001
14 * Advent Networks, Inc. <http://www.adventnetworks.com>
15 * Oliver Brown <obrown@adventnetworks.com>
16 *
17 * See file CREDITS for list of people who contributed to this
18 * project.
19 *
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License as
22 * published by the Free Software Foundation; either version 2 of
23 * the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 * MA 02111-1307 USA
34 */
35
36/*********************************************************************/
37/* DESCRIPTION:
38 * This file contains the board configuartion for the GW8260 board.
39 *
40 * MODULE DEPENDENCY:
41 * None
42 *
43 * RESTRICTIONS/LIMITATIONS:
44 * None
45 *
46 * Copyright (c) 2001, Advent Networks, Inc.
47 */
48/*********************************************************************/
49
50#ifndef __CONFIG_H
51#define __CONFIG_H
52
53/* Enable debug prints */
54#undef DEBUG /* General debug */
55#undef DEBUG_BOOTP_EXT /* Debug received vendor fields */
56
57/* What is the oscillator's (UX2) frequency in Hz? */
58#define CONFIG_8260_CLKIN (66 * 1000 * 1000)
59
60/*-----------------------------------------------------------------------
61 * MODCK_H & MODCLK[1-3] - Ref: Section 9.2 in MPC8206 User Manual
62 *-----------------------------------------------------------------------
63 * What should MODCK_H be? It is dependent on the oscillator
64 * frequency, MODCK[1-3], and desired CPM and core frequencies.
65 * Here are some example values (all frequencies are in MHz):
66 *
67 * MODCK_H MODCK[1-3] Osc CPM Core S2-6 S2-7 S2-8
68 * ------- ---------- --- --- ---- ----- ----- -----
69 * 0x5 0x5 66 133 133 Open Close Open
70 * 0x5 0x6 66 133 166 Open Open Close
71 * 0x5 0x7 66 133 200 Open Open Open
72 * 0x6 0x0 66 133 233 Close Close Close
73 * 0x6 0x1 66 133 266 Close Close Open
74 * 0x6 0x2 66 133 300 Close Open Close
75 */
76#define CFG_SBC_MODCK_H 0x05
77
78/* Define this if you want to boot from 0x00000100. If you don't define
79 * this, you will need to program the bootloader to 0xfff00000, and
80 * get the hardware reset config words at 0xfe000000. The simplest
81 * way to do that is to program the bootloader at both addresses.
82 * It is suggested that you just let U-Boot live at 0x00000000.
83 */
84#define CFG_SBC_BOOT_LOW 1
85
86/* What should the base address of the main FLASH be and how big is
87 * it (in MBytes)? This must contain TEXT_BASE from board/sbc8260/config.mk
88 * The main FLASH is whichever is connected to *CS0. U-Boot expects
89 * this to be the SIMM.
90 */
91#define CFG_FLASH0_BASE 0x40000000
92#define CFG_FLASH0_SIZE 8
93
94/* Define CFG_FLASH_CHECKSUM to enable flash checksum during boot.
95 * Note: the 'flashchecksum' environment variable must also be set to 'y'.
96 */
97#define CFG_FLASH_CHECKSUM
98
99/* What should be the base address of SDRAM DIMM and how big is
100 * it (in Mbytes)?
101 */
102#define CFG_SDRAM0_BASE 0x00000000
103#define CFG_SDRAM0_SIZE 64
104
105/*
106 * DRAM tests
107 * CFG_DRAM_TEST - enables the following tests.
108 *
109 * CFG_DRAM_TEST_DATA - Enables test for shorted or open data lines
110 * Environment variable 'test_dram_data' must be
111 * set to 'y'.
112 * CFG_DRAM_TEST_DATA - Enables test to verify that each word is uniquely
113 * addressable. Environment variable
114 * 'test_dram_address' must be set to 'y'.
115 * CFG_DRAM_TEST_WALK - Enables test a 64-bit walking ones pattern test.
116 * This test takes about 6 minutes to test 64 MB.
117 * Environment variable 'test_dram_walk' must be
118 * set to 'y'.
119 */
120#define CFG_DRAM_TEST
121#if defined(CFG_DRAM_TEST)
122#define CFG_DRAM_TEST_DATA
123#define CFG_DRAM_TEST_ADDRESS
124#define CFG_DRAM_TEST_WALK
125#endif /* CFG_DRAM_TEST */
126
127/*
128 * GW8260 with 16 MB DIMM:
129 *
130 * 0x0000 0000 Exception Vector code, 8k
131 * :
132 * 0x0000 1FFF
133 * 0x0000 2000 Free for Application Use
134 * :
135 * :
136 *
137 * :
138 * :
139 * 0x00F5 FF30 Monitor Stack (Growing downward)
140 * Monitor Stack Buffer (0x80)
141 * 0x00F5 FFB0 Board Info Data
142 * 0x00F6 0000 Malloc Arena
143 * : CFG_ENV_SECT_SIZE, 256k
144 * : CFG_MALLOC_LEN, 128k
145 * 0x00FC 0000 RAM Copy of Monitor Code
146 * : CFG_MONITOR_LEN, 256k
147 * 0x00FF FFFF [End of RAM], CFG_SDRAM_SIZE - 1
148 */
149
150/*
151 * GW8260 with 64 MB DIMM:
152 *
153 * 0x0000 0000 Exception Vector code, 8k
154 * :
155 * 0x0000 1FFF
156 * 0x0000 2000 Free for Application Use
157 * :
158 * :
159 *
160 * :
161 * :
162 * 0x03F5 FF30 Monitor Stack (Growing downward)
163 * Monitor Stack Buffer (0x80)
164 * 0x03F5 FFB0 Board Info Data
165 * 0x03F6 0000 Malloc Arena
166 * : CFG_ENV_SECT_SIZE, 256k
167 * : CFG_MALLOC_LEN, 128k
168 * 0x03FC 0000 RAM Copy of Monitor Code
169 * : CFG_MONITOR_LEN, 256k
170 * 0x03FF FFFF [End of RAM], CFG_SDRAM_SIZE - 1
171 */
172
173
174/*
175 * select serial console configuration
176 *
177 * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
178 * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
179 * for SCC).
180 *
181 * if CONFIG_CONS_NONE is defined, then the serial console routines must
182 * defined elsewhere.
183 */
184#define CONFIG_CONS_ON_SMC 1 /* define if console on SMC */
185#undef CONFIG_CONS_ON_SCC /* define if console on SCC */
186#undef CONFIG_CONS_NONE /* define if console on neither */
187#define CONFIG_CONS_INDEX 1 /* which SMC/SCC channel for console */
188
189/*
190 * select ethernet configuration
191 *
192 * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
193 * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
194 * for FCC)
195 *
196 * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
197 * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
198 * from CONFIG_COMMANDS to remove support for networking.
199 */
200
201#undef CONFIG_ETHER_ON_SCC
202#define CONFIG_ETHER_ON_FCC
203#undef CONFIG_ETHER_NONE /* define if ethernet on neither */
204
205#ifdef CONFIG_ETHER_ON_SCC
206#define CONFIG_ETHER_INDEX 1 /* which SCC/FCC channel for ethernet */
207#endif /* CONFIG_ETHER_ON_SCC */
208
209#ifdef CONFIG_ETHER_ON_FCC
210#define CONFIG_ETHER_INDEX 2 /* which SCC/FCC channel for ethernet */
211#define CONFIG_MII /* MII PHY management */
212#define CONFIG_BITBANGMII /* bit-bang MII PHY management */
213/*
214 * Port pins used for bit-banged MII communictions (if applicable).
215 */
216#define MDIO_PORT 2 /* Port C */
217#define MDIO_ACTIVE (iop->pdir |= 0x00400000)
218#define MDIO_TRISTATE (iop->pdir &= ~0x00400000)
219#define MDIO_READ ((iop->pdat & 0x00400000) != 0)
220
221#define MDIO(bit) if(bit) iop->pdat |= 0x00400000; \
wdenk8bde7f72003-06-27 21:31:46 +0000222 else iop->pdat &= ~0x00400000
wdenkfe8c2802002-11-03 00:38:21 +0000223
224#define MDC(bit) if(bit) iop->pdat |= 0x00200000; \
wdenk8bde7f72003-06-27 21:31:46 +0000225 else iop->pdat &= ~0x00200000
wdenkfe8c2802002-11-03 00:38:21 +0000226
227#define MIIDELAY udelay(1)
228#endif /* CONFIG_ETHER_ON_FCC */
229
230#if defined(CONFIG_ETHER_ON_FCC) && (CONFIG_ETHER_INDEX == 2)
231
232/*
233 * - Rx-CLK is CLK13
234 * - Tx-CLK is CLK14
235 * - Select bus for bd/buffers (see 28-13)
236 * - Enable Full Duplex in FSMR
237 */
238# define CFG_CMXFCR_MASK (CMXFCR_FC2|CMXFCR_RF2CS_MSK|CMXFCR_TF2CS_MSK)
239# define CFG_CMXFCR_VALUE (CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14)
240# define CFG_CPMFCR_RAMTYPE 0
241# define CFG_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
242
243#elif defined(CONFIG_ETHER_ON_FCC) && (CONFIG_ETHER_INDEX == 3)
244
245/*
246 * - Rx-CLK is CLK15
247 * - Tx-CLK is CLK16
248 * - Select bus for bd/buffers (see 28-13)
249 * - Enable Full Duplex in FSMR
250 */
251# define CFG_CMXFCR_MASK (CMXFCR_FC3|CMXFCR_RF3CS_MSK|CMXFCR_TF3CS_MSK)
252# define CFG_CMXFCR_VALUE (CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16)
253# define CFG_CPMFCR_RAMTYPE 0
254# define CFG_FCC_PSMR (FCC_PSMR_FDE | FCC_PSMR_LPB)
255
256#endif /* CONFIG_ETHER_ON_FCC, CONFIG_ETHER_INDEX */
257
258/* Define this to reserve an entire FLASH sector (256 KB) for
259 * environment variables. Otherwise, the environment will be
260 * put in the same sector as U-Boot, and changing variables
261 * will erase U-Boot temporarily
262 */
263#define CFG_ENV_IN_OWN_SECT
264
265/* Define to allow the user to overwrite serial and ethaddr */
266#define CONFIG_ENV_OVERWRITE
267
268/* What should the console's baud rate be? */
269#define CONFIG_BAUDRATE 115200
270
271/* Ethernet MAC address - This is set to all zeros to force an
272 * an error if we use BOOTP without setting
273 * the MAC address
274 */
275#define CONFIG_ETHADDR 00:00:00:00:00:00
276
277/* Set to a positive value to delay for running BOOTCOMMAND */
278#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
279
280/* Be selective on what keys can delay or stop the autoboot process
281 * To stop use: " "
282 */
283#define CONFIG_AUTOBOOT_KEYED
284#define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds, press \" \" to stop\n"
285#define CONFIG_AUTOBOOT_STOP_STR " "
286#undef CONFIG_AUTOBOOT_DELAY_STR
287#define DEBUG_BOOTKEYS 0
288
289/* Add support for a few extra bootp options like:
290 * - File size
291 * - DNS
292 */
293#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | \
wdenk8bde7f72003-06-27 21:31:46 +0000294 CONFIG_BOOTP_BOOTFILESIZE | \
295 CONFIG_BOOTP_DNS)
wdenkfe8c2802002-11-03 00:38:21 +0000296
297/* undef this to save memory */
298#define CFG_LONGHELP
299
300/* Monitor Command Prompt */
301#define CFG_PROMPT "=> "
302
303/* What U-Boot subsytems do you want enabled? */
304#define CONFIG_COMMANDS (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
wdenk8bde7f72003-06-27 21:31:46 +0000305 CFG_CMD_BEDBUG | \
306 CFG_CMD_ELF | \
307 CFG_CMD_ASKENV | \
308 CFG_CMD_ECHO | \
309 CFG_CMD_REGINFO | \
310 CFG_CMD_IMMAP | \
311 CFG_CMD_MII)
wdenkfe8c2802002-11-03 00:38:21 +0000312
313/* Where do the internal registers live? */
314#define CFG_IMMR 0xf0000000
315
316/* Use the HUSH parser */
317#define CFG_HUSH_PARSER
318#ifdef CFG_HUSH_PARSER
319#define CFG_PROMPT_HUSH_PS2 "> "
320#endif
321
322/* What is the address of IO controller */
323#define CFG_IO_BASE 0xe0000000
324
325/*****************************************************************************
326 *
327 * You should not have to modify any of the following settings
328 *
329 *****************************************************************************/
330
331#define CONFIG_MPC8260 1 /* This is an MPC8260 CPU */
332#define CONFIG_GW8260 1 /* on an GW8260 Board */
Jon Loeliger9c4c5ae2005-07-23 10:37:35 -0500333#define CONFIG_CPM2 1 /* Has a CPM2 */
wdenkfe8c2802002-11-03 00:38:21 +0000334
335/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
336#include <cmd_confdefs.h>
337
338/*
339 * Miscellaneous configurable options
340 */
341#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
342# define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
343#else
344# define CFG_CBSIZE 256 /* Console I/O Buffer Size */
345#endif
346
347/* Print Buffer Size */
348#define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT)+16)
349
350#define CFG_MAXARGS 8 /* max number of command args */
351
352#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
353
354/* Convert clocks to MHZ when passing board info to kernel.
355 * This must be defined for eariler 2.4 kernels (~2.4.4).
356 */
357#define CONFIG_CLOCKS_IN_MHZ
358
359#define CFG_LOAD_ADDR 0x100000 /* default load address */
360#define CFG_HZ 1000 /* decrementer freq: 1 ms ticks */
361
362
363/* memtest works from the end of the exception vector table
364 * to the end of the DRAM less monitor and malloc area
365 */
366#define CFG_MEMTEST_START 0x2000
367
368#define CFG_STACK_USAGE 0x10000 /* Reserve 64k for the stack usage */
369
370#define CFG_MEM_END_USAGE ( CFG_MONITOR_LEN \
wdenk8bde7f72003-06-27 21:31:46 +0000371 + CFG_MALLOC_LEN \
372 + CFG_ENV_SECT_SIZE \
373 + CFG_STACK_USAGE )
wdenkfe8c2802002-11-03 00:38:21 +0000374
375#define CFG_MEMTEST_END ( CFG_SDRAM_SIZE * 1024 * 1024 \
wdenk8bde7f72003-06-27 21:31:46 +0000376 - CFG_MEM_END_USAGE )
wdenkfe8c2802002-11-03 00:38:21 +0000377
378/* valid baudrates */
379#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
380
381/*
382 * Low Level Configuration Settings
383 * (address mappings, register initial values, etc.)
384 * You should know what you are doing if you make changes here.
385 */
386
387#define CFG_FLASH_BASE CFG_FLASH0_BASE
388#define CFG_FLASH_SIZE CFG_FLASH0_SIZE
389#define CFG_SDRAM_BASE CFG_SDRAM0_BASE
390#define CFG_SDRAM_SIZE CFG_SDRAM0_SIZE
391
392/*-----------------------------------------------------------------------
393 * Hard Reset Configuration Words
394 */
395#if defined(CFG_SBC_BOOT_LOW)
396# define CFG_SBC_HRCW_BOOT_FLAGS (HRCW_CIP | HRCW_BMS)
397#else
398# define CFG_SBC_HRCW_BOOT_FLAGS (0)
399#endif /* defined(CFG_SBC_BOOT_LOW) */
400
401/* get the HRCW ISB field from CFG_IMMR */
402#define CFG_SBC_HRCW_IMMR ( ((CFG_IMMR & 0x10000000) >> 10) | \
wdenk8bde7f72003-06-27 21:31:46 +0000403 ((CFG_IMMR & 0x01000000) >> 7) | \
404 ((CFG_IMMR & 0x00100000) >> 4) )
wdenkfe8c2802002-11-03 00:38:21 +0000405
406#define CFG_HRCW_MASTER ( HRCW_BPS11 | \
wdenk8bde7f72003-06-27 21:31:46 +0000407 HRCW_DPPC11 | \
408 CFG_SBC_HRCW_IMMR | \
409 HRCW_MMR00 | \
410 HRCW_LBPC11 | \
411 HRCW_APPC10 | \
412 HRCW_CS10PC00 | \
413 (CFG_SBC_MODCK_H & HRCW_MODCK_H1111) | \
414 CFG_SBC_HRCW_BOOT_FLAGS )
wdenkfe8c2802002-11-03 00:38:21 +0000415
416/* no slaves */
417#define CFG_HRCW_SLAVE1 0
418#define CFG_HRCW_SLAVE2 0
419#define CFG_HRCW_SLAVE3 0
420#define CFG_HRCW_SLAVE4 0
421#define CFG_HRCW_SLAVE5 0
422#define CFG_HRCW_SLAVE6 0
423#define CFG_HRCW_SLAVE7 0
424
425/*-----------------------------------------------------------------------
426 * Definitions for initial stack pointer and data area (in DPRAM)
427 */
428#define CFG_INIT_RAM_ADDR CFG_IMMR
429#define CFG_INIT_RAM_END 0x4000 /* End of used area in DPRAM */
430#define CFG_GBL_DATA_SIZE 128 /* bytes reserved for initial data */
431#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
432#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
433
434/*-----------------------------------------------------------------------
435 * Start addresses for the final memory configuration
436 * (Set up by the startup code)
437 * Please note that CFG_SDRAM_BASE _must_ start at 0
438 * Note also that the logic that sets CFG_RAMBOOT is platform dependent.
439 */
440#define CFG_MONITOR_BASE CFG_FLASH0_BASE
441
442#define CFG_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Monitor */
443#define CFG_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */
444
445/*
446 * For booting Linux, the board info and command line data
447 * have to be in the first 8 MB of memory, since this is
448 * the maximum mapped by the Linux kernel during initialization.
449 */
450#define CFG_BOOTMAPSZ (8 * 1024 * 1024) /* Initial Memory map for Linux */
451
452/*-----------------------------------------------------------------------
453 * FLASH and environment organization
454 */
455#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
456#define CFG_MAX_FLASH_SECT 32 /* max number of sectors on one chip */
457
458#define CFG_FLASH_ERASE_TOUT 8000 /* Timeout for Flash Erase (in ms) */
459#define CFG_FLASH_WRITE_TOUT 1 /* Timeout for Flash Write (in ms) */
460
461#define CFG_ENV_IS_IN_FLASH 1
462
463#ifdef CFG_ENV_IN_OWN_SECT
464# define CFG_ENV_ADDR (CFG_MONITOR_BASE + (256 * 1024))
465# define CFG_ENV_SECT_SIZE (256 * 1024)
466#else
467# define CFG_ENV_SIZE (16 * 1024)/* Size of Environment Sector */
468# define CFG_ENV_ADD ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) - CFG_ENV_SIZE)
469# define CFG_ENV_SECT_SIZE (256 * 1024)/* see README - env sect real size */
470#endif /* CFG_ENV_IN_OWN_SECT */
471
472/*-----------------------------------------------------------------------
473 * Cache Configuration
474 */
475#define CFG_CACHELINE_SIZE 32 /* For MPC8260 CPU */
476
477#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
478# define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
479#endif
480
481/*-----------------------------------------------------------------------
482 * HIDx - Hardware Implementation-dependent Registers 2-11
483 *-----------------------------------------------------------------------
484 * HID0 also contains cache control - initially enable both caches and
485 * invalidate contents, then the final state leaves only the instruction
486 * cache enabled. Note that Power-On and Hard reset invalidate the caches,
487 * but Soft reset does not.
488 *
489 * HID1 has only read-only information - nothing to set.
490 */
491#define CFG_HID0_INIT (HID0_ICE |\
wdenk8bde7f72003-06-27 21:31:46 +0000492 HID0_DCE |\
493 HID0_ICFI |\
494 HID0_DCI |\
495 HID0_IFEM |\
496 HID0_ABE)
wdenkfe8c2802002-11-03 00:38:21 +0000497
498#define CFG_HID0_FINAL (HID0_ICE |\
wdenk8bde7f72003-06-27 21:31:46 +0000499 HID0_IFEM |\
500 HID0_ABE |\
501 HID0_EMCP)
wdenkfe8c2802002-11-03 00:38:21 +0000502#define CFG_HID2 0
503
504/*-----------------------------------------------------------------------
505 * RMR - Reset Mode Register
506 *-----------------------------------------------------------------------
507 */
508#define CFG_RMR 0
509
510/*-----------------------------------------------------------------------
511 * BCR - Bus Configuration 4-25
512 *-----------------------------------------------------------------------
513 */
514#define CFG_BCR (BCR_ETM)
515
516/*-----------------------------------------------------------------------
517 * SIUMCR - SIU Module Configuration 4-31
518 *-----------------------------------------------------------------------
519 */
520#define CFG_SIUMCR (SIUMCR_DPPC11 |\
wdenk8bde7f72003-06-27 21:31:46 +0000521 SIUMCR_L2CPC00 |\
522 SIUMCR_APPC10 |\
523 SIUMCR_MMR00)
wdenkfe8c2802002-11-03 00:38:21 +0000524
525
526/*-----------------------------------------------------------------------
527 * SYPCR - System Protection Control 11-9
528 * SYPCR can only be written once after reset!
529 *-----------------------------------------------------------------------
530 * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
531 */
532#define CFG_SYPCR (SYPCR_SWTC |\
wdenk8bde7f72003-06-27 21:31:46 +0000533 SYPCR_BMT |\
534 SYPCR_PBME |\
535 SYPCR_LBME |\
536 SYPCR_SWRI |\
537 SYPCR_SWP)
wdenkfe8c2802002-11-03 00:38:21 +0000538
539/*-----------------------------------------------------------------------
540 * TMCNTSC - Time Counter Status and Control 4-40
541 *-----------------------------------------------------------------------
542 * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
543 * and enable Time Counter
544 */
545#define CFG_TMCNTSC (TMCNTSC_SEC |\
wdenk8bde7f72003-06-27 21:31:46 +0000546 TMCNTSC_ALR |\
547 TMCNTSC_TCF |\
548 TMCNTSC_TCE)
wdenkfe8c2802002-11-03 00:38:21 +0000549
550/*-----------------------------------------------------------------------
551 * PISCR - Periodic Interrupt Status and Control 4-42
552 *-----------------------------------------------------------------------
553 * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
554 * Periodic timer
555 */
556#define CFG_PISCR (PISCR_PS |\
wdenk8bde7f72003-06-27 21:31:46 +0000557 PISCR_PTF |\
558 PISCR_PTE)
wdenkfe8c2802002-11-03 00:38:21 +0000559
560/*-----------------------------------------------------------------------
561 * SCCR - System Clock Control 9-8
562 *-----------------------------------------------------------------------
563 */
564#define CFG_SCCR 0
565
566/*-----------------------------------------------------------------------
567 * RCCR - RISC Controller Configuration 13-7
568 *-----------------------------------------------------------------------
569 */
570#define CFG_RCCR 0
571
572/*
573 * Initialize Memory Controller:
574 *
575 * Bank Bus Machine PortSz Device
576 * ---- --- ------- ------ ------
577 * 0 60x GPCM 32 bit FLASH (SIMM - 4MB)
578 * 1 60x GPCM 32 bit unused
579 * 2 60x SDRAM 64 bit SDRAM (DIMM - 16MB or 64MB)
580 * 3 60x SDRAM 64 bit unused
581 * 4 Local GPCM 8 bit IO (on board - 64k)
582 * 5 60x GPCM 8 bit unused
583 * 6 60x GPCM 8 bit unused
584 * 7 60x GPCM 8 bit unused
585 *
586 */
587
588/*-----------------------------------------------------------------------
589 * BR0 - Base Register
590 * Ref: Section 10.3.1 on page 10-14
591 * OR0 - Option Register
592 * Ref: Section 10.3.2 on page 10-18
593 *-----------------------------------------------------------------------
594 */
595
596/* Bank 0,1 - FLASH SIMM
597 *
598 * This expects the FLASH SIMM to be connected to *CS0
599 * It consists of 4 AM29F016D parts.
600 *
601 * Note: For the 8 MB SIMM, *CS1 is unused.
602 */
603
604/* BR0 is configured as follows:
605 *
606 * - Base address of 0x40000000
607 * - 32 bit port size
608 * - Data errors checking is disabled
609 * - Read and write access
610 * - GPCM 60x bus
611 * - Access are handled by the memory controller according to MSEL
612 * - Not used for atomic operations
613 * - No data pipelining is done
614 * - Valid
615 */
616#define CFG_BR0_PRELIM ((CFG_FLASH0_BASE & BRx_BA_MSK) |\
wdenk8bde7f72003-06-27 21:31:46 +0000617 BRx_PS_32 |\
618 BRx_MS_GPCM_P |\
619 BRx_V)
wdenkfe8c2802002-11-03 00:38:21 +0000620
621/* OR0 is configured as follows:
622 *
623 * - 8 MB
624 * - *BCTL0 is asserted upon access to the current memory bank
625 * - *CW / *WE are negated a quarter of a clock earlier
626 * - *CS is output at the same time as the address lines
627 * - Uses a clock cycle length of 5
628 * - *PSDVAL is generated internally by the memory controller
629 * unless *GTA is asserted earlier externally.
630 * - Relaxed timing is generated by the GPCM for accesses
631 * initiated to this memory region.
632 * - One idle clock is inserted between a read access from the
633 * current bank and the next access.
634 */
635#define CFG_OR0_PRELIM (MEG_TO_AM(CFG_FLASH0_SIZE) |\
wdenk8bde7f72003-06-27 21:31:46 +0000636 ORxG_CSNT |\
637 ORxG_ACS_DIV1 |\
638 ORxG_SCY_5_CLK |\
639 ORxG_TRLX |\
640 ORxG_EHTR)
wdenkfe8c2802002-11-03 00:38:21 +0000641
642/*-----------------------------------------------------------------------
643 * BR2 - Base Register
644 * Ref: Section 10.3.1 on page 10-14
645 * OR2 - Option Register
646 * Ref: Section 10.3.2 on page 10-16
647 *-----------------------------------------------------------------------
648 */
649
650/* Bank 2 - SDRAM DIMM
651 *
652 * 16MB DIMM: P/N
653 * 64MB DIMM: P/N 1W-8864X8-4-P1-EST or
654 * MT4LSDT864AG-10EB1 (Micron)
655 *
656 * Note: *CS3 is unused for this DIMM
657 */
658
659/* With a 16 MB or 64 MB DIMM, the BR2 is configured as follows:
660 *
661 * - Base address of 0x00000000
662 * - 64 bit port size (60x bus only)
663 * - Data errors checking is disabled
664 * - Read and write access
665 * - SDRAM 60x bus
666 * - Access are handled by the memory controller according to MSEL
667 * - Not used for atomic operations
668 * - No data pipelining is done
669 * - Valid
670 */
671#define CFG_BR2_PRELIM ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
wdenk8bde7f72003-06-27 21:31:46 +0000672 BRx_PS_64 |\
673 BRx_MS_SDRAM_P |\
674 BRx_V)
wdenkfe8c2802002-11-03 00:38:21 +0000675
676/* With a 16 MB DIMM, the OR2 is configured as follows:
677 *
678 * - 16 MB
679 * - 2 internal banks per device
680 * - Row start address bit is A9 with PSDMR[PBI] = 0
681 * - 11 row address lines
682 * - Back-to-back page mode
683 * - Internal bank interleaving within save device enabled
684 */
685#if (CFG_SDRAM0_SIZE == 16)
686#define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
wdenk8bde7f72003-06-27 21:31:46 +0000687 ORxS_BPD_2 |\
688 ORxS_ROWST_PBI0_A9 |\
689 ORxS_NUMR_11)
wdenkfe8c2802002-11-03 00:38:21 +0000690
691/* With a 16 MB DIMM, the PSDMR is configured as follows:
692 *
693 * - Page Based Interleaving,
694 * - Refresh Enable,
695 * - Address Multiplexing where A5 is output on A14 pin
696 * (A6 on A15, and so on),
697 * - use address pins A16-A18 as bank select,
698 * - A9 is output on SDA10 during an ACTIVATE command,
699 * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
700 * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
701 * is 3 clocks,
702 * - earliest timing for READ/WRITE command after ACTIVATE command is
703 * 2 clocks,
704 * - earliest timing for PRECHARGE after last data was read is 1 clock,
705 * - earliest timing for PRECHARGE after last data was written is 1 clock,
706 * - CAS Latency is 2.
707 */
708
709/*-----------------------------------------------------------------------
710 * PSDMR - 60x Bus SDRAM Mode Register
711 * Ref: Section 10.3.3 on page 10-21
712 *-----------------------------------------------------------------------
713 */
714#define CFG_PSDMR (PSDMR_RFEN |\
wdenk8bde7f72003-06-27 21:31:46 +0000715 PSDMR_SDAM_A14_IS_A5 |\
716 PSDMR_BSMA_A16_A18 |\
717 PSDMR_SDA10_PBI0_A9 |\
718 PSDMR_RFRC_7_CLK |\
719 PSDMR_PRETOACT_3W |\
720 PSDMR_ACTTORW_2W |\
721 PSDMR_LDOTOPRE_1C |\
722 PSDMR_WRC_1C |\
723 PSDMR_CL_2)
wdenkfe8c2802002-11-03 00:38:21 +0000724#endif /* (CFG_SDRAM0_SIZE == 16) */
725
726/* With a 64 MB DIMM, the OR2 is configured as follows:
727 *
728 * - 64 MB
729 * - 4 internal banks per device
730 * - Row start address bit is A8 with PSDMR[PBI] = 0
731 * - 12 row address lines
732 * - Back-to-back page mode
733 * - Internal bank interleaving within save device enabled
734 */
735#if (CFG_SDRAM0_SIZE == 64)
736#define CFG_OR2_PRELIM (MEG_TO_AM(CFG_SDRAM0_SIZE) |\
wdenk8bde7f72003-06-27 21:31:46 +0000737 ORxS_BPD_4 |\
738 ORxS_ROWST_PBI0_A8 |\
739 ORxS_NUMR_12)
wdenkfe8c2802002-11-03 00:38:21 +0000740
741/* With a 64 MB DIMM, the PSDMR is configured as follows:
742 *
743 * - Page Based Interleaving,
744 * - Refresh Enable,
745 * - Address Multiplexing where A5 is output on A14 pin
746 * (A6 on A15, and so on),
747 * - use address pins A14-A16 as bank select,
748 * - A9 is output on SDA10 during an ACTIVATE command,
749 * - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
750 * - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
751 * is 3 clocks,
752 * - earliest timing for READ/WRITE command after ACTIVATE command is
753 * 2 clocks,
754 * - earliest timing for PRECHARGE after last data was read is 1 clock,
755 * - earliest timing for PRECHARGE after last data was written is 1 clock,
756 * - CAS Latency is 2.
757 */
758
759/*-----------------------------------------------------------------------
760 * PSDMR - 60x Bus SDRAM Mode Register
761 * Ref: Section 10.3.3 on page 10-21
762 *-----------------------------------------------------------------------
763 */
764#define CFG_PSDMR (PSDMR_RFEN |\
wdenk8bde7f72003-06-27 21:31:46 +0000765 PSDMR_SDAM_A14_IS_A5 |\
766 PSDMR_BSMA_A14_A16 |\
767 PSDMR_SDA10_PBI0_A9 |\
768 PSDMR_RFRC_7_CLK |\
769 PSDMR_PRETOACT_3W |\
770 PSDMR_ACTTORW_2W |\
771 PSDMR_LDOTOPRE_1C |\
772 PSDMR_WRC_1C |\
773 PSDMR_CL_2)
wdenkfe8c2802002-11-03 00:38:21 +0000774#endif /* (CFG_SDRAM0_SIZE == 64) */
775
776#define CFG_PSRT 0x0e
777#define CFG_MPTPR MPTPR_PTP_DIV32
778
779
780/*-----------------------------------------------------------------------
781 * BR4 - Base Register
782 * Ref: Section 10.3.1 on page 10-14
783 * OR4 - Option Register
784 * Ref: Section 10.3.2 on page 10-18
785 *-----------------------------------------------------------------------
786 */
787/* Bank 4 - Onboard Memory Mapped IO controller
788 *
789 * This expects the onboard IO controller to connected to *CS4 and
790 * the local bus.
791 * - Base address of 0xe0000000
792 * - 8 bit port size (local bus only)
793 * - Read and write access
794 * - GPCM local bus
795 * - Not used for atomic operations
796 * - No data pipelining is done
797 * - Valid
798 * - extended hold time
799 * - 11 wait states
800 */
801
802#ifdef CFG_IO_BASE
803# define CFG_BR4_PRELIM ((CFG_IO_BASE & BRx_BA_MSK) |\
wdenk8bde7f72003-06-27 21:31:46 +0000804 BRx_PS_8 |\
805 BRx_MS_GPCM_L |\
806 BRx_V)
wdenkfe8c2802002-11-03 00:38:21 +0000807
808# define CFG_OR4_PRELIM (ORxG_AM_MSK |\
wdenk8bde7f72003-06-27 21:31:46 +0000809 ORxG_SCY_11_CLK |\
810 ORxG_EHTR)
wdenkfe8c2802002-11-03 00:38:21 +0000811#endif /* CFG_IO_BASE */
812
813/*
814 * Internal Definitions
815 *
816 * Boot Flags
817 */
818#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */
819#define BOOTFLAG_WARM 0x02 /* Software reboot */
820
821#endif /* __CONFIG_H */