How to runtime read DDR clock rate

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

How to runtime read DDR clock rate

Jump to solution
608 Views
GG0712
Contributor III

Hi NXP team,

 

I using s32g399ardb3 and BSP35.

How can I runtime access DDR clock rate?

Does S32G3 maximum DDR clock rate is DDR4-3200?

How can I adjust DDR clock rate?

GG0712_0-1757498302469.png

 

root@s32g399ardb3:~# cat /sys/kernel/debug/clk/clk_summary 
| enable | prepare | protect | | | duty
clock | count | count | count | rate | accuracy | phase | cycle
ddr_axi | 0 | 0 | 0 | 800000000 | 0 | 0 | 50000
ddr_pll_ref | 0 | 0 | 0 | 800000000 | 0 | 0 | 50000
ddr_reg | 0 | 0 | 0 | 132206143 | 0 | 0 | 50000
root@s32g399ardb3:~# lshw 
s32g399ardb3
description: Computer
product: NXP S32G399A-RDB3
width: 64 bits
capabilities: smp tagged_addr_disabled
...
...
...
*-memory
description: System memory
physical id: c
size: 3415MiB

Thanks

0 Kudos
Reply
1 Solution
567 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @GG0712 

Thanks for your post.

1. Yes, from the RM, the maximum DDR clock rate supported is DDR4-3200

2. The DDR clock is set via the code in TFA, you may try adjusting it via the TFA

 

BR

Chenyin

View solution in original post

0 Kudos
Reply
5 Replies
568 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @GG0712 

Thanks for your post.

1. Yes, from the RM, the maximum DDR clock rate supported is DDR4-3200

2. The DDR clock is set via the code in TFA, you may try adjusting it via the TFA

 

BR

Chenyin

0 Kudos
Reply
562 Views
GG0712
Contributor III

Hi @chenyin_h ,

 

Our HW team measure the clock rate is 1600 MHz

But from my previous post, the clock rate of ddr_pll_ref is 800 MHz

Does this correct?

 

Thanks

0 Kudos
Reply
554 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @GG0712 

Thanks for your reply.

Yes, it is correct, within the internal DDR PHY the DDR_CLK will be doubled and therefore the outputted DRAM clock frequency is DDR_CLK multiplied with 2, which would be 800*2=1600Mhz.

 

BR

Chenyin 

0 Kudos
Reply
552 Views
GG0712
Contributor III

Hi @chenyin_h ,

 

According what you said.

Can I understand that DDR clock rate is 1600 MHz and data rate is 3200 MHz ?

 

Thanks

0 Kudos
Reply
544 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @GG0712 

Thanks for your reply.

Yes, I agree with you, the data rate is 3200MT/s per my understanding.

 

BR

Chenyin

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2166553%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20runtime%20read%20DDR%20clock%20rate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2166553%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20NXP%20team%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20using%20s32g399ardb3%20and%20BSP35.%3C%2FP%3E%3CP%3EHow%20can%20I%20runtime%20access%20DDR%20clock%20rate%3F%3C%2FP%3E%3CP%3EDoes%20S32G3%20maximum%20DDR%20clock%20rate%20is%20DDR4-3200%3F%3C%2FP%3E%3CP%3EHow%20can%20I%20adjust%20DDR%20clock%20rate%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22GG0712_0-1757498302469.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22GG0712_0-1757498302469.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F356231i03FE8E3B660C94F4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22GG0712_0-1757498302469.png%22%20alt%3D%22GG0712_0-1757498302469.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CPRE%3Eroot%40s32g399ardb3%3A~%23%20cat%20%2Fsys%2Fkernel%2Fdebug%2Fclk%2Fclk_summary%20%3CBR%20%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%7C%20enable%20%7C%20prepare%20%7C%20protect%20%20%20%20%20%20%20%20%20%20%20%7C%20%20%20%20%20%20%20%20%20%20%7C%20%20%20%20%20%20%20%7C%20duty%3CBR%20%2F%3Eclock%20%20%20%20%20%20%20%7C%20count%20%20%7C%20count%20%20%20%7C%20count%20%7C%20rate%20%20%20%20%20%20%7C%20accuracy%20%7C%20phase%20%7C%20cycle%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3Eddr_axi%3C%2FFONT%3E%20%20%20%20%20%7C%200%20%20%20%20%20%20%7C%200%20%20%20%20%20%20%20%7C%200%20%20%20%20%20%7C%20%3CFONT%20color%3D%22%23FF0000%22%3E800000000%3C%2FFONT%3E%20%7C%200%20%20%20%20%20%20%20%20%7C%200%20%20%20%20%20%7C%2050000%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3Eddr_pll_ref%3C%2FFONT%3E%20%7C%200%20%20%20%20%20%20%7C%200%20%20%20%20%20%20%20%7C%200%20%20%20%20%20%7C%20%3CFONT%20color%3D%22%23FF0000%22%3E800000000%3C%2FFONT%3E%20%7C%200%20%20%20%20%20%20%20%20%7C%200%20%20%20%20%20%7C%2050000%3CBR%20%2F%3Eddr_reg%20%20%20%20%20%7C%200%20%20%20%20%20%20%7C%200%20%20%20%20%20%20%20%7C%200%20%20%20%20%20%7C%20132206143%20%7C%200%20%20%20%20%20%20%20%20%7C%200%20%20%20%20%20%7C%2050000%3C%2FPRE%3E%3CPRE%3Eroot%40s32g399ardb3%3A~%23%20lshw%20%3CBR%20%2F%3Es32g399ardb3%20%3CBR%20%2F%3Edescription%3A%20Computer%3CBR%20%2F%3Eproduct%3A%20NXP%20S32G399A-RDB3%3CBR%20%2F%3Ewidth%3A%2064%20bits%3CBR%20%2F%3Ecapabilities%3A%20smp%20tagged_addr_disabled%3CBR%20%2F%3E...%3CBR%20%2F%3E...%3CBR%20%2F%3E...%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3E*-memory%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3Edescription%3A%20System%20memory%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3Ephysical%20id%3A%20c%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3Esize%3A%203415MiB%3C%2FFONT%3E%3C%2FPRE%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2167697%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20runtime%20read%20DDR%20clock%20rate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2167697%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F236748%22%20target%3D%22_blank%22%3E%40GG0712%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20reply.%3C%2FP%3E%0A%3CP%3EYes%2C%20I%20agree%20with%20you%2C%20the%20data%20rate%20is%203200MT%2Fs%20per%20my%20understanding.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EChenyin%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2167496%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20runtime%20read%20DDR%20clock%20rate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2167496%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F24163%22%20target%3D%22_blank%22%3E%40chenyin_h%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAccording%20what%20you%20said.%3C%2FP%3E%3CP%3ECan%20I%20understand%20that%20DDR%20clock%20rate%20is%201600%20MHz%20and%20data%20rate%20is%203200%20MHz%20%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2167494%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20runtime%20read%20DDR%20clock%20rate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2167494%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F236748%22%20target%3D%22_blank%22%3E%40GG0712%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20reply.%3C%2FP%3E%0A%3CP%3EYes%2C%20it%20is%20correct%2C%26nbsp%3B%3CSPAN%20class%3D%22fontstyle0%22%3Ewithin%20the%20internal%20DDR%20PHY%20the%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22fontstyle0%22%3EDDR_CLK%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22fontstyle0%22%3Ewill%20be%20doubled%20and%20therefore%20the%20outputted%20DRAM%20clock%20frequency%20is%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22fontstyle0%22%3EDDR_CLK%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22fontstyle0%22%3Emultiplied%20with%202%2C%20which%20would%20be%20800*2%3D1600Mhz.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EChenyin%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2167382%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20runtime%20read%20DDR%20clock%20rate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2167382%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F24163%22%20target%3D%22_blank%22%3E%40chenyin_h%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOur%20HW%20team%20measure%20the%20clock%20rate%20is%201600%20MHz%3C%2FP%3E%3CP%3EBut%20from%20my%20previous%20post%2C%20the%20clock%20rate%20of%26nbsp%3Bddr_pll_ref%20is%20800%20MHz%3C%2FP%3E%3CP%3EDoes%20this%20correct%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2167375%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20runtime%20read%20DDR%20clock%20rate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2167375%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F236748%22%20target%3D%22_blank%22%3E%40GG0712%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20post.%3C%2FP%3E%0A%3CP%3E1.%20Yes%2C%20from%20the%20RM%2C%20the%26nbsp%3B%3CSPAN%3Emaximum%20DDR%20clock%20rate%20supported%20is%20DDR4-3200%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E2.%20The%20DDR%20clock%20is%20set%20via%20the%20code%20in%20TFA%2C%20you%20may%20try%20adjusting%20it%20via%20the%20TFA%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3EBR%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EChenyin%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E