1 // SPDX-License-Identifier: GPL-2.0+
3 * SPL/U-Boot common functions for CompuLab CL-SOM-iMX7 module
5 * (C) Copyright 2017 CompuLab, Ltd. http://www.compulab.com
7 * Author: Uri Mashiach <uri.mashiach@compulab.co.il>
11 #include <fsl_esdhc_imx.h>
12 #include <asm-generic/gpio.h>
17 #define CL_SOM_IMX7_GPIO_SPI_CS IMX_GPIO_NR(4, 19)
19 int board_spi_cs_gpio(unsigned int bus, unsigned int cs)
21 return CL_SOM_IMX7_GPIO_SPI_CS;
24 #endif /* CONFIG_SPI */
26 #ifdef CONFIG_FSL_ESDHC_IMX
28 int board_mmc_getcd(struct mmc *mmc)
30 struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
33 switch (cfg->esdhc_base) {
34 case USDHC1_BASE_ADDR:
35 ret = !gpio_get_value(CL_SOM_IMX7_GPIO_USDHC1_CD);
37 case USDHC3_BASE_ADDR:
38 ret = 1; /* Assume uSDHC3 emmc is always present */
45 #endif /* CONFIG_FSL_ESDHC_IMX */