2 * This file is part of the coreboot project.
4 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
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.
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.
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
21 /*----------------------------------------------------------------------------
22 * TYPEDEFS, DEFINITIONS AND MACROS
24 *----------------------------------------------------------------------------
27 /* Single CPU system? */
28 #if (CONFIG_MAX_PHYSICAL_CPUS == 1)
29 #define HT_BUILD_NC_ONLY 1
32 /* Debugging Options */
34 //#define AMD_DEBUG_ERROR_STOP 1
36 /*----------------------------------------------------------------------------
39 *----------------------------------------------------------------------------
43 #define FILECODE 0xFF01
48 /* include the main HT source file */
52 /*----------------------------------------------------------------------------
55 *----------------------------------------------------------------------------
58 /* FIXME: Find a better place for these pre-ram functions. */
59 #define NODE_HT(x) NODE_PCI(x,0)
60 #define NODE_MP(x) NODE_PCI(x,1)
61 #define NODE_MC(x) NODE_PCI(x,3)
62 #define NODE_LC(x) NODE_PCI(x,4)
64 static u32 get_nodes(void)
69 dev = PCI_DEV(CBB, CDB, 0);
70 nodes = ((pci_read_config32(dev, 0x60)>>4) & 7) ;
71 #if CONFIG_MAX_PHYSICAL_CPUS > 8
72 nodes += (((pci_read_config32(dev, 0x160)>>4) & 7)<<3);
81 * void AMD_CB_EventNotify (u8 evtClass, u16 event, const u8 *pEventData0)
83 * Needs to be fixed to output the debug structures.
86 void AMD_CB_EventNotify (u8 evtClass, u16 event, const u8 *pEventData0)
88 printk_debug("AMD_CB_EventNotify()\n");
89 printk_debug("event class: %02x event: %04x\n", evtClass, event);
94 * void getAmdTopolist(u8 ***p)
96 * point to the stock topo list array
99 void getAmdTopolist(u8 ***p)
101 *p = (u8 **)amd_topo_list;
106 * void amd_ht_init(struct sys_info *sysinfo)
108 * AMD HT init coreboot wrapper
111 void amd_ht_init(struct sys_info *sysinfo)
113 AMD_HTBLOCK ht_wrapper = {
114 NULL, // u8 **topolist;
115 0, // u8 AutoBusStart;
116 32, // u8 AutoBusMax;
117 6, // u8 AutoBusIncrement;
118 NULL, // BOOL (*AMD_CB_IgnoreLink)();
119 NULL, // BOOL (*AMD_CB_OverrideBusNumbers)();
120 NULL, // BOOL (*AMD_CB_ManualBUIDSwapList)();
121 NULL, // void (*AMD_CB_DeviceCapOverride)();
122 NULL, // void (*AMD_CB_Cpu2CpuPCBLimits)();
123 NULL, // void (*AMD_CB_IOPCBLimits)();
124 NULL, // BOOL (*AMD_CB_SkipRegang)();
125 NULL, // BOOL (*AMD_CB_CustomizeTrafficDistribution)();
126 NULL, // BOOL (*AMD_CB_CustomizeBuffers)();
127 NULL, // void (*AMD_CB_OverrideDevicePort)();
128 NULL, // void (*AMD_CB_OverrideCpuPort)();
129 AMD_CB_EventNotify // void (*AMD_CB_EventNotify) ();
132 printk_debug("Enter amd_ht_init()\n");
133 amdHtInitialize(&ht_wrapper);
134 printk_debug("Exit amd_ht_init()\n");