amdfam10: add phenom II as known cpu
[coreboot.git] / src / northbridge / amd / amdfam10 / pci.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 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
21 #ifndef AMDFAM10_PCI_C
22 #define AMDFAM10_PCI_C
23 /* bit [10,8] are dev func, bit[1,0] are dev index */
24
25
26 static u32 pci_read_config32_index(device_t dev, u32 index_reg, u32 index)
27 {
28         u32 dword;
29
30         pci_write_config32(dev, index_reg, index);
31         dword = pci_read_config32(dev, index_reg+0x4);
32         return dword;
33 }
34
35 #ifdef UNUSED_CODE
36 static void pci_write_config32_index(device_t dev, u32 index_reg, u32 index, u32 data)
37 {
38
39         pci_write_config32(dev, index_reg, index);
40
41         pci_write_config32(dev, index_reg + 0x4, data);
42
43 }
44 #endif
45
46 static u32 pci_read_config32_index_wait(device_t dev, u32 index_reg, u32 index)
47 {
48
49         u32 dword;
50
51         index &= ~(1<<30);
52         pci_write_config32(dev, index_reg, index);
53         do {
54                 dword = pci_read_config32(dev, index_reg);
55         } while (!(dword & (1<<31)));
56         dword = pci_read_config32(dev, index_reg+0x4);
57         return dword;
58 }
59
60 #ifdef UNUSED_CODE
61 static void pci_write_config32_index_wait(device_t dev, u32 index_reg, u32 index, u32 data)
62 {
63
64         u32 dword;
65
66         pci_write_config32(dev, index_reg + 0x4, data);
67         index |= (1<<30);
68         pci_write_config32(dev, index_reg, index);
69         do {
70                 dword = pci_read_config32(dev, index_reg);
71         } while (!(dword & (1<<31)));
72
73 }
74 #endif
75 #endif
76
77