This patch is from 2009-10-20
[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 #if CONFIG_DEBUG_RAM_SETUP
25 #define PRINT_DEBUG_MEM(x)              print_debug(x)
26 #define PRINT_DEBUG_MEM_HEX8(x)         print_debug_hex8(x)
27 #define PRINT_DEBUG_MEM_HEX16(x)        print_debug_hex16(x)
28 #define PRINT_DEBUG_MEM_HEX32(x)        print_debug_hex32(x)
29 #define DUMPNORTH()                     dump_pci_device(PCI_DEV(0, 0, 0))
30 #else
31 #define PRINT_DEBUG_MEM(x)
32 #define PRINT_DEBUG_MEM_HEX8(x)
33 #define PRINT_DEBUG_MEM_HEX16(x)
34 #define PRINT_DEBUG_MEM_HEX32(x)
35 #define DUMPNORTH()
36 #endif
37 #include "northbridge/via/vx800/translator_ddr2_init.c"
38 #include "northbridge/via/vx800/dram_init.h"
39 #include "northbridge/via/vx800/vx800_early_smbus.c"
40 #include "northbridge/via/vx800/vx800_early_serial.c"
41 #include "northbridge/via/vx800/dram_util.h"
42 #include "northbridge/via/vx800/dram_util.c"
43 #include "northbridge/via/vx800/detection.c"
44 #include "northbridge/via/vx800/freq_setting.c"
45 #include "northbridge/via/vx800/timing_setting.c"
46 #include "northbridge/via/vx800/drdy_bl.c"
47 #include "northbridge/via/vx800/driving_setting.c"
48 #include "northbridge/via/vx800/clk_ctrl.c"
49 #include "northbridge/via/vx800/dev_init.c"
50 #include "northbridge/via/vx800/rank_map.c"
51 #include "northbridge/via/vx800/dqs_search.c"
52 #include "northbridge/via/vx800/final_setting.c"
53 #include "northbridge/via/vx800/uma_ram_setting.c"
54 #include "northbridge/via/vx800/dram_init.c"
55 /*
56  * Support one dimm with up to 2 ranks
57  */
58
59 static void ddr2_ram_setup()
60 {
61         u8 Data;
62         CB_STATUS Status;
63         PRINT_DEBUG_MEM("In ddr2_ram_setup\r");
64
65         Status = DDR2_DRAM_INIT();
66         if (CB_SUCCESS != Status) {
67                 PRINT_DEBUG_MEM("Dram init error. Status = %x\r");
68         }
69
70 }