diff mbox

[U-Boot,2/4] Tegra114: Dalmore: Add SDIO3 pad config to pinctrl_config table

Message ID 1363105031-30296-3-git-send-email-twarren@nvidia.com
State Superseded
Delegated to: Tom Warren
Headers show

Commit Message

Tom Warren March 12, 2013, 4:17 p.m. UTC
SDIO1 (the SD-card slot on Dalmore) needs to have its pads setup
before the MMC driver is added.

Signed-off-by: Tom Warren <twarren@nvidia.com>
---
 arch/arm/include/asm/arch-tegra114/gp_padctrl.h |    7 +++++++
 board/nvidia/dalmore/dalmore.c                  |    4 ++++
 board/nvidia/dalmore/pinmux-config-dalmore.h    |    2 ++
 3 files changed, 13 insertions(+), 0 deletions(-)

Comments

Stephen Warren March 12, 2013, 5:52 p.m. UTC | #1
On 03/12/2013 10:17 AM, Tom Warren wrote:
> SDIO1 (the SD-card slot on Dalmore) needs to have its pads setup
> before the MMC driver is added.

> diff --git a/board/nvidia/dalmore/dalmore.c b/board/nvidia/dalmore/dalmore.c

> +	/* Initialize any non-default pad configs (APB_MISC_GP regs) */
> +	padgrp_config_table(dalmore_padctrl, ARRAY_SIZE(dalmore_padctrl));

Given that you're only using this table for the very first time here ...

> diff --git a/board/nvidia/dalmore/pinmux-config-dalmore.h b/board/nvidia/dalmore/pinmux-config-dalmore.h

>  static struct padctrl_config dalmore_padctrl[] = {
>  	/* (_padgrp, _slwf, _slwr, _drvup, _drvdn, _lpmd, _schmt, _hsm) */
> +	DEFAULT_PADCFG(SDIO3, SDIOCFG_DRVUP_SLWF, SDIOCFG_DRVDN_SLWR, \
> +		SDIOCFG_DRVUP, SDIOCFG_DRVDN, NONE, DISABLE, ENABLE),
>  };

... and it was empty before now, I'd be inclined to remove the *dalmore*
files from the Tegra114 pinmux series that implemented
padgrp_config_table(), and just do all the Dalmore-specific stuff in
this patch.

But it's not a big deal.
Tom Warren March 12, 2013, 5:59 p.m. UTC | #2
Stephen,

On Tue, Mar 12, 2013 at 10:52 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 03/12/2013 10:17 AM, Tom Warren wrote:
>> SDIO1 (the SD-card slot on Dalmore) needs to have its pads setup
>> before the MMC driver is added.
>
>> diff --git a/board/nvidia/dalmore/dalmore.c b/board/nvidia/dalmore/dalmore.c
>
>> +     /* Initialize any non-default pad configs (APB_MISC_GP regs) */
>> +     padgrp_config_table(dalmore_padctrl, ARRAY_SIZE(dalmore_padctrl));
>
> Given that you're only using this table for the very first time here ...
>
>> diff --git a/board/nvidia/dalmore/pinmux-config-dalmore.h b/board/nvidia/dalmore/pinmux-config-dalmore.h
>
>>  static struct padctrl_config dalmore_padctrl[] = {
>>       /* (_padgrp, _slwf, _slwr, _drvup, _drvdn, _lpmd, _schmt, _hsm) */
>> +     DEFAULT_PADCFG(SDIO3, SDIOCFG_DRVUP_SLWF, SDIOCFG_DRVDN_SLWR, \
>> +             SDIOCFG_DRVUP, SDIOCFG_DRVDN, NONE, DISABLE, ENABLE),
>>  };
>
> ... and it was empty before now, I'd be inclined to remove the *dalmore*
> files from the Tegra114 pinmux series that implemented
> padgrp_config_table(), and just do all the Dalmore-specific stuff in
> this patch.
>
> But it's not a big deal.
Yeah, I thought of doing that, but I already had this all
working/tested/MAKEALL'd, and have to take off early today, so I sent
the patchset as-is.

Thanks,

Tom
>
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-tegra114/gp_padctrl.h b/arch/arm/include/asm/arch-tegra114/gp_padctrl.h
index c538bdd..82c70cb 100644
--- a/arch/arm/include/asm/arch-tegra114/gp_padctrl.h
+++ b/arch/arm/include/asm/arch-tegra114/gp_padctrl.h
@@ -56,4 +56,11 @@  struct apb_misc_gp_ctlr {
 	u32	sdio1cfg;	/* 0xEC: APB_MISC_GP_SDIO1CFGPADCTRL */
 };
 
+/* SDMMC1/3 settings from section 27.5 of T114 TRM */
+#define SDIOCFG_DRVUP_SLWF	0
+#define SDIOCFG_DRVDN_SLWR	0
+#define SDIOCFG_DRVUP		0x24
+#define SDIOCFG_DRVDN		0x14
+#define SDIOCFG_HSM		1
+
 #endif	/* _TEGRA114_GP_PADCTRL_H_ */
diff --git a/board/nvidia/dalmore/dalmore.c b/board/nvidia/dalmore/dalmore.c
index 2020a5f..7449b5b 100644
--- a/board/nvidia/dalmore/dalmore.c
+++ b/board/nvidia/dalmore/dalmore.c
@@ -16,6 +16,7 @@ 
 
 #include <common.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch/gp_padctrl.h>
 #include "pinmux-config-dalmore.h"
 
 /*
@@ -32,4 +33,7 @@  void pinmux_init(void)
 
 	pinmux_config_table(unused_pins_lowpower,
 		ARRAY_SIZE(unused_pins_lowpower));
+
+	/* Initialize any non-default pad configs (APB_MISC_GP regs) */
+	padgrp_config_table(dalmore_padctrl, ARRAY_SIZE(dalmore_padctrl));
 }
diff --git a/board/nvidia/dalmore/pinmux-config-dalmore.h b/board/nvidia/dalmore/pinmux-config-dalmore.h
index e6fe842..7af3f75 100644
--- a/board/nvidia/dalmore/pinmux-config-dalmore.h
+++ b/board/nvidia/dalmore/pinmux-config-dalmore.h
@@ -364,5 +364,7 @@  static struct pingroup_config tegra114_pinmux_set_nontristate[] = {
 
 static struct padctrl_config dalmore_padctrl[] = {
 	/* (_padgrp, _slwf, _slwr, _drvup, _drvdn, _lpmd, _schmt, _hsm) */
+	DEFAULT_PADCFG(SDIO3, SDIOCFG_DRVUP_SLWF, SDIOCFG_DRVDN_SLWR, \
+		SDIOCFG_DRVUP, SDIOCFG_DRVDN, NONE, DISABLE, ENABLE),
 };
 #endif /* PINMUX_CONFIG_COMMON_H */