]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/sbc8260.h
Initial revision
[karo-tx-uboot.git] / include / configs / sbc8260.h
1 /*
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 <jtm@smoothsmoothie.com>
12  *
13  * Configuration settings for the WindRiver SBC8260 board.
14  *      See http://www.windriver.com/products/html/sbc8260.html
15  *
16  * See file CREDITS for list of people who contributed to this
17  * project.
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License as
21  * published by the Free Software Foundation; either version 2 of
22  * the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32  * MA 02111-1307 USA
33  */
34
35 #ifndef __CONFIG_H
36 #define __CONFIG_H
37
38 /* Enable debug prints */
39 #undef DEBUG                  /* General debug */
40 #undef DEBUG_BOOTP_EXT        /* Debug received vendor fields */
41
42 /*****************************************************************************
43  *
44  * These settings must match the way _your_ board is set up
45  *
46  *****************************************************************************/
47
48 /* What is the oscillator's (UX2) frequency in Hz? */
49 #define CONFIG_8260_CLKIN  (66 * 1000 * 1000)
50
51 /*-----------------------------------------------------------------------
52  * MODCK_H & MODCLK[1-3] - Ref: Section 9.2 in MPC8206 User Manual
53  *-----------------------------------------------------------------------
54  * What should MODCK_H be? It is dependent on the oscillator
55  * frequency, MODCK[1-3], and desired CPM and core frequencies.
56  * Here are some example values (all frequencies are in MHz):
57  *
58  * MODCK_H   MODCK[1-3]  Osc    CPM    Core  S2-6   S2-7   S2-8
59  * -------   ----------  ---    ---    ----  -----  -----  -----
60  * 0x1       0x5         33     100    133   Open   Close  Open
61  * 0x1       0x6         33     100    166   Open   Open   Close
62  * 0x1       0x7         33     100    200   Open   Open   Open
63  *
64  * 0x2       0x2         33     133    133   Close  Open   Close
65  * 0x2       0x3         33     133    166   Close  Open   Open
66  * 0x2       0x4         33     133    200   Open   Close  Close
67  * 0x2       0x5         33     133    233   Open   Close  Open
68  * 0x2       0x6         33     133    266   Open   Open   Close
69  *
70  * 0x5       0x5         66     133    133   Open   Close  Open
71  * 0x5       0x6         66     133    166   Open   Open   Close
72  * 0x5       0x7         66     133    200   Open   Open   Open
73  * 0x6       0x0         66     133    233   Close  Close  Close
74  * 0x6       0x1         66     133    266   Close  Close  Open
75  * 0x6       0x2         66     133    300   Close  Open   Close
76  */
77 #define CFG_SBC_MODCK_H 0x05
78
79 /* Define this if you want to boot from 0x00000100. If you don't define
80  * this, you will need to program the bootloader to 0xfff00000, and
81  * get the hardware reset config words at 0xfe000000. The simplest
82  * way to do that is to program the bootloader at both addresses.
83  * It is suggested that you just let U-Boot live at 0x00000000.
84  */
85 #define CFG_SBC_BOOT_LOW 1
86
87 /* What should the base address of the main FLASH be and how big is
88  * it (in MBytes)? This must contain TEXT_BASE from board/sbc8260/config.mk
89  * The main FLASH is whichever is connected to *CS0. U-Boot expects
90  * this to be the SIMM.
91  */
92 #define CFG_FLASH0_BASE 0x40000000
93 #define CFG_FLASH0_SIZE 4
94
95 /* What should the base address of the secondary FLASH be and how big
96  * is it (in Mbytes)? The secondary FLASH is whichever is connected
97  * to *CS6. U-Boot expects this to be the on board FLASH. If you don't
98  * want it enabled, don't define these constants.
99  */
100 #define CFG_FLASH1_BASE 0x60000000
101 #define CFG_FLASH1_SIZE 2
102
103 /* What should be the base address of SDRAM DIMM and how big is
104  * it (in Mbytes)?
105 */
106 #define CFG_SDRAM0_BASE 0x00000000
107 #define CFG_SDRAM0_SIZE 64
108
109 /* What should be the base address of the LEDs and switch S0?
110  * If you don't want them enabled, don't define this.
111  */
112 #define CFG_LED_BASE 0xa0000000
113
114
115 /*
116  * SBC8260 with 16 MB DIMM:
117  *
118  *     0x0000 0000     Exception Vector code, 8k
119  *           :
120  *     0x0000 1FFF
121  *     0x0000 2000     Free for Application Use
122  *           :
123  *           :
124  *
125  *           :
126  *           :
127  *     0x00F5 FF30     Monitor Stack (Growing downward)
128  *                     Monitor Stack Buffer (0x80)
129  *     0x00F5 FFB0     Board Info Data
130  *     0x00F6 0000     Malloc Arena
131  *           :              CFG_ENV_SECT_SIZE, 256k
132  *           :              CFG_MALLOC_LEN,    128k
133  *     0x00FC 0000     RAM Copy of Monitor Code
134  *           :              CFG_MONITOR_LEN,   256k
135  *     0x00FF FFFF     [End of RAM], CFG_SDRAM_SIZE - 1
136  */
137
138 /*
139  * SBC8260 with 64 MB DIMM:
140  *
141  *     0x0000 0000     Exception Vector code, 8k
142  *           :
143  *     0x0000 1FFF
144  *     0x0000 2000     Free for Application Use
145  *           :
146  *           :
147  *
148  *           :
149  *           :
150  *     0x03F5 FF30     Monitor Stack (Growing downward)
151  *                     Monitor Stack Buffer (0x80)
152  *     0x03F5 FFB0     Board Info Data
153  *     0x03F6 0000     Malloc Arena
154  *           :              CFG_ENV_SECT_SIZE, 256k
155  *           :              CFG_MALLOC_LEN,    128k
156  *     0x03FC 0000     RAM Copy of Monitor Code
157  *           :              CFG_MONITOR_LEN,   256k
158  *     0x03FF FFFF     [End of RAM], CFG_SDRAM_SIZE - 1
159  */
160
161
162 /*
163  * select serial console configuration
164  *
165  * if either CONFIG_CONS_ON_SMC or CONFIG_CONS_ON_SCC is selected, then
166  * CONFIG_CONS_INDEX must be set to the channel number (1-2 for SMC, 1-4
167  * for SCC).
168  *
169  * if CONFIG_CONS_NONE is defined, then the serial console routines must
170  * defined elsewhere.
171  */
172 #define CONFIG_CONS_ON_SMC      1       /* define if console on SMC */
173 #undef  CONFIG_CONS_ON_SCC              /* define if console on SCC */
174 #undef  CONFIG_CONS_NONE                /* define if console on neither */
175 #define CONFIG_CONS_INDEX       1       /* which SMC/SCC channel for console */
176
177 /*
178  * select ethernet configuration
179  *
180  * if either CONFIG_ETHER_ON_SCC or CONFIG_ETHER_ON_FCC is selected, then
181  * CONFIG_ETHER_INDEX must be set to the channel number (1-4 for SCC, 1-3
182  * for FCC)
183  *
184  * if CONFIG_ETHER_NONE is defined, then either the ethernet routines must be
185  * defined elsewhere (as for the console), or CFG_CMD_NET must be removed
186  * from CONFIG_COMMANDS to remove support for networking.
187  */
188
189 #undef  CONFIG_ETHER_ON_SCC
190 #define CONFIG_ETHER_ON_FCC
191 #undef  CONFIG_ETHER_NONE               /* define if ethernet on neither */
192
193 #ifdef  CONFIG_ETHER_ON_SCC
194 #define CONFIG_ETHER_INDEX      1       /* which SCC/FCC channel for ethernet */
195 #endif  /* CONFIG_ETHER_ON_SCC */
196
197 #ifdef  CONFIG_ETHER_ON_FCC
198 #define CONFIG_ETHER_INDEX      2       /* which SCC/FCC channel for ethernet */
199 #define CONFIG_MII                      /* MII PHY management           */
200 #define CONFIG_BITBANGMII               /* bit-bang MII PHY management  */
201 /*
202  * Port pins used for bit-banged MII communictions (if applicable).
203  */
204 #define MDIO_PORT       2       /* Port C */
205 #define MDIO_ACTIVE     (iop->pdir |=  0x00400000)
206 #define MDIO_TRISTATE   (iop->pdir &= ~0x00400000)
207 #define MDIO_READ       ((iop->pdat &  0x00400000) != 0)
208
209 #define MDIO(bit)       if(bit) iop->pdat |=  0x00400000; \
210                         else    iop->pdat &= ~0x00400000
211
212 #define MDC(bit)        if(bit) iop->pdat |=  0x00200000; \
213                         else    iop->pdat &= ~0x00200000
214
215 #define MIIDELAY        udelay(1)
216 #endif  /* CONFIG_ETHER_ON_FCC */
217
218 #if defined(CONFIG_ETHER_ON_SCC) && (CONFIG_ETHER_INDEX == 1)
219
220 /*
221  *  - RX clk is CLK11
222  *  - TX clk is CLK12
223  */
224 # define CFG_CMXSCR_VALUE       (CMXSCR_RS1CS_CLK11  | CMXSCR_TS1CS_CLK12)
225
226 #elif defined(CONFIG_ETHER_ON_FCC) && (CONFIG_ETHER_INDEX == 2)
227
228 /*
229  * - Rx-CLK is CLK13
230  * - Tx-CLK is CLK14
231  * - Select bus for bd/buffers (see 28-13)
232  * - Enable Full Duplex in FSMR
233  */
234 # define CFG_CMXFCR_MASK        (CMXFCR_FC2|CMXFCR_RF2CS_MSK|CMXFCR_TF2CS_MSK)
235 # define CFG_CMXFCR_VALUE       (CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14)
236 # define CFG_CPMFCR_RAMTYPE     0
237 # define CFG_FCC_PSMR           (FCC_PSMR_FDE | FCC_PSMR_LPB)
238
239 #endif /* CONFIG_ETHER_ON_FCC, CONFIG_ETHER_INDEX */
240
241 /*
242  * select SPI support configuration
243  */
244 #undef  CONFIG_SPI                      /* enable SPI driver            */
245
246 /*
247  * select i2c support configuration
248  *
249  * Supported configurations are {none, software, hardware} drivers.
250  * If the software driver is chosen, there are some additional
251  * configuration items that the driver uses to drive the port pins.
252  */
253 #undef  CONFIG_HARD_I2C                 /* I2C with hardware support    */
254 #define CONFIG_SOFT_I2C         1       /* I2C bit-banged               */
255 #define CFG_I2C_SPEED           400000  /* I2C speed and slave address  */
256 #define CFG_I2C_SLAVE           0x7F
257
258 /*
259  * Software (bit-bang) I2C driver configuration
260  */
261 #ifdef CONFIG_SOFT_I2C
262 #define I2C_PORT        3               /* Port A=0, B=1, C=2, D=3 */
263 #define I2C_ACTIVE      (iop->pdir |=  0x00010000)
264 #define I2C_TRISTATE    (iop->pdir &= ~0x00010000)
265 #define I2C_READ        ((iop->pdat & 0x00010000) != 0)
266 #define I2C_SDA(bit)    if(bit) iop->pdat |=  0x00010000; \
267                         else    iop->pdat &= ~0x00010000
268 #define I2C_SCL(bit)    if(bit) iop->pdat |=  0x00020000; \
269                         else    iop->pdat &= ~0x00020000
270 #define I2C_DELAY       udelay(5)       /* 1/4 I2C clock duration */
271 #endif /* CONFIG_SOFT_I2C */
272
273
274 /* Define this to reserve an entire FLASH sector (256 KB) for
275  * environment variables. Otherwise, the environment will be
276  * put in the same sector as U-Boot, and changing variables
277  * will erase U-Boot temporarily
278  */
279 #define CFG_ENV_IN_OWN_SECT     1
280
281 /* Define to allow the user to overwrite serial and ethaddr */
282 #define CONFIG_ENV_OVERWRITE
283
284 /* What should the console's baud rate be? */
285 #define CONFIG_BAUDRATE         9600
286
287 /* Ethernet MAC address */
288 #define CONFIG_ETHADDR          00:a0:1e:a8:7b:cb
289
290 /*
291  * Define this to set the last octet of the ethernet address from the
292  * DS0-DS7 switch and light the LEDs with the result. The DS0-DS7
293  * switch and the LEDs are backwards with respect to each other. DS7
294  * is on the board edge side of both the LED strip and the DS0-DS7
295  * switch.
296  */
297 #if 0
298 # define CONFIG_MISC_INIT_R
299 #endif
300
301 /* Set to a positive value to delay for running BOOTCOMMAND */
302 #define CONFIG_BOOTDELAY        5       /* autoboot after 5 seconds */
303
304 #if 0
305 /* Be selective on what keys can delay or stop the autoboot process
306  *     To stop  use: " "
307  */
308 # define CONFIG_AUTOBOOT_KEYED
309 # define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds, press \" \" to stop\n"
310 # define CONFIG_AUTOBOOT_STOP_STR       " "
311 # undef CONFIG_AUTOBOOT_DELAY_STR
312 # define DEBUG_BOOTKEYS         0
313 #endif
314
315 /* Define a command string that is automatically executed when no character
316  * is read on the console interface withing "Boot Delay" after reset.
317  */
318 #define CONFIG_BOOT_ROOT_INITRD 0       /* Use ram disk for the root file system */
319 #define CONFIG_BOOT_ROOT_NFS    1       /* Use a NFS mounted root file system */
320
321 #if CONFIG_BOOT_ROOT_INITRD
322 #define CONFIG_BOOTCOMMAND \
323         "version;" \
324         "echo;" \
325         "bootp;" \
326         "setenv bootargs root=/dev/ram0 rw " \
327         "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
328         "bootm"
329 #endif /* CONFIG_BOOT_ROOT_INITRD */
330
331 #if CONFIG_BOOT_ROOT_NFS
332 #define CONFIG_BOOTCOMMAND \
333         "version;" \
334         "echo;" \
335         "bootp;" \
336         "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " \
337         "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off;" \
338         "bootm"
339 #endif /* CONFIG_BOOT_ROOT_NFS */
340
341 /* Add support for a few extra bootp options like:
342  *      - File size
343  *      - DNS
344  */
345 #define CONFIG_BOOTP_MASK       (CONFIG_BOOTP_DEFAULT | \
346                                  CONFIG_BOOTP_BOOTFILESIZE | \
347                                  CONFIG_BOOTP_DNS)
348
349 /* undef this to save memory */
350 #define CFG_LONGHELP
351
352 /* Monitor Command Prompt */
353 #define CFG_PROMPT              "=> "
354
355 /* What U-Boot subsytems do you want enabled? */
356 #ifdef CONFIG_ETHER_ON_FCC
357 # define CONFIG_COMMANDS        (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
358                                 CFG_CMD_ELF     | \
359                                 CFG_CMD_ASKENV  | \
360                                 CFG_CMD_ECHO    | \
361                                 CFG_CMD_I2C     | \
362                                 CFG_CMD_SDRAM   | \
363                                 CFG_CMD_REGINFO | \
364                                 CFG_CMD_IMMAP   | \
365                                 CFG_CMD_MII     )
366 #else
367 # define CONFIG_COMMANDS        (((CONFIG_CMD_DFL & ~(CFG_CMD_KGDB))) | \
368                                 CFG_CMD_ELF     | \
369                                 CFG_CMD_ASKENV  | \
370                                 CFG_CMD_ECHO    | \
371                                 CFG_CMD_I2C     | \
372                                 CFG_CMD_SDRAM   | \
373                                 CFG_CMD_REGINFO | \
374                                 CFG_CMD_IMMAP   )
375 #endif /* CONFIG_ETHER_ON_FCC */
376
377 /* Where do the internal registers live? */
378 #define CFG_IMMR                0xF0000000
379
380 /*****************************************************************************
381  *
382  * You should not have to modify any of the following settings
383  *
384  *****************************************************************************/
385
386 #define CONFIG_MPC8260          1       /* This is an MPC8260 CPU   */
387 #define CONFIG_SBC8260          1       /* on an EST SBC8260 Board  */
388
389 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
390 #include <cmd_confdefs.h>
391
392 /*
393  * Miscellaneous configurable options
394  */
395 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
396 #  define CFG_CBSIZE            1024    /* Console I/O Buffer Size           */
397 #else
398 #  define CFG_CBSIZE            256     /* Console I/O Buffer Size           */
399 #endif
400
401 /* Print Buffer Size */
402 #define CFG_PBSIZE        (CFG_CBSIZE + sizeof(CFG_PROMPT)+16)
403
404 #define CFG_MAXARGS             32      /* max number of command args   */
405
406 #define CFG_BARGSIZE            CFG_CBSIZE /* Boot Argument Buffer Size    */
407
408 #define CFG_LOAD_ADDR           0x140000   /* default load address */
409 #define CFG_HZ                  1000    /* decrementer freq: 1 ms ticks */
410
411 #define CFG_MEMTEST_START       0x2000  /* memtest works from the end of */
412                                         /* the exception vector table */
413                                         /* to the end of the DRAM  */
414                                         /* less monitor and malloc area */
415 #define CFG_STACK_USAGE         0x10000 /* Reserve 64k for the stack usage */
416 #define CFG_MEM_END_USAGE       ( CFG_MONITOR_LEN \
417                                 + CFG_MALLOC_LEN \
418                                 + CFG_ENV_SECT_SIZE \
419                                 + CFG_STACK_USAGE )
420
421 #define CFG_MEMTEST_END         ( CFG_SDRAM_SIZE * 1024 * 1024 \
422                                 - CFG_MEM_END_USAGE )
423
424 /* valid baudrates */
425 #define CFG_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
426
427 /*
428  * Low Level Configuration Settings
429  * (address mappings, register initial values, etc.)
430  * You should know what you are doing if you make changes here.
431  */
432
433 #define CFG_FLASH_BASE  CFG_FLASH0_BASE
434 #define CFG_FLASH_SIZE  CFG_FLASH0_SIZE
435 #define CFG_SDRAM_BASE  CFG_SDRAM0_BASE
436 #define CFG_SDRAM_SIZE  CFG_SDRAM0_SIZE
437
438 /*-----------------------------------------------------------------------
439  * Hard Reset Configuration Words
440  */
441 #if defined(CFG_SBC_BOOT_LOW)
442 #  define  CFG_SBC_HRCW_BOOT_FLAGS  (HRCW_CIP | HRCW_BMS)
443 #else
444 #  define  CFG_SBC_HRCW_BOOT_FLAGS  (0)
445 #endif /* defined(CFG_SBC_BOOT_LOW) */
446
447 /* get the HRCW ISB field from CFG_IMMR */
448 #define CFG_SBC_HRCW_IMMR       ( ((CFG_IMMR & 0x10000000) >> 10) | \
449                                   ((CFG_IMMR & 0x01000000) >>  7) | \
450                                   ((CFG_IMMR & 0x00100000) >>  4) )
451
452 #define CFG_HRCW_MASTER         ( HRCW_BPS11                            | \
453                                   HRCW_DPPC11                           | \
454                                   CFG_SBC_HRCW_IMMR                     | \
455                                   HRCW_MMR00                            | \
456                                   HRCW_LBPC11                           | \
457                                   HRCW_APPC10                           | \
458                                   HRCW_CS10PC00                         | \
459                                   (CFG_SBC_MODCK_H & HRCW_MODCK_H1111)  | \
460                                   CFG_SBC_HRCW_BOOT_FLAGS )
461
462 /* no slaves */
463 #define CFG_HRCW_SLAVE1         0
464 #define CFG_HRCW_SLAVE2         0
465 #define CFG_HRCW_SLAVE3         0
466 #define CFG_HRCW_SLAVE4         0
467 #define CFG_HRCW_SLAVE5         0
468 #define CFG_HRCW_SLAVE6         0
469 #define CFG_HRCW_SLAVE7         0
470
471 /*-----------------------------------------------------------------------
472  * Definitions for initial stack pointer and data area (in DPRAM)
473  */
474 #define CFG_INIT_RAM_ADDR       CFG_IMMR
475 #define CFG_INIT_RAM_END        0x4000  /* End of used area in DPRAM    */
476 #define CFG_GBL_DATA_SIZE       128     /* bytes reserved for initial data */
477 #define CFG_GBL_DATA_OFFSET     (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
478 #define CFG_INIT_SP_OFFSET      CFG_GBL_DATA_OFFSET
479
480 /*-----------------------------------------------------------------------
481  * Start addresses for the final memory configuration
482  * (Set up by the startup code)
483  * Please note that CFG_SDRAM_BASE _must_ start at 0
484  * Note also that the logic that sets CFG_RAMBOOT is platform dependent.
485  */
486 #define CFG_MONITOR_BASE        CFG_FLASH0_BASE
487
488 #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
489 #  define CFG_RAMBOOT
490 #endif
491
492 #define CFG_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor   */
493 #define CFG_MALLOC_LEN          (128 << 10)     /* Reserve 128 kB for malloc()  */
494
495 /*
496  * For booting Linux, the board info and command line data
497  * have to be in the first 8 MB of memory, since this is
498  * the maximum mapped by the Linux kernel during initialization.
499  */
500 #define CFG_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
501
502 /*-----------------------------------------------------------------------
503  * FLASH and environment organization
504  */
505 #define CFG_MAX_FLASH_BANKS     1       /* max number of memory banks           */
506 #define CFG_MAX_FLASH_SECT      16      /* max number of sectors on one chip    */
507
508 #define CFG_FLASH_ERASE_TOUT    8000    /* Timeout for Flash Erase (in ms)      */
509 #define CFG_FLASH_WRITE_TOUT    1       /* Timeout for Flash Write (in ms)      */
510
511 #ifndef CFG_RAMBOOT
512 #  define CFG_ENV_IS_IN_FLASH   1
513
514 #  ifdef CFG_ENV_IN_OWN_SECT
515 #    define CFG_ENV_ADDR        (CFG_MONITOR_BASE + 0x40000)
516 #    define CFG_ENV_SECT_SIZE   0x40000
517 #  else
518 #    define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_MONITOR_LEN - CFG_ENV_SECT_SIZE)
519 #    define CFG_ENV_SIZE        0x1000  /* Total Size of Environment Sector     */
520 #    define CFG_ENV_SECT_SIZE   0x10000 /* see README - env sect real size      */
521 #  endif /* CFG_ENV_IN_OWN_SECT */
522
523 #else
524 #  define CFG_ENV_IS_IN_NVRAM   1
525 #  define CFG_ENV_ADDR          (CFG_MONITOR_BASE - 0x1000)
526 #  define CFG_ENV_SIZE          0x200
527 #endif /* CFG_RAMBOOT */
528
529 /*-----------------------------------------------------------------------
530  * Cache Configuration
531  */
532 #define CFG_CACHELINE_SIZE      32      /* For MPC8260 CPU */
533
534 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
535 # define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value */
536 #endif
537
538 /*-----------------------------------------------------------------------
539  * HIDx - Hardware Implementation-dependent Registers                    2-11
540  *-----------------------------------------------------------------------
541  * HID0 also contains cache control - initially enable both caches and
542  * invalidate contents, then the final state leaves only the instruction
543  * cache enabled. Note that Power-On and Hard reset invalidate the caches,
544  * but Soft reset does not.
545  *
546  * HID1 has only read-only information - nothing to set.
547  */
548 #define CFG_HID0_INIT   (HID0_ICE  |\
549                          HID0_DCE  |\
550                          HID0_ICFI |\
551                          HID0_DCI  |\
552                          HID0_IFEM |\
553                          HID0_ABE)
554
555 #define CFG_HID0_FINAL  (HID0_ICE  |\
556                          HID0_IFEM |\
557                          HID0_ABE  |\
558                          HID0_EMCP)
559 #define CFG_HID2        0
560
561 /*-----------------------------------------------------------------------
562  * RMR - Reset Mode Register
563  *-----------------------------------------------------------------------
564  */
565 #define CFG_RMR         0
566
567 /*-----------------------------------------------------------------------
568  * BCR - Bus Configuration                                       4-25
569  *-----------------------------------------------------------------------
570  */
571 #define CFG_BCR         (BCR_ETM)
572
573 /*-----------------------------------------------------------------------
574  * SIUMCR - SIU Module Configuration                             4-31
575  *-----------------------------------------------------------------------
576  */
577
578 #define CFG_SIUMCR      (SIUMCR_DPPC11  |\
579                          SIUMCR_L2CPC00 |\
580                          SIUMCR_APPC10  |\
581                          SIUMCR_MMR00)
582
583
584 /*-----------------------------------------------------------------------
585  * SYPCR - System Protection Control                            11-9
586  * SYPCR can only be written once after reset!
587  *-----------------------------------------------------------------------
588  * Watchdog & Bus Monitor Timer max, 60x Bus Monitor enable
589  */
590 #define CFG_SYPCR       (SYPCR_SWTC |\
591                          SYPCR_BMT  |\
592                          SYPCR_PBME |\
593                          SYPCR_LBME |\
594                          SYPCR_SWRI |\
595                          SYPCR_SWP)
596
597 /*-----------------------------------------------------------------------
598  * TMCNTSC - Time Counter Status and Control                     4-40
599  *-----------------------------------------------------------------------
600  * Clear once per Second and Alarm Interrupt Status, Set 32KHz timersclk,
601  * and enable Time Counter
602  */
603 #define CFG_TMCNTSC     (TMCNTSC_SEC |\
604                          TMCNTSC_ALR |\
605                          TMCNTSC_TCF |\
606                          TMCNTSC_TCE)
607
608 /*-----------------------------------------------------------------------
609  * PISCR - Periodic Interrupt Status and Control                 4-42
610  *-----------------------------------------------------------------------
611  * Clear Periodic Interrupt Status, Set 32KHz timersclk, and enable
612  * Periodic timer
613  */
614 #define CFG_PISCR       (PISCR_PS  |\
615                          PISCR_PTF |\
616                          PISCR_PTE)
617
618 /*-----------------------------------------------------------------------
619  * SCCR - System Clock Control                                   9-8
620  *-----------------------------------------------------------------------
621  */
622 #define CFG_SCCR        0
623
624 /*-----------------------------------------------------------------------
625  * RCCR - RISC Controller Configuration                         13-7
626  *-----------------------------------------------------------------------
627  */
628 #define CFG_RCCR        0
629
630 /*
631  * Initialize Memory Controller:
632  *
633  * Bank Bus     Machine PortSz  Device
634  * ---- ---     ------- ------  ------
635  *  0   60x     GPCM    32 bit  FLASH (SIMM - 4MB) *
636  *  1   60x     GPCM    32 bit  FLASH (SIMM - Unused)
637  *  2   60x     SDRAM   64 bit  SDRAM (DIMM - 16MB or 64MB)
638  *  3   60x     SDRAM   64 bit  SDRAM (DIMM - Unused)
639  *  4   Local   SDRAM   32 bit  SDRAM (on board - 4MB)
640  *  5   60x     GPCM     8 bit  EEPROM (8KB)
641  *  6   60x     GPCM     8 bit  FLASH  (on board - 2MB) *
642  *  7   60x     GPCM     8 bit  LEDs, switches
643  *
644  *  (*) This configuration requires the SBC8260 be configured
645  *      so that *CS0 goes to the FLASH SIMM, and *CS6 goes to
646  *      the on board FLASH. In other words, JP24 should have
647  *      pins 1 and 2 jumpered and pins 3 and 4 jumpered.
648  *
649  */
650
651 /*-----------------------------------------------------------------------
652  * BR0,BR1 - Base Register
653  *     Ref: Section 10.3.1 on page 10-14
654  * OR0,OR1 - Option Register
655  *     Ref: Section 10.3.2 on page 10-18
656  *-----------------------------------------------------------------------
657  */
658
659 /* Bank 0,1 - FLASH SIMM
660  *
661  * This expects the FLASH SIMM to be connected to *CS0
662  * It consists of 4 AM29F080B parts.
663  *
664  * Note: For the 4 MB SIMM, *CS1 is unused.
665  */
666
667 /* BR0 is configured as follows:
668  *
669  *     - Base address of 0x40000000
670  *     - 32 bit port size
671  *     - Data errors checking is disabled
672  *     - Read and write access
673  *     - GPCM 60x bus
674  *     - Access are handled by the memory controller according to MSEL
675  *     - Not used for atomic operations
676  *     - No data pipelining is done
677  *     - Valid
678  */
679 #define CFG_BR0_PRELIM  ((CFG_FLASH0_BASE & BRx_BA_MSK) |\
680                          BRx_PS_32                      |\
681                          BRx_MS_GPCM_P                  |\
682                          BRx_V)
683
684 /* OR0 is configured as follows:
685  *
686  *     - 4 MB
687  *     - *BCTL0 is asserted upon access to the current memory bank
688  *     - *CW / *WE are negated a quarter of a clock earlier
689  *     - *CS is output at the same time as the address lines
690  *     - Uses a clock cycle length of 5
691  *     - *PSDVAL is generated internally by the memory controller
692  *       unless *GTA is asserted earlier externally.
693  *     - Relaxed timing is generated by the GPCM for accesses
694  *       initiated to this memory region.
695  *     - One idle clock is inserted between a read access from the
696  *       current bank and the next access.
697  */
698 #define CFG_OR0_PRELIM  (MEG_TO_AM(CFG_FLASH0_SIZE)     |\
699                          ORxG_CSNT                      |\
700                          ORxG_ACS_DIV1                  |\
701                          ORxG_SCY_5_CLK                 |\
702                          ORxG_TRLX                      |\
703                          ORxG_EHTR)
704
705 /*-----------------------------------------------------------------------
706  * BR2,BR3 - Base Register
707  *     Ref: Section 10.3.1 on page 10-14
708  * OR2,OR3 - Option Register
709  *     Ref: Section 10.3.2 on page 10-16
710  *-----------------------------------------------------------------------
711  */
712
713 /* Bank 2,3 - SDRAM DIMM
714  *
715  *     16MB DIMM: P/N
716  *     64MB DIMM: P/N  1W-8864X8-4-P1-EST
717  *
718  * Note: *CS3 is unused for this DIMM
719  */
720
721 /* With a 16 MB or 64 MB DIMM, the BR2 is configured as follows:
722  *
723  *     - Base address of 0x00000000
724  *     - 64 bit port size (60x bus only)
725  *     - Data errors checking is disabled
726  *     - Read and write access
727  *     - SDRAM 60x bus
728  *     - Access are handled by the memory controller according to MSEL
729  *     - Not used for atomic operations
730  *     - No data pipelining is done
731  *     - Valid
732  */
733 #define CFG_BR2_PRELIM  ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
734                          BRx_PS_64                      |\
735                          BRx_MS_SDRAM_P                 |\
736                          BRx_V)
737
738 #define CFG_BR3_PRELIM  ((CFG_SDRAM0_BASE & BRx_BA_MSK) |\
739                          BRx_PS_64                      |\
740                          BRx_MS_SDRAM_P                 |\
741                          BRx_V)
742
743 /* With a 16 MB DIMM, the OR2 is configured as follows:
744  *
745  *     - 16 MB
746  *     - 2 internal banks per device
747  *     - Row start address bit is A9 with PSDMR[PBI] = 0
748  *     - 11 row address lines
749  *     - Back-to-back page mode
750  *     - Internal bank interleaving within save device enabled
751  */
752 #if (CFG_SDRAM0_SIZE == 16)
753 #define CFG_OR2_PRELIM  (MEG_TO_AM(CFG_SDRAM0_SIZE)     |\
754                          ORxS_BPD_2                     |\
755                          ORxS_ROWST_PBI0_A9             |\
756                          ORxS_NUMR_11)
757 #endif
758
759 /* With a 64 MB DIMM, the OR2 is configured as follows:
760  *
761  *     - 64 MB
762  *     - 4 internal banks per device
763  *     - Row start address bit is A8 with PSDMR[PBI] = 0
764  *     - 12 row address lines
765  *     - Back-to-back page mode
766  *     - Internal bank interleaving within save device enabled
767  */
768 #if (CFG_SDRAM0_SIZE == 64)
769 #define CFG_OR2_PRELIM  (MEG_TO_AM(CFG_SDRAM0_SIZE)     |\
770                          ORxS_BPD_4                     |\
771                          ORxS_ROWST_PBI0_A8             |\
772                          ORxS_NUMR_12)
773 #endif
774
775 /*-----------------------------------------------------------------------
776  * PSDMR - 60x Bus SDRAM Mode Register
777  *     Ref: Section 10.3.3 on page 10-21
778  *-----------------------------------------------------------------------
779  */
780
781 /* Address that the DIMM SPD memory lives at.
782  */
783 #define SDRAM_SPD_ADDR 0x54
784
785 #if (CFG_SDRAM0_SIZE == 16)
786 /* With a 16 MB DIMM, the PSDMR is configured as follows:
787  *
788  *     - Bank Based Interleaving,
789  *     - Refresh Enable,
790  *     - Address Multiplexing where A5 is output on A14 pin
791  *       (A6 on A15, and so on),
792  *     - use address pins A16-A18 as bank select,
793  *     - A9 is output on SDA10 during an ACTIVATE command,
794  *     - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
795  *     - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
796  *       is 3 clocks,
797  *     - earliest timing for READ/WRITE command after ACTIVATE command is
798  *       2 clocks,
799  *     - earliest timing for PRECHARGE after last data was read is 1 clock,
800  *     - earliest timing for PRECHARGE after last data was written is 1 clock,
801  *     - CAS Latency is 2.
802  */
803 #define CFG_PSDMR       (PSDMR_RFEN           |\
804                          PSDMR_SDAM_A14_IS_A5 |\
805                          PSDMR_BSMA_A16_A18   |\
806                          PSDMR_SDA10_PBI0_A9  |\
807                          PSDMR_RFRC_7_CLK     |\
808                          PSDMR_PRETOACT_3W    |\
809                          PSDMR_ACTTORW_2W     |\
810                          PSDMR_LDOTOPRE_1C    |\
811                          PSDMR_WRC_1C         |\
812                          PSDMR_CL_2)
813 #endif
814
815 #if (CFG_SDRAM0_SIZE == 64)
816 /* With a 64 MB DIMM, the PSDMR is configured as follows:
817  *
818  *     - Bank Based Interleaving,
819  *     - Refresh Enable,
820  *     - Address Multiplexing where A5 is output on A14 pin
821  *       (A6 on A15, and so on),
822  *     - use address pins A14-A16 as bank select,
823  *     - A9 is output on SDA10 during an ACTIVATE command,
824  *     - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
825  *     - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
826  *       is 3 clocks,
827  *     - earliest timing for READ/WRITE command after ACTIVATE command is
828  *       2 clocks,
829  *     - earliest timing for PRECHARGE after last data was read is 1 clock,
830  *     - earliest timing for PRECHARGE after last data was written is 1 clock,
831  *     - CAS Latency is 2.
832  */
833 #define CFG_PSDMR       (PSDMR_RFEN           |\
834                          PSDMR_SDAM_A14_IS_A5 |\
835                          PSDMR_BSMA_A14_A16   |\
836                          PSDMR_SDA10_PBI0_A9  |\
837                          PSDMR_RFRC_7_CLK     |\
838                          PSDMR_PRETOACT_3W    |\
839                          PSDMR_ACTTORW_2W     |\
840                          PSDMR_LDOTOPRE_1C    |\
841                          PSDMR_WRC_1C         |\
842                          PSDMR_CL_2)
843 #endif
844
845 /*
846  * Shoot for approximately 1MHz on the prescaler.
847  */
848 #if (CONFIG_8260_CLKIN == (66 * 1000 * 1000))
849 #define CFG_MPTPR       MPTPR_PTP_DIV64
850 #elif (CONFIG_8260_CLKIN == (33 * 1000 * 1000))
851 #define CFG_MPTPR       MPTPR_PTP_DIV32
852 #else
853 #warning "Unconfigured bus clock freq: check CFG_MPTPR and CFG_PSRT are OK"
854 #define CFG_MPTPR       MPTPR_PTP_DIV32
855 #endif
856 #define CFG_PSRT        14
857
858
859 /* Bank 4 - On board SDRAM
860  *
861  * This is not implemented yet.
862  */
863
864 /*-----------------------------------------------------------------------
865  * BR6 - Base Register
866  *     Ref: Section 10.3.1 on page 10-14
867  * OR6 - Option Register
868  *     Ref: Section 10.3.2 on page 10-18
869  *-----------------------------------------------------------------------
870  */
871
872 /* Bank 6 - On board FLASH
873  *
874  * This expects the on board FLASH SIMM to be connected to *CS6
875  * It consists of 1 AM29F016A part.
876  */
877 #if (defined(CFG_FLASH1_BASE) && defined(CFG_FLASH1_SIZE))
878
879 /* BR6 is configured as follows:
880  *
881  *     - Base address of 0x60000000
882  *     - 8 bit port size
883  *     - Data errors checking is disabled
884  *     - Read and write access
885  *     - GPCM 60x bus
886  *     - Access are handled by the memory controller according to MSEL
887  *     - Not used for atomic operations
888  *     - No data pipelining is done
889  *     - Valid
890  */
891 #  define CFG_BR6_PRELIM  ((CFG_FLASH1_BASE & BRx_BA_MSK) |\
892                            BRx_PS_8                       |\
893                            BRx_MS_GPCM_P                  |\
894                            BRx_V)
895
896 /* OR6 is configured as follows:
897  *
898  *     - 2 MB
899  *     - *BCTL0 is asserted upon access to the current memory bank
900  *     - *CW / *WE are negated a quarter of a clock earlier
901  *     - *CS is output at the same time as the address lines
902  *     - Uses a clock cycle length of 5
903  *     - *PSDVAL is generated internally by the memory controller
904  *       unless *GTA is asserted earlier externally.
905  *     - Relaxed timing is generated by the GPCM for accesses
906  *       initiated to this memory region.
907  *     - One idle clock is inserted between a read access from the
908  *       current bank and the next access.
909  */
910 #  define CFG_OR6_PRELIM  (MEG_TO_AM(CFG_FLASH1_SIZE)  |\
911                            ORxG_CSNT                   |\
912                            ORxG_ACS_DIV1               |\
913                            ORxG_SCY_5_CLK              |\
914                            ORxG_TRLX                   |\
915                            ORxG_EHTR)
916 #endif /* (defined(CFG_FLASH1_BASE) && defined(CFG_FLASH1_SIZE)) */
917
918 /*-----------------------------------------------------------------------
919  * BR7 - Base Register
920  *     Ref: Section 10.3.1 on page 10-14
921  * OR7 - Option Register
922  *     Ref: Section 10.3.2 on page 10-18
923  *-----------------------------------------------------------------------
924  */
925
926 /* Bank 7 - LEDs and switches
927  *
928  *  LEDs     are at 0x00001 (write only)
929  *  switches are at 0x00001 (read only)
930  */
931 #ifdef CFG_LED_BASE
932
933 /* BR7 is configured as follows:
934  *
935  *     - Base address of 0xA0000000
936  *     - 8 bit port size
937  *     - Data errors checking is disabled
938  *     - Read and write access
939  *     - GPCM 60x bus
940  *     - Access are handled by the memory controller according to MSEL
941  *     - Not used for atomic operations
942  *     - No data pipelining is done
943  *     - Valid
944  */
945 #  define CFG_BR7_PRELIM  ((CFG_LED_BASE & BRx_BA_MSK)   |\
946                            BRx_PS_8                      |\
947                            BRx_MS_GPCM_P                 |\
948                            BRx_V)
949
950 /* OR7 is configured as follows:
951  *
952  *     - 1 byte
953  *     - *BCTL0 is asserted upon access to the current memory bank
954  *     - *CW / *WE are negated a quarter of a clock earlier
955  *     - *CS is output at the same time as the address lines
956  *     - Uses a clock cycle length of 15
957  *     - *PSDVAL is generated internally by the memory controller
958  *       unless *GTA is asserted earlier externally.
959  *     - Relaxed timing is generated by the GPCM for accesses
960  *       initiated to this memory region.
961  *     - One idle clock is inserted between a read access from the
962  *       current bank and the next access.
963  */
964 #  define CFG_OR7_PRELIM  (ORxG_AM_MSK                 |\
965                            ORxG_CSNT                   |\
966                            ORxG_ACS_DIV1               |\
967                            ORxG_SCY_15_CLK             |\
968                            ORxG_TRLX                   |\
969                            ORxG_EHTR)
970 #endif /* CFG_LED_BASE */
971
972 /*
973  * Internal Definitions
974  *
975  * Boot Flags
976  */
977 #define BOOTFLAG_COLD   0x01    /* Normal Power-On: Boot from FLASH  */
978 #define BOOTFLAG_WARM   0x02    /* Software reboot                   */
979
980 #endif  /* __CONFIG_H */