Beaglebone Black enable 'do_poweroff' U_BOOT_CMD

Has anyone managed to compile uboot with support for the poweroff command at u-boot command line prompt?

Follow up to my answer, I was able to realize a working version of do_poweroff U_BOOT_CMD.

I exploited the TPS65217 i2c PMIC device.

Implementation details summary

What actually the do_poweroff command do is to wrap the following series of commands:

  • Select TPS device using u-boot device-model interface

    pmic dev tps@24

  • Write OFF bit field of the STATUS register (this will prepare the chip to enter the poweroff state)

    pmic write 0x0A 0x80

  • Write 0x1E and 0x7D XORed value to PASSWORD register for unlock Level1 protection and enabling write permission into the SEQ6 register

    pmic write 0x0B 0x6B

  • Finally write SEQDWN and INSTDWN bits for performing instant shutdown of the board

    pmic write 0x16 0x02


I am attaching here the full patch file applied to my u-boot repo.

Enjoy :slight_smile:

enable-do-poweroff-u-boot-cmd.patch (4.2 KB)