summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/power-imx233.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-12-26 01:08:56 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-12-26 01:17:28 +0100
commite2da3f47d335dad87362354c36ea7e27bc26676b (patch)
tree9582166e73d0cb05eaff08c2b0208acb157139e0 /firmware/target/arm/imx233/power-imx233.h
parentca83b558dffbdc91e7ada0e1c48c208b945e1385 (diff)
downloadrockbox-e2da3f47d335dad87362354c36ea7e27bc26676b.tar.gz
rockbox-e2da3f47d335dad87362354c36ea7e27bc26676b.tar.bz2
rockbox-e2da3f47d335dad87362354c36ea7e27bc26676b.zip
imx233: fix regulator voltage setting + always enable DCDC mode
Make sure DCDC is running at boot (it is disabled by default when 5V is present and we don't want to rely on the bootloader to change this). When changing the voltage on a regulator, it usually takes 2ms for the voltage to stabilize. In DCDC mode, there is an irq to notify about the event so use it ! This is especially important when changing cpu frequency because increasing the cpu freq while the voltage is rising is unreliable. Change-Id: Icfe9ef3ee90156d1e17da0820d9041859f7f3bca
Diffstat (limited to 'firmware/target/arm/imx233/power-imx233.h')
-rw-r--r--firmware/target/arm/imx233/power-imx233.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/power-imx233.h b/firmware/target/arm/imx233/power-imx233.h
index 6991fde7b2..786a450972 100644
--- a/firmware/target/arm/imx233/power-imx233.h
+++ b/firmware/target/arm/imx233/power-imx233.h
@@ -31,6 +31,8 @@
#define HW_POWER_CTRL__ENIRQ_VBUS_VALID (1 << 3)
#define HW_POWER_CTRL__VBUSVALID_IRQ (1 << 4)
#define HW_POWER_CTRL__POLARITY_VBUSVALID (1 << 5)
+#define HW_POWER_CTRL__ENIRQ_DC_OK (1 << 14)
+#define HW_POWER_CTRL__DC_OK_IRQ (1 << 15)
#define HW_POWER_5VCTRL (*(volatile uint32_t *)(HW_POWER_BASE + 0x10))
#define HW_POWER_5VCTRL__ENABLE_DCDC (1 << 0)
@@ -191,6 +193,7 @@ enum imx233_regulator_t
void imx233_power_get_regulator(enum imx233_regulator_t reg, unsigned *target_mv,
unsigned *brownout_mv);
+// WARNING this call will block until voltage is stable
void imx233_power_set_regulator(enum imx233_regulator_t reg, unsigned target_mv,
unsigned brownout_mv);