How are clock divisors enfc_pred and enfs_podf modified in Linux for the i.MX6ULL?

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

How are clock divisors enfc_pred and enfs_podf modified in Linux for the i.MX6ULL?

Jump to solution
1,115 Views
JohnKlug
Senior Contributor I

When I set the values of enfc_pred and enfs_podf in U-Boot, they disappear in Linux.

Here is the clk_summary:

pll2_pfd2_396m           1        1        0   396000000          0
                enfc_sel              0        0        0   396000000          0
                   enfc_pred          0        0        0    66000000          0
                      enfc_podf       0        0        0    22000000          0
                         gpmi_io       0        0        0    22000000          



 Here is a register dump in Linux that matches the clk_summary:

bash# devmem2 0x20c402c w
/dev/mem opened.
Memory mapped at address 0x76fb7000.
Read at address  0x020C402C (0x76fb702c): 0x0055B6C1


Here is the register setting in U-Boot that I would like to try in Linux:

=> md.l 0x20c402c 1
020c402c: 0015b6c1 


I have been unable to find these divisors in existing device tree entries in the arch/arm/boot/dts directory.

Labels (2)
0 Kudos
Reply
1 Solution
1,089 Views
JohnKlug
Senior Contributor I
I found out that the driver attempts to set these parameters automatically in drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

The clock is set in this module to 22MHz for my part which has tRC_min of 30nS. This results in a read cycle and write cycle of 90nS as measured. By moving to a 66MHz clock, the read/write cycle time improves from 90nS to 30nS which matches the data sheet for my part. Why is the clock so slow? I will need to check other timings to see if they are within the specification for the part I have.

View solution in original post

0 Kudos
Reply
2 Replies
1,074 Views
joanxie
NXP TechSupport
NXP TechSupport

you can find this in the clock settings, I share the code here

https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/arch/arm/mach-imx/mx6/clock.c#L64

0 Kudos
Reply
1,090 Views
JohnKlug
Senior Contributor I
I found out that the driver attempts to set these parameters automatically in drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c

The clock is set in this module to 22MHz for my part which has tRC_min of 30nS. This results in a read cycle and write cycle of 90nS as measured. By moving to a 66MHz clock, the read/write cycle time improves from 90nS to 30nS which matches the data sheet for my part. Why is the clock so slow? I will need to check other timings to see if they are within the specification for the part I have.
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2018107%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20are%20clock%20divisors%20enfc_pred%20and%20enfs_podf%20modified%20in%20Linux%20for%20the%20i.MX6ULL%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2018107%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20I%20set%20the%20values%20of%20enfc_pred%20and%20enfs_podf%20in%20U-Boot%2C%20they%20disappear%20in%20Linux.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EHere%20is%20the%20clk_summary%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Epll2_pfd2_396m%20%20%20%20%20%20%20%20%20%20%201%20%20%20%20%20%20%20%201%20%20%20%20%20%20%20%200%20%20%20396000000%20%20%20%20%20%20%20%20%20%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20enfc_sel%20%20%20%20%20%20%20%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20396000000%20%20%20%20%20%20%20%20%20%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20enfc_pred%20%20%20%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20%2066000000%20%20%20%20%20%20%20%20%20%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20enfc_podf%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20%2022000000%20%20%20%20%20%20%20%20%20%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20gpmi_io%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20%20%20%20%20%200%20%20%20%2022000000%20%20%20%20%20%20%20%20%20%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%26nbsp%3BHere%20is%20a%20register%20dump%20in%20Linux%20that%20matches%20the%20clk_summary%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ebash%23%20devmem2%200x20c402c%20w%0A%2Fdev%2Fmem%20opened.%0AMemory%20mapped%20at%20address%200x76fb7000.%0ARead%20at%20address%20%200x020C402C%20(0x76fb702c)%3A%200x0055B6C1%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3EHere%20is%20the%20register%20setting%20in%20U-Boot%20that%20I%20would%20like%20to%20try%20in%20Linux%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%3D%26gt%3B%20md.l%200x20c402c%201%0A020c402c%3A%200015b6c1%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3EI%20have%20been%20unable%20to%20find%20these%20divisors%20in%20existing%20device%20tree%20entries%20in%20the%20arch%2Farm%2Fboot%2Fdts%20directory.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2018107%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX6UL%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2019167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20are%20clock%20divisors%20enfc_pred%20and%20enfs_podf%20modified%20in%20Linux%20for%20the%20i.MX6ULL%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2019167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eyou%20can%20find%20this%20in%20the%20clock%20settings%2C%20I%20share%20the%20code%20here%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fnxp-imx%2Fuboot-imx%2Fblob%2Flf_v2022.04%2Farch%2Farm%2Fmach-imx%2Fmx6%2Fclock.c%23L64%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fnxp-imx%2Fuboot-imx%2Fblob%2Flf_v2022.04%2Farch%2Farm%2Fmach-imx%2Fmx6%2Fclock.c%23L64%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2018746%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20How%20are%20clock%20divisors%20enfc_pred%20and%20enfs_podf%20modified%20in%20Linux%20for%20the%20i.MX6ULL%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2018746%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI%20found%20out%20that%20the%20driver%20attempts%20to%20set%20these%20parameters%20automatically%20in%20drivers%2Fmtd%2Fnand%2Fraw%2Fgpmi-nand%2Fgpmi-nand.c%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20clock%20is%20set%20in%20this%20module%20to%2022MHz%20for%20my%20part%20which%20has%20tRC_min%20of%2030nS.%20This%20results%20in%20a%20read%20cycle%20and%20write%20cycle%20of%2090nS%20as%20measured.%20By%20moving%20to%20a%2066MHz%20clock%2C%20the%20read%2Fwrite%20cycle%20time%20improves%20from%2090nS%20to%2030nS%20which%20matches%20the%20data%20sheet%20for%20my%20part.%20Why%20is%20the%20clock%20so%20slow%3F%20I%20will%20need%20to%20check%20other%20timings%20to%20see%20if%20they%20are%20within%20the%20specification%20for%20the%20part%20I%20have.%3C%2FLINGO-BODY%3E