On Sun, Jun 01, 2003 at 01:52:57AM +0200, Dag-Erling Smorgrav wrote: > "David P. Reese Jr." <daver_at_gomerbud.com> writes: > > In rev 1.214 of sys/dev/pci/pci.c, we have started checking if a > > pci_set_command_bit() was successful with a subsequent PCI_READ_CONFIG > > and comparing the results. For some odd reason, this doesnt work when > > my viapropm tries to attach. > > viapropm is seriously broken for other reasons and needs professional > help. It will be hard for me to provide that professional help because the chipset docs require an NDA. > > pci_set_command_bit(dev, child, bit); > > command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); > > if (command & bit) > > return (0); > > It should allow the register to "settle" between write and read, which > may take some time (see chipset docs for timing details). DELAY(1000) > should be OK in an attach function. Well, using the following patch: Index: pci.c =================================================================== RCS file: /home/daver/cvs-freebsd/src/sys/dev/pci/pci.c,v retrieving revision 1.214 diff -u -r1.214 pci.c --- pci.c 16 Apr 2003 03:15:08 -0000 1.214 +++ pci.c 1 Jun 2003 02:45:11 -0000 _at__at_ -606,6 +606,9 _at__at_ break; } pci_set_command_bit(dev, child, bit); +#define PCI_CFG_DELAY 10000000 + device_printf(dev, "delaying for %i microseconds\n", PCI_CFG_DELAY); + DELAY(PCI_CFG_DELAY); command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); if (command & bit) return (0); I get: viapropm0: SMBus I/O base at 0x5000 viapropm0: <VIA VT82C686A Power Management Unit> port 0x5000-0x500f at device 7.4 on pci0 pci0: delaying for 10000000 microseconds viapropm0: failed to enable port mapping! viapropm0: could not allocate bus space device_probe_and_attach: viapropm0 attach returned 6 This seems to imply that we don't have a timing problem. Instead it looks like the chip doesn't want reflect it's status in it's command register. Can someone with access to the docs give me a clue? -- David P. Reese Jr. daver_at_gomerbud.com -------------------------------------------------------------------------- It can be argued that returning a NULL pointer when asked to allocate zero bytes is a silly response to a silly question. -- FreeBSD manual page for malloc(3)Received on Sat May 31 2003 - 18:46:57 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:10 UTC