This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM437X: TPS65218D0 : PMIC Power up and Power Down sequencing

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: TPS65218

We stumbled across something strange while testing the power down sequence of the PMIC.  What we basically saw was an uncontrolled shutdown of rail DCDC3.  We couldn’t figure out why until we did a register dump of the PMIC and saw that register 0x23 has a 70h instead of a 75h (disabling the controlled sequence of shutdown of DCDC3).  Once we forced this bit back to 75h the shutdown sequence was correct.  After investigating further we see that 75h is there at u-boot (after a power cycle), but somewhere the register gets changed to 70h after booting (at kernel level).  We are trying to figure out where and why this is being changed at the kernel level.

Doesn’t make sense for a change to occur at kernel level.  Doesn’t make sense to make that rail uncontrolled either. 

PS: As a sanity check, we checked the starter kit eval and saw the same thing.

 Any ideas as to where and why this is being changed at kernel level?  

  • Hi,

    I will take a look on the Starter Kit and get you back.

  • Hi,

    I confirm the register 0x23 is 0x75 in U-Boot and 0x70 in Linux.

    I am routing your query to our PMIC expert to understand if it has any issue in using value 0x70.

  • Hi.  Disabling the sequencer for the DCDC3 rail I would think is important since the shutdown sequence is outlined in the datasheet to where the rails must shutdown in a specific order.  It would be interesting to find out why the starter kit eval disables this feature after Uboot.  

  • Hi, 

    We found as part of bootup where the 0x23 value is changing from 0x75 to 0x70. 

    File: 

    drivers/regulator/tps65218-regulator.c we commented following part of code in static const struct regulator_desc regulators[]; after commenting the following section we see the register 0x23 value is 0x75 in Linux its not overwritten to 0x70.
    /*TPS65218_REGULATOR("DCDC3", "regulator-dcdc3", TPS65218_DCDC_3,
    REGULATOR_VOLTAGE, tps65218_ldo1_dcdc34_ops, 64,
    TPS65218_REG_CONTROL_DCDC3,
    TPS65218_CONTROL_DCDC3_MASK, TPS65218_REG_ENABLE1,
    TPS65218_ENABLE1_DC3_EN, 0, 0, ldo1_dcdc3_ranges, 2,
    0, 0, TPS65218_REG_SEQ4, TPS65218_SEQ4_DC3_SEQ_MASK),*/
    static const struct regulator_desc regulators[] = {
    	TPS65218_REGULATOR("DCDC1", "regulator-dcdc1", TPS65218_DCDC_1,
    			   REGULATOR_VOLTAGE, tps65218_dcdc12_ops, 64,
    			   TPS65218_REG_CONTROL_DCDC1,
    			   TPS65218_CONTROL_DCDC1_MASK, TPS65218_REG_ENABLE1,
    			   TPS65218_ENABLE1_DC1_EN, 0, 0, dcdc1_dcdc2_ranges,
    			   2, 4000, 0, TPS65218_REG_SEQ3,
    			   TPS65218_SEQ3_DC1_SEQ_MASK),
    	TPS65218_REGULATOR("DCDC2", "regulator-dcdc2", TPS65218_DCDC_2,
    			   REGULATOR_VOLTAGE, tps65218_dcdc12_ops, 64,
    			   TPS65218_REG_CONTROL_DCDC2,
    			   TPS65218_CONTROL_DCDC2_MASK, TPS65218_REG_ENABLE1,
    			   TPS65218_ENABLE1_DC2_EN, 0, 0, dcdc1_dcdc2_ranges,
    			   2, 4000, 0, TPS65218_REG_SEQ3,
    			   TPS65218_SEQ3_DC2_SEQ_MASK),
    	/*TPS65218_REGULATOR("DCDC3", "regulator-dcdc3", TPS65218_DCDC_3,
    			   REGULATOR_VOLTAGE, tps65218_ldo1_dcdc34_ops, 64,
    			   TPS65218_REG_CONTROL_DCDC3,
    			   TPS65218_CONTROL_DCDC3_MASK, TPS65218_REG_ENABLE1,
    			   TPS65218_ENABLE1_DC3_EN, 0, 0, ldo1_dcdc3_ranges, 2,
    			   0, 0, TPS65218_REG_SEQ4, TPS65218_SEQ4_DC3_SEQ_MASK),*/
    	TPS65218_REGULATOR("DCDC4", "regulator-dcdc4", TPS65218_DCDC_4,
    			   REGULATOR_VOLTAGE, tps65218_ldo1_dcdc34_ops, 53,
    			   TPS65218_REG_CONTROL_DCDC4,
    			   TPS65218_CONTROL_DCDC4_MASK, TPS65218_REG_ENABLE1,
    			   TPS65218_ENABLE1_DC4_EN, 0, 0, dcdc4_ranges, 2,
    			   0, 0, TPS65218_REG_SEQ4, TPS65218_SEQ4_DC4_SEQ_MASK),
    	TPS65218_REGULATOR("DCDC5", "regulator-dcdc5", TPS65218_DCDC_5,
    			   REGULATOR_VOLTAGE, tps65218_dcdc56_pmic_ops, 1, -1,
    			   -1, TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC5_EN, 0,
    			   0, NULL, 0, 0, 1000000, TPS65218_REG_SEQ5,
    			   TPS65218_SEQ5_DC5_SEQ_MASK),
    	TPS65218_REGULATOR("DCDC6", "regulator-dcdc6", TPS65218_DCDC_6,
    			   REGULATOR_VOLTAGE, tps65218_dcdc56_pmic_ops, 1, -1,
    			   -1, TPS65218_REG_ENABLE1, TPS65218_ENABLE1_DC6_EN, 0,
    			   0, NULL, 0, 0, 1800000, TPS65218_REG_SEQ5,
    			   TPS65218_SEQ5_DC6_SEQ_MASK),
    	TPS65218_REGULATOR("LDO1", "regulator-ldo1", TPS65218_LDO_1,
    			   REGULATOR_VOLTAGE, tps65218_ldo1_dcdc34_ops, 64,
    			   TPS65218_REG_CONTROL_LDO1,
    			   TPS65218_CONTROL_LDO1_MASK, TPS65218_REG_ENABLE2,
    			   TPS65218_ENABLE2_LDO1_EN, 0, 0, ldo1_dcdc3_ranges,
    			   2, 0, 0, TPS65218_REG_SEQ6,
    			   TPS65218_SEQ6_LDO1_SEQ_MASK),
    	TPS65218_REGULATOR("LS3", "regulator-ls3", TPS65218_LS_3,
    			   REGULATOR_CURRENT, tps65218_ls3_ops, 0, 0, 0,
    			   TPS65218_REG_ENABLE2, TPS65218_ENABLE2_LS3_EN,
    			   TPS65218_REG_CONFIG2, TPS65218_CONFIG2_LS3ILIM_MASK,
    			   NULL, 0, 0, 0, 0, 0),
    };
    Now the question is, as most of PMIC settings are done from u-boot do we really need to include/enable the  drivers/regulator/tps65218-regulator.c driver as part of config. Is there a advantage in including this driver? 
  • Hi Mikhilesh,

    I will look into your question.

    Is your PMIC power down sequence test passed with the kernel code change above?

  • Hi Nikhil,

    I believe removing the highlighted lines below from your dts should resolve the issue as those register writes relate to suspend:

                    dcdc3: regulator-dcdc3 {

                            regulator-name = "vdds_ddr";

                            regulator-boot-on;

                            regulator-always-on;

                            regulator-state-mem {

                                    regulator-on-in-suspend;

                            };

                            regulator-state-disk {

                                    regulator-off-in-suspend;

                            };

                    };

    Best regards,
    Brad