LEDs (or other GPIO) on iMX8QM-MEK

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

LEDs (or other GPIO) on iMX8QM-MEK

2,294 Views
stuartrubin
Contributor III

Can someone please give me some direction on controlling the LEDs (and maybe other GPIOs) on the iMX8QM-MEK board from both U-Boot (in code) and Linux (maybe from the command line)?

I'm having a hard time finding it in the docs.

Thank you

0 Kudos
4 Replies

2,084 Views
stuartrubin
Contributor III

Igor, thank you. I will look into this.

0 Kudos

2,084 Views
stuartrubin
Contributor III

Igor, thank you again for this.

 

Unfortunately, I am having trouble doing something which I think is quite basic. Here are the specifics. Perhaps you can show me the proper steps or an example?

 

In U-boot, I would like to control the SCU Debug LED (which is D3 on the iMX8QM-MEK schematic). This LED is tied to SCU_GPIO0_02.

 

From what I've figured out from the U-Boot source, I think I need to do some combination of changing the DTS, "allocating" a resource, reserving a resource, and setting a pad configuration, but I just can't figure it out.

 

Thank you very much!

 

Stuart

0 Kudos

2,084 Views
igorpadykov
NXP Employee
NXP Employee

Hi Stuart

may be useful to look:

MX8 GPIO - Variscite Wiki 

System Controller Firmware 101 - Pad configuration service 

dts example

fsl-imx8q-arm2.dtsi\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel 

pinctrl_pcieb: pciebgrp{
            fsl,pins = <
                SC_P_PCIE_CTRL1_CLKREQ_B_LSIO_GPIO4_IO30    0x06000021
                SC_P_PCIE_CTRL1_WAKE_B_LSIO_GPIO4_IO31        0x04000021
                SC_P_PCIE_CTRL1_PERST_B_LSIO_GPIO5_IO00        0x06000021
            >;
        };

&pcieb{
    ext_osc = <1>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_pcieb>;
    reset-gpio = <&gpio5 0 GPIO_ACTIVE_LOW>;
    clkreq-gpio = <&gpio4 1 GPIO_ACTIVE_LOW>;
    status = "okay";
};

Best regards
igor

Best regards
igor

0 Kudos

2,084 Views
igorpadykov
NXP Employee
NXP Employee

Hi Stuart

in i.MX8QM (and i.MX8QXP) gpios are handles by SCU:  System Controller Firmware 101 - Getting started 

documentation can be found in SCFW Porting Kit

May be useful similar case https://community.nxp.com/thread/511052 

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

0 Kudos