We're getting closer. It has been pointed out that this code is not pretty. I agree. Get
it working, then we'll get it pretty. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://coreboot.org/repository/coreboot-v3@717 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
c945259136
commit
30c0db46ed
10 changed files with 192 additions and 79 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This file is part of the coreboot project.
|
||||
*
|
||||
* Copyright (C) 2007 Advanced Micro Devices, Inc.
|
||||
* Copyright (C) 2006-2007 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -282,3 +282,124 @@
|
|||
#define NBCAP_MEMCLK_166MHZ 1
|
||||
#define NBCAP_MEMCLK_200MHZ 0
|
||||
#define NBCAP_MEMCTRL (1 << 8)
|
||||
|
||||
/* resources for the routing in the northbridge. These may be family specific;
|
||||
* the were in v2.
|
||||
*/
|
||||
#define RES_DEBUG 0
|
||||
#define RES_PCI_IO 0x10
|
||||
#define RES_PORT_IO_8 0x22
|
||||
#define RES_PORT_IO_32 0x20
|
||||
#define RES_MEM_IO 0x40
|
||||
|
||||
#ifndef ASSEMBLY
|
||||
/* cpu version -- no support for f0 yet */
|
||||
static inline int is_cpu_rev_a0(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfffef) == 0x0f00;
|
||||
}
|
||||
static inline int is_cpu_pre_c0(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfffef) < 0x0f48;
|
||||
}
|
||||
|
||||
static inline int is_cpu_c0(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfffef) == 0x0f48;
|
||||
}
|
||||
|
||||
static inline int is_cpu_pre_b3(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfffef) < 0x0f41;
|
||||
}
|
||||
|
||||
static inline int is_cpu_b3(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfffef) == 0x0f41;
|
||||
}
|
||||
//AMD_D0_SUPPORT
|
||||
static inline int is_cpu_pre_d0(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfff0f) < 0x10f00;
|
||||
}
|
||||
|
||||
static inline int is_cpu_d0(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfff0f) == 0x10f00;
|
||||
}
|
||||
|
||||
//AMD_E0_SUPPORT
|
||||
static inline int is_cpu_pre_e0(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfff0f) < 0x20f00;
|
||||
}
|
||||
|
||||
static inline int is_cpu_e0(void)
|
||||
{
|
||||
return (cpuid_eax(1) & 0xfff00) == 0x20f00;
|
||||
}
|
||||
|
||||
|
||||
/* note: we'd like to have this sysinfo common to all K8, there's no need to
|
||||
* have one different kind per different kind of k8 at this point.
|
||||
*/
|
||||
//#include "raminit.h"
|
||||
|
||||
struct dimm_size {
|
||||
u8 per_rank; // it is rows + col + bank_lines + data lines */
|
||||
u8 rows;
|
||||
u8 col;
|
||||
u8 bank; //1, 2, 3 mean 2, 4, 8
|
||||
u8 rank;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct mem_info { // pernode
|
||||
u32 dimm_mask;
|
||||
struct dimm_size sz[DIMM_SOCKETS];
|
||||
u32 x4_mask;
|
||||
u32 x16_mask;
|
||||
u32 single_rank_mask;
|
||||
u32 page_1k_mask;
|
||||
// u32 ecc_mask;
|
||||
// u32 registered_mask;
|
||||
u8 is_opteron;
|
||||
u8 is_registered;
|
||||
u8 is_ecc;
|
||||
u8 is_Width128;
|
||||
u8 memclk_set; // we need to use this to retrieve the mem param
|
||||
u8 rsv[3];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct link_pair_st {
|
||||
struct device * udev;
|
||||
u32 upos;
|
||||
u32 uoffs;
|
||||
struct device * dev;
|
||||
u32 pos;
|
||||
u32 offs;
|
||||
|
||||
} __attribute__((packed));
|
||||
|
||||
struct sys_info {
|
||||
u8 ctrl_present[NODE_NUMS];
|
||||
struct mem_info meminfo[NODE_NUMS];
|
||||
struct mem_controller ctrl[NODE_NUMS];
|
||||
u8 mem_trained[NODE_NUMS]; //0: no dimm, 1: trained, 0x80: not started, 0x81: recv1 fail, 0x82: Pos Fail, 0x83:recv2 fail
|
||||
u32 tom_k;
|
||||
u32 tom2_k;
|
||||
|
||||
u32 mem_base[NODE_NUMS];
|
||||
u32 cs_base[NODE_NUMS*8]; //8 cs_idx
|
||||
u32 hole_reg[NODE_NUMS]; // can we spare it to one, and put ctrl idx in it
|
||||
|
||||
u8 dqs_delay_a[NODE_NUMS*2*2*9]; //8 node channel 2, direction 2 , bytelane *9
|
||||
u8 dqs_rcvr_dly_a[NODE_NUMS*2*8]; //8 node, channel 2, receiver 8
|
||||
u32 nodes;
|
||||
struct link_pair_st link_pair[16];// enough? only in_conherent
|
||||
u32 link_pair_num;
|
||||
u32 ht_c_num;
|
||||
u32 sbdn;
|
||||
u32 sblk;
|
||||
u32 sbbusn;
|
||||
} __attribute__((packed));
|
||||
#endif /* ! ASSEMBLY */
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#define HC_POSSIBLE_NUM 8
|
||||
|
||||
struct amdk8_sysconf_t {
|
||||
struct amdk8_sysconf{
|
||||
//ht
|
||||
unsigned nodes;
|
||||
unsigned hc_possible_num;
|
||||
|
|
|
|||
|
|
@ -155,33 +155,32 @@
|
|||
#define PCI_VENDOR_ID_CIRRUS 0x1013
|
||||
#define PCI_DEVICE_ID_CIRRUS_5446 0x00b8 /* Used by QEMU */
|
||||
|
||||
#define PCI_VENDIR_ID_NVIDIA 0x10de
|
||||
/*
|
||||
0360MCP55 LPC Bridge
|
||||
0361MCP55 LPC Bridge
|
||||
0362MCP55 LPC Bridge
|
||||
0363MCP55 LPC Bridge
|
||||
0364MCP55 LPC Bridge
|
||||
0365MCP55 LPC Bridge
|
||||
0366MCP55 LPC Bridge
|
||||
0367MCP55 LPC Bridge
|
||||
0368MCP55 SMBus
|
||||
0369MCP55 Memory Controller
|
||||
036aMCP55 Memory Controller
|
||||
036bMCP55 SMU
|
||||
036cMCP55 USB Controller
|
||||
036dMCP55 USB Controller
|
||||
036eMCP55 IDE
|
||||
0370MCP55 PCI bridge
|
||||
0371MCP55 High Definition Audio
|
||||
0372MCP55 Ethernet
|
||||
0373MCP55 Ethernet
|
||||
0374MCP55 PCI Express bridge
|
||||
0375MCP55 PCI Express bridge
|
||||
0376MCP55 PCI Express bridge
|
||||
0377MCP55 PCI Express bridge
|
||||
0378MCP55 PCI Express bridge
|
||||
037aMCP55 Memory Controller
|
||||
*/
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PCIBRIDGE 0x370
|
||||
#define PCI_VENDOR_ID_NVIDIA 0x10de
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_LPC 0x0360
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_SLAVE 0x0361
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_LPC_2 0x0362
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_LPC_3 0x0363
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_LPC_4 0x0364
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_LPC_5 0x0365
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_LPC_6 0x0366
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PRO 0x0367
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_SM2 0x0368
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_IDE 0x036E
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_SATA0 0x037E
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_SATA1 0x037F
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_NIC 0x0372
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_NIC_BRIDGE 0x0373
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_AZA 0x0371
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_USB 0x036C
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_USB2 0x036D
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PCI 0x0370
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_B_C 0x0374
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_E 0x0375
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_A 0x0376
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_F 0x0377
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_D 0x0378
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_HT 0x0369
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_TRIM 0x036A
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP55_PMU 0x036B
|
||||
|
||||
#endif /* DEVICE_PCI_IDS_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue