From e2da3f47d335dad87362354c36ea7e27bc26676b Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 26 Dec 2012 01:08:56 +0100 Subject: 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 --- firmware/target/arm/imx233/power-imx233.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'firmware/target/arm/imx233/power-imx233.h') 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); -- cgit v1.2.3