Re: Why does bus_alloc_resource fail for sound and PCIC?

2002-01-06 Thread Michael Reifenberger

On Sun, 6 Jan 2002, M. Warner Losh wrote:
...

> : pci2:  on pcib2
> : pccbb0:  mem 0x5000-0x5fff irq 11 at device
> : 0.0 on pci2
> : pcib2: device pccbb0 requested unsupported memory range 0x5000-0x5fff
> : (decoding 0xc020-0xcfff, 0xe800-0xefff)
> : pccbb0: Could not map register memory
> : device_probe_and_attach: pccbb0 attach returned 12
> : pccbb0:  mem 0x5010-0x50100fff irq 11 at device
> : 0.1 on pci2
> : pcib2: device pccbb0 requested unsupported memory range 0x5010-0x50100fff
> : (decoding 0xc020-0xcfff, 0xe800-0xefff)
> : pccbb0: Could not map register memory
> : device_probe_and_attach: pccbb0 attach returned 12
>
> Maybe you need some patches to the pci bridge code to map the range
> requested, or to just allow it (since it just works anyway).  There's
> another kludge option: PCI_ALLOW_UNSUPPORTED_IO_RANGE.
Thanks for the hint.
After applying my attached patch this option got accepted and led to
probed and attached NEWCARD devices.
Inserting a FA411 Card leads to a frozen system (after reading the CIS info)
until the card gets ejected.
Haven't tried the OLDCARD (which worked in compat mode anyway) yet.
Maybe NEWCARD is trying to use wrong resources here...

Maybe we need some special handling for the new Intel-mobile-chipset
used by IBM (which supports up to 1GB of memory).

Bye!

Michael Reifenberger
^.*Plaut.*$, IT, R/3 Basis, GPS


--- conf/options.orig   Sat Dec 22 17:05:24 2001
+++ conf/optionsMon Jan  7 02:44:51 2002
@@ -418,4 +418,5 @@
 PCI_QUIET  opt_pci.h
 PCI_ENABLE_IO_MODESopt_pci.h
+PCI_ALLOW_UNSUPPORTED_IO_RANGE opt_pcib.h
 
 # NFS options
--- dev/pci/pci_pci.c.orig  Mon Nov 26 08:12:35 2001
+++ dev/pci/pci_pci.c   Mon Jan  7 02:44:27 2002
@@ -35,4 +35,7 @@
  */
 
+#include "opt_bus.h"
+#include "opt_pcib.h"
+
 #include 
 #include 



Re: Why does bus_alloc_resource fail for sound and PCIC?

2002-01-06 Thread M. Warner Losh

In message: <20020105232557.S706-10@nihil>
Michael Reifenberger <[EMAIL PROTECTED]> writes:
: But why?
: Where is PCI_ENABLE_IO_MODES different from:
: 
: pci_enable_busmaster(dev);
: pci_enable_io(dev, SYS_RES_IOPORT);
: pci_enable_io(dev, SYS_RES_MEMORY);
: 
: or
: 
: data = pci_read_config(dev, PCIR_COMMAND, 2);
: data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN);
: pci_write_config(dev, PCIR_COMMAND, data, 2);
: 
: which allready existed in snd_ich ?!?

I think it has to do with the caching of these values in the pci
layer.  The option turns them on and updates the values in the cache,
while the other options do not appear to do so.

: BTW: In the case of the PCIC I still get:
: pcib2:  at device 30.0 on pci0
: pci2:  on pcib2
: pccbb0:  mem 0x5000-0x5fff irq 11 at device
: 0.0 on pci2
: pcib2: device pccbb0 requested unsupported memory range 0x5000-0x5fff
: (decoding 0xc020-0xcfff, 0xe800-0xefff)
: pccbb0: Could not map register memory
: device_probe_and_attach: pccbb0 attach returned 12
: pccbb0:  mem 0x5010-0x50100fff irq 11 at device
: 0.1 on pci2
: pcib2: device pccbb0 requested unsupported memory range 0x5010-0x50100fff
: (decoding 0xc020-0xcfff, 0xe800-0xefff)
: pccbb0: Could not map register memory
: device_probe_and_attach: pccbb0 attach returned 12

Maybe you need some patches to the pci bridge code to map the range
requested, or to just allow it (since it just works anyway).  There's
another kludge option: PCI_ALLOW_UNSUPPORTED_IO_RANGE.

Warner

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Why does bus_alloc_resource fail for sound and PCIC?

