From patchwork Thu Nov 28 13:52:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 294888 X-Patchwork-Delegate: panto@antoniou-consulting.com 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 764762C007A for ; Fri, 29 Nov 2013 00:52:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 92F79A7464; Thu, 28 Nov 2013 14:52:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 jPUMdkHU3kIP; Thu, 28 Nov 2013 14:52:43 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8427CA746D; Thu, 28 Nov 2013 14:52:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2EAEA746D for ; Thu, 28 Nov 2013 14:52:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 zVjJ+o+ZbGf4 for ; Thu, 28 Nov 2013 14:52:30 +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 vaxjo.synopsys.com (vaxjo.synopsys.com [198.182.60.75]) by theia.denx.de (Postfix) with ESMTP id 2F35AA7464 for ; Thu, 28 Nov 2013 14:52:23 +0100 (CET) Received: from WBSNus01mta1 (us01secmta1.synopsys.com [10.9.203.100]) by vaxjo.synopsys.com (Postfix) with ESMTP id 3F568DA91; Thu, 28 Nov 2013 05:52:22 -0800 (PST) Received: from us01secmta1.internal.synopsys.com (us01secmta1.internal.synopsys.com [127.0.0.1]) by us01secmta1.internal.synopsys.com (Service) with ESMTP id 2B4BD27113; Thu, 28 Nov 2013 05:52:22 -0800 (PST) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by us01secmta1.internal.synopsys.com (Service) with ESMTP id D488927102; Thu, 28 Nov 2013 05:52:21 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id C154B775; Thu, 28 Nov 2013 05:52:21 -0800 (PST) Received: from abrodkin-8560l.internal.synopsys.com (abrodkin-8560l.internal.synopsys.com [10.121.8.118]) by mailhost.synopsys.com (Postfix) with ESMTP id 75E71771; Thu, 28 Nov 2013 05:52:18 -0800 (PST) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Thu, 28 Nov 2013 17:52:15 +0400 Message-Id: <1385646735-8726-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 1.8.4.2 Cc: Alim Akhtar , Alexey Brodkin , Pantelis Antoniou , Jaehoon Chung , Rajeshwari Shinde , Andy Fleming , Mischa Jonker Subject: [U-Boot] [PATCH] dwmmc: make driver usable for non-exynos platforms X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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's no point in having of "dwmmc.h" per architecure - we're talking about device driver (DesignWare MMC controller) which is expected to work with any CPU it is attached to. So defines used for DW MMC configuration should be in its own header which is avaialble for everybody. Signed-off-by: Alexey Brodkin Cc: Mischa Jonker Cc: Alexey Brodkin Cc: Jaehoon Chung Cc: Andy Fleming Cc: Alim Akhtar Cc: Rajeshwari Shinde Cc: Simon Glass Cc: Pantelis Antoniou --- arch/arm/include/asm/arch-exynos/dwmmc.h | 22 ---------------------- drivers/mmc/dw_mmc.c | 1 - include/dwmmc.h | 22 ++++++++++++++++++++++ 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/arch/arm/include/asm/arch-exynos/dwmmc.h b/arch/arm/include/asm/arch-exynos/dwmmc.h index d1c5d4f..da66e25 100644 --- a/arch/arm/include/asm/arch-exynos/dwmmc.h +++ b/arch/arm/include/asm/arch-exynos/dwmmc.h @@ -5,28 +5,6 @@ * SPDX-License-Identifier: GPL-2.0+ */ -#define DWMCI_CLKSEL 0x09C -#define DWMCI_SHIFT_0 0x0 -#define DWMCI_SHIFT_1 0x1 -#define DWMCI_SHIFT_2 0x2 -#define DWMCI_SHIFT_3 0x3 -#define DWMCI_SET_SAMPLE_CLK(x) (x) -#define DWMCI_SET_DRV_CLK(x) ((x) << 16) -#define DWMCI_SET_DIV_RATIO(x) ((x) << 24) - -#define EMMCP_MPSBEGIN0 0x1200 -#define EMMCP_SEND0 0x1204 -#define EMMCP_CTRL0 0x120C - -#define MPSCTRL_SECURE_READ_BIT (0x1<<7) -#define MPSCTRL_SECURE_WRITE_BIT (0x1<<6) -#define MPSCTRL_NON_SECURE_READ_BIT (0x1<<5) -#define MPSCTRL_NON_SECURE_WRITE_BIT (0x1<<4) -#define MPSCTRL_USE_FUSE_KEY (0x1<<3) -#define MPSCTRL_ECB_MODE (0x1<<2) -#define MPSCTRL_ENCRYPTION (0x1<<1) -#define MPSCTRL_VALID (0x1<<0) - #ifdef CONFIG_OF_CONTROL int exynos_dwmmc_init(const void *blob); #endif diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 1e0f72b..2638c3f 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -11,7 +11,6 @@ #include #include #include -#include #define PAGE_SIZE 4096 diff --git a/include/dwmmc.h b/include/dwmmc.h index 6c91143..8ea1092 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -123,6 +123,28 @@ #define DWMCI_BMOD_IDMAC_FB (1 << 1) #define DWMCI_BMOD_IDMAC_EN (1 << 7) +#define DWMCI_CLKSEL 0x09C +#define DWMCI_SHIFT_0 0x0 +#define DWMCI_SHIFT_1 0x1 +#define DWMCI_SHIFT_2 0x2 +#define DWMCI_SHIFT_3 0x3 +#define DWMCI_SET_SAMPLE_CLK(x) (x) +#define DWMCI_SET_DRV_CLK(x) ((x) << 16) +#define DWMCI_SET_DIV_RATIO(x) ((x) << 24) + +#define EMMCP_MPSBEGIN0 0x1200 +#define EMMCP_SEND0 0x1204 +#define EMMCP_CTRL0 0x120C + +#define MPSCTRL_SECURE_READ_BIT (0x1<<7) +#define MPSCTRL_SECURE_WRITE_BIT (0x1<<6) +#define MPSCTRL_NON_SECURE_READ_BIT (0x1<<5) +#define MPSCTRL_NON_SECURE_WRITE_BIT (0x1<<4) +#define MPSCTRL_USE_FUSE_KEY (0x1<<3) +#define MPSCTRL_ECB_MODE (0x1<<2) +#define MPSCTRL_ENCRYPTION (0x1<<1) +#define MPSCTRL_VALID (0x1<<0) + /* quirks */ #define DWMCI_QUIRK_DISABLE_SMU (1 << 0)