public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] am57xx: Set tps659038 PMIC GPIO7 pad mux value to POWERHOLD
@ 2016-11-30  9:32 Keerthy
  2016-12-01 15:32 ` Tom Rini
  2016-12-12 13:35 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Keerthy @ 2016-11-30  9:32 UTC (permalink / raw)
  To: u-boot

The GPIO7 pad mux should be programmed to POWERHOLD value
as per board design. In cases where the PMIC is shut off the
mux is set to GPIO7 mode. So during initialization to be on the
safer side set the mode to POWERHOLD.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 board/ti/am57xx/board.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index f3e3f0b..5fd39bd 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -49,6 +49,9 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define SYSINFO_BOARD_NAME_MAX_LEN	45
 
+#define TPS65903X_PRIMARY_SECONDARY_PAD2	0xFB
+#define TPS65903X_PAD2_POWERHOLD_MASK		0x20
+
 const struct omap_sysinfo sysinfo = {
 	"Board: UNKNOWN(BeagleBoard X15?) REV UNKNOWN\n"
 };
@@ -380,12 +383,26 @@ int board_init(void)
 int board_late_init(void)
 {
 	setup_board_eeprom_env();
+	u8 val;
 
 	/*
 	 * DEV_CTRL.DEV_ON = 1 please - else palmas switches off in 8 seconds
 	 * This is the POWERHOLD-in-Low behavior.
 	 */
 	palmas_i2c_write_u8(TPS65903X_CHIP_P1, 0xA0, 0x1);
+
+	/*
+	 * Set the GPIO7 Pad to POWERHOLD. This has higher priority
+	 * over DEV_CTRL.DEV_ON bit. This can be reset in case of
+	 * PMIC Power off. So to be on the safer side set it back
+	 * to POWERHOLD mode irrespective of the current state.
+	 */
+	palmas_i2c_read_u8(TPS65903X_CHIP_P1, TPS65903X_PRIMARY_SECONDARY_PAD2,
+			   &val);
+	val = val | TPS65903X_PAD2_POWERHOLD_MASK;
+	palmas_i2c_write_u8(TPS65903X_CHIP_P1, TPS65903X_PRIMARY_SECONDARY_PAD2,
+			    val);
+
 	return 0;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] am57xx: Set tps659038 PMIC GPIO7 pad mux value to POWERHOLD
  2016-11-30  9:32 [U-Boot] [PATCH] am57xx: Set tps659038 PMIC GPIO7 pad mux value to POWERHOLD Keerthy
@ 2016-12-01 15:32 ` Tom Rini
  2016-12-12 13:35 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2016-12-01 15:32 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 30, 2016 at 03:02:53PM +0530, Keerthy wrote:

> The GPIO7 pad mux should be programmed to POWERHOLD value
> as per board design. In cases where the PMIC is shut off the
> mux is set to GPIO7 mode. So during initialization to be on the
> safer side set the mode to POWERHOLD.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161201/0b96b34a/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] am57xx: Set tps659038 PMIC GPIO7 pad mux value to POWERHOLD
  2016-11-30  9:32 [U-Boot] [PATCH] am57xx: Set tps659038 PMIC GPIO7 pad mux value to POWERHOLD Keerthy
  2016-12-01 15:32 ` Tom Rini
@ 2016-12-12 13:35 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2016-12-12 13:35 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 30, 2016 at 03:02:53PM +0530, Keerthy wrote:

> The GPIO7 pad mux should be programmed to POWERHOLD value
> as per board design. In cases where the PMIC is shut off the
> mux is set to GPIO7 mode. So during initialization to be on the
> safer side set the mode to POWERHOLD.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161212/8ecc4c25/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-12 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30  9:32 [U-Boot] [PATCH] am57xx: Set tps659038 PMIC GPIO7 pad mux value to POWERHOLD Keerthy
2016-12-01 15:32 ` Tom Rini
2016-12-12 13:35 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox