This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6442: DTS changes to run GPIO_INPUT_INTERRUPT example from Linux

Part Number: AM6442

Hello,

I'm trying to run a modified GPIO_INPUT_INTERRUPT example from MCU SDK using R19 gpio for interrupt. I had to deal with SCIClient error:

[Error] Sciclient event config failed!!!
ASSERT: 0.334s: syscfg/ti_drivers_config.c:Sciclient_gpioIrqSet:116: FALSE failed !!!

To solve this issue I did a few things:

  • changed sciclient_defaultBoardcfg_rm.c according to this tutorial
  • rebuilt bootloaders with similar changes in rm-cfg.c and sysfw_img_cfg.h in k3-image-gen
  • modified Linux device tree
    &main_gpio0 {
            status = "reserved";
    };

The example starts, but it required reserving whole main_gpio0 node.

The question is: is it possible to set reserved status only for one (or a few) GPIOs instead of a whole node?

First thing that came to my mind was gpio_reserved_ranges, but it seems like this value is ignored in the driver, also this particular parameter is not listed in the driver documentation (gpio_davinci.yml).

  • Hi Mateusz,

    Thanks for the query.

    Please allow me sometime to get back to you.

    Regards,

    Vaibhav

  • Hi Mateusz,

    It is not clear how your system partitions between Linux and FreeRTOS, but

    The question is: is it possible to set reserved status only for one (or a few) GPIOs instead of a whole node?

    No, Linux doesn't support reserving a subset of GPIO pins.

  • Hi Bin,

    Thanks for the reply.

    For now the whole system is Yocto Linux running on one of the A53 cores and the GPIO interrupt example running on r5f0_0 (remoteproc starting from Linux). Booting the board using u-boot i.e. tiboot3.bin, tispl.bin and u-boot.img.

    Reserving a whole GPIO bank is a little drastic, also in the future one of those GPIOs might be needed for Linux purposes. If reserving a subset of GPIOs is not an option, is it possible to split the main_gpio0 into smaller (with 16 or 32 GPIOs) nodes?

    I tried to make some modifications in device tree to split the main_gpio0 to 2 separate banks e.g. main_gpio0 and main_gpio0a, one with 48 and second with 39 GPIOs, and remap GPIOs higher than 48 to main_gpioa (such as AM64x-SK onboard green heartbeat diode), but couldn't get GPIOs from second bank to work.

    Is there any workaround other than reserving the main_gpio0 node, or is it only solution?

    Regards,
    Mateusz

  • Hi Mateusz,

    Regardless how main_gpio0 GPIO pins are partitioned, they are all under the single GPIO controller - main_gpio0, which can only be controlled in one OS. None of Linux on A53 or RTOS on R5F supports routing a portion of the GPIO pins to another remote CPU (A53 or R5F).

    So I don't see any workaround/solution, other than designing your board to only use a particular GPIO bank to a OS as an whole unit.

  • Hi Bin,

    Thank you for clearing that. I think that closes the discussion.

    Regards,
    Mateusz