PMU control
set LDO voltage (u8 ldo, u8 voltage)
Depending on the chip ID:
- 4328, 5354:
- for ldo == LDO voltage 1 (== 1)
- Set locn to 2
- Set shift to 25
- Set mask to 0xF
- Break
- for ldo == LDO voltage 2 (== 2)
- Set locn to 3
- Set shift to 1
- Set mask to 0xF
- Break
- for ldo == LDO voltage 3 (== 3)
- Set locn to 3
- Set shift to 9
- Set mask to 0xF
- Break
- for ldo == PA reference (== 4)
- Set locn to 3
- Set shift to 17
- Set mask to 0x3F
- Break
- for ldo == LDO voltage 1 (== 1)
- 4312:
- for ldo == PA reference (others must not happen)
- Set locn to 0
- Set shift to 21
- Set mask to 0x3F
- Break
- for ldo == PA reference (others must not happen)
- 4325
- For ldo == 5
- Set locn to 5
- Set shift to 9
- Set mask to 0xF
- Break
- For ldo == 7
- Set locn to 3
- Set shift to 20
- Set mask to 0x1F
- If chip common chip status AND 0x200 is not zero
- Replace voltage with (voltage ^ 0x9) (Exclusive OR)
- Break
- Others: Must not happen - return
- For ldo == 5
- Others: Must not happen - return
MaskSet the reg(ulator?) control register "locn" with mask << shift and set with (voltage & mask) << shift.
switch PA ref LDO (bool enable)
Depending on the chip ID:
- 4312: set ldo = 2
- 4328: set ldo = 8
- 5354: set ldo = 8
- Others: do nothing
With the ldo value, if used, set 1<<ldo (enable TRUE) or clear 1<<ldo (enable FALSE) in the PMU min res mask chipcommon register (0x618).
PMU res masks (u32 *pmin, u32 *pmax)
- Set u32 min_mask and max_mask to 0
Set rscrs to (PMU capabilities & 0x1F00) >> 8
Depending on the chip ID:
- 5354:
- Set max_mask to 0xFFFFF
- Break
- 4328:
- Set min_mask to 0x10003
- Set max_mask to 0xFFFFF
- Break
- 4325:
If chip revision < 2
- Set min_mask to 0x402
If chip status & 0x200 not equal 0
- OR min_mask with 0x8
- Otherwise
If boardflags & 0x00800000 is not zero
- Set min_mask to 2
If chip status & 0x200 not equal 0
- OR min_mask with 0x10
If boardflags & 0x00200000 is not zero AND (boardtype is 0x0490 OR boardtype is 0x0491)
- OR min_mask with 1
Set max_mask to ~(~0 << rscrs)
- Break
- 4312:
- Set min_mask to 0x0CBB
- Break
- 4322:
If chip revision < 2
- Set min_mask to 0x000D
- Set max_mask to 0x1FF
- Break
- Others: Break
- Set *pmin to min_mask
- Set *pmax to max_mask