Цитата(Zwerg_nase @ Jan 20 2006, 17:22)

Как PCI девайс может узнать, какой номер устройства ему присвоен. Т.е. к какому AD[] подсоединён IDSEL. Пользую корку pci_mt32 Altera, в описании корки про это не нашёл, а без этого не могу прочитать свои Configuration Registers (BAR и т.д.), а очень хочется.
PCI-девайс и не должен знать, к какому из ADi подсоединен его IDSEL. Спецификация говорит, что девайс должен определять начало обращения к нему в конфигурационном пространстве по установленному IDSEL и все, больше ничего на этот счет спецификация, afair не говорит.
Откуда Вы хотите прочитать BAR и т.п.? Если из хоста, то контроллер шины PCI должен в соответствии с запросом на чтение/запись пространства конфигурации выставить соответствующий ADi, т.е. IDSEL.
Вот что говорит спецификация:
Цитата
Implementation Note: System Generation of IDSEL
How a system generates IDSEL is system specific; however, if no other mapping is required, the following example may be used. The IDSEL signal associated with Device Number 0 is connected to AD[16], IDSEL of Device Number 1 is connected to AD[17], and so forth until IDSEL of Device Number 15 is connected to AD[31]. For Device Numbers 17-31, the host bridge should execute the transaction but not assert any of the AD[31::16] lines but allow the access to be terminated with Master-Abort.
Twenty-one different devices can be uniquely selected for configuration accesses by connecting a different address line to each device and asserting one of the AD[31::11] lines at a time. The issue with connecting one of the upper 21 AD lines to IDSEL is an additional load on the AD line. This can be mitigated by resistively coupling IDSEL to the appropriate AD line. This does, however, create a very slow slew rate on IDSEL, causing it to be in an invalid logic state most of the time, as shown in Figure 3-4 with the "XXXX" marks. However, since it is only used on the address phase of a Type 0 configuration transaction, the address bus can be pre-driven a few clocks before FRAME#16, thus guaranteeing IDSEL to be stable when it needs to be sampled. Pre-driving the address bus is equivalent to IDSEL stepping as discussed in Section 3.6.3. Note that if resistive coupling is used, the bridge that generates the configuration transaction is required to use IDSEL stepping or ensure that the clock period is sufficiently long to allow IDSEL to become stable before initiating the configuration transaction. For all other cycles, IDSEL is undefined and may be at a non-deterministic level during the address phase.