pci to isa bridge config space

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

pci to isa bridge config space

Post by Raymond »

The pci to isa bridge should have config space.And there maybe 4096 bytes in the config space,so what do the offsets of 0x60-0x63 mean?How to use them?

It's better some one has detail structure of the space.Maybe some links or article.

I do not mean the isa.Thanks.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: pci to isa bridge config space

Post by Combuster »

The BIOS needs functional hardware to boot, and therefore it has set up all the routing for you. There's no reason to touch any of the bus bridges you find on the PCI bus, including the PCI-to-ISA one.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

Re: pci to isa bridge config space

Post by Raymond »

What is the relationship between pci slot num and bus no,deviceno,func no,how to compute the slot no?
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

Re: pci to isa bridge config space

Post by Raymond »

why i ask this, because i need to use the network and usb,the isa bridge is firstly used on bochs ,and offset 0x60-0x63 must be relative to

the slot number of pci device.Who can tell me,thanks
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: pci to isa bridge config space

Post by BenLunt »

I think you have a great misunderstanding of how the PCI is enumerated if you are asking that question.

You don't enumerate the PCI via slot numbers. You enumerate the PCI by bus/dev/func numbers.

Code: Select all

for (bus=0; bus<MAX_BUS; bus++)
  for (dev=0; dev<MAX_DEV; dev++)
    for (func=0; func<MAX_FUNC; func++) {
       if (VENDOR_ID(bus, dev, func) != 0xFFFF) {
         // we have a valid device here
       }
       if (!multiple-function)
         break;
    }
To use the USB or NIC or any other device, you first enumerate the devices via something like the above and when you find a device, you check the class, sub class, and prog_interface fields to see if it is the device type you are looking for. For USB, you find a serial device class of 0x0C, then a USB sub class of 0x03, then a programming interface value of 0x00, 0x10, 0x20, or 0x30.

Chapter 2 of a few of my books explain this in detail, especially the USB book.

Note: Bit 7 in the first function's header_type field indicates if there are multiple functions on this device.
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

Re: pci to isa bridge config space

Post by Raymond »

ben,you have a mistake on my meaning,i just want to know how can i use the offset 0x60-0x63 in the config space of the pci to isa bridge,

if they are not exist please tell me,I know how to detect pci and scan it.Maybe you can give me some documents about pci to isa bridge.
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: pci to isa bridge config space

Post by Octocontrabass »

Raymond wrote:ben,you have a mistake on my meaning,i just want to know how can i use the offset 0x60-0x63 in the config space of the pci to isa bridge,
Why do you want to use it? It sounds like you're looking at the wrong thing.
Raymond wrote:if they are not exist please tell me,I know how to detect pci and scan it.
Ben already told you how to scan for PCI devices. There is more information on the wiki page for PCI.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: pci to isa bridge config space

Post by Brendan »

Hi,
Raymond wrote:ben,you have a mistake on my meaning,i just want to know how can i use the offset 0x60-0x63 in the config space of the pci to isa bridge,
You'd need a chipset driver just to figure out what registers at offsets 0x60 to 0x63 in the PCI Config Space of a PCI to ISA (or PCI to LPC) bridge actually do. Without knowing what the registers do, you can't know how to use them.

Notes:
  • For most Intel chipset's the registers at offsets 0x60 to 0x63 control how PCI IRQs A to D are routed to PIC chip inputs; but without more information (how other things use PIC chip inputs, how PCI device IRQs are mapped to PCI IRQs) you still don't know how to use the registers (and should respect the firmware's settings anyway).
  • For the only AMD chipset I looked at the registers at offsets 0x60 to 0x63 have no documentation at all (I'd assume they don't exist); and there's a completely different device (called a "System Management Device" in the chipset docs) that contains the registers that control how PCI IRQs A to D are routed to PIC chip inputs.
  • For the only VIA chipset I looked at, the registers at offsets 0x60 to 0x63 control which IO ports are used by a "Programmable Chip Select"(!), and registers 0x54 to 0x57 control how PCI IRQs A to D are routed to PIC chip inputs.

Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply