imx233: implement emi frequency scaling (disabled by default)
commit5aa19f3eeb4e401b2d1ac57131a87b87b6ce55d5
authorAmaury Pouly <amaury.pouly@gmail.com>
Thu, 10 Jan 2013 00:43:08 +0000 (10 00:43 +0000)
committerAmaury Pouly <amaury.pouly@gmail.com>
Thu, 10 Jan 2013 00:51:35 +0000 (10 00:51 +0000)
treeae54a62a5a4420dff8ec5198f6f5c9418c34151f
parentb9923df170104320e55bff05ecc2a0105067f9cb
imx233: implement emi frequency scaling (disabled by default)

CPU frequency scaling is basically useless without scaling the
memory frequency. On the i.MX233, the EMI (external memory
interface) and DRAM blocks are responsable for the DDR settings.
This commits implements emi frequency scaling. Only some settings
are implemented and the timings values only apply to mDDR
(extracted from Sigmatel linux port) and have been checked to
work on the Fuze+ and Zen X-Fi2/3. This feature is still disabled
by default but I expected some battery life savings by boosting
higher to 454MHz and unboosting lower to 64MHz.
Note that changing the emi frequency is particularly tricky and
to avoid writing it entirely in assembly we rely on the compiler
to not use the stack except in the prolog and epilog (because
it's in dram which is disabled when doing the change) and to put
constant pools in iram which should always be true if the
compiler isn't completely dumb and since the code itself is put
in iram. If this proves to be insufficient, one can always switch
the stack to the irq stack since interrupts are disabled during
the change.

Change-Id: If6ef5357f7ff091130ca1063e48536c6028f23ba
firmware/SOURCES
firmware/target/arm/imx233/clkctrl-imx233.h
firmware/target/arm/imx233/emi-imx233.c [new file with mode: 0644]
firmware/target/arm/imx233/emi-imx233.h [new file with mode: 0644]
firmware/target/arm/imx233/system-imx233.c
firmware/target/arm/imx233/system-target.h