3 * BuS Elektronik GmbH & Co.KG <esw@bus-elektonik.de>
5 * (C) Copyright 2000-2003
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 * See file CREDITS for list of people who contributed to this
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 #include "asm/m5282.h"
34 puts ("Board: MCF-EV1 + MCF-EV23 (BuS Elektronik GmbH & Co. KG)\n");
35 #if (TEXT_BASE == CFG_INT_FLASH_BASE)
36 puts (" Boot from Internal FLASH\n");
42 long int initdram (int board_type)
47 MCFSDRAMC_DCR = MCFSDRAMC_DCR_RTIM_6
48 | MCFSDRAMC_DCR_RC((15 * CFG_CLK)>>4);
49 #ifdef CFG_SDRAM_BASE0
51 MCFSDRAMC_DACR0 = MCFSDRAMC_DACR_BASE(CFG_SDRAM_BASE0)
52 | MCFSDRAMC_DACR_CASL(1)
53 | MCFSDRAMC_DACR_CBM(3)
54 | MCFSDRAMC_DACR_PS_16);
56 MCFSDRAMC_DMR0 = MCFSDRAMC_DMR_BAM_16M
59 MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_IP;
61 *(unsigned short *)(CFG_SDRAM_BASE0) = 0xA5A5;
62 MCFSDRAMC_DACR0 |= MCFSDRAMC_DACR_RE;
63 for (i=0; i < 2000; i++)
65 mbar_writeLong(MCFSDRAMC_DACR0, mbar_readLong(MCFSDRAMC_DACR0)
66 | MCFSDRAMC_DACR_IMRS);
67 *(unsigned int *)(CFG_SDRAM_BASE0 + 0x220) = 0xA5A5;
68 size += CFG_SDRAM_SIZE * 1024 * 1024;
70 #ifdef CFG_SDRAM_BASE1
71 MCFSDRAMC_DACR1 = MCFSDRAMC_DACR_BASE(CFG_SDRAM_BASE1)
72 | MCFSDRAMC_DACR_CASL(1)
73 | MCFSDRAMC_DACR_CBM(3)
74 | MCFSDRAMC_DACR_PS_16;
76 MCFSDRAMC_DMR1 = MCFSDRAMC_DMR_BAM_16M
79 MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IP;
81 *(unsigned short *)(CFG_SDRAM_BASE1) = 0xA5A5;
82 MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_RE;
83 for (i=0; i < 2000; i++)
85 MCFSDRAMC_DACR1 |= MCFSDRAMC_DACR_IMRS;
86 *(unsigned int *)(CFG_SDRAM_BASE1 + 0x220) = 0xA5A5;
87 size += CFG_SDRAM_SIZE1 * 1024 * 1024;
93 #if defined(CFG_DRAM_TEST)
96 uint *pstart = (uint *) CFG_MEMTEST_START;
97 uint *pend = (uint *) CFG_MEMTEST_END;
100 printf("SDRAM test phase 1:\n");
101 for (p = pstart; p < pend; p++)
104 for (p = pstart; p < pend; p++) {
105 if (*p != 0xaaaaaaaa) {
106 printf ("SDRAM test fails at: %08x\n", (uint) p);
111 printf("SDRAM test phase 2:\n");
112 for (p = pstart; p < pend; p++)
115 for (p = pstart; p < pend; p++) {
116 if (*p != 0x55555555) {
117 printf ("SDRAM test fails at: %08x\n", (uint) p);
122 printf("SDRAM test passed.\n");
127 int misc_init_r(void)
133 /*---------------------------------------------------------------------------*/
135 int do_vcimage (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
142 source = simple_strtoul(argv[1],NULL,16);
143 vcxk_loadimage(source);
147 printf ("Usage:\n%s\n", cmdtp->usage);
154 /***************************************************/
157 vcimage, 2, 0, do_vcimage,
158 "vcimage - loads an image to Display\n",
162 /* EOF EB+MCF-EV123c */