From: Joe Hershberger Date: Tue, 5 Jun 2012 23:49:42 +0000 (-0500) Subject: Xilinx: ARM: mmc: Move MMC driver to drivers/mmc X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d4e3a26e24907a7641b6800a6241003b05ed6de;p=thirdparty%2Fu-boot.git Xilinx: ARM: mmc: Move MMC driver to drivers/mmc Move the mmc driver to a common drivers location so it can be used by any zynq-based board that wants to use it. Signed-off-by: Joe Hershberger --- diff --git a/arch/arm/include/asm/arch-zynq/mmc.h b/arch/arm/include/asm/arch-zynq/mmc.h new file mode 100644 index 00000000000..8a70ae3af07 --- /dev/null +++ b/arch/arm/include/asm/arch-zynq/mmc.h @@ -0,0 +1,23 @@ +/* + * Copyright 2012 Joe Hershberger + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +extern int zynq_mmc_init(bd_t *bd); diff --git a/board/xilinx/zynq_common/Makefile b/board/xilinx/zynq_common/Makefile index 96683a7f318..d884920b05d 100644 --- a/board/xilinx/zynq_common/Makefile +++ b/board/xilinx/zynq_common/Makefile @@ -36,7 +36,6 @@ COBJS-$(CONFIG_CMD_NET) += xemacps_g.o xemacps_control.o \ xemacps.o xgmac.o COBJS-$(CONFIG_CMD_SPI) += xilinx_qspi.o xilinx_qspips.o COBJS-$(CONFIG_CMD_NAND) += xilinx_nandps.o -COBJS-$(CONFIG_CMD_MMC) += mmc.o COBJS := $(sort $(COBJS-y)) diff --git a/board/xilinx/zynq_common/board.c b/board/xilinx/zynq_common/board.c index f5b65b31278..c7d688b6882 100644 --- a/board/xilinx/zynq_common/board.c +++ b/board/xilinx/zynq_common/board.c @@ -3,6 +3,7 @@ */ #include +#include #include #include #include @@ -673,6 +674,13 @@ int board_eth_init(bd_t *bis) } #endif +#ifdef CONFIG_CMD_MMC +int board_mmc_init(bd_t *bd) +{ + return zynq_mmc_init(bd); +} +#endif + int dram_init(void) { gd->ram_size = PHYS_SDRAM_1_SIZE; diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index 3496f0aa0fe..4881f0fd6d9 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile @@ -36,6 +36,7 @@ COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o +COBJS-$(CONFIG_ZYNQ_MMC) += zynq_mmc.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/board/xilinx/zynq_common/mmc.c b/drivers/mmc/zynq_mmc.c similarity index 99% rename from board/xilinx/zynq_common/mmc.c rename to drivers/mmc/zynq_mmc.c index 5d4bd769a29..f97aa70efeb 100755 --- a/board/xilinx/zynq_common/mmc.c +++ b/drivers/mmc/zynq_mmc.c @@ -1,10 +1,11 @@ #include +#include #include #include #include #include -#include "sd_hardware.h" +#include "zynq_mmc.h" #define SD_BASEADDR XPSS_SDIO0_BASEADDR @@ -368,7 +369,7 @@ static int pele_sdh_init(struct mmc *mmc) return 0; } -int board_mmc_init(bd_t *bd) +int zynq_mmc_init(bd_t *bd) { struct mmc *mmc; diff --git a/board/xilinx/zynq_common/sd_hardware.h b/drivers/mmc/zynq_mmc.h similarity index 100% rename from board/xilinx/zynq_common/sd_hardware.h rename to drivers/mmc/zynq_mmc.h diff --git a/include/configs/zynq_ep107.h b/include/configs/zynq_ep107.h index e4aa9b64b79..11c56839637 100644 --- a/include/configs/zynq_ep107.h +++ b/include/configs/zynq_ep107.h @@ -119,6 +119,7 @@ #ifdef CONFIG_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_ZYNQ_MMC #define CONFIG_CMD_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 diff --git a/include/configs/zynq_zc702.h b/include/configs/zynq_zc702.h index b75b7392241..45002bca810 100644 --- a/include/configs/zynq_zc702.h +++ b/include/configs/zynq_zc702.h @@ -81,6 +81,7 @@ #ifdef CONFIG_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_ZYNQ_MMC #define CONFIG_CMD_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 diff --git a/include/configs/zynq_zc770.h b/include/configs/zynq_zc770.h index 997b8916e94..602dccccf65 100644 --- a/include/configs/zynq_zc770.h +++ b/include/configs/zynq_zc770.h @@ -147,6 +147,7 @@ #ifdef CONFIG_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_ZYNQ_MMC #define CONFIG_CMD_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2 diff --git a/include/configs/zynq_zed.h b/include/configs/zynq_zed.h index 2fe050f946a..ea060a413e7 100644 --- a/include/configs/zynq_zed.h +++ b/include/configs/zynq_zed.h @@ -120,6 +120,7 @@ #ifdef CONFIG_MMC #define CONFIG_GENERIC_MMC +#define CONFIG_ZYNQ_MMC #define CONFIG_CMD_MMC #define CONFIG_CMD_FAT #define CONFIG_CMD_EXT2