2002-01-05 Thread Michael Reifenberger

Hi,
thanks for the tip. "options PCI_ENABLE_IO_MODES" did the trick (for snd_ich).
But why?
Where is PCI_ENABLE_IO_MODES different from:

pci_enable_busmaster(dev);
pci_enable_io(dev, SYS_RES_IOPORT);
pci_enable_io(dev, SYS_RES_MEMORY);

or

data = pci_read_config(dev, PCIR_COMMAND, 2);
data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN);
pci_write_config(dev, PCIR_COMMAND, data, 2);

which allready existed in snd_ich ?!?

BTW: In the case of the PCIC I still get:
pcib2:  at device 30.0 on pci0
pci2:  on pcib2
pccbb0:  mem 0x5000-0x5fff irq 11 at device
0.0 on pci2
pcib2: device pccbb0 requested unsupported memory range 0x5000-0x5fff
(decoding 0xc020-0xcfff, 0xe800-0xefff)
pccbb0: Could not map register memory
device_probe_and_attach: pccbb0 attach returned 12
pccbb0:  mem 0x5010-0x50100fff irq 11 at device
0.1 on pci2
pcib2: device pccbb0 requested unsupported memory range 0x5010-0x50100fff
(decoding 0xc020-0xcfff, 0xe800-0xefff)
pccbb0: Could not map register memory
device_probe_and_attach: pccbb0 attach returned 12

...

Bye!

Michael Reifenberger
^.*Plaut.*$, IT, R/3 Basis, GPS


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Why does bus_alloc_resource fail for sound and PCIC?

2002-01-05 Thread Michael Reifenberger

On Sat, 5 Jan 2002, Matthew N. Dodd wrote:
...
> While the PCI bus code should enable these resources, only the driver
> really knows if a PCI map will be used.  It should enable it.  See
> pci_enable_io()
Am I wrong or is:

pci_enable_busmaster(dev);
pci_enable_io(dev, SYS_RES_IOPORT);
pci_enable_io(dev, SYS_RES_MEMORY);

(which I additionally added now) equivalent to (the allready existing):

data = pci_read_config(dev, PCIR_COMMAND, 2);
data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN);
pci_write_config(dev, PCIR_COMMAND, data, 2);

anyway neither one seems to do the job.
bus_alloc_resource() still fails...

Any tips to analyse/debug the problem?



Bye!

Michael Reifenberger
^.*Plaut.*$, IT, R/3 Basis, GPS


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Why does bus_alloc_resource fail for sound and PCIC?

2002-01-05 Thread M. Warner Losh

You might want to try and enable PCI_ENABLE_IO_MODES in your kernel.

Warner

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Why does bus_alloc_resource fail for sound and PCIC?

2002-01-05 Thread Matthew N. Dodd

On Sat, 5 Jan 2002, Michael Reifenberger wrote:
> map[10]: type 4, range 32, base 2400, size  8, port disabled
> map[14]: type 4, range 32, base 2000, size  7, port disabled
> ...
> 
> Which I interpret as:
> There are two ioports (type 4) which are disabled ( should get enabled
> using RF_ACTIVE flag)...

While the PCI bus code should enable these resources, only the driver
really knows if a PCI map will be used.  It should enable it.  See
pci_enable_io()

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |   2 x '84 Volvo 245DL| ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Why does bus_alloc_resource fail for sound and PCIC?

2002-01-05 Thread Michael Reifenberger

Hi,
here are some details for my previous message (A30p) (where the detailed
dmesg output was attached):

In the case of the snd_ich driver it seems that the following code fails:
...
foo = bus_alloc_resource(dev,SYS_RES_IOPORT,0x10,0,~0,1,RF_ACTIVE);
bar = bus_alloc_resource(dev,SYS_RES_IOPORT,0x14,0,~0,1,RF_ACTIVE);
...

foo and bar are 0 but the bus-probe-code earlier prints:
...
found-> vendor=0x8086, dev=0x2485, revid=0x01
bus=0, slot=31, func=5
class=04-01-00, hdrtype=0x00, mfdev=0
intpin=b, irq=11
map[10]: type 4, range 32, base 2400, size  8, port disabled
map[14]: type 4, range 32, base 2000, size  7, port disabled
...

Which I interpret as:
There are two ioports (type 4) which are disabled ( should get enabled
using RF_ACTIVE flag)...

Where is the problem.

Bye!

Michael Reifenberger
^.*Plaut.*$, IT, R/3 Basis, GPS


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message