Question

I have a Jetway NF81-T56 motherboard which has a header providing 8 I/O lines labeled GPIO30-GPIO37. There is no GPIO driver in my CentOS6 install, and I am attemptiing to write a driver. A Fintek F71869 Super IO chip provides the GPIO and other I/O functions. I can access and modify the GPIO3 registers through the 0x2e/0x2f ports, but haven't been able to access the data port using the GPIO BASE_ADDR set in the F71869 GPIO registers. I have read those registers, and the GPIO BASE_ADDR is set to 0x0a00. The manual page for the chip states:

The index port is BASE_ADDR[15:2] + 5 and the data port is BASE_ADDR[15:2] + 6

I have set the data port to 0x0f (as displayed by connected LEDs) and tried reading ports 0x0a00-0x0a7f. All returned 0xff, and not 0x0f. Does anyone know how to interpret the "BASE_ADDR[15:2]" notation syntax? I have tried searching the Internet and tried contacting the manufacturer, to no avail.

Was it helpful?

Solution

This is hardware-style vector (bitfield) notation, basically you right shift two places.

0x0a00 becomes 0x0280 if I'm doing it right in my head.

To draw it out here are the bits [15:0]
0x0a00 = 0000 1010 0000 0000
now select bits [15:2]
         0000 1010 0000 00
which we re-format as [13:0] of a new vector
           00 0010 1000 0000 = 0x0280

So it looks like you should be accessing at 0x0285 and 0x0286. However, you need to be sure you've got the board configured correctly, and more important you need to be sure that nothing else is also located at those addresses.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top