Message ID | 1455902390-5387-8-git-send-email-nikita@compulab.co.il |
---|---|
State | Accepted |
Commit | dccaaaeb990828573dfa242dfc6c29851d38e32c |
Delegated to: | Tom Rini |
Headers | show |
On Fri, Feb 19, 2016 at 07:19:47PM +0200, Nikita Kiryanov wrote: > Set TPS65218 FSEAL bit to 1 so that RTC could be powered using on-board > 3V battery. This is necessary so that time and date will survive reboots and > power offs. > > Cc: Tom Rini <trini@konsulko.com> > Cc: Albert Aribaud <albert.u.boot@aribaud.net> > Cc: Igor Grinberg <grinberg@compulab.co.il> > Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Reviewed-by: Tom Rini <trini@konsulko.com>
On Fri, Feb 19, 2016 at 07:19:47PM +0200, Nikita Kiryanov wrote: > Set TPS65218 FSEAL bit to 1 so that RTC could be powered using on-board > 3V battery. This is necessary so that time and date will survive reboots and > power offs. > > Cc: Tom Rini <trini@konsulko.com> > Cc: Albert Aribaud <albert.u.boot@aribaud.net> > Cc: Igor Grinberg <grinberg@compulab.co.il> > Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> > Reviewed-by: Tom Rini <trini@konsulko.com> Applied to u-boot/master, thanks!
diff --git a/board/compulab/cm_t43/cm_t43.c b/board/compulab/cm_t43/cm_t43.c index 445b609..0d5da6f 100644 --- a/board/compulab/cm_t43/cm_t43.c +++ b/board/compulab/cm_t43/cm_t43.c @@ -23,11 +23,18 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; int power_init_board(void) { struct pmic *p; + uchar tps_status = 0; power_tps65218_init(I2C_PMIC); p = pmic_get("TPS65218_PMIC"); - if (p && !pmic_probe(p)) + if (p && !pmic_probe(p)) { puts("PMIC: TPS65218\n"); + /* We don't care if fseal is locked, but we do need it set */ + tps65218_lock_fseal(); + tps65218_reg_read(TPS65218_STATUS, &tps_status); + if (!(tps_status & TPS65218_FSEAL)) + printf("WARNING: RTC not backed by battery!\n"); + } return 0; }
Set TPS65218 FSEAL bit to 1 so that RTC could be powered using on-board 3V battery. This is necessary so that time and date will survive reboots and power offs. Cc: Tom Rini <trini@konsulko.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> --- board/compulab/cm_t43/cm_t43.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)