Does anyone know how to use the integrated GPIO on the Vega. The documentation in the programmers manual is unclear and (to me at least) contradictory.
Specifically, the GPIO appears to be mapped into PCI I/O space with a base address available from PCI configuration space. However, the supposed location of that base address is register 0x44, and the greatest register number in configuration space (as accessed by 0xCF8/0xCFC) is 0x3f. What am I missing?
This is the solution that I came up with for using GPIO on the Vega:
(this message is in response to my original post) 1: Get the base address for the GPIO from the PCI configuration area using the ISA bridge configuration space (bus 0, device 0x0c, function 0). outl(0x80006044, 0xcf8); addr = inl(0xcfc) - 1; I don't know the reason for subtracting 1 - it was the way that base addresses were fetched in the SDK and it appears to work. 2. Turn on the GPIO in the Miscellaneous register in south bridge configuration space. outl(0x80006040, 0xcf8); outb(2, 0xcfc); 3. Use the GPIO with the base address. gpioValue = inb(addr + 6); Reading the GPIO configuration at boot time (at register BASE + 7) did not appear to work. This may be because of incomplete setup or because I am using an early version of the Vega.