U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Franklin S Cooper Jr <fcooper@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 20/30] ARM: k2g: Add pinmux support for K2G ICE evm
Date: Tue, 23 May 2017 12:42:49 -0500	[thread overview]
Message-ID: <20170523174259.14797-21-fcooper@ti.com> (raw)
In-Reply-To: <20170523174259.14797-1-fcooper@ti.com>

Add basic pinmux data for new K2G ICE evm. Also add pinmuxing for a
generic K2G evm which includes I2C 0 and 1 used for board detection
purposes.

Since multiple K2G boards are supported that means initially generic
pinmuxing should be used when board detection hasn't ran. Once board
detection runs the proper pinmuxing can be reran to match the board
being ran on.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 board/ti/ks2_evm/board_k2g.c |  2 ++
 board/ti/ks2_evm/mux-k2g.h   | 45 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c
index d796fd1..a93ef47 100644
--- a/board/ti/ks2_evm/board_k2g.c
+++ b/board/ti/ks2_evm/board_k2g.c
@@ -274,6 +274,8 @@ int embedded_dtb_select(void)
 
 	fdtdec_setup();
 
+	k2g_mux_config();
+
 	k2g_reset_mux_config();
 
 	/* deassert FLASH_HOLD */
diff --git a/board/ti/ks2_evm/mux-k2g.h b/board/ti/ks2_evm/mux-k2g.h
index 773f9b7..630103d 100644
--- a/board/ti/ks2_evm/mux-k2g.h
+++ b/board/ti/ks2_evm/mux-k2g.h
@@ -11,6 +11,22 @@
 #include <asm/io.h>
 #include <asm/arch/mux-k2g.h>
 #include <asm/arch/hardware.h>
+#include "board.h"
+
+struct pin_cfg k2g_generic_pin_cfg[] = {
+	/* UART0 */
+	{ 115,  MODE(0) },	/* SOC_UART0_RXD */
+	{ 116,  MODE(0) },	/* SOC_UART0_TXD */
+
+	/* I2C 0 */
+	{ 223,  MODE(0) },	/* SOC_I2C0_SCL */
+	{ 224,  MODE(0) },	/* SOC_I2C0_SDA */
+
+	/* I2C 1 */
+	{ 225,  MODE(0) },	/* SOC_I2C1_SCL */
+	{ 226,  MODE(0) },	/* SOC_I2C1_SDA */
+	{ MAX_PIN_N, }
+};
 
 struct pin_cfg k2g_evm_pin_cfg[] = {
 	/* GPMC */
@@ -307,7 +323,34 @@ struct pin_cfg k2g_evm_pin_cfg[] = {
 	{ MAX_PIN_N, }
 };
 
+struct pin_cfg k2g_ice_evm_pin_cfg[] = {
+	/* MMC 1 */
+	{ 63, MODE(0) | PIN_PTD },	/* MMC1_DAT3.MMC1_DAT3 */
+	{ 64, MODE(0) | PIN_PTU },	/* MMC1_DAT2.MMC1_DAT2 */
+	{ 65, MODE(0) | PIN_PTU },	/* MMC1_DAT1.MMC1_DAT1 */
+	{ 66, MODE(0) | PIN_PTD },	/* MMC1_DAT0.MMC1_DAT0 */
+	{ 67, MODE(0) | PIN_PTD },	/* MMC1_CLK.MMC1_CLK   */
+	{ 68, MODE(0) | PIN_PTD },	/* MMC1_CMD.MMC1_CMD   */
+	{ 69, MODE(3) | PIN_PTU },	/* MMC1_SDCD.GPIO0_69  */
+	{ 70, MODE(0) | PIN_PTU },	/* MMC1_SDWP.MMC1_SDWP */
+	{ 71, MODE(0) | PIN_PTD },	/* MMC1_POW.MMC1_POW   */
+
+	/* I2C 0 */
+	{ 223,  MODE(0) },		/* SOC_I2C0_SCL */
+	{ 224,  MODE(0) },		/* SOC_I2C0_SDA */
+	{ MAX_PIN_N, }
+};
+
 void k2g_mux_config(void)
 {
-	configure_pin_mux(k2g_evm_pin_cfg);
+	if (!board_ti_was_eeprom_read()) {
+		configure_pin_mux(k2g_generic_pin_cfg);
+	} else if (board_is_k2g_gp()) {
+		configure_pin_mux(k2g_evm_pin_cfg);
+	} else if (board_is_k2g_ice()) {
+		configure_pin_mux(k2g_ice_evm_pin_cfg);
+	} else {
+		puts("Unknown board, cannot configure pinmux.");
+		hang();
+	}
 }
-- 
2.10.0

  parent reply	other threads:[~2017-05-23 17:42 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 17:42 [U-Boot] [PATCH v2 00/30] ARM: k2g: Add support for new K2G ICE EVM Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 01/30] ti: common: board_detect: Allow settings board detection variables manually Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 02/30] spl: fit: Break out some functions into a common file Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 03/30] boot_fit: Create helper functions that can be used to select DTB out of FIT Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 04/30] fdt: Enable selecting correct DTB from appended FIT Image Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 05/30] ti: common: board_detect: Add function to determine if EEPROM was read Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 06/30] dts: Allow OF_LIST to depend on FIT_EMBED Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 07/30] ARM: dts: k2g: Introduce U-boot specific dtsi file Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 08/30] arm: dts: Add new "generic" 66AK2Gx device tree file Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 09/30] board_f: Add new function to allow runtime DTB selection Franklin S Cooper Jr
2017-05-24 15:38   ` Franklin S Cooper Jr
2017-05-26  8:08   ` Lothar Waßmann
2017-05-26 18:24     ` Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 10/30] Makefile: Build additional binaries for dtb FIT blobs appended to U-boot Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 11/30] ARM: keystone2: Allow to build with all image formats Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 12/30] ARM: k2g: Define embedded_dtb_select for runtime DTB selection in U-boot Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 13/30] ARM: keystone2: Define board_fit_config_name_match for Keystone 2 boards Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 14/30] ks2_evm: Add EEPROM based board detection Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 15/30] defconfig: keystone2: Enable U-boot runtime DTB detection Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 16/30] ARM: keystone2: Add additional fields used for DDR3 configuration Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 17/30] ARM: k2g: Program DDR PHY MR2 register with the default value Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 18/30] ARM: k2g: Program DDRPHY_DATX8 registers via mask and value variables Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 19/30] ks2_evm: Add EEPROM based board detection helper functions Franklin S Cooper Jr
2017-05-23 17:42 ` Franklin S Cooper Jr [this message]
2017-05-23 17:42 ` [U-Boot] [PATCH v2 21/30] ARM: k2g: Add DDR3 configuration for K2G ICE evm Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 22/30] board: ks2: Use board detection to wrap code not specific to " Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 23/30] ARM: k2g: Use board detection to wrap K2G GP specific calls Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 24/30] ARM: k2g: Update board_name u-boot env variable at runtime Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 25/30] ARM: dts: keystone-k2g: Remove skeleton.dtsi Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 26/30] ARM: dts: keystone-k2g-evm: Add unit address to memory node Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 27/30] ARM: dts: k2g: Disable netcp by default Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 28/30] ARM: dts: k2g: Add DT support for K2G Industrial Communication Engine evm Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 29/30] ARM: k2g: Add K2G ICE DTB to the list of possible DTBs Franklin S Cooper Jr
2017-05-23 17:42 ` [U-Boot] [PATCH v2 30/30] defconfig: k2g_evm_defconfig: Add K2G ICE to OF_LIST Franklin S Cooper Jr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170523174259.14797-21-fcooper@ti.com \
    --to=fcooper@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox