From patchwork Thu Oct 27 14:47:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 79696 Delivered-To: patch@linaro.org Received: by 10.80.142.83 with SMTP id 19csp686223edx; Thu, 27 Oct 2016 07:49:27 -0700 (PDT) X-Received: by 10.194.192.105 with SMTP id hf9mr7332219wjc.41.1477579767528; Thu, 27 Oct 2016 07:49:27 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id lp3si8960124wjb.72.2016.10.27.07.49.27; Thu, 27 Oct 2016 07:49:27 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@nifty.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 78EC7A7573; Thu, 27 Oct 2016 16:48:28 +0200 (CEST) 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 zw7EBU4Z6bUo; Thu, 27 Oct 2016 16:48:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 15704A75CA; Thu, 27 Oct 2016 16:48:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3A7AA754A for ; Thu, 27 Oct 2016 16:47:50 +0200 (CEST) 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 aNHg2vtNOIk6 for ; Thu, 27 Oct 2016 16:47:50 +0200 (CEST) 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 conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by theia.denx.de (Postfix) with ESMTPS id 5950AB382E for ; Thu, 27 Oct 2016 16:47:49 +0200 (CEST) Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id u9RElDVS017011; Thu, 27 Oct 2016 23:47:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u9RElDVS017011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1477579648; bh=+HPKPREuJTto5sl2GHYmZafD3PKxhpuwTHV2Vrj+YQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNsX9QOVLbeP4YcIVxmnN6NO8pOVq+9Dm5WK5cLemeOcrsQIDn8sNVqO6qSZkk2Kw 1ZM3eKa3rjsH40Yj+MNTBMLBpYdL7JtGs2bCUXa+q0y4ltQRruR76nZqrn2b5wwKVi 67kDIesYDNwjoe1GQOf2DRqPRALay/ntl8DdAsBnKUX1qUcEKzfrHVd88TuHg3H8NI 2/lPyea9adhqYAZTSuhaL4W9w5r0/KEdDb+kKyiDI+ANcq/L9hZ4AeujbEQe4aNCss Ls/O35xPaczlbI0XuaBnINwChTNpICPS0Ylf38iUvFLqRy0wWU3fn55SfIxljB5Dlt fJTUPSt4iMXBQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 27 Oct 2016 23:47:09 +0900 Message-Id: <1477579630-9692-11-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477579630-9692-1-git-send-email-yamada.masahiro@socionext.com> References: <1477579630-9692-1-git-send-email-yamada.masahiro@socionext.com> Cc: Albert Aribaud Subject: [U-Boot] [PATCH 10/11] ARM: uniphier: support DDR PHY parameter dump command for LD11 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" Add the LD11 SoC data and adjuts the printf() format because this is a 64-bit SoC. Otherwise, 16-digits pointer addresses would break the log format. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/Kconfig | 3 ++- arch/arm/mach-uniphier/dram/cmd_ddrphy.c | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 6 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/Kconfig b/arch/arm/mach-uniphier/Kconfig index 7bee6c7..aa3909a 100644 --- a/arch/arm/mach-uniphier/Kconfig +++ b/arch/arm/mach-uniphier/Kconfig @@ -99,7 +99,8 @@ config CMD_PINMON config CMD_DDRPHY_DUMP bool "Enable dump command of DDR PHY parameters" - depends on ARCH_UNIPHIER_LD4 || ARCH_UNIPHIER_PRO4 || ARCH_UNIPHIER_SLD8 + depends on ARCH_UNIPHIER_LD4 || ARCH_UNIPHIER_PRO4 || \ + ARCH_UNIPHIER_SLD8 || ARCH_UNIPHIER_LD11 default y help The command "ddrphy" shows the resulting parameters of DDR PHY diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c index c868eb0..9730330 100644 --- a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c +++ b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c @@ -22,6 +22,8 @@ /* field separator */ #define FS " " +#define ptr_to_uint(p) ((unsigned int)(unsigned long)(p)) + struct phy_param { resource_size_t base; unsigned int nr_dx; @@ -47,6 +49,11 @@ static const struct phy_param uniphier_sld8_phy_param[] = { { /* sentinel */ } }; +static const struct phy_param uniphier_ld11_phy_param[] = { + { .base = 0x5bc01000, .nr_dx = 4, }, + { /* sentinel */ } +}; + static void print_bdl(void __iomem *reg, int n) { u32 val = readl(reg); @@ -174,15 +181,17 @@ static void mdl_dump(const struct phy_param *phy_param) #define REG_DUMP(x) \ { int ofst = PHY_ ## x; void __iomem *reg = phy_base + ofst; \ - printf("%3d: %-10s: %p : %08x\n", \ - ofst >> PHY_REG_SHIFT, #x, reg, readl(reg)); } + printf("%3d: %-10s: %08x : %08x\n", \ + ofst >> PHY_REG_SHIFT, #x, \ + ptr_to_uint(reg), readl(reg)); } #define DX_REG_DUMP(dx, x) \ { int ofst = PHY_DX_BASE + PHY_DX_STRIDE * (dx) + \ PHY_DX_## x; \ void __iomem *reg = phy_base + ofst; \ - printf("%3d: DX%d%-7s: %p : %08x\n", \ - ofst >> PHY_REG_SHIFT, (dx), #x, reg, readl(reg)); } + printf("%3d: DX%d%-7s: %08x : %08x\n", \ + ofst >> PHY_REG_SHIFT, (dx), #x, \ + ptr_to_uint(reg), readl(reg)); } static void reg_dump(const struct phy_param *phy_param) { @@ -194,7 +203,7 @@ static void reg_dump(const struct phy_param *phy_param) for (p = 0; phy_param->base; phy_param++, p++) { phy_base = ioremap(phy_param->base, SZ_4K); - printf("== PHY%d (base: %p) ==\n", p, phy_base); + printf("== PHY%d (base: %08x) ==\n", p, ptr_to_uint(phy_base)); printf(" No: Name : Address : Data\n"); REG_DUMP(RIDR); @@ -246,6 +255,9 @@ static int do_ddr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) case SOC_UNIPHIER_SLD8: phy_param = uniphier_sld8_phy_param; break; + case SOC_UNIPHIER_LD11: + phy_param = uniphier_ld11_phy_param; + break; default: printf("unsupported SoC\n"); return CMD_RET_FAILURE;