summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c
diff options
context:
space:
mode:
authorCástor Muñoz <cmvidal@gmail.com>2016-05-22 00:43:18 +0200
committerCástor Muñoz <cmvidal@gmail.com>2016-05-25 12:23:47 +0200
commit3f17745930ab0bee11555ab35318121dbec8fab1 (patch)
treef55eca9ef78772842b9f9e9dc448b04d9cefaef5 /firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c
parente863f9a0ce8d968b085252c3b093b17ca07b65dd (diff)
iPod Classic: HW initialization for RB
Do not rely on a bootloader initializing the HW, RB initializes and configures GPIO, I2C, and PMU at startup. Change-Id: If7f856b1f345f63de584aa4e4fc22d130cd66c80
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c')
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c
index 9c3ec8e711..920c93ad5d 100644
--- a/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c
@@ -143,7 +143,9 @@ void pmu_write_rtc(unsigned char* buffer)
pmu_write_multiple(0x59, 7, buffer);
}
-#ifdef BOOTLOADER
+/*
+ * preinit
+ */
int pmu_rd_multiple(int address, int count, unsigned char* buffer)
{
return i2c_rd(0, 0xe6, address, count, buffer);
@@ -225,7 +227,9 @@ void pmu_preinit(void)
/* AUTOLDO (HDD): 3400 mV, disabled,
limit = 1000 mA (40mA*0x19), limit always active */
PCF5063X_REG_AUTOOUT, 0x6f,
+#ifdef BOOTLOADER
PCF5063X_REG_AUTOENA, 0x0,
+#endif
PCF5063X_REG_AUTOCTL, 0x0,
PCF5063X_REG_AUTOMXC, 0x59,
@@ -257,7 +261,9 @@ void pmu_preinit(void)
PCF5063X_REG_GPOCFG, 0x1,
/* LED converter OFF, overvoltage protection enabled,
OCP limit is 500 mA, led_dimstep = 16*0x6/32768 */
+#ifdef BOOTLOADER
PCF5063X_REG_LEDENA, 0x0,
+#endif
PCF5063X_REG_LEDCTL, 0x5,
PCF5063X_REG_LEDDIM, 0x6,
@@ -274,4 +280,3 @@ void pmu_preinit(void)
pmu_rd_multiple(PCF5063X_REG_INT1, 5, rd_buf);
pmu_rd(PCF50635_REG_INT6);
}
-#endif /* BOOTLOADER */