From patchwork Mon Jun 17 07:31:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 617 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 470C43F353 for ; Mon, 17 Jun 2019 09:38:56 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id r142sf6572994pfc.2 for ; Mon, 17 Jun 2019 00:38:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757135; cv=pass; d=google.com; s=arc-20160816; b=XCrYKuNK60bWHjWRnuXQ+QNSwrj/bayJHGp7aOZKfgB8NeWWBOhlkyGg5R+/74To+U pVpFIPFdmt1QQTsWarzVXTndMHgC+gC9ixmDLEWlS5DdmFM/ZaSALiQMZ30xtK8gVPCm F9wtLuXDKGeBHRsu1XgIT2Vtyyk1baMIHtLi7iNG3m+ZUjIRii1LE8nF+W5yWVJHIP4G tU/INWEUr4+JZWs+xizcSiOSkoFZVOQYYvtLJQ5iwFbXabjGn90+0NVCIYsDcOnycMqd 64CvT0g4iqwTVjubaASdpiUNL5GOKlXp8ppLQ935bprCsert4XZ/ZsI7+gb1gSQA2TrV P9NA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=fV+Xw3JfNkv++IABtg8iJ4t9pJTiWdkPPFfmNR5Js5E=; b=AHHbFHQedlXORHE0ul4Jv2Hhz24GGDtI36m7NfXzeccXe0T2ktU20JW+4OcqiI+KJL AvaBOj2ka3zMQQQLQgXMvYcZb/41l5fWRcwcG5WZ9c25ji/PRDNSU4V7LfNcpNcosii/ QuMafmi9d/+9q/T4Sbe29erLsYpR6IPmeLfRZST7GGMcwLqahg5W71rTF1fDgbt6VnY3 ICqnIQc8aD/hy0aTMQqAGWQ5gacgXy5gtYFvKwPgzvGZ6CRHpbIApZ9do03B08cop5X8 LLDwdA0u8/1/6WLmuvjNxXVquHcEJo2rXuCt7UixlI3EdpIRGsZgc4An4URnRR4j3H7T hXNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hoy6oM4Q; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=fV+Xw3JfNkv++IABtg8iJ4t9pJTiWdkPPFfmNR5Js5E=; b=StZ9mhokmLoJCotS7x+aoXnxO7mp8om/NuH0eUPSR095XSLkY+ORmkiyZsndd36eab nPIhvuJP62SPkHo5/IrDY0uq/eWwr/k2GqETtJqdmta2OlxPRtnRjrxp4Ud/efG/wtty UKytuxUcW1IdNCt/ut5wDWKlOGD+dJzCRl7IU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=fV+Xw3JfNkv++IABtg8iJ4t9pJTiWdkPPFfmNR5Js5E=; b=F1WEBhrzZhBdr9p6YK82kfSffszBeXBd0okJHEON/1UW+GzoM610hpgAqaWkwqqndi HgG6qdkzdIKYjXL1tQcgc2NE+nyxdmm1g3DcNDpbFOGjSeSfut7VJghI7SSqLZA3xGO6 E/lukpyLMez6JBv2v4oSuNiPG+fGhhoa+gXadaOAx0OBuUkPDkztbitr4a2HSANMETQD c5sYJNU1HrMIecTo/M2PPqnxBQRr8lyvm4Kl38tc1Qfwwz5vfwixT2Wmlxh/MLnBBEFq BzoDSfBiqvllfYL5VPgw8Rv/3H0xFfnkLlKG9zrP5GlT01OZX58GPfW7OGaHCQisN4Ed qmJQ== X-Gm-Message-State: APjAAAXcKVHCUMtwOAzsYbZokQgdUTrcY1enzKR7GfjEDCXgpCnUGhAj /6aGHSaZMzfJmkX4VYrQyaVCWQMx X-Google-Smtp-Source: APXvYqwg+7lC2kc4EGkMnpGuJgeb7Ze3R/CIS5EtpAUwP5N4WVRQISXKBBXAKMftnYQsPqBFYj3jhQ== X-Received: by 2002:a17:90a:ba94:: with SMTP id t20mr25802372pjr.116.1560757135116; Mon, 17 Jun 2019 00:38:55 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3227:: with SMTP id k36ls3161411pjb.0.gmail; Mon, 17 Jun 2019 00:38:54 -0700 (PDT) X-Received: by 2002:a17:90a:3688:: with SMTP id t8mr24148063pjb.35.1560757134864; Mon, 17 Jun 2019 00:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757134; cv=none; d=google.com; s=arc-20160816; b=S7Att+xek8dSoJT1jNjw3a4i8nH30GLkmzClZLcXgPPIu3bTB8mw1th8LLK3fJZeCr vPcSbMz6WpwGGMZkND5CHD+2IePZW/Z6QMW6KPyww7k7mYViVe/hrJKKaniNZHZS3jMa /blK3HzGY4HN8+DoW41LcxEyBqTkHaF07ZRyKuQI1yYgu/B8a091RIkaMAMEyib7Xj9f qpvx3o7x8HYDbGF3pci4S0kIajiIbLd0UormAgPYuQxeozz2hqCGMRbBX83EggvN59wB thTMV6nrr0jCQa4KFwCqg3FntuScLAJ8EJHujhnGaNFrXHitAwLetmBMsJsjhUgDU6++ b7xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ncKf50fiEnrptfCgQksAHfGfZ7rEjc6rzKjfXMV54Nc=; b=0EcIv6wQWxtgrJAKSx3rvijDzUV1Sb+yBPxk0pYo0YsvmNyblzRKPfsZP0oPJ+Oe90 dHc2ZwxBhdNdlTCL3b6B6UYfmEv5CxKnyZFyivN7NzzYIQLwFGZYBCH7ersr+d2eK+DX W9dyi49o4CIRrsHZR7pWGjEhJNoe+KdsobMIC0ue7XU4mTlXDG2aEn+kGI1v0Ai1mMPb L+V391z0cz+JqH8V4G7TeV1awDCZchxKaXUIup3SfVx9Ha3wIZEWtdgsfhsWfCoecvXz HruiQlDxDe/wa7ZNona7A9ZQ6peEGIk1EqXFi127VuopUYUHpEQcWlaKNl88WMxvI30B B+1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hoy6oM4Q; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z3sor12676358pln.53.2019.06.17.00.38.54 for (Google Transport Security); Mon, 17 Jun 2019 00:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:bc43:: with SMTP id t3mr40057849plz.250.1560757134577; Mon, 17 Jun 2019 00:38:54 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.38.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:38:54 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: Manivannan Sadhasivam , gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 46/99] ram: rockchip: debug: Add sdram_print_ddr_info Date: Mon, 17 Jun 2019 13:01:59 +0530 Message-Id: <20190617073252.27810-47-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190617073252.27810-1-jagan@amarulasolutions.com> References: <20190617073252.27810-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hoy6oM4Q; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add sdram ddr info print support, this would help to observe the sdram base parameters. Here is sample print on LPDDR4, 50MHz channel 0 BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- .../include/asm/arch-rockchip/sdram_common.h | 7 ++++ drivers/ram/rockchip/sdram_debug.c | 40 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 0cb737d665..7d1372f033 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -128,8 +128,15 @@ int dram_init(void); inline void sdram_print_dram_type(unsigned char dramtype) { } + +inline void sdram_print_ddr_info(struct sdram_cap_info *cap_info, + struct sdram_base_params *base) +{ +} #else void sdram_print_dram_type(unsigned char dramtype); +void sdram_print_ddr_info(struct sdram_cap_info *cap_info, + struct sdram_base_params *base); #endif /* CONFIG_RAM_ROCKCHIP_DEBUG */ #endif diff --git a/drivers/ram/rockchip/sdram_debug.c b/drivers/ram/rockchip/sdram_debug.c index c13e140fa5..69a6f94a73 100644 --- a/drivers/ram/rockchip/sdram_debug.c +++ b/drivers/ram/rockchip/sdram_debug.c @@ -32,3 +32,43 @@ void sdram_print_dram_type(unsigned char dramtype) break; } } + +void sdram_print_ddr_info(struct sdram_cap_info *cap_info, + struct sdram_base_params *base) +{ + u32 bg; + + bg = (cap_info->dbw == 0) ? 2 : 1; + + sdram_print_dram_type(base->dramtype); + + printascii(", "); + printdec(base->ddr_freq); + printascii("MHz\n"); + + printascii("BW="); + printdec(8 << cap_info->bw); + + printascii(" Col="); + printdec(cap_info->col); + + printascii(" Bk="); + printdec(0x1 << cap_info->bk); + if (base->dramtype == DDR4) { + printascii(" BG="); + printdec(1 << bg); + } + + printascii(" CS0 Row="); + printdec(cap_info->cs0_row); + if (cap_info->rank > 1) { + printascii(" CS1 Row="); + printdec(cap_info->cs1_row); + } + + printascii(" CS="); + printdec(cap_info->rank); + + printascii(" Die BW="); + printdec(8 << cap_info->dbw); +}