From bbdd8f4a9f206ca40dea2b15d9458ac048de6c64 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sun, 4 Dec 2005 21:52:58 +0000 Subject: 1203_hcdn.diff: store every HT device unit id base and pass those info to acpi https://openbios.org/roundup/linuxbios/issue46 Note: This version drops the two scripts a and c and creates the dsdt on the fly from Config.lb using makerule git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2134 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/amdk8/get_sblk_pci1234.c | 11 +++++++++++ src/northbridge/amd/amdk8/northbridge.c | 23 ++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'src/northbridge') diff --git a/src/northbridge/amd/amdk8/get_sblk_pci1234.c b/src/northbridge/amd/amdk8/get_sblk_pci1234.c index d52a7f761a..eff6ca1c62 100644 --- a/src/northbridge/amd/amdk8/get_sblk_pci1234.c +++ b/src/northbridge/amd/amdk8/get_sblk_pci1234.c @@ -78,9 +78,12 @@ unsigned node_link_to_bus(unsigned node, unsigned link) extern unsigned pci1234[]; +extern unsigned hcdn[]; extern unsigned hc_possible_num; extern unsigned sblk; +unsigned hcdn_reg[4]; // defined in northbridge.c + /* why we need pci1234 array final result for pci1234 will be pci1234[0] will record sblink and bus range @@ -176,6 +179,10 @@ void get_sblk_pci1234(void) set the node_id and link_id that could have ht chain in the one array, then check if is enabled.... then update final value */ + //here we need to set hcdn + //1. hypertransport.c need to record hcdn_reg together with 0xe0, 0xe4, 0xe8, 0xec when are set + //2. so at the same time we need update hsdn with hcdn_reg here + dev = dev_find_slot(0, PCI_DEVFN(0x18, 1)); for(j=0;j<4;j++) { uint32_t dwordx; @@ -183,6 +190,7 @@ void get_sblk_pci1234(void) dwordx &=0xffff0ff1; //keep bus num, node_id, link_num, enable bits if((dwordx & 0xff1) == dword) { //SBLINK pci1234[0] = dwordx; + hcdn[0] = hcdn_reg[j]; continue; } if((dwordx & 1) == 1) { @@ -191,6 +199,7 @@ void get_sblk_pci1234(void) for(i=1;ipath.u.pci.devfn >> 3) - 0x18; } +unsigned hcdn_reg[4]; // it will be used by get_sblk_pci1234 + static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned link, unsigned sblink, unsigned int max, unsigned offset_unitid) { #if 0 @@ -107,8 +109,11 @@ static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned lin uint32_t link_type; + int i; uint32_t busses, config_busses; unsigned free_reg, config_reg; + unsigned ht_unitid_base[4]; // here assume only 4 HT device on chain + dev->link[link].cap = 0x80 + (link *0x20); do { link_type = pci_read_config32(dev, dev->link[link].cap + 0x18); @@ -195,7 +200,10 @@ static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned lin /* Now we can scan all of the subordinate busses i.e. the * chain on the hypertranport link */ - max = hypertransport_scan_chain(&dev->link[link], 0, 0xbf, max, offset_unitid); + for(i=0;i<4;i++) { + ht_unitid_base[i] = 0x20; + } + max = hypertransport_scan_chain(&dev->link[link], 0, 0xbf, max, ht_unitid_base, offset_unitid); #if 0 printk_debug("%s Hyper transport scan link: %d new max: %d\n", @@ -214,6 +222,19 @@ static unsigned int amdk8_scan_chain(device_t dev, unsigned nodeid, unsigned lin (dev->link[link].subordinate << 24); f1_write_config32(config_reg, config_busses); + { + // config config_reg, and ht_unitid_base to update hcdn_reg; + int index; + unsigned temp = 0; + index = (config_reg-0xe0) >> 2; + for(i=0;i<4;i++) { + temp |= (ht_unitid_base[i] & 0xff) << (i*8); + } + + hcdn_reg[index] = temp; + + } + #if 0 printk_debug("%s Hypertransport scan link: %d done\n", dev_path(dev), link); -- cgit v1.2.3