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
This commit is contained in:
Amaury Pouly 2013-01-10 00:43:08 +00:00
parent b9923df170
commit 5aa19f3eeb
6 changed files with 490 additions and 9 deletions

View file

@ -526,6 +526,7 @@ target/arm/imx233/lradc-imx233.c
target/arm/imx233/pwm-imx233.c
target/arm/imx233/rtc-imx233.c
target/arm/imx233/dcp-imx233.c
target/arm/imx233/emi-imx233.c
# ifdef HAVE_TOUCHSCREEN
target/arm/imx233/touchscreen-imx233.c
# endif