How can I configure the i.MX6 GPT_CAPTURE to read a PWM/frequency ?

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

How can I configure the i.MX6 GPT_CAPTURE to read a PWM/frequency ?

1,919 Views
maximenoah
Contributor I

Hi,

I want use GPT_CAPTURE1 to read frenquency. i say that i have to configure my device tree but i don't understant this post : How can I use the i.MX6 GPT to safely read a PWM? (https://community.nxp.com/thread/492843).

I understand that i have to use SD1_DAT0 as GPT_CAPTURE1, but it's all.

I'm new in Yocto and Linux embedded.

Best Regard,

Maxime.

Labels (3)
2 Replies

1,536 Views
igorpadykov
NXP Employee
NXP Employee

Hi Maxime

for porting patches from mentioned link one can try to follow

https://community.nxp.com/docs/DOC-100203 

i.MX Yocto Project: How can I (quickly) modify the kernel and test it? 

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

1,536 Views
maximenoah
Contributor I

Hi igor,

 

Thank you for your answer and your link, it's very good for a beginner in embedded linux & Yocto !

 

I use var-som-solo with the board VAR-SOLOCustomBoard. Both from variscite : VAR-SOM-SOLO/DUAL : NXP/Freescale iMX6 Solo / Dual Lite | Variscite 

 

I worked well on it with your link and I have some questions :

 

- If i understand documents, the uboot is a bootloader which allow to initialize the var-som-solo during the boot and the   device tree  is also use during the boot but it allow to found the material caracterisque from var-som-solo ? It's correct ?

 

- For my device trees, the organization is the following :

 

imx6dl-var-som-vsc.dts ---------------> imx6dl-var-som.dtsi

                                        ---------------> imx6qdl-var-solocb-dt6cb-displays.dtsi

                                        ---------------> imx6qdl-var-solocb-dt6cb-buttons.dtsi

                                        ---------------> imx6qdl-var-solocb-misc.dtsi

                          |----------------> imx6dl.dtsi

 

                                                           |--------------------> dt-bindings/gpio/gpio.h

                                                           |--------------------> dt-bindings/input/input.h

 

                          |----------------> imx6qdl-var-som.dtsi

                         

                                                           |--------------------> imx6q-pinfunc.h

                                                           |--------------------> imx6qdl.dtsi

                                                           |--------------------> dt-bindings/interrupt-controller/irq.h

 

                                                                                                  |-----------------------> skeleton.dtsi

                                                                                                  |-----------------------> dt-bindings/clock/imx6qdl-clock.h

                                                                                                  |-----------------------> dt-bindings/input/input.h

                                                                                                  |-----------------------> dt-bindings/interrupt-controller/arm-gic.h

 

it's normal that it's different from you ?

- If i want my custom dts, and change the name of the file during the command install_yocto.sh, how to process ? Because, if the file to flash NAND is imx6dl-var-som-vsc.dts and i want that it to be imx6dl-var-som-Maxime.dts for example, how to proceed ?

install_yocto.png

 

- If i understand, if i want to custom my customboard, i only change imx6dl-var-som-vsc.dts and imx6dl-var-som.dtsi ? If i want to custom my soc, i change the rest ?

 

So, if i want custom my var-som-solo to add GPT_Capture1, in the file imx6qdl-var-som.dtsi i add :

 

pinctrl_gpt_input_capture0: gptinputcapture0grp {
            fsl,pins = <
                MX6QDL_PAD_SD1_DAT0__GPT_CAPTURE1    0x1b0b0
            >;
};

 

before

 

pinctrl_usdhc1_1: usdhc1grp {
            fsl,pins = <
                MX6QDL_PAD_SD1_CMD__SD1_CMD        0x17071
                MX6QDL_PAD_SD1_CLK__SD1_CLK           0x10071
                MX6QDL_PAD_SD1_DAT0__SD1_DATA0        0x17071
                MX6QDL_PAD_SD1_DAT1__SD1_DATA1        0x17071
                MX6QDL_PAD_SD1_DAT2__SD1_DATA2        0x17071
                MX6QDL_PAD_SD1_DAT3__SD1_DATA3        0x17071
            >;
        };

 

then i disable &usdhc1

 

&usdhc1 {    /* uSDHC1, eMMC */
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usdhc1_1>;
    non-removable;
    keep-power-in-suspend;
    enable-sdio-wakeup;
    status = "okay"; >>>>  status = "disable";
};

 

then i copy/paste the patch (time.patch.zip) from https://community.nxp.com/thread/492843 into time.c and it's ok ?  i rebuilt my dts, i flash my NAND et i can read frequency on GPT_CAPTURE1 ?

 

- For my uboot, i have not the same directories that you :

with the example mx6q_4x_mt41j128.cfg is in build_12/tmp/work/var-som-mx6-fslc-linux-gnueabi/u-boot-fw-utils/1.0r0/git/board/freescale/mx6sabresd/mx6q_4x_mt41j128.cfg   and not in board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg

with the example mx6sabresd.c is in build_12/tmp/work/var-som-mx6-fslc-linux-gnueabi/u-boot-fw-utils/1.0r0/git/board/freescale/mx6sabresd/mx6sabresd.c    and not in board/freescale/imx/ddr/mx6sabresd.c

the same with mx6sabre_common.h and mx6sabresd.h which are in build_12/tmp/work/var-som-mx6-fslc-linux-gnueabi/u-boot-fw-utils/1.0r0/git/board/freescale/include/configs/....

For my board i don't found that... Only mx6var_som.c in build_x12/tmp/work/var_som_mx6-fslc-linux-gnueabi/u-boot-fw-utils/1.0-r0/git/board/variscite/mx6var_som/mx6var-som.c and mx6var-som.h in   build_x12/tmp/work/var_som_mx6-fslc-linux-gnueabi/u-boot-fw-utils/1.0-r0/git/include/configs/mx6var-som.h. I don't have common.h and cfg... But there is mx6_common.h but i don't know if it has relation between.

And file with vardl and var-solo are into mx6sabreauto and this, is not my board.. So i don't know where search..

Thank you for your answer.

Best Regards,

Maxime.

0 Kudos
Reply