linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] sunxi: board: Add H616 MMC2 pins
@ 2021-04-26 12:14 Andre Przywara
  2021-04-26 12:25 ` Jagan Teki
  2021-04-26 16:14 ` [linux-sunxi] " Jernej Škrabec
  0 siblings, 2 replies; 3+ messages in thread
From: Andre Przywara @ 2021-04-26 12:14 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Jernej Skrabec, Samuel Holland, Icenowy Zheng, u-boot,
	linux-sunxi, linux-sunxi

We hardcode the pinctrl setting for the MMC controllers in boards.c,
since we need them also in the SPL, where there is no DT yet.

Add the respective setting for the H616 SoC, to enable eMMC on boards
with this SoC as well.
Also to make diagnosing this problem easier, print a warning if a board
tries to setup MMC2 pins without a respective SoC setting being defined.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 board/sunxi/board.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index b97ca578f7f..f825dfd7ce8 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -555,6 +555,17 @@ static void mmc_pinmux_setup(int sdc)
 			sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
 			sunxi_gpio_set_drv(pin, 2);
 		}
+#elif defined(CONFIG_MACH_SUN50I_H616)
+		/* SDC2: PC0-PC1, PC5-PC6, PC8-PC11, PC13-PC16 */
+		for (pin = SUNXI_GPC(0); pin <= SUNXI_GPC(16); pin++) {
+			if (pin > SUNXI_GPC(1) && pin < SUNXI_GPC(5))
+				continue;
+			if (pin == SUNXI_GPC(7) || pin == SUNXI_GPC(12))
+				continue;
+			sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2);
+			sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
+			sunxi_gpio_set_drv(pin, 2);
+		}
 #elif defined(CONFIG_MACH_SUN9I)
 		/* SDC2: PC6-PC16 */
 		for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(16); pin++) {
@@ -562,6 +573,8 @@ static void mmc_pinmux_setup(int sdc)
 			sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP);
 			sunxi_gpio_set_drv(pin, 2);
 		}
+#else
+		puts("ERROR: No pinmux setup defined for MMC2!\n");
 #endif
 		break;
 
-- 
2.17.5


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

* Re: [PATCH] sunxi: board: Add H616 MMC2 pins
  2021-04-26 12:14 [PATCH] sunxi: board: Add H616 MMC2 pins Andre Przywara
@ 2021-04-26 12:25 ` Jagan Teki
  2021-04-26 16:14 ` [linux-sunxi] " Jernej Škrabec
  1 sibling, 0 replies; 3+ messages in thread
From: Jagan Teki @ 2021-04-26 12:25 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Jernej Skrabec, Samuel Holland, Icenowy Zheng, U-Boot-Denx,
	linux-sunxi, linux-sunxi

On Mon, Apr 26, 2021 at 5:45 PM Andre Przywara <andre.przywara@arm.com> wrote:
>
> We hardcode the pinctrl setting for the MMC controllers in boards.c,
> since we need them also in the SPL, where there is no DT yet.
>
> Add the respective setting for the H616 SoC, to enable eMMC on boards
> with this SoC as well.
> Also to make diagnosing this problem easier, print a warning if a board
> tries to setup MMC2 pins without a respective SoC setting being defined.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

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

* Re: [linux-sunxi] [PATCH] sunxi: board: Add H616 MMC2 pins
  2021-04-26 12:14 [PATCH] sunxi: board: Add H616 MMC2 pins Andre Przywara
  2021-04-26 12:25 ` Jagan Teki
@ 2021-04-26 16:14 ` Jernej Škrabec
  1 sibling, 0 replies; 3+ messages in thread
From: Jernej Škrabec @ 2021-04-26 16:14 UTC (permalink / raw)
  To: Jagan Teki, linux-sunxi
  Cc: Samuel Holland, Icenowy Zheng, u-boot, linux-sunxi, linux-sunxi,
	andre.przywara

Dne ponedeljek, 26. april 2021 ob 14:14:46 CEST je Andre Przywara napisal(a):
> We hardcode the pinctrl setting for the MMC controllers in boards.c,
> since we need them also in the SPL, where there is no DT yet.
> 
> Add the respective setting for the H616 SoC, to enable eMMC on boards
> with this SoC as well.
> Also to make diagnosing this problem easier, print a warning if a board
> tries to setup MMC2 pins without a respective SoC setting being defined.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>

Best regards,
Jernej




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

end of thread, other threads:[~2021-04-27  3:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 12:14 [PATCH] sunxi: board: Add H616 MMC2 pins Andre Przywara
2021-04-26 12:25 ` Jagan Teki
2021-04-26 16:14 ` [linux-sunxi] " Jernej Škrabec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).