Commit aada6276c68daf0229442aa8bf6e60aae4c4fd0d

Authored by Bin Meng
Committed by Simon Glass
1 parent 0ff65eb99c

x86: crownbay: Add SDHCI support

There are two standard SD card slots on the Crown Bay board, which
are connected to the Topcliff PCH SDIO controllers. Enable the SDHC
support so that we can use them.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

Showing 3 changed files with 54 additions and 1 deletions Side-by-side Diff

arch/x86/cpu/queensbay/Makefile
... ... @@ -4,7 +4,7 @@
4 4 # SPDX-License-Identifier: GPL-2.0+
5 5 #
6 6  
7   -obj-y += tnc_car.o tnc_dram.o tnc.o
  7 +obj-y += tnc_car.o tnc_dram.o tnc.o topcliff.o
8 8 obj-y += fsp_configs.o fsp_support.o
9 9 obj-$(CONFIG_PCI) += tnc_pci.o
arch/x86/cpu/queensbay/topcliff.c
  1 +/*
  2 + * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
  3 + *
  4 + * SPDX-License-Identifier: GPL-2.0+
  5 + */
  6 +
  7 +#include <common.h>
  8 +#include <errno.h>
  9 +#include <malloc.h>
  10 +#include <pci.h>
  11 +#include <pci_ids.h>
  12 +#include <sdhci.h>
  13 +
  14 +static struct pci_device_id mmc_supported[] = {
  15 + { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SDIO_0 },
  16 + { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SDIO_1 },
  17 + { }
  18 +};
  19 +
  20 +int cpu_mmc_init(bd_t *bis)
  21 +{
  22 + struct sdhci_host *mmc_host;
  23 + pci_dev_t devbusfn;
  24 + u32 iobase;
  25 + int ret;
  26 + int i;
  27 +
  28 + for (i = 0; i < ARRAY_SIZE(mmc_supported); i++) {
  29 + devbusfn = pci_find_devices(mmc_supported, i);
  30 + if (devbusfn == -1)
  31 + return -ENODEV;
  32 +
  33 + mmc_host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
  34 + if (!mmc_host)
  35 + return -ENOMEM;
  36 +
  37 + mmc_host->name = "Topcliff SDHCI";
  38 + pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, &iobase);
  39 + mmc_host->ioaddr = (void *)iobase;
  40 + mmc_host->quirks = 0;
  41 + ret = add_sdhci(mmc_host, 0, 0);
  42 + if (ret)
  43 + return ret;
  44 + }
  45 +
  46 + return 0;
  47 +}
include/configs/crownbay.h
... ... @@ -48,6 +48,12 @@
48 48  
49 49 #define CONFIG_SPI_FLASH_SST
50 50  
  51 +#define CONFIG_MMC
  52 +#define CONFIG_SDHCI
  53 +#define CONFIG_GENERIC_MMC
  54 +#define CONFIG_MMC_SDMA
  55 +#define CONFIG_CMD_MMC
  56 +
51 57 /* Video is not supported */
52 58 #undef CONFIG_VIDEO
53 59 #undef CONFIG_CFB_CONSOLE