0

When I do

lspci -v

in order to find may audio device memory I get

00:1f.3 Multimedia audio controller: Intel Corporation Device ds35 Subsystem: Intel Corporation Device 754 Flags: bus master, fast devsel, latency 64, IRQ 126
Memory at d1114000 (64-bit, non-prefetchable) [size=16K]
Memory at d1000000 (64-bit, non-prefetchable) [size=1M] Capabilities: Kernel ...

As you can see "memory at" shows up twice?

  1. Why is that?

  2. What are the differences in both these addresses.

  3. Why it is only the case for this particular audio device.

Thanks for help.

1 Answer 1

2

1.) The chipset has been designed to split the memory-mapped I/O allocation of the audio controller into several blocks, and the base address for each block can be assigned separately. This results in a more flexible chipset design that can be configured to accomodate various different hardware configurations.

2.) The two blocks are not copies of each other, but are used for different purposes. To understand more, you'll have to download the datasheet PDF(s) for your chipset from Intel, and possibly also some documentation on the HD Audio standard, and then read some very solid technical documentation.

3.) If the audio controller needs a total of 1040K of address space for its MMIO functionality, assigning it in two separate blocks that are both power-of-2 sized, the firmware will have a higher chance of being able to assign all the MMIO areas of the various hardware components into one or just a few contiguous blocks of addresses, without leaving too many inconvenient "holes" of memory or unusable address space in between them. This allows the hardware memory management unit of the processor to work more efficiently, as the Memory Type Range Registers (MTRRs) can assign optimal access strategies for both MMIO and regular memory blocks. There is only a limited number of MTRRs available, so achieving a tight packing of MMIO blocks helps.

1
  • what is the difference between the address read from lspci -v and the one written to each BAR of PCI device? I see they are different! This address from lspci -v ("Memory at xxxxx") - is it physical address of PCI device? Also, I did strace lspci -v and I see lspci open various /sys/bus/pci/devices/files, where is the information of PCI device address really encoded?
    – DannyS
    Sep 23, 2019 at 18:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .