Post Go back to editing

Controlling GPIO through axi_gpreg using AD9361 with ADRV1CRR-BOB Breakout Carrier

Hello,

I am developing a program that is required to communicate with some hardware. This means that I need to use at least 8 GPIO output ports.

Currently, I am capable of controlling leds, switches, buttons and 3 GPIO (IO_L02_13_JX2_P, IO_L06_13_JX2_N, IO_L06_13_JX2_P) through the linux driver.

Unfortunately, the rest of gpio is not controllable through the linux drivers. The issues is almost identical to the one described here:  Controlling Breakout Carrier (PicoZed SDR) GPIOs  where a direct mmap to the axi_gpreg is recommended as one that does not require changing the fpga fabric.

I know:

 But I am unable to achieve it as I can not locate the registers in the physical memory of the device (from the embedded linux using mmap).

Where should I look to find the location/locations of these registers?

Thank you for your help,
Best regards,
Kamil



Adding some additional info
[edited by: kwozniak at 12:07 PM (GMT -5) on 12 Jan 2022]
  • Alright, after a lot of digging and help from our company FPGA team we managed to locate the register.

    The address information is partially at https://wiki.analog.com/resources/fpga/docs/hdl/regmap where you can see the full regmap, specifically axi_gpreg

    As shown the REG_IO_ENG and REG_IO_OUT are at 0x0400 and 0x0404 but this is not the full address!!

    For this specific platform the address is offset of 0x4120 + your reg address for example 0x0400

    So the table should look like this:

    Port REG_IO_ENB REG_IO_OU REG_IO_IN
    0 0x41200400 0x41200404 0x41200408
    1 0x41200440 0x41200444 0x41200448
    2 0x41200480 0x41200484 0x41200488
    3 0x412004C0 0x412004C4 0x412004C8

    Additionally, if you just want to test that this work you can use the following linux utility: busybox devmem (https://stackoverflow.com/questions/12040303/how-to-access-physical-addresses-from-user-space-in-linux)

    To read the value (read the enabled io out):

    sudo busybox devmem 0x41200400

    To set the value (set first 8 io out to high):

    sudo busybox devmem 0x41200404 w 0x0000FF

    Good luck everyone who had a similar issue!
    Kamil