wdenk | f8cac65 | 2002-08-26 22:36:39 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | #include <common.h> |
| 25 | #include <config.h> |
| 26 | #include <mpc8xx.h> |
| 27 | |
| 28 | /* ------------------------------------------------------------------------- */ |
| 29 | |
| 30 | #define _NOT_USED_ 0xFFFFFFFF |
| 31 | |
| 32 | const uint edo_60ns[] = |
| 33 | { 0x8ffbec24, 0x0ff3ec04, 0x0cf3ec04, 0x00f3ec04, |
| 34 | 0x00f3ec00, 0x37f7ec47, _NOT_USED_, _NOT_USED_, |
| 35 | 0x8fffec24, 0x0ffbec04, 0x08f3ec04, 0x07f3ec08, |
| 36 | 0x08f3ec04, 0x07f3ec48, 0x08f3ec04, 0x07f3ec48, |
| 37 | 0x08f3ec04, 0x07f3ec48, 0x1ff7ec47, _NOT_USED_, |
| 38 | _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_, |
| 39 | 0x8fffcc24, 0x0fefcc04, 0x0cafcc00, 0x11bfcc47, |
| 40 | _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_, |
| 41 | 0x8fffcc24, 0x0fefcc04, 0x0cafcc00, 0x03afcc4c, |
| 42 | 0x0cafcc00, 0x03afcc4c, 0x0cafcc00, 0x03afcc4c, |
| 43 | 0x0cafcc00, 0x33bfcc4f, _NOT_USED_, _NOT_USED_, |
| 44 | _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_, |
| 45 | 0xc0ffcc84, 0x00ffcc04, 0x07ffcc04, 0x3fffcc06, |
| 46 | 0xffffcc85, 0xffffcc05, _NOT_USED_, _NOT_USED_, |
| 47 | _NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_, |
| 48 | 0x33ffcc07, _NOT_USED_, _NOT_USED_, _NOT_USED_ }; |
| 49 | |
| 50 | /* ------------------------------------------------------------------------- */ |
| 51 | |
| 52 | /* |
| 53 | * Check Board Identity: |
| 54 | */ |
| 55 | |
| 56 | int checkboard (void) |
| 57 | { |
| 58 | puts ("Board: AMX860\n"); |
| 59 | return 0; |
| 60 | } |
| 61 | |
| 62 | /* ------------------------------------------------------------------------- */ |
| 63 | |
| 64 | long int initdram (int board_type) |
| 65 | { |
| 66 | |
| 67 | volatile immap_t *immap = (immap_t *)CFG_IMMR; |
| 68 | volatile memctl8xx_t *memctl = &immap->im_memctl; |
| 69 | |
| 70 | /* AMX860: has 4 Mb of 60ns EDO DRAM, so start DRAM at 0 */ |
| 71 | |
| 72 | upmconfig(UPMA, (uint *) edo_60ns, sizeof(edo_60ns)/sizeof(uint)); |
| 73 | |
| 74 | #ifndef CONFIG_AMX_RAM_EXT |
| 75 | memctl->memc_mptpr = 0x0400; /* divide by 16 */ |
| 76 | #else |
| 77 | memctl->memc_mptpr = 0x0200; |
| 78 | #endif |
| 79 | |
| 80 | memctl->memc_mamr = 0x30a21114; |
| 81 | memctl->memc_or2 = 0xffc00800; |
| 82 | #ifndef CONFIG_AMX_RAM_EXT |
| 83 | memctl->memc_br2 = 0x81; |
| 84 | |
| 85 | return (4 << 20); |
| 86 | #else |
| 87 | memctl->memc_or1 = 0xff000800; |
| 88 | memctl->memc_br1 = 0x00000081; |
| 89 | memctl->memc_br2 = 0x01000081; |
| 90 | |
| 91 | return (20 << 20); |
| 92 | #endif |
| 93 | } |