public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Prabhakar Kushwaha <prabhakar@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/20] armv8/ls2085ardb: add hwconfig setting for eSDHC
Date: Mon, 18 May 2015 12:38:39 +0530	[thread overview]
Message-ID: <1431932937-10120-2-git-send-email-prabhakar@freescale.com> (raw)
In-Reply-To: <1431932937-10120-1-git-send-email-prabhakar@freescale.com>

From: Yangbo Lu <yangbo.lu@freescale.com>

Add hwconfig setting for eSDHC since it shares some pins with other
IP block.

Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 board/freescale/ls2085ardb/ls2085ardb.c | 36 +++++++++++++++++++++++++++++++++
 include/configs/ls2085ardb.h            |  2 ++
 2 files changed, 38 insertions(+)

diff --git a/board/freescale/ls2085ardb/ls2085ardb.c b/board/freescale/ls2085ardb/ls2085ardb.c
index 6cb7b13..e0a8a41 100644
--- a/board/freescale/ls2085ardb/ls2085ardb.c
+++ b/board/freescale/ls2085ardb/ls2085ardb.c
@@ -10,6 +10,7 @@
 #include <fsl_ifc.h>
 #include <fsl_ddr.h>
 #include <asm/io.h>
+#include <hwconfig.h>
 #include <fdt_support.h>
 #include <libfdt.h>
 #include <fsl_debug_server.h>
@@ -21,8 +22,15 @@
 #include "../common/qixis.h"
 #include "ls2085ardb_qixis.h"
 
+#define PIN_MUX_SEL_SDHC	0x00
+
+#define SET_SDHC_MUX_SEL(reg, value)	((reg & 0xf0) | value)
 DECLARE_GLOBAL_DATA_PTR;
 
+enum {
+	MUX_TYPE_SDHC,
+};
+
 unsigned long long get_qixis_addr(void)
 {
 	unsigned long long addr;
@@ -129,6 +137,34 @@ int board_early_init_f(void)
 	return 0;
 }
 
+int config_board_mux(int ctrl_type)
+{
+	u8 reg5;
+
+	reg5 = QIXIS_READ(brdcfg[5]);
+
+	switch (ctrl_type) {
+	case MUX_TYPE_SDHC:
+		reg5 = SET_SDHC_MUX_SEL(reg5, PIN_MUX_SEL_SDHC);
+		break;
+	default:
+		printf("Wrong mux interface type\n");
+		return -1;
+	}
+
+	QIXIS_WRITE(brdcfg[5], reg5);
+
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	if (hwconfig("sdhc"))
+		config_board_mux(MUX_TYPE_SDHC);
+
+	return 0;
+}
+
 void detail_board_ddr_info(void)
 {
 	puts("\nDDR    ");
diff --git a/include/configs/ls2085ardb.h b/include/configs/ls2085ardb.h
index 62f13f9..29c934e 100644
--- a/include/configs/ls2085ardb.h
+++ b/include/configs/ls2085ardb.h
@@ -288,6 +288,8 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_DOS_PARTITION
 #endif
 
+#define CONFIG_MISC_INIT_R
+
 /* Initial environment variables */
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS		\
-- 
1.9.1

  reply	other threads:[~2015-05-18  7:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18  7:08 [U-Boot] [PATCH 01/20] armv8/ls2085ardb: Add eth & phy f/w loading support Prabhakar Kushwaha
2015-05-18  7:08 ` Prabhakar Kushwaha [this message]
2015-05-18  7:08 ` [U-Boot] [PATCH 03/20] armv8/ls2085a: Enable Date command for QDS and RDB Prabhakar Kushwaha
2015-05-18  7:08 ` [U-Boot] [PATCH 04/20] armv8/ls2085aqds: Add support of 0x49 in ethernet Prabhakar Kushwaha
2015-05-26 15:51   ` York Sun
2015-05-18  7:08 ` [U-Boot] [PATCH 05/20] armv8/ls2085a: call ft_pcie_setup() to change dts status Prabhakar Kushwaha
2015-05-26 15:54   ` York Sun
2015-05-27  3:40     ` Lian M.H.
2015-05-27  4:30       ` Kushwaha Prabhakar
2015-05-27 15:27         ` York Sun
2015-05-18  7:08 ` [U-Boot] [PATCH 06/20] armv8/ls2085qds: Update SFP TX bit as "0" to enable XFI Prabhakar Kushwaha
2015-05-18  7:08 ` [U-Boot] [PATCH 07/20] armv8/ls2085rdb: Update PCA9547PW slave address Prabhakar Kushwaha
2015-05-26 15:55   ` York Sun

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=1431932937-10120-2-git-send-email-prabhakar@freescale.com \
    --to=prabhakar@freescale.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