Hello,
I was trying to setup some pins in uBoot and was trying to find the IO bank and offset mapping so I could make use of
IMX_GPIO_NR(bank, nr) to control the pin.
I didnt see anything in the reference manual and the imx dts files on the kernel side use this format
* The pin function ID is a tuple of
* <mux_reg conf_reg input_reg mux_mode input_val>
Also in the kernel is there a recommended place for board initialization or is it best to keep that in uboot?
Thanks!
Hi Raman
for IMX_GPIO_NR one can look at
gpio.h\arch-imx8\asm\include\arm\arch - uboot-imx - i.MX U-Boot
spl.c\imx8mq_evk\freescale\board - uboot-imx - i.MX U-Boot
>Also in the kernel is there a recommended place for board initialization or is it best to keep that in uboot?
it depends on kernel, in latest for example clock initialization is performed in
imx\clk\drivers - linux-imx - i.MX Linux kernel
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Igor
In this example
#define USDHC2_CD_GPIO IMX_GPIO_NR(2, 12)
I wanted to know how I could find that bank 2 and offset 12 corresponds to a specific pin.
So for example where can I find the mapping from SAI5_RXC or AC15 to a bank and offset number.
Thanks!
Hi Raman
from gpio.h\arch-imx8\asm\include\arm\arch - uboot-imx - i.MX U-Boot
/* IMX8 the GPIO index is from 0 not 1 */#define IMX_GPIO_NR(port, index) (((port)*32)+((index)&31))port number can be found in IOMUX Chapter of i.MX8M Mini Reference Manual i.MX 8M Mini Applications Processor Reference Manual Best regards igor
Thanks Igor I found this in uboot and understand how to use the #define.
What I need is a way to map from a named pin for example SAI5_RXC or AC15 to a bank/port and offset number.
Do you know where I can find that?
Thanks,
Raman
Hi Raman
from p.1395 RM : GPIO3_IO20 (port3, index 20)
Best regards
igor