From patchwork Fri Feb 26 05:21:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 62943 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp529445lbc; Thu, 25 Feb 2016 21:25:48 -0800 (PST) X-Received: by 10.28.184.137 with SMTP id i131mr943364wmf.96.1456464348782; Thu, 25 Feb 2016 21:25:48 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id il10si13853857wjb.245.2016.02.25.21.25.48; Thu, 25 Feb 2016 21:25:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 51B88A7857; Fri, 26 Feb 2016 06:23:35 +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 XLagBKbZS6Lh; Fri, 26 Feb 2016 06:23:35 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0A481A785C; Fri, 26 Feb 2016 06:22:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C9166A74E0 for ; Fri, 26 Feb 2016 06:21:32 +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 505bcvg7InU2 for ; Fri, 26 Feb 2016 06:21:32 +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 conuserg009-v.nifty.com (conuserg009.nifty.com [202.248.44.35]) by theia.denx.de (Postfix) with ESMTPS id A9AD8A773A for ; Fri, 26 Feb 2016 06:21:30 +0100 (CET) Received: from beagle.diag.org (p14090-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.90]) (authenticated) by conuserg009-v.nifty.com with ESMTP id u1Q5L8lF000668; Fri, 26 Feb 2016 14:21:20 +0900 X-Nifty-SrcIP: [153.142.97.90] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 26 Feb 2016 14:21:52 +0900 Message-Id: <1456464113-13901-21-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456464113-13901-1-git-send-email-yamada.masahiro@socionext.com> References: <1456464113-13901-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 20/21] ARM: uniphier: deprecate umc_dram_init_{start, poll} X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/dram/umc-ph1-ld4.c | 6 ++++-- arch/arm/mach-uniphier/dram/umc-ph1-pro4.c | 6 ++++-- arch/arm/mach-uniphier/dram/umc-ph1-sld8.c | 6 ++++-- arch/arm/mach-uniphier/dram/umc-regs.h | 23 ++++++----------------- 4 files changed, 18 insertions(+), 23 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/mach-uniphier/dram/umc-ph1-ld4.c b/arch/arm/mach-uniphier/dram/umc-ph1-ld4.c index 0eb47d7..09b2c1c 100644 --- a/arch/arm/mach-uniphier/dram/umc-ph1-ld4.c +++ b/arch/arm/mach-uniphier/dram/umc-ph1-ld4.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "../init.h" #include "ddrphy-regs.h" @@ -145,8 +146,9 @@ static int umc_ch_init(void __iomem *dc_base, void __iomem *ca_base, void __iomem *phy_base = dc_base + 0x00001000; int ret; - umc_dram_init_start(dc_base); - umc_dram_init_poll(dc_base); + writel(UMC_INITSET_INIT1EN, dc_base + UMC_INITSET); + while (readl(dc_base + UMC_INITSET) & UMC_INITSTAT_INIT1ST) + cpu_relax(); writel(0x00000101, dc_base + UMC_DIOCTLA); diff --git a/arch/arm/mach-uniphier/dram/umc-ph1-pro4.c b/arch/arm/mach-uniphier/dram/umc-ph1-pro4.c index 9569c10..93d2e2c 100644 --- a/arch/arm/mach-uniphier/dram/umc-ph1-pro4.c +++ b/arch/arm/mach-uniphier/dram/umc-ph1-pro4.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "../init.h" #include "ddrphy-regs.h" @@ -133,8 +134,9 @@ static int umc_ch_init(void __iomem *dc_base, void __iomem *ca_base, int nr_phy = width / 16; int phy, ret; - umc_dram_init_start(dc_base); - umc_dram_init_poll(dc_base); + writel(UMC_INITSET_INIT1EN, dc_base + UMC_INITSET); + while (readl(dc_base + UMC_INITSET) & UMC_INITSTAT_INIT1ST) + cpu_relax(); for (phy = 0; phy < nr_phy; phy++) { writel(0x00000100 | ((1 << (phy + 1)) - 1), diff --git a/arch/arm/mach-uniphier/dram/umc-ph1-sld8.c b/arch/arm/mach-uniphier/dram/umc-ph1-sld8.c index 43e53fd..d873130 100644 --- a/arch/arm/mach-uniphier/dram/umc-ph1-sld8.c +++ b/arch/arm/mach-uniphier/dram/umc-ph1-sld8.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "../init.h" #include "ddrphy-regs.h" @@ -148,8 +149,9 @@ static int umc_ch_init(void __iomem *dc_base, void __iomem *ca_base, void __iomem *phy_base = dc_base + 0x00001000; int ret; - umc_dram_init_start(dc_base); - umc_dram_init_poll(dc_base); + writel(UMC_INITSET_INIT1EN, dc_base + UMC_INITSET); + while (readl(dc_base + UMC_INITSET) & UMC_INITSTAT_INIT1ST) + cpu_relax(); writel(0x00000101, dc_base + UMC_DIOCTLA); diff --git a/arch/arm/mach-uniphier/dram/umc-regs.h b/arch/arm/mach-uniphier/dram/umc-regs.h index c65dd82..cc2dd27 100644 --- a/arch/arm/mach-uniphier/dram/umc-regs.h +++ b/arch/arm/mach-uniphier/dram/umc-regs.h @@ -9,6 +9,8 @@ #ifndef ARCH_UMC_REGS_H #define ARCH_UMC_REGS_H +#include + #define UMC_CPURST 0x00000700 #define UMC_IDSRST 0x0000070C #define UMC_IXMRST 0x00000714 @@ -46,7 +48,11 @@ #define UMC_CMDCTLA 0x00000000 #define UMC_CMDCTLB 0x00000004 #define UMC_INITSET 0x00000014 +#define UMC_INITSET_INIT1EN BIT(1) /* init without power-on wait */ +#define UMC_INITSET_INIT0EN BIT(0) /* init with power-on wait */ #define UMC_INITSTAT 0x00000018 +#define UMC_INITSTAT_INIT1ST BIT(1) /* init without power-on wait */ +#define UMC_INITSTAT_INIT0ST BIT(0) /* init with power-on wait */ #define UMC_SPCCTLA 0x00000030 #define UMC_SPCCTLB 0x00000034 #define UMC_SPCSETA 0x00000038 @@ -98,21 +104,4 @@ #define UMC_BITPERPIXELMODE_D0 0x010 #define UMC_PAIR1DOFF_D0 0x054 -#ifndef __ASSEMBLY__ - -#include - -static inline void umc_dram_init_start(void __iomem *dramcont) -{ - writel(0x00000002, dramcont + UMC_INITSET); -} - -static inline void umc_dram_init_poll(void __iomem *dramcont) -{ - while ((readl(dramcont + UMC_INITSTAT) & 0x00000002)) - ; -} - -#endif - #endif