]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
arm: mvebu: Add SDIO/SDHCI support for Armada A38x
authorStefan Roese <sr@denx.de>
Mon, 29 Jun 2015 12:58:10 +0000 (14:58 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:29:20 +0000 (13:29 +0200)
Armada A38x implements an SDHCI compatible SDIO controller. This patch
enables the Marvell driver to support this SoC. And enables the
SDIO controller if selected by the board configuration.

Tested on Marvell DB-88F6820-GP board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Luka Perkov <luka.perkov@sartura.hr>
arch/arm/mach-mvebu/cpu.c
arch/arm/mach-mvebu/include/mach/cpu.h
arch/arm/mach-mvebu/include/mach/gpio.h [new file with mode: 0644]
arch/arm/mach-mvebu/include/mach/soc.h

index 0121db8bb5d838069981158028b2ce506ab6377f..531d0fb44cdb8c2061abe4ef03a1f91f867c27fe 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/pl310.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
+#include <sdhci.h>
 
 #define DDR_BASE_CS_OFF(n)     (0x0000 + ((n) << 3))
 #define DDR_SIZE_CS_OFF(n)     (0x0004 + ((n) << 3))
@@ -245,6 +246,16 @@ int cpu_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_MV_SDHCI
+int board_mmc_init(bd_t *bis)
+{
+       mv_sdh_init(MVEBU_SDIO_BASE, 0, 0,
+                   SDHCI_QUIRK_32BIT_DMA_ADDR | SDHCI_QUIRK_WAIT_SEND_CMD);
+
+       return 0;
+}
+#endif
+
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {
index 3b48460a0b7e6939958ac7fdb6da1c1c50ca61fc..4bdb6331e113a149fdc1241b843e5a9d838499b7 100644 (file)
@@ -114,6 +114,8 @@ void mvebu_sdram_size_adjust(enum memory_bank bank);
 int mvebu_mbus_probe(struct mbus_win windows[], int count);
 int mvebu_soc_family(void);
 
+int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks);
+
 /*
  * Highspeed SERDES PHY config init, ported from bin_hdr
  * to mainline U-Boot
diff --git a/arch/arm/mach-mvebu/include/mach/gpio.h b/arch/arm/mach-mvebu/include/mach/gpio.h
new file mode 100644 (file)
index 0000000..09e3c50
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * SPDX-License-Identifier:      GPL-2.0+
+ */
+
+#ifndef __MACH_MVEBU_GPIO_H
+#define __MACH_MVEBU_GPIO_H
+
+/* Empty file - sdhci requires this. */
+
+#endif
index 0a9307c8ce2e021762d93ae6aa73dc017e5ebe48..1aeec27aecd3139e25e618d81d6100aac0956410 100644 (file)
@@ -51,6 +51,7 @@
 #define MVEBU_REG_PCIE_BASE    (MVEBU_REGISTER(0x40000))
 #define MVEBU_EGIGA0_BASE      (MVEBU_REGISTER(0x70000))
 #define MVEBU_EGIGA1_BASE      (MVEBU_REGISTER(0x74000))
+#define MVEBU_SDIO_BASE                (MVEBU_REGISTER(0xd8000))
 
 #define SDRAM_MAX_CS           4
 #define SDRAM_ADDR_MASK                0xFF000000