From patchwork Fri Dec 12 13:05:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 420483 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E94A014003E for ; Sat, 13 Dec 2014 00:09:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2CCFA4BAAB; Fri, 12 Dec 2014 14:08:56 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wq-7161cnKJ7; Fri, 12 Dec 2014 14:08:55 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8A01F4BA8F; Fri, 12 Dec 2014 14:08:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 738AD4BB17 for ; Fri, 12 Dec 2014 14:08:51 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RrFh8+Tex5CS for ; Fri, 12 Dec 2014 14:08:51 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by theia.denx.de (Postfix) with ESMTPS id 1441E4BB04 for ; Fri, 12 Dec 2014 14:08:45 +0100 (CET) Received: by mail-pa0-f45.google.com with SMTP id lf10so6614271pab.18 for ; Fri, 12 Dec 2014 05:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=Bml/Zco71/odQnfxElphoWsnqMenWAhOxgcDtfEa2kc=; b=DFTW7SvivGmyjUTvZiB24+kFivgiDYR+yA+MIY+xT8sHNhOhjohy1vqel4BunsdOuM OL1SYLL9QagufgTx2oytUEJEOJ8LWx+5zB8Va2w1ot5EAZF6B2a1yBLVqoqfXiG6V9ZS inzhjbUelSQvmobeJjj8alcYbc7kHDbsdWiBb7C/ahRhzE+Ln4TvAJvbT7ypzuvdsAeB FUyqe5z+BLH5csKqoPb3rbqkKbhQ0wLljyfug5/nzAwN4VDludIFLeAIjFNMzrmGGTdu wkhKAstAWY8mkv3OPpV6HQrhdyDzY6O14iau3MtBhe2aJHa2oNXuUEnq8KEs4M77ZmkG BoZA== X-Received: by 10.66.220.34 with SMTP id pt2mr7067366pac.142.1418389724110; Fri, 12 Dec 2014 05:08:44 -0800 (PST) Received: from localhost ([106.120.101.38]) by mx.google.com with ESMTPSA id xb9sm1594904pbc.5.2014.12.12.05.08.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Dec 2014 05:08:43 -0800 (PST) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Fri, 12 Dec 2014 21:05:43 +0800 Message-Id: <1418389545-11254-26-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1418389545-11254-1-git-send-email-bmeng.cn@gmail.com> References: <1418389545-11254-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH v3 25/27] x86: crownbay: Add SDHCI support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: Simon Glass --- Changes in v3: None Changes in v2: - Use ARRAY_SIZE(mmc_supported) instead of 2 - Check return value of add_sdhci() arch/x86/cpu/queensbay/Makefile | 2 +- arch/x86/cpu/queensbay/topcliff.c | 47 +++++++++++++++++++++++++++++++++++++++ include/configs/crownbay.h | 6 +++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 arch/x86/cpu/queensbay/topcliff.c diff --git a/arch/x86/cpu/queensbay/Makefile b/arch/x86/cpu/queensbay/Makefile index ace04ca..2c2ec01 100644 --- a/arch/x86/cpu/queensbay/Makefile +++ b/arch/x86/cpu/queensbay/Makefile @@ -4,6 +4,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-y += tnc_car.o tnc_dram.o tnc.o +obj-y += tnc_car.o tnc_dram.o tnc.o topcliff.o obj-y += fsp_configs.o fsp_support.o obj-$(CONFIG_PCI) += tnc_pci.o diff --git a/arch/x86/cpu/queensbay/topcliff.c b/arch/x86/cpu/queensbay/topcliff.c new file mode 100644 index 0000000..b01422a --- /dev/null +++ b/arch/x86/cpu/queensbay/topcliff.c @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014, Bin Meng + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include + +static struct pci_device_id mmc_supported[] = { + { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SDIO_0 }, + { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SDIO_1 }, + { } +}; + +int cpu_mmc_init(bd_t *bis) +{ + struct sdhci_host *mmc_host; + pci_dev_t devbusfn; + u32 iobase; + int ret; + int i; + + for (i = 0; i < ARRAY_SIZE(mmc_supported); i++) { + devbusfn = pci_find_devices(mmc_supported, i); + if (devbusfn == -1) + return -ENODEV; + + mmc_host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host)); + if (!mmc_host) + return -ENOMEM; + + mmc_host->name = "Topcliff SDHCI"; + pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, &iobase); + mmc_host->ioaddr = (void *)iobase; + mmc_host->quirks = 0; + ret = add_sdhci(mmc_host, 0, 0); + if (ret) + return ret; + } + + return 0; +} diff --git a/include/configs/crownbay.h b/include/configs/crownbay.h index 09a52ab..b9db6b7 100644 --- a/include/configs/crownbay.h +++ b/include/configs/crownbay.h @@ -48,6 +48,12 @@ #define CONFIG_SPI_FLASH_SST +#define CONFIG_MMC +#define CONFIG_SDHCI +#define CONFIG_GENERIC_MMC +#define CONFIG_MMC_SDMA +#define CONFIG_CMD_MMC + /* Video is not supported */ #undef CONFIG_VIDEO #undef CONFIG_CFB_CONSOLE