summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/power-imx233.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-01-28 00:43:04 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-02-01 15:02:22 +0100
commit289440605aeda05b0722c64f8798906dcd0af41a (patch)
tree39cb9c309c1134e7c10114b5effdd2a1de22b4e6 /firmware/target/arm/imx233/power-imx233.h
parentc18a4e631690250024031be1b306e9003b2300ad (diff)
downloadrockbox-289440605aeda05b0722c64f8798906dcd0af41a.tar.gz
rockbox-289440605aeda05b0722c64f8798906dcd0af41a.tar.bz2
rockbox-289440605aeda05b0722c64f8798906dcd0af41a.zip
imx233/fuze+: set a few recommended power bits by Freescale, remove some uneeded headers, implement audio path selection for playback and radio
Change-Id: If926ead9b776504a58eb102fcc0e9acadf4f7379
Diffstat (limited to 'firmware/target/arm/imx233/power-imx233.h')
-rw-r--r--firmware/target/arm/imx233/power-imx233.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/power-imx233.h b/firmware/target/arm/imx233/power-imx233.h
index 368ca719da..3a2452ce19 100644
--- a/firmware/target/arm/imx233/power-imx233.h
+++ b/firmware/target/arm/imx233/power-imx233.h
@@ -52,6 +52,8 @@
#define HW_POWER_5VCTRL__PWD_CHARGE_4P2 (1 << 20)
#define HW_POWER_MINPWR (*(volatile uint32_t *)(HW_POWER_BASE + 0x20))
+#define HW_POWER_MINPWR__HALF_FETS (1 << 5)
+#define HW_POWER_MINPWR__DOUBLE_FETS (1 << 6)
#define HW_POWER_CHARGE (*(volatile uint32_t *)(HW_POWER_BASE + 0x30))
#define HW_POWER_CHARGE__BATTCHRG_I_BP 0
@@ -129,6 +131,27 @@
#define HW_POWER_MISC__FREQSEL__21p6MHz 6
#define HW_POWER_MISC__FREQSEL__17p28MHz 7
+#define HW_POWER_LOOPCTRL (*(volatile uint32_t *)(HW_POWER_BASE + 0xb0))
+#define HW_POWER_LOOPCTRL__DC_C_BP 0
+#define HW_POWER_LOOPCTRL__DC_C_BM 0x3
+#define HW_POWER_LOOPCTRL__DC_R_BP 4
+#define HW_POWER_LOOPCTRL__DC_R_BM 0xf0
+#define HW_POWER_LOOPCTRL__DC_FF_BP 8
+#define HW_POWER_LOOPCTRL__DC_FF_BM (0x7 << 8)
+#define HW_POWER_LOOPCTRL__EN_RCSCALE_BP 12
+#define HW_POWER_LOOPCTRL__EN_RCSCALE_BM (0x3 << 12)
+#define HW_POWER_LOOPCTRL__EN_RCSCALE__DISABLED 0
+#define HW_POWER_LOOPCTRL__EN_RCSCALE__2X 1
+#define HW_POWER_LOOPCTRL__EN_RCSCALE__4X 2
+#define HW_POWER_LOOPCTRL__EN_RCSCALE__8X 3
+#define HW_POWER_LOOPCTRL__RCSCALE_THRESH (1 << 14)
+#define HW_POWER_LOOPCTRL__DF_HYST_THRESH (1 << 15)
+#define HW_POWER_LOOPCTRL__CM_HYST_THRESH (1 << 16)
+#define HW_POWER_LOOPCTRL__EN_DF_HYST (1 << 17)
+#define HW_POWER_LOOPCTRL__EN_CM_HYST (1 << 18)
+#define HW_POWER_LOOPCTRL__HYST_SIGN (1 << 19)
+#define HW_POWER_LOOPCTRL__TOGGLE_DIF (1 << 20)
+
#define HW_POWER_STS (*(volatile uint32_t *)(HW_POWER_BASE + 0xc0))
#define HW_POWER_STS__VBUSVALID (1 << 1)
#define HW_POWER_STS__CHRGSTS (1 << 11)
@@ -148,6 +171,17 @@ void imx233_power_set_charge_current(unsigned current); /* in mA */
void imx233_power_set_stop_current(unsigned current); /* in mA */
void imx233_power_enable_batadj(bool enable);
+static inline void imx233_power_set_dcdc_freq(bool pll, unsigned freq)
+{
+ HW_POWER_MISC &= ~(HW_POWER_MISC__SEL_PLLCLK | HW_POWER_MISC__FREQSEL_BM);
+ /* WARNING: HW_POWER_MISC does have a SET/CLR variant ! */
+ if(pll)
+ {
+ HW_POWER_MISC |= freq << HW_POWER_MISC__FREQSEL_BP;
+ HW_POWER_MISC |= HW_POWER_MISC__SEL_PLLCLK;
+ }
+}
+
struct imx233_power_info_t
{
int vddd; /* in mV */