GX2: Define the unused DIMM1 to 0xFF to make it obvious it is a bogus value.
[coreboot.git] / src / mainboard / wyse / s50 / romstage.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2010 Nils Jacobs
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; version 2 of
9  * the License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19  * MA 02110-1301 USA
20  */
21
22 #include <stdint.h>
23 #include <device/pci_def.h>
24 #include <arch/io.h>
25 #include <device/pnp_def.h>
26 #include <arch/hlt.h>
27 #include <console/console.h>
28 #include <lib.h>
29 #include "cpu/x86/bist.h"
30 #include "cpu/x86/msr.h"
31 #include <cpu/amd/gx2def.h>
32 #include <cpu/amd/geode_post_code.h>
33
34 #include "southbridge/amd/cs5536/cs5536_early_smbus.c"
35 #include "southbridge/amd/cs5536/cs5536_early_setup.c"
36
37 #define DIMM0 0xA0
38 #define DIMM1 0xFF /* DIMM1 is not available/used on this board. */
39
40 static inline int spd_read_byte(unsigned int device, unsigned int address)
41 {
42         if (device != DIMM0)
43                 return 0xFF;    /* No DIMM1, don't even try. */
44
45         return smbus_read_byte(device, address);
46 }
47
48 #include "northbridge/amd/gx2/raminit.h"
49 #include "northbridge/amd/gx2/pll_reset.c"
50 #include "northbridge/amd/gx2/raminit.c"
51 #include "lib/generic_sdram.c"
52 #include "cpu/amd/model_gx2/cpureginit.c"
53 #include "cpu/amd/model_gx2/syspreinit.c"
54 #include "cpu/amd/model_lx/msrinit.c"
55
56 void main(unsigned long bist)
57 {
58         static const struct mem_controller memctrl [] = {
59                 {.channel0 = {(0xa<<3)|0, (0xa<<3)|1}}
60         };
61
62         SystemPreInit();
63
64         cs5536_early_setup();
65         
66         /* cs5536_disable_internal_uart  disable them. Set them up now... */
67         cs5536_setup_onchipuart(1);
68
69         uart_init();
70         console_init();
71
72         /* Halt if there was a built in self test failure */
73         report_bist_failure(bist);
74
75         pll_reset();
76
77         cpuRegInit();
78         print_err("done cpuRegInit\n");
79
80         sdram_initialize(1, memctrl);
81         print_err("ram setup done\n");
82
83         msr_init();
84
85         /* Check all of memory */
86         /*ram_check(0x00000000, 640*1024);*/
87         print_err("ram check done\n");
88 }
89