Add constants for fast path resume copying
[coreboot.git] / src / mainboard / supermicro / h8qgi / mainboard.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2011 - 2012 Advanced Micro Devices, 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 <console/console.h>
21 #include <device/device.h>
22 #include <device/pci.h>
23 #include <arch/io.h>
24 #include <boot/tables.h>
25 #include <cpu/x86/msr.h>
26 #include <cpu/amd/mtrr.h>
27 #include <device/pci_def.h>
28 #include <NbPlatform.h>
29 #include "chip.h"
30
31 void set_pcie_dereset(void *nbconfig);
32 void set_pcie_reset(void *nbconfig);
33
34 /**
35  *
36  */
37 void set_pcie_reset(void *nbconfig)
38 {
39 }
40
41 /**
42  * Mainboard specific RD890 CIMx callback
43  * Release Resets to PCIe Links
44  * For Both SR56X0 chips, PCIE_RESET_GPIO1 to reset pcie
45  */
46 void set_pcie_dereset(void *nbconfig)
47 {
48         //u32 nb_dev = MAKE_SBDFO(0, 0x0, 0x0, 0x0, 0x0);
49         u32 i;
50         u32 val;
51         u32 nb_addr;
52
53         val = 0x00000007UL;
54         AMD_NB_CONFIG_BLOCK *pConfig = (AMD_NB_CONFIG_BLOCK*)nbconfig;
55         for (i = 0; i < MAX_NB_COUNT; i ++) {
56                 nb_addr = pConfig->Northbridges[i].NbPciAddress.AddressValue | NB_HTIU_INDEX;
57                 LibNbPciIndexRMW(nb_addr,
58                                 NB_HTIU_REGA8,
59                                 AccessS3SaveWidth32,
60                                 ~val,
61                                 val,
62                                  &(pConfig->Northbridges[i]));
63         }
64 }
65
66
67 /*************************************************
68  * enable the dedicated function in h8qgi board.
69  *************************************************/
70 static void h8qgi_enable(device_t dev)
71 {
72         printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
73 }
74
75 #if (CONFIG_HAVE_MAINBOARD_RESOURCES == 1)
76 int add_mainboard_resources(struct lb_memory *mem)
77 {
78         return 0;
79 }
80 #endif
81
82 struct chip_operations mainboard_ops = {
83         CHIP_NAME(CONFIG_MAINBOARD_VENDOR " " CONFIG_MAINBOARD_PART_NUMBER " Mainboard")
84                 .enable_dev = h8qgi_enable,
85 };