u-boot cpu speed

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

u-boot cpu speed

1,758 Views
dluberger
Contributor V

I realize it's not a "supported" feature, but I really need to set the cpu speed to a lower setting during boot. I know I can set the default governor in the kernel configuration, but how do i do that for u-boot? I'm fine with modifying the source code, I just don't see where to do that. I looked at arch/arm/cpu/armv7/mx7/soc.c and i see some code for displaying speed grades, but nothing about actually setting the speed. i don't see anywhere to set the speed via register settings in the board.c file either.  I'm using the mx6sxsabresd board. my custom board will not work if i can't limit the power draw, and it seems right now i can only do that in the rootfs via frequency governors. in u-boot and kernel, i want those to be forced to always use the lowest cpu frequency possible (which seems to be 198 MHz).  

Labels (5)
0 Kudos
6 Replies

1,114 Views
igorpadykov
NXP Employee
NXP Employee

Hi David

one can look at baremetal sdk example (zip can be found on SMP Enable in IMX6 )

 ../cpu_utility/..cpu_workpoint.c

in uboot codes can be added to plugin.S.

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

0 Kudos

1,114 Views
dluberger
Contributor V

This is way over my head.  I can find the plugin.s file for the eval board mx6sxsabresd but it looks like all assembler code. i don't see how i can use the code in the cpu_workpoint.c file to modify plugin.s.  Aside from that, my understanding is that the cpu frequency for this processor is "hard coded" in the boot rom.  It seems that I'd need to modify boot rom code. Is that what the plugin.s code is?  I'm very confused by all of this.  Can't I just set some register value in plugin.S to set the cpu frequency for u-boot?

0 Kudos

1,114 Views
igorpadykov
NXP Employee
NXP Employee

Hi David

you are right, changing cpu speed is compex procedure and it is not just

changing some register value in plugin.S. Also it is correct that

cpu frequency for processor is "hard coded" in the boot rom. However

plugin.S is special procedure when processor exits from rom for performing

customer codes (not "hard coded"), this allows for any changes including

changing arm core (or ddr) frequency.

Best regards
igor

0 Kudos

1,114 Views
dluberger
Contributor V

So that means that no matter what the processor will always start up at 792MHz, even if I change it in the plugin.s code?

I read that there's a low power mode for this processor.  Is there a way to enable that at startup? It's in section 8.11 of the reference manual, call USB low power boot. There's a mode that has all the clocks running at fairly low frequencies.

0 Kudos

1,114 Views
igorpadykov
NXP Employee
NXP Employee

>So that means that no matter what the processor will always start up at 792MHz,
>even if I change it in the plugin.s code?

you are right that processor always start up at 792MHz, however after executing ROM
codes it executes plugin.s, so you can change its frequency in plugin.s, after that

it can start uboot with new arm frequency.

>I read that there's a low power mode for this processor.  Is there a way to enable that at startup?

yes with BT_FREQ, please check sect.8.4.3 Clocks at boot time i.MX6DQ Reference Manual
http://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf

Best regards
igor

0 Kudos

1,114 Views
dluberger
Contributor V

I'm not sure that's what I'm talking about. With BT_FREQ, the SYSTEM_PLL is 792MHz regardless of that setting. What I'm referring to is LPB_BOOT described in section 8.10.  It shows the ARM_CLK_ROOT as low as 132MHz.  I need to know how to set that mode.  My understanding is that if I need to boot from fuses, I can't use the GPIO boot overrides for setting the boot device, so setting fuses seems very complicated.  Is there a guide to tell me how to use the u-boot fuse command along with exactly which fuse banks and values to use to duplicate the eval board gpio overrides and use LPB_BOOT only without changing or setting any other fuses?

0 Kudos