From 3f17745930ab0bee11555ab35318121dbec8fab1 Mon Sep 17 00:00:00 2001 From: Cástor Muñoz Date: Sun, 22 May 2016 00:43:18 +0200 Subject: 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 --- firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'firmware/target/arm/s5l8702/ipod6g/pmu-ipod6g.c') 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 */ -- cgit v1.2.3