summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-10-27 23:47:09 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-10-29 17:24:30 +0900
commit5f49845ecc6606ef3516f13b247995c81d02923a (patch)
treebcfa5ac13662386f09d2b641165451710bedbc1f /arch
parentadf55f63ae7d09a4a0f3fedd5e3955caf7fd0f09 (diff)
downloadu-boot-5f49845ecc6606ef3516f13b247995c81d02923a.tar.gz
ARM: uniphier: support DDR PHY parameter dump command for LD11
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 <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-uniphier/Kconfig3
-rw-r--r--arch/arm/mach-uniphier/dram/cmd_ddrphy.c22
2 files changed, 19 insertions, 6 deletions
diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig
index 7bee6c7a29..aa3909a766 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 c868eb03fd..9730330738 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;