diff mbox

[U-Boot,26/31] ARM: k2g: Use board detection to wrap K2G GP specific calls

Message ID 20170302190435.23212-27-fcooper@ti.com
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Franklin S Cooper Jr March 2, 2017, 7:04 p.m. UTC
Certain peripherals used by K2G GP aren't used on K2G ICE evm. Or
configuration is slightly different. Therefore, use board detection to
deal with these variations.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
---
 board/ti/ks2_evm/board_k2g.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Comments

Tom Rini March 9, 2017, 1:09 p.m. UTC | #1
On Thu, Mar 02, 2017 at 01:04:30PM -0600, Franklin S Cooper Jr wrote:

> Certain peripherals used by K2G GP aren't used on K2G ICE evm. Or
> configuration is slightly different. Therefore, use board detection to
> deal with these variations.
> 
> Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>

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

Patch

diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c
index 8340cde..0fbc64a 100644
--- a/board/ti/ks2_evm/board_k2g.c
+++ b/board/ti/ks2_evm/board_k2g.c
@@ -114,7 +114,9 @@  int board_mmc_init(bd_t *bis)
 		return -1;
 	}
 
-	omap_mmc_init(0, 0, 0, -1, -1);
+	if (board_is_k2g_gp())
+		omap_mmc_init(0, 0, 0, -1, -1);
+
 	omap_mmc_init(1, 0, 0, -1, -1);
 	return 0;
 }
@@ -184,11 +186,13 @@  int embedded_dtb_select(void)
 
 	k2g_reset_mux_config();
 
-	/* deassert FLASH_HOLD */
-	clrbits_le32(K2G_GPIO1_BANK2_BASE + K2G_GPIO_DIR_OFFSET,
-		     BIT(9));
-	setbits_le32(K2G_GPIO1_BANK2_BASE + K2G_GPIO_SETDATA_OFFSET,
-		     BIT(9));
+	if (board_is_k2g_gp()) {
+		/* deassert FLASH_HOLD */
+		clrbits_le32(K2G_GPIO1_BANK2_BASE + K2G_GPIO_DIR_OFFSET,
+			     BIT(9));
+		setbits_le32(K2G_GPIO1_BANK2_BASE + K2G_GPIO_SETDATA_OFFSET,
+			     BIT(9));
+	}
 
 	return 0;
 }