summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c')
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c
index 2e0fe87883..50e91b616e 100644
--- a/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/power-ipod6g.c
@@ -43,6 +43,44 @@ void power_init(void)
43 43
44 /* DOWN1CTL: CPU DVM step time = 30us (default: no DVM) */ 44 /* DOWN1CTL: CPU DVM step time = 30us (default: no DVM) */
45 pmu_write(0x20, 2); 45 pmu_write(0x20, 2);
46
47 /* USB power configuration:
48 *
49 * GPIO C0 is probably related to the LTC4066's CLPROG
50 * pin (see datasheet). Setting it high allows to double
51 * the maximum current selected by HPWR:
52 *
53 * GPIO B6 GPIO C0 USB current
54 * HPWR CLPROG ??? limit (mA)
55 * ------- ---------- -----------
56 * 0 0 100
57 * 1 0 500
58 * 0 1 200
59 * 1 1 1000 ??? (max.seen ~750mA)
60 *
61 * USB current limit includes battery charge and device
62 * consumption. Battery charge has it's own limit at
63 * 330~340 mA (configured using RPROG).
64 *
65 * Setting either of GPIO C1 or GPIO C2 disables battery
66 * charge, power needed for device consumptiom is drained
67 * from USB or AC adaptor when present. If external power
68 * is not present or it is insufficient or limited,
69 * additional required power is drained from battery.
70 */
71 PCONB = (PCONB & 0x000000ff)
72 | (0xe << 8) /* route D+ to ADC2: off */
73 | (0xe << 12) /* route D- to ADC2: off */
74 | (0x0 << 16) /* USB related input, POL pin ??? */
75 | (0x0 << 20) /* USB related input, !CHRG pin ??? */
76 | (0xe << 24) /* HPWR: 100mA */
77 | (0xe << 28); /* USB suspend: off */
78
79 PCONC = (PCONC & 0xffff0000)
80 | (0xe << 0) /* double HPWR limit: off */
81 | (0xe << 4) /* disable battery charge: off */
82 | (0xe << 8) /* disable battery charge: off */
83 | (0x0 << 12); /* USB inserted/not inserted */
46} 84}
47 85
48void ide_power_enable(bool on) 86void ide_power_enable(bool on)