Fix many things for via/epia-m700 to build.
[coreboot.git] / src / northbridge / via / vx800 / raminit.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2009 One Laptop per Child, Association, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 #include <spd.h>
21 #include <sdram_mode.h>
22 #include <delay.h>
23
24 #define DEBUG_RAM_SETUP 1
25
26 #ifdef DEBUG_RAM_SETUP
27 #define PRINT_DEBUG_MEM(x)              print_debug(x)
28 #define PRINT_DEBUG_MEM_HEX8(x)         print_debug_hex8(x)
29 #define PRINT_DEBUG_MEM_HEX16(x)        print_debug_hex16(x)
30 #define PRINT_DEBUG_MEM_HEX32(x)        print_debug_hex32(x)
31 #define DUMPNORTH()                     dump_pci_device(PCI_DEV(0, 0, 0))
32 #else
33 #define PRINT_DEBUG_MEM(x)
34 #define PRINT_DEBUG_MEM_HEX8(x)
35 #define PRINT_DEBUG_MEM_HEX16(x)
36 #define PRINT_DEBUG_MEM_HEX32(x)
37 #define DUMPNORTH()
38 #endif
39 #include "northbridge/via/vx800/translator_ddr2_init.c"
40 #include "northbridge/via/vx800/dram_init.h"
41 #include "northbridge/via/vx800/vx800_early_smbus.c"
42 #include "northbridge/via/vx800/vx800_early_serial.c"
43 #include "northbridge/via/vx800/dram_util.h"
44 #include "northbridge/via/vx800/dram_util.c"
45 #include "northbridge/via/vx800/detection.c"
46 #include "northbridge/via/vx800/freq_setting.c"
47 #include "northbridge/via/vx800/timing_setting.c"
48 #include "northbridge/via/vx800/drdy_bl.c"
49 #include "northbridge/via/vx800/driving_setting.c"
50 #include "northbridge/via/vx800/clk_ctrl.c"
51 #include "northbridge/via/vx800/dev_init.c"
52 #include "northbridge/via/vx800/rank_map.c"
53 #include "northbridge/via/vx800/dqs_search.c"
54 #include "northbridge/via/vx800/final_setting.c"
55 #include "northbridge/via/vx800/uma_ram_setting.c"
56 #include "northbridge/via/vx800/dram_init.c"
57 /*
58  * Support one dimm with up to 2 ranks
59  */
60
61 static void ddr2_ram_setup()
62 {
63         u8 Data;
64         CB_STATUS Status;
65         PRINT_DEBUG_MEM("In ddr2_ram_setup\r");
66
67         Status = DDR2_DRAM_INIT();
68         if (CB_SUCCESS != Status) {
69                 PRINT_DEBUG_MEM("Dram init error. Status = %x\r");
70         }
71
72 }