please download L4T sources via download center, you may check the header file for the APIs to check GPIO status.
for example, $L4T_Sources/r32.4.4/Linux_for_Tegra/source/public/cboot/bootloader/partner/t18x/cboot/include/dev/gpio.h
But I get the compile error as below when I include the “/dev/gpio.h” and use the apis.
/home/nvidia/Workspace/NVIDIA/SDKManager/SDK/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/cboot/bootloader/partner/t18x/cboot/top/main.c:74: undefined reference to `gpio_config’
/home/nvidia/Workspace/NVIDIA/SDKManager/SDK/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/cboot/bootloader/partner/t18x/cboot/top/main.c:76: undefined reference to `gpio_get’
Is it the static library?
If it does, I need to write the library name into Makefile, right?
could you please try to include below header file for testing, $L4T_Sources/r32.4.4/Linux_for_Tegra/source/public/cboot/bootloader/partner/common/include/drivers/tegrabl_gpio.h
please use this GPIO API for reading a GPIO pin state in CBoot.
for example,
according to pinmux spreadsheets. the signal name is I2S0_DOUT for pin# 193, it is GPIO3_PT.06.
you may also refer to Xavier NX’s GPIO definition,
for example, $L4T_Sources/r32.4.4/Linux_for_Tegra/source/public/kernel/nvidia/include/dt-bindings/gpio/tegra194-gpio.h
you’re correct this pin number is 446 form kernel side, which coming from ( (19 * 8) + 6) + 288 = 446.
however, you should note that there’re GPIO allocation ranges for kernel.
for example, you may found the kernel init messages to register these GPIO within the range.
[ 0.875748] gpiochip_setup_dev: registered GPIOs 288 to 511 on device: gpiochip0 (tegra-gpio)
according to Boot Flow, since you’re going to check the GPIO state in CBoot.
could you please revise the pin number as (19 * 8) + 6 = 158, for verification.
thanks
There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks
can you share the change you made.
this is not kernel panic. this cboot panic.