1 #include <console/console.h>
2 #include <device/pci.h>
3 #include <device/pci_ids.h>
6 #if CONFIG_LOGICAL_CPUS==1
7 #include <cpu/amd/multicore.h>
10 #include <cpu/amd/amdk8_sysconf.h>
14 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
16 unsigned char bus_isa = 5 ;
17 unsigned char bus_8131_0 = 1;
18 unsigned char bus_8131_1 = 2;
19 unsigned char bus_8131_2 = 3;
20 unsigned char bus_8111_0 = 1;
21 unsigned char bus_8111_1 = 4;
22 unsigned apicid_8111 ;
23 unsigned apicid_8131_1;
24 unsigned apicid_8131_2;
27 { //Here you only need to set value in pci1234 for HT-IO that could be installed or not
28 //You may need to preset pci1234 for HTIO board, please refer to src/northbridge/amd/amdk8/get_sblk_pci1234.c for detail
39 { //HT Chain device num, actually it is unit id base of every ht device in chain, assume every chain only have 4 ht device at most
53 static unsigned get_bus_conf_done = 0;
55 void get_bus_conf(void)
63 if(get_bus_conf_done==1) return; //do it only once
65 get_bus_conf_done = 1;
67 sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
68 for(i=0;i<sysconf.hc_possible_num; i++) {
69 sysconf.pci1234[i] = pci1234x[i];
70 sysconf.hcdn[i] = hcdnx[i];
75 sysconf.sbdn = (sysconf.hcdn[0] >> 8) & 0xff;
76 sbdn3 = sysconf.hcdn[0] & 0xff;
78 bus_8131_0 = (sysconf.pci1234[0] >> 16) & 0xff;
79 bus_8111_0 = bus_8131_0;
82 dev = dev_find_slot(bus_8111_0, PCI_DEVFN(sysconf.sbdn,0));
84 bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
85 #if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
86 bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
88 // printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
92 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:03.0, using defaults\n", bus_8111_0);
96 dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3,0));
98 bus_8131_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
101 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:01.0, using defaults\n", bus_8131_0);
105 dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,0));
107 bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
108 #if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
109 bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
111 // printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
115 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
119 /*I/O APICs: APIC ID Version State Address*/
120 #if CONFIG_LOGICAL_CPUS==1
121 apicid_base = get_apicid_base(3);
123 apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
125 apicid_8111 = apicid_base+0;
126 apicid_8131_1 = apicid_base+1;
127 apicid_8131_2 = apicid_base+2;