Re: PCI port I/O and memory-mapped I/O
- Reply: orbit : "Re: PCI port I/O and memory-mapped I/O"
- In reply to: Warner Losh : "Re: PCI port I/O and memory-mapped I/O"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 17 Sep 2025 02:49:03 UTC
On Tue, Sep 16, 2025 at 05:36:51PM -0700, Warner Losh wrote: > On Tue, Sep 16, 2025 at 9:26 AM orbit <ordinarybit@proton.me> wrote: > > > Hi, > > > > I am exploring PCI device driver at the moment were I could see my FreeBSD > > system having this Intel gigabit NIC detected as shown in the dmesg. > > > > em0: <Intel(R) PRO/1000 Legacy Network Connection 1.1.0> port > > 0xd010-0xd017 mem 0xf0000000-0xf001ffff irq 9 at device 3.0 on pci0 > > > > Can someone confirm if the "port 0xd010-0xd017" and "mem > > 0xf0000000-0xf001ffff" pertains respectively to the PCI port I/O space > > and the PCI memory space being allocated to this Intel network driver upon > > attachment? If yes, does the Intel network controller chip use these ranges Yes they are. More exactly, these are BARs for PCI function. You may also want to look at the output of pciconf(8) -lvcb for your device. > > of memory addresses to map its control and status registers? If not, what > > are the usage of these port and memory address ranges? This is really a question about specific device. You should consult the datasheet or programming manual from the vendor to see what for the BARs are used. Usually indeed BARs are directly handled by hardware as the control and communication resource. Sometimes BARs contain registers that point to bus space regions where actual registers are located. > > > > Yes. Those are the addresses that the BIOS assigned to them, and that > FreeBSD picked up. That's the hardware register file for the network > controller. > > The actual physical address is typically mapped 1:1 to the PCI Bus address, > but sometimes an iommu remaps. At least on x86, IOMMU remaps requests from devices to system memory, not requests from CPU to devices.