public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: tenth post about PCI code, need help
@ 2003-01-08 18:09 Ray Lee
  2003-01-08 18:49 ` Richard B. Johnson
  0 siblings, 1 reply; 7+ messages in thread
From: Ray Lee @ 2003-01-08 18:09 UTC (permalink / raw)
  To: fretre3618, Linux Kernel

> 1. which device is at port address 0xCFB? (please note, NOT 0xCF8)

0xcfb ('bee') is the fourth byte of the 32 bit register that sits/starts
at 0xcf8 ('eight'). Note the difference in the code between the outb and
outl calls.

To answer your other questions, I think you'd have better luck reading
the spec for the x86 pc-style PCI bridge chip, rather than the (generic)
PCI v2.0 spec itself. The spec for the actual chip is always the final
authority for what's going on. (Unless, of course, it's wrong...)

Ray


^ permalink raw reply	[flat|nested] 7+ messages in thread
* tenth post about PCI code, need help
@ 2003-01-08 16:13 fretre lewis
  0 siblings, 0 replies; 7+ messages in thread
From: fretre lewis @ 2003-01-08 16:13 UTC (permalink / raw)
  To: linux-kernel


hi,
  first, I have to say sorry for my 10th posting the same question , I hope 
someone can answer it indeed, it seem too difficult for me.


  I am learning code pci_check_direct(), at arch/i386/kernel/pci-pc.c

the PCI spec v2.0 say: ( page32)

"Anytime a host bridge sees a full DWORD I/O write from the host to
CONFIG_ADDRESS, the bridge must latch the data into its CONFIG_ADDRESS
register. On full DWORD I/O reads to CONFIG_ADDRESS,the bridge must return
the
data in CONFIG_ADDRESS. Any other types of accesses to this
address(non-DWORD)
have no effect on CONFIG_ADDRESS and are excuted as normal I/O transaction
on PCI bus......"

CONFIG_ADDRESS = 0xCF8
CONFIG_DATA = 0xCFC

so I think "outb (0x01, 0xCFB);" just is a normal write operation to a 
device at port address 0xCFB not a configuration type operation(maybe 
wrong,fix me), then my questions are:

1. which device is at port address 0xCFB? (please note, NOT 0xCF8)

2. what is meaning of the writing operation "outb (0x01, 0xCFB);" for THIS
device?, it'seem that PCI spec v2.0 not say anything about it?

3. why need "outb (0x01, 0xCFB);" before configuration operation "outl
(0x80000000, 0xCF8);" if check configuration type 1? and why need "outb
(0x00, 0xCFB);" before "outb (0x00, 0xCF8);" if check configuration type 2?

please help me, thanks a lot.

406 static struct pci_ops * __devinit pci_check_direct(void)
407 {
408         unsigned int tmp;
409         unsigned long flags;
410
411         __save_flags(flags); __cli();
412
413         /*
414          * Check if configuration type 1 works.
415          */
416         if (pci_probe & PCI_PROBE_CONF1) {
417                 outb (0x01, 0xCFB);  <<<=========
418                 tmp = inl (0xCF8);
419                 outl (0x80000000, 0xCF8);
420                 if (inl (0xCF8) == 0x80000000 &&
421                     pci_sanity_check(&pci_direct_conf1)) {
422                         outl (tmp, 0xCF8);
423                         __restore_flags(flags);
424                         printk(KERN_INFO "PCI: Using configuration type
1\n");
425                         request_region(0xCF8, 8, "PCI conf1");
426                         return &pci_direct_conf1;
427                 }
428                 outl (tmp, 0xCF8);
429         }
430
431         /*
432          * Check if configuration type 2 works.
433          */
434         if (pci_probe & PCI_PROBE_CONF2) {
435                 outb (0x00, 0xCFB);   <<<=========
436                 outb (0x00, 0xCF8);
437                 outb (0x00, 0xCFA);
438                 if (inb (0xCF8) == 0x00 && inb (0xCFA) == 0x00 &&
439                     pci_sanity_check(&pci_direct_conf2)) {
440                         __restore_flags(flags);
441                         printk(KERN_INFO "PCI: Using configuration type
2\n");
442                         request_region(0xCF8, 4, "PCI conf2");
443                         return &pci_direct_conf2;
444                 }
445         }
446
447         __restore_flags(flags);
448         return NULL;
449 }
450
451 #endif



_________________________________________________________________
MSN 8: advanced junk mail protection and 2 months FREE*. 
http://join.msn.com/?page=features/junkmail


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-01-08 19:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-08 18:09 tenth post about PCI code, need help Ray Lee
2003-01-08 18:49 ` Richard B. Johnson
2003-01-08 19:13   ` Ray Lee
2003-01-08 19:20   ` H. Peter Anvin
2003-01-08 19:44     ` Richard B. Johnson
2003-01-08 19:48       ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2003-01-08 16:13 fretre lewis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox