]> git.ipfire.org Git - people/ms/u-boot.git/blob - board/amcc/kilauea/memory.c
ppc4xx: Enable Primordial Stack for 40x and Unify ECC Handling
[people/ms/u-boot.git] / board / amcc / kilauea / memory.c
1 /*
2 * Copyright (c) 2008 Nuovation System Designs, LLC
3 * Grant Erickson <gerickson@nuovations.com>
4 *
5 * (C) Copyright 2007
6 * Stefan Roese, DENX Software Engineering, sr@denx.de.
7 *
8 * See file CREDITS for list of people who contributed to this
9 * project.
10 *
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.
15 *
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.
20 *
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,
24 * MA 02111-1307 USA
25 */
26
27 #include <common.h>
28 #include <asm/processor.h>
29 #include <i2c.h>
30
31 void sdram_init(void)
32 {
33 return;
34 }
35
36 #if defined(CONFIG_NAND_U_BOOT)
37 long int initdram(int board_type)
38 {
39 return (CFG_MBYTES_SDRAM << 20);
40 }
41 #endif /* defined(CONFIG_NAND_U_BOOT) */
42
43 #if defined(CFG_DRAM_TEST)
44 int testdram (void)
45 {
46 printf ("testdram\n");
47 #if defined (CONFIG_NAND_U_BOOT)
48 return 0;
49 #endif
50 uint *pstart = (uint *) 0x00000000;
51 uint *pend = (uint *) 0x00001000;
52 uint *p;
53
54 for (p = pstart; p < pend; p++) {
55 *p = 0xaaaaaaaa;
56 }
57
58 for (p = pstart; p < pend; p++) {
59 if (*p != 0xaaaaaaaa) {
60 #if !defined (CONFIG_NAND_SPL)
61 printf ("SDRAM test fails at: %08x\n", (uint) p);
62 #endif
63 return 1;
64 }
65 }
66
67 for (p = pstart; p < pend; p++) {
68 *p = 0x55555555;
69 }
70
71 for (p = pstart; p < pend; p++) {
72 if (*p != 0x55555555) {
73 #if !defined (CONFIG_NAND_SPL)
74 printf ("SDRAM test fails at: %08x\n", (uint) p);
75 #endif
76 return 1;
77 }
78 }
79 #if !defined (CONFIG_NAND_SPL)
80 printf ("SDRAM test passed!!!\n");
81 #endif
82 return 0;
83 }
84 #endif