* pci_check_type2() help.
@ 2012-04-16 16:02 Onkar N Mahajan
2012-04-16 19:13 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Onkar N Mahajan @ 2012-04-16 16:02 UTC (permalink / raw)
To: linux-pci
Hello list,
I am trying to understand the PCI functionality in Linux kernel.
What is the best way to start to understanding this - where to start
in the kernel code ? Books ? Manuals ?
I started reading the code - where I am stuck in this function -
pci_check_type2() ; Wherein I am not able to get from where these values
0xCFB,0xCF8,0xCFA are arrived at ? I guess these are port numbers , but
in which manuals can I find this all information.
linux/arch/x86/pci/init.c:
static int __init pci_check_type2(void)
{
unsigned long flags;
int works = 0;
local_irq_save(flags);
outb(0x00, 0xCFB);
outb(0x00, 0xCF8);
outb(0x00, 0xCFA);
if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00 &&
pci_sanity_check(&pci_direct_conf2)) {
works = 1;
}
local_irq_restore(flags);
return works;
}
Please help me figuring out right manuals for this.
-- Onkar
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pci_check_type2() help.
2012-04-16 19:13 ` Randy Dunlap
@ 2012-04-16 16:20 ` Onkar N Mahajan
2012-04-16 19:21 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Onkar N Mahajan @ 2012-04-16 16:20 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-pci
On Mon, 2012-04-16 at 12:13 -0700, Randy Dunlap wrote:
> On 04/16/2012 09:02 AM, Onkar N Mahajan wrote:
>
> > Hello list,
> >
> > I am trying to understand the PCI functionality in Linux kernel.
> > What is the best way to start to understanding this - where to start
> > in the kernel code ? Books ? Manuals ?
> >
> > I started reading the code - where I am stuck in this function -
> > pci_check_type2() ; Wherein I am not able to get from where these values
> > 0xCFB,0xCF8,0xCFA are arrived at ? I guess these are port numbers , but
> > in which manuals can I find this all information.
> >
> > linux/arch/x86/pci/init.c:
> > static int __init pci_check_type2(void)
> > {
> > unsigned long flags;
> > int works = 0;
> >
> > local_irq_save(flags);
> >
> > outb(0x00, 0xCFB);
> > outb(0x00, 0xCF8);
> > outb(0x00, 0xCFA);
> > if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00 &&
> > pci_sanity_check(&pci_direct_conf2)) {
> > works = 1;
> > }
> >
> > local_irq_restore(flags);
> >
> > return works;
> > }
> >
> >
> > Please help me figuring out right manuals for this.
>
>
> The PCI spec (version 2.1 seems to be all I have available)
> discusses PCI Configuration Mechanisms and Special Cycles and
> these PCI config registers.
>
Thanks Randy , for your help. Can you please also guide me with
respect to good way to start understanding the PCI implementation
in Linux ?
-- Onkar
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pci_check_type2() help.
2012-04-16 16:02 pci_check_type2() help Onkar N Mahajan
@ 2012-04-16 19:13 ` Randy Dunlap
2012-04-16 16:20 ` Onkar N Mahajan
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2012-04-16 19:13 UTC (permalink / raw)
To: Onkar N Mahajan; +Cc: linux-pci
On 04/16/2012 09:02 AM, Onkar N Mahajan wrote:
> Hello list,
>
> I am trying to understand the PCI functionality in Linux kernel.
> What is the best way to start to understanding this - where to start
> in the kernel code ? Books ? Manuals ?
>
> I started reading the code - where I am stuck in this function -
> pci_check_type2() ; Wherein I am not able to get from where these values
> 0xCFB,0xCF8,0xCFA are arrived at ? I guess these are port numbers , but
> in which manuals can I find this all information.
>
> linux/arch/x86/pci/init.c:
> static int __init pci_check_type2(void)
> {
> unsigned long flags;
> int works = 0;
>
> local_irq_save(flags);
>
> outb(0x00, 0xCFB);
> outb(0x00, 0xCF8);
> outb(0x00, 0xCFA);
> if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00 &&
> pci_sanity_check(&pci_direct_conf2)) {
> works = 1;
> }
>
> local_irq_restore(flags);
>
> return works;
> }
>
>
> Please help me figuring out right manuals for this.
The PCI spec (version 2.1 seems to be all I have available)
discusses PCI Configuration Mechanisms and Special Cycles and
these PCI config registers.
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pci_check_type2() help.
2012-04-16 16:20 ` Onkar N Mahajan
@ 2012-04-16 19:21 ` Randy Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2012-04-16 19:21 UTC (permalink / raw)
To: Onkar N Mahajan; +Cc: linux-pci
On 04/16/2012 09:20 AM, Onkar N Mahajan wrote:
> On Mon, 2012-04-16 at 12:13 -0700, Randy Dunlap wrote:
>> On 04/16/2012 09:02 AM, Onkar N Mahajan wrote:
>>
>>> Hello list,
>>>
>>> I am trying to understand the PCI functionality in Linux kernel.
>>> What is the best way to start to understanding this - where to start
>>> in the kernel code ? Books ? Manuals ?
>>>
>>> I started reading the code - where I am stuck in this function -
>>> pci_check_type2() ; Wherein I am not able to get from where these values
>>> 0xCFB,0xCF8,0xCFA are arrived at ? I guess these are port numbers , but
>>> in which manuals can I find this all information.
>>>
>>> linux/arch/x86/pci/init.c:
>>> static int __init pci_check_type2(void)
>>> {
>>> unsigned long flags;
>>> int works = 0;
>>>
>>> local_irq_save(flags);
>>>
>>> outb(0x00, 0xCFB);
>>> outb(0x00, 0xCF8);
>>> outb(0x00, 0xCFA);
>>> if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00 &&
>>> pci_sanity_check(&pci_direct_conf2)) {
>>> works = 1;
>>> }
>>>
>>> local_irq_restore(flags);
>>>
>>> return works;
>>> }
>>>
>>>
>>> Please help me figuring out right manuals for this.
>>
>>
>> The PCI spec (version 2.1 seems to be all I have available)
>> discusses PCI Configuration Mechanisms and Special Cycles and
>> these PCI config registers.
>>
> Thanks Randy , for your help. Can you please also guide me with
> respect to good way to start understanding the PCI implementation
> in Linux ?
Not really. It's best to ask specific questions about it.
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-16 16:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-16 16:02 pci_check_type2() help Onkar N Mahajan
2012-04-16 19:13 ` Randy Dunlap
2012-04-16 16:20 ` Onkar N Mahajan
2012-04-16 19:21 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).