diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2008-10-12 14:40:23 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2008-10-12 14:40:23 +0000 |
commit | 0a20c416226d34ef25881e4d143cf1b8bf531656 (patch) | |
tree | 4063219eef59254c34ef8db6fef59f3d2fc7e1c8 /src/southbridge/via/vt8237r/vt8237_ctrl.c | |
parent | 2e5a9d952f3f3d23cf57a08abeffe3dee3444950 (diff) | |
download | coreboot-0a20c416226d34ef25881e4d143cf1b8bf531656.tar.xz |
VIA VT8237R cleanups (trivial).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3651 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/via/vt8237r/vt8237_ctrl.c')
-rw-r--r-- | src/southbridge/via/vt8237r/vt8237_ctrl.c | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/src/southbridge/via/vt8237r/vt8237_ctrl.c b/src/southbridge/via/vt8237r/vt8237_ctrl.c index 666fbcf68c..0af20d37cb 100644 --- a/src/southbridge/via/vt8237r/vt8237_ctrl.c +++ b/src/southbridge/via/vt8237r/vt8237_ctrl.c @@ -28,20 +28,17 @@ static void vt8237_cfg(struct device *dev) { u8 regm, regm2, regm3; - device_t devfun3; devfun3 = dev_find_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_K8T890CE_3, 0); - - if (!devfun3) - devfun3 = dev_find_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_K8M890CE_3, 0); - - if (!devfun3) - die("Unknown NB"); - - /* CPU to PCI Flow Control 1 & 2, just fill in recommended */ + PCI_DEVICE_ID_VIA_K8T890CE_3, 0); + if (!devfun3) + devfun3 = dev_find_device(PCI_VENDOR_ID_VIA, + PCI_DEVICE_ID_VIA_K8M890CE_3, 0); + if (!devfun3) + die("Unknown NB"); + + /* CPU to PCI Flow Control 1 & 2, just fill in recommended. */ pci_write_config8(dev, 0x70, 0xc2); pci_write_config8(dev, 0x71, 0xc8); @@ -54,7 +51,8 @@ static void vt8237_cfg(struct device *dev) pci_write_config8(dev, 0x77, 0x48); pci_write_config8(dev, 0x78, 0x01); /* APIC on HT */ - pci_write_config8(dev, 0x7c, 0x77); //maybe Enable LDT APIC Mode bit3 set to 1 + /* Maybe Enable LDT APIC Mode bit3 set to 1 */ + pci_write_config8(dev, 0x7c, 0x77); /* WARNING: Need to copy some registers from NB (D0F3) to SB (D11F7). */ @@ -89,28 +87,24 @@ static void vt8237_cfg(struct device *dev) * NB V-Link Manual Driving Control - Data 0xb6 0x46 0x46 0x88 0x88 * NB V-Link Receiving Strobe Delay 0xb7 0x02 0x02 0x61 0x01 * NB V-Link Compensation Control bit4,0 (b5,b6) 0xb4 0x10 0x10 0x11 0x11 - * SB V-Link Strobe Drive Control 0xb9 0x00 0xa5 0x98 0x98 + * SB V-Link Strobe Drive Control 0xb9 0x00 0xa5 0x98 0x98 * SB V-Link Data drive Control???? 0xba 0x00 0xbb 0x77 0x77 * SB V-Link Receive Strobe Delay???? 0xbb 0x04 0x11 0x11 0x11 * SB V-Link Compensation Control bit0 (use b9) 0xb8 0x00 0x01 0x01 0x01 * V-Link CKG Control 0xb0 0x05 0x05 0x06 0x03 * V-Link CKG Control 0xb1 0x05 0x05 0x01 0x03 */ - static void vt8237s_vlink_init(struct device *dev) { u8 reg; - device_t devfun7; devfun7 = dev_find_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_K8T890CE_7, 0); - + PCI_DEVICE_ID_VIA_K8T890CE_7, 0); if (!devfun7) devfun7 = dev_find_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_K8M890CE_7, 0); - - /* no pairing NB found */ + PCI_DEVICE_ID_VIA_K8M890CE_7, 0); + /* No pairing NB was found. */ if (!devfun7) return; @@ -132,40 +126,43 @@ static void vt8237s_vlink_init(struct device *dev) pci_write_config8(dev, 0xba, 0x88); pci_write_config8(dev, 0xbb, 0x89); - reg = pci_read_config8(dev, 0xbd); reg |= 0x3; pci_write_config8(dev, 0xbd, reg); - /* Program V-link 8X 8bit full duplex, parity disabled FIXME */ + /* Program V-link 8X 8bit full duplex, parity disabled. FIXME. */ pci_write_config8(dev, 0x48, 0x13); } -static void ctrl_enable(struct device *dev) { - - /* enable the 0:13 and 0:13.1 */ +static void ctrl_enable(struct device *dev) +{ + /* Enable the 0:13 and 0:13.1. */ /* FIXME */ pci_write_config8(dev, 0x4f, 0x43); } - extern void dump_south(device_t dev); -static void ctrl_init(struct device *dev) { - - /* TODO: Fix some ordering issue fo V-link set Rx77[6] and PCI1_Rx4F[0] - should to 1 FIXME DO you need?*/ +static void ctrl_init(struct device *dev) +{ + /* + * TODO: Fix some ordering issue for V-link set Rx77[6] and + * PCI1_Rx4F[0] should to 1. + * FIXME DO you need? + */ - /* VT8237R specific configuration other SB are done in their own directories */ - /* add A version */ + /* + * VT8237R specific configuration. Other SB are done in their own + * directories. TODO: Add A version. + */ device_t devsb = dev_find_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_VT8237S_LPC, 0); + PCI_DEVICE_ID_VIA_VT8237S_LPC, 0); if (devsb) { - /* FIXME: Skip v-link setup for now */ -// vt8237s_vlink_init(dev); + /* FIXME: Skip v-link setup for now. */ +// vt8237s_vlink_init(dev); } - /* configure PCI1 and copy mirror registers from D0F3 */ + /* Configure PCI1 and copy mirror registers from D0F3. */ vt8237_cfg(dev); dump_south(dev); } |