How To Configure Pins On MCIMX8QXP-CPU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How To Configure Pins On MCIMX8QXP-CPU

1,108 Views
cgiordano
Contributor III

Hi community, I am learning fresh about the I.MX8 on my MCIMX8QXP-CPU development board.  I have been getting fairly acquainted with the Yocto build and such.  I have so far successfully added my own layer where I can run a user-space program on this dev board as well as insert a "hello" Linux module which auto-loads upon boot.  So I'm in the first phases of this journey of I.MX8 support.  

I suppose no easy way to ask this, but the question about how to map the pins to certain functions is one that eludes me at this time.  I have watched some material about DTS files, but not sure if this is exactly what I need to look at.  Either way, I would eventually like to understand how pin X is configured by default to serve as say a GP Output, or a SPI RX line, etc.  It is not clear to me how one is supposed to easily support the I.MX8 if you are not aware of what pins have in terms of functions that can be multiplexed to them.  

And another thing that eludes me is how to configure a peripheral - such as SPI or UART...  How does the kernel know how to set the baud rate correctly for a UART?  I know from my experience, I would read a micro-controller's reference manual and write the correct value to a specific register associated with the UART.  Or like a SPI bus, how to set the clock speed, clock polarity/phase...  how does the kernel know how to do these things in general to peripherals that I know have to have some register at some memory mapped address that operates based on what value is present in these registers?  

So pins and their functions is of interest to me - any links that spell these out to me would be great.  How are peripherals set up as well would be where I would want to go next, but I suppose first things first.  This question is mainly about understanding how the kernel maps out the pins to particular functions.  

Thanks in advance.  I am working hard to figure all this out.  I am relatively new to Linux and the I.MX family, so please forgive me for my lack of "basic" knowledge here.  I appreciate any helpful feedback I receive.  

4 Replies

966 Views
cgiordano
Contributor III

What about this:

Pins Tool for i.MX Application Processors | NXP 

I just am not sure how to set this up for a custom board my company is designing and how to incorporate the DTS file it apparently generates in my Yocto build.  For what it's worth, I am using the development board listed in the title of this thread and per NXP's IMX Yocto User's Guide, I am building the 'imx-image-core'.  I'd like to figure out how to start from here and move this eventually to my company's custom PCB.  

I have been getting the hang of this Yocto/Linux business being that I have started looking into this for the first time in my life from March of 2020.  I have figured out how to add my custom layer that contains a C program and add 2 custom modules (i.e. USB drivers) that I need as well.  So I've been mostly concerned with these tasks for the past few months.  All in all, there will be a time that I need to work on supporting the custom PCB with this build and this is going to be uncharted territory for me.  What might be interesting is how does this image I am generating (imx-image-core) know how to map the pins and make the kernel aware of where the UART, I2C, USB, etc. registers are that physically manipulate the silicon?  Is this all wrapped up in a DTS file or multiple files?  

Thanks in advance.  Sorry for the super-delayed response.  These days, times are hard living in this messed up pandemic that we don't see any end in sight to.  Just stuck in my basement juggling work and supporting my family.  What a life...  I'll leave it at that, because this isn't living IMHO.  But rather be safe than think about getting the virus or spreading it to my fellow humans that share our planet.  Best wishes!  

0 Kudos

966 Views
igorpadykov
NXP Employee
NXP Employee

Hi Christopher

all chip configuration is handled by SCU described in Chapter 13
System Controller Unit (SCU) i.MX8QXP Reference Manual

i.MX 8DualXPlus/8QuadXPlus Applications Processor Reference Manual

Access to SCU is performed through APIs, one can look at

System Controller Firmware 101 - Getting started 

"System Controller Firmware Porting Guide" included in

SCFW Porting Kit

i.MX8 ADC_IN0 pin can't set as GPIO function 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

966 Views
cgiordano
Contributor III

Thanks for the reply.  Seems silly, but I cannot find this reference manual you are referring to when I do a search for "imx8qxp reference manual".  Perhaps you can provide me a link please?  For some reason this is giving me difficulty looking for a document online...  Anyhow, I would greatly appreciate directing me here.  

0 Kudos

966 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